-
Notifications
You must be signed in to change notification settings - Fork 703
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
Ability to capture modifier keys (e.g. alt) #366
Comments
There really is a gap in that regard. Like using ControlV or ControlF that doesn't even work. I haven’t looked at it much yet. I just solved the Alt key and € key that was not working. My preference would really be to make the combination of the shift, ctrl and alt keys available separately from the other keys. Regarding the mouse, I introduced practically all the basic functionalities needed. Regarding the keys, I don't know if there are any limitations in their handling, some combinations can be managed by the OS itself and it may not be possible to change its behavior. It would be great to be able to improve the level of the keys control. Take a look at TextField where I implemented 3 key combinations to copy (Ctrl+Alt+C), cut (Ctrl+Alt+X) and paste (Ctrl+Alt+V). |
I just did a test where I modified It demonstrated pretty clearly that a new API will be required because existing I would suggest
and
Ala Windows' Thoughts? |
And if neither the |
Yep. I just did a PoC to prove this works: In this gif I do:
Proving that I could plum Ignore the "About..." menu in this demo. That's my test case for enabling top-level menu items that don't have sub-items, but can just do an action.
What do you think about using a bool to indicate up/down vs. having two methods? e.g.: /// <summary>
/// Method invoked when a key is pressed or depresed.
/// </summary>
/// <param name="keyEvent">Contains the details about the key that produced the event.</param>
/// <param name="up">True if this is a key-up event. False if it is a key-down event.</param>
/// <returns></returns>
public virtual bool KeyPress (KeyEvent keyEvent, bool up)
{
return false;
} |
Good job. The parameter up in KeyPress is not necessary because this event is only captured if we ignore both the key down and the key up, that is, it is only triggered after the key up, of course. |
Some additional notes... In reality, This mutes my enthusiasm some, because I suspect it's a tenet of |
Perhaps you are right. I think many of the complexities used should only work on windows :-) |
Right, they should work cross platform, and I think that the way of handling this would be to introduce a new method "ProcessKeyDown" which might only be triggered on Windows. And we could flag this appropriately. Perhaps provide this not as a ProcessKeyDown, but a "WindowsKeyDown". Anyways, what we could do in addition to this new method, is essentially allow the per-platform capabilities to be enhanced. So for example, the "Alt" processing key might be limited to Windows, and I think that it is ok that this is the case. On each platform, we can take advantage of the best that we can get. |
Also my opinion is to try to adapt to all platforms and the keys that do not exist in some or in others to replace with another combination that has the same behavior. |
Done. Closing. |
I'm messing with
MenuBar
et.al. and am curious about something: Why doesMapKey
(and the rest of the call chain) filter out lettingProcessKey
see just modifier key events?For example, if we wanted
MenuBar
to highlight when a user pressesalt
like it does on Windows, we'd want it to be able to 'see' that the user has just pressedalt
.Would the world end if
MapKey
was modified to pass through shift-modifier keys?The text was updated successfully, but these errors were encountered: