ui.backend.x11.keys: Support for the Windows/Meta key on X11

char-rename
Björn Lindqvist 2016-08-16 15:05:19 +02:00
parent de2e01268e
commit acdcc1f2c2
3 changed files with 25 additions and 2 deletions

View File

@ -47,6 +47,22 @@ IN: ui.backend.gtk.tests
{ is_modifier 1 } { is_modifier 1 }
} ; } ;
: gdk-windows-key-release-event ( -- event )
S{ GdkEventKey
{ type 9 }
{ window ALIEN: 1a71d80 }
{ send_event 0 }
{ time 47998769 }
{ state 67108928 }
{ keyval 119 }
{ length 1 }
{ string ALIEN: 2017640 }
{ hardware_keycode 25 }
{ group 0 }
{ is_modifier 0 }
} ;
! The Mac build servers doesn't have the gtk libs ! The Mac build servers doesn't have the gtk libs
os linux? [ os linux? [
! key-event>gesture ! key-event>gesture
@ -54,10 +70,12 @@ os linux? [
T{ key-down f f "F2" } T{ key-down f f "F2" }
T{ key-up f f "H" } T{ key-up f f "H" }
T{ key-down f f " " } T{ key-down f f " " }
T{ key-up { mods { M+ } } { sym "w" } }
} [ } [
gdk-key-press-event key-event>gesture gdk-key-press-event key-event>gesture
gdk-key-release-event key-event>gesture gdk-key-release-event key-event>gesture
gdk-space-key-press-event key-event>gesture gdk-space-key-press-event key-event>gesture
gdk-windows-key-release-event key-event>gesture
] unit-test ] unit-test
! key-sym ! key-sym

View File

@ -8,6 +8,7 @@ CONSTANT: modifiers
{ S+ 0x1 } { S+ 0x1 }
{ C+ 0x4 } { C+ 0x4 }
{ A+ 0x8 } { A+ 0x8 }
{ M+ 0x40 }
} }
CONSTANT: codes CONSTANT: codes

View File

@ -128,7 +128,7 @@ HELP: A+
{ $description "Alt key modifier." } ; { $description "Alt key modifier." } ;
HELP: M+ HELP: M+
{ $description "Meta key modifier. This is the Command key on Mac OS X." } ; { $description "Meta key modifier. This is the Command key on Mac OS X and the Windows key on other Unices and Windows." } ;
HELP: S+ HELP: S+
{ $description "Shift key modifier." } ; { $description "Shift key modifier." } ;
@ -257,7 +257,7 @@ ARTICLE: "gesture-differences" "Gesture handling differences between platforms"
{ { $link S+ } "Shift" } { { $link S+ } "Shift" }
{ { $link A+ } "Alt" } { { $link A+ } "Alt" }
{ { $link C+ } "Control" } { { $link C+ } "Control" }
{ { $link M+ } "Windows key" } { { $link M+ } "Windows key (often called Super on Unix)" }
} }
"On Windows, " { $link key-up } " gestures are not reported for all keyboard events." "On Windows, " { $link key-up } " gestures are not reported for all keyboard events."
$nl $nl
@ -342,6 +342,10 @@ ARTICLE: "keyboard-gestures" "Keyboard gestures"
{ $snippet "F6" } { $snippet "F6" }
{ $snippet "F7" } { $snippet "F7" }
{ $snippet "F8" } { $snippet "F8" }
{ $snippet "F9" }
{ $snippet "F10" }
{ $snippet "F11" }
{ $snippet "F12" }
{ $snippet "LEFT" } { $snippet "LEFT" }
{ $snippet "RIGHT" } { $snippet "RIGHT" }
{ $snippet "DOWN" } { $snippet "DOWN" }