diff options
author | Sven Gothel <[email protected]> | 2013-04-11 07:16:19 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-04-11 07:16:19 +0200 |
commit | b13868b612689307ebf4e46ee4ede2fd0560e504 (patch) | |
tree | 9cff4878336ed678f93998bacac12a26495e19fd /src/newt/native/X11Display.c | |
parent | f3e0f109ac7f03ef803523af8e965d713b6044db (diff) |
NEWT KeyEvent: Use UTF-16 UniCode for key-code and key-symbol exposing well defined key encoding and simplify usage.
Note, we use one collision to reduce key-code range:
[0x61 .. 0x78] keyCodes [F1..F24] collide w/ ['a'..'x']
Since keyCode/Sym won't use lower capital a-z, this is a no isssue.
KeyEvent:
- 'printable' type is being determined by a nonPrintableKeys table,
while 'action' type is set in case !printable and !modifier.
- public ctor hidden, use create(..) method instead.
This allows us to ensure modifier bit are properly set (incl. the keySym one) w/o performance loss.
- ctor validates that only one of the type flags is set, printable, modifyable or action.
WindowImpl:
- Using IntBitfield of 255 bits to track pressed state,
while removing the repeat state tracking since it is redundant.
The Windows impl. uses a single field to validate whether a key
was already repeated or not.
- Properly cast keyCode short values to int for tracking!
AWTNewtEventFactory, SWTNewtEventFactory:
- Add translation of keyCode/Sym from and to NEWT
- All tested via:
- Newt -> Awt for AWTRobot
- OSX CALayer: AWT -> NEWT
- SWT tests
X11:
- Add VK_CONTEXT_MENU mapping (XK_Menu)
LinuxEventDeviceTracker:
- Fix apostrophe and grave mapping, i.e. to VK_QUOTE and VK_BACK_QUOTE.
Adapted all unit tests, especially:
- TestNewtKeyCodesAWT: More fine grained keyCode ranges to test
using proper keyCode symbols.
Diffstat (limited to 'src/newt/native/X11Display.c')
-rw-r--r-- | src/newt/native/X11Display.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/newt/native/X11Display.c b/src/newt/native/X11Display.c index 903188467..56b7251d2 100644 --- a/src/newt/native/X11Display.c +++ b/src/newt/native/X11Display.c @@ -99,6 +99,8 @@ static short X11KeySym2NewtVKey(KeySym keySym) { case XK_Super_L: case XK_Super_R: return J_VK_WINDOWS; + case XK_Menu: + return J_VK_CONTEXT_MENU; case XK_Pause: return J_VK_PAUSE; case XK_Caps_Lock: |