question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ability to capture modifier keys (e.g. alt)

See original GitHub issue

I’m messing with MenuBar et.al. and am curious about something: Why does MapKey (and the rest of the call chain) filter out letting ProcessKey see just modifier key events?

For example, if we wanted MenuBar to highlight when a user presses alt like it does on Windows, we’d want it to be able to ‘see’ that the user has just pressed alt.

Would the world end if MapKey was modified to pass through shift-modifier keys?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
tigcommented, Apr 14, 2020

I just did a test where I modified MapKey in WindowsDriver.cs to pass just alt keypresses on.

It demonstrated pretty clearly that a new API will be required because existing ProcessKey implementations get confused.

I would suggest

public virtual bool KeyDown(KeyEvent keyEvent)

and

public virtual bool KeyUp (KeyEvent keyEvent)

Ala Windows’ WM_KEYDOWN/WM_KEYUP.

Thoughts?

0reactions
tigcommented, May 21, 2020

Done. Closing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can Alt key alone be used as a modifier in web apps? Eg
It really differs for Mac and Windows platforms. On Windows you'd usually use Alt-combos with alphanumeric characters as "access keys".
Read more >
Why are there so many modifier keys (Shift, Alt, Ctrl, Win)? ...
Modifier keys such as Shift, Alt, Ctrl, and Win are used to provide additional functionality to the keys on a keyboard. Short answer:...
Read more >
How to use modifier keys like SHIFT and ALT ?? : r/godot
Greets, Having a terrible time figuring out how to use modifier keys like SHIFT, ALT, Meta etc. as Input events in Godot.
Read more >
[KBM] Allow additional modifiers · Issue #8651
Invent new modifier keys e.g. similar to the above example, I could map the key [right alt] to [virtual mod 0], then map...
Read more >
What would it take to add new modifier keys to Windows?
The only thing you'd be able to do with your special keyboard would be to create hot-keys that incorporate your special modifier.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found