Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain valid key events #45

Open
musicin3d opened this issue Apr 29, 2020 · 0 comments
Open

Explain valid key events #45

musicin3d opened this issue Apr 29, 2020 · 0 comments

Comments

@musicin3d
Copy link

musicin3d commented Apr 29, 2020

Documentation does not explain how to define hotkeys for screen.key(...). The only hit that it gives is that you can provide a single letter (A), a name (escape), or a Ctl+key combo (C-c). But how do you respond to "shift+tab"?

I had to do some digging until I found the following...

program.js:401

var name = (key.ctrl ? 'C-' : '')
  + (key.meta ? 'M-' : '')
  + (key.shift && key.name ? 'S-' : '')
  + (key.name || ch);

Based on this, you can also listen for "M-a" or "S-tab". This might be a convention for some, but it's not universally known --especially meta (super?). Furthermore, it appears that you must order the modifiers a certain way if you want to combine them. For example, "C-S-tab" would be recognized, but what about "S-C-tab"?

In the very least, these features and expectations should probably be documented.

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

No branches or pull requests

1 participant