Skip to content

feat: allow using ⇧symbols instead of R - #216

Open
eugenesvk wants to merge 31 commits into
yqrashawn:masterfrom
eugenesvk:symbol
Open

feat: allow using ⇧symbols instead of R#216
eugenesvk wants to merge 31 commits into
yqrashawn:masterfrom
eugenesvk:symbol

Conversation

@eugenesvk

@eugenesvk eugenesvk commented Mar 23, 2023

Copy link
Copy Markdown
Contributor

This PR adds a new great feature allowing using various ⇧symbols instead of R: see https://github.com/eugenesvk/GokuRakuJoudo/blob/symbol/KeySymbols.md for a brief overview or the linked issue

It works by prepending replacement functions that convert ⇧›!R before calling the existing from/to parsers

  • Adds generated symbol data tables (allows to easier add variants like ? and , just add it in a list and the full table will be auto-regenerated)
  • Adds various symbol helper functions
  • Adds a few tests of the new keys-symbols functions
  • Adds ReadMe reference and a more detailed file with allowed key tables
  • Allow using strings as keys (with a special symbol at the start to differentiate from regular strings like osascript, not sure if ' would work)

A few TODOs:

  • exiting on syntax warnings is disabled, I don't know why joker is so strict and doesn't accept valid identifier symbols, and how to make it less strict (previously these were broken anyway, so I had variable names with special symbols, and there were no warnings shown, but I understand now why goku would sometimes hang forever if I added a few more vars like that)

Fixes a couple of bugs:

  • Also found a weird bug that hanged the whole process on many warnings, and from https://github.com/babashka/process I understood that what you had with@ proc deref was fine, but testing it turned out that no deref was the right way, not sure what's going on there
  • Another one was syntax warnings were just swallowed, only errors bubbled up since the process exited

Closes #205

@eugenesvk
eugenesvk force-pushed the symbol branch 5 times, most recently from c0fc71a to 7a984c8 Compare March 28, 2023 19:58
@ChristinWhite

Copy link
Copy Markdown

This is dramatically easier to read and write than the letter system, I hope it will be merged.

@eugenesvk

Copy link
Copy Markdown
Contributor Author

rebased on master after testing with v0.7.2, seems to work fine

@nrjdalal

nrjdalal commented Feb 7, 2025

Copy link
Copy Markdown

This is dramatically easier to read and write than the letter system, I hope it will be merged.

Here's my naive attempt to make things even easier, try https://github.com/nrjdalal/karabiner-human-config and let me know what improvement y'all seek.

Support for the feature to allow using ⇧symbols instead of R
Replace key symbols with their Cap key symbol in a string
Sort key symbols map by key length (BB > A) to match ⇧› before ⇧
due to duplicate :err?
- Change FROM rules to replace symbols to Cap names for every key
- Change TO rules to replace symbols to Cap names for every key (including within key vector)
- Replacing modifier symbols with their Cap abbreviations
- Replacing  modifiers with individual prefixes into a single group with a single prefix
- Replacing  keys with symbols with regular keys
- Replacing  map with :keys with symbols with regular keys (in the map)
Support for the feature to allow using ⇧symbols instead of R
⇧ at the end of a key is a literal shift, not a modifier
Support for the feature to allow using ⇧symbols instead of R
- Allows proper vertical alignment with tabs and spaces
- To disambiguate from script and other non-key strings requires a ‘ character at the beginning
- Remove all whitespace from the string and then convert it to a keyword, then run the usual pipeline
Requires escaping them with an underscore like _␠
`✱›` or `✦`
@eugenesvk

Copy link
Copy Markdown
Contributor Author

rebased on master and added right-sided hyper (all four mods)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow using modifier symbols instead of their name abbreviations (same for longer key names)

3 participants