Record information about other key modifiers on X11/GTK

In particular, Mod4 is used for the Command button when you run Linux
on Mac hardware. I don't know how to get the others, but added them
for safety.
This commit is contained in:
Jay McCarthy 2014-01-27 15:19:54 -07:00
parent f7e903d493
commit e7f0f3587a
3 changed files with 54 additions and 2 deletions

View File

@ -20,6 +20,9 @@ See also @|mousekeydiscuss|.
[shift-down any/c #f] [shift-down any/c #f]
[control-down any/c #f] [control-down any/c #f]
[meta-down any/c #f] [meta-down any/c #f]
[mod3-down any/c #f]
[mod4-down any/c #f]
[mod5-down any/c #f]
[alt-down any/c #f] [alt-down any/c #f]
[x exact-integer? 0] [x exact-integer? 0]
[y exact-integer? 0] [y exact-integer? 0]
@ -28,8 +31,9 @@ See also @|mousekeydiscuss|.
See the corresponding @racketidfont{get-} and @racketidfont{set-} See the corresponding @racketidfont{get-} and @racketidfont{set-}
methods for information about @racket[key-code], @racket[shift-down], methods for information about @racket[key-code], @racket[shift-down],
@racket[control-down], @racket[meta-down], @racket[alt-down], @racket[control-down], @racket[meta-down], @racket[mod3-down], @racket[mod4-down],
@racket[x], @racket[y], @racket[time-stamp], @racket[caps-down]. @racket[mod5-down], @racket[alt-down], @racket[x], @racket[y],
@racket[time-stamp], @racket[caps-down].
The release key code, as returned by @method[key-event% The release key code, as returned by @method[key-event%
get-key-release-code], is initialized to @racket['press]. get-key-release-code], is initialized to @racket['press].
@ -205,6 +209,27 @@ Returns @racket[#t] if the Meta (Unix), Alt (Windows), or Command (Mac OS
} }
@defmethod[(get-mod3-down)
boolean?]{
Returns @racket[#t] if the Mod3 (Unix) key was down for the event.
}
@defmethod[(get-mod4-down)
boolean?]{
Returns @racket[#t] if the Mod4 (Unix) key was down for the event.
}
@defmethod[(get-mod5-down)
boolean?]{
Returns @racket[#t] if the Mod5 (Unix) key was down for the event.
}
@defmethod[(get-other-altgr-key-code) @defmethod[(get-other-altgr-key-code)
(or/c char? key-code-symbol? #f)]{ (or/c char? key-code-symbol? #f)]{
@ -339,6 +364,27 @@ Sets whether the Meta (Unix), Alt (Windows), or Command (Mac OS X) key
} }
@defmethod[(set-mod3-down [down? any/c])
void?]{
Sets whether the Mod3 (Unix) key was down for the event.
}
@defmethod[(set-mod4-down [down? any/c])
void?]{
Sets whether the Mod4 (Unix) key was down for the event.
}
@defmethod[(set-mod5-down [down? any/c])
void?]{
Sets whether the Mod5 (Unix) key was down for the event.
}
@defmethod[(set-other-altgr-key-code [code (or/c char? key-code-symbol? #f)]) @defmethod[(set-other-altgr-key-code [code (or/c char? key-code-symbol? #f)])
void?]{ void?]{

View File

@ -77,6 +77,9 @@
[[bool? shift-down] #f] [[bool? shift-down] #f]
[[bool? control-down] #f] [[bool? control-down] #f]
[[bool? meta-down] #f] [[bool? meta-down] #f]
[[bool? mod3-down] #f]
[[bool? mod4-down] #f]
[[bool? mod5-down] #f]
[[bool? alt-down] #f] [[bool? alt-down] #f]
[[exact-integer? x] 0] [[exact-integer? x] 0]
[[exact-integer? y] 0]) [[exact-integer? y] 0])

View File

@ -233,6 +233,9 @@
[shift-down (bit? modifiers GDK_SHIFT_MASK)] [shift-down (bit? modifiers GDK_SHIFT_MASK)]
[control-down (bit? modifiers GDK_CONTROL_MASK)] [control-down (bit? modifiers GDK_CONTROL_MASK)]
[meta-down (bit? modifiers GDK_MOD1_MASK)] [meta-down (bit? modifiers GDK_MOD1_MASK)]
[mod3-down (bit? modifiers GDK_MOD3_MASK)]
[mod4-down (bit? modifiers GDK_MOD4_MASK)]
[mod5-down (bit? modifiers GDK_MOD5_MASK)]
[alt-down (bit? modifiers GDK_META_MASK)] [alt-down (bit? modifiers GDK_META_MASK)]
[x 0] [x 0]
[y 0] [y 0]