#DOCUMENTATION by cg
class: XWorkstation
comment/format in:
#grabKey:modifier:window:
#keyPress:key:code:state:x:y:rootX:rootY:time:
--- a/XWorkstation.st Sat Jul 28 10:10:40 2018 +0200
+++ b/XWorkstation.st Sat Jul 28 12:05:16 2018 +0200
@@ -5449,15 +5449,17 @@
|commonKey|
+ "/ 'key: ' print. key print. ' view:' print. view printCR.
+
lastEventTime := time.
altDown := state bitTest:altModifierMask.
metaDown := state bitTest:metaModifierMask.
shiftDown := state bitTest:(self shiftModifierMask).
ctrlDown := state bitTest:(self ctrlModifierMask).
key isNil ifTrue:[
- "/ happens sometimes on some systems
- "/ (alt-graph on sun has no keysym)
- ^ self
+ "/ happens sometimes on some systems
+ "/ (alt-graph on sun has no keysym)
+ ^ self
].
eventRootX := rX.
eventRootY := rY.
@@ -5466,6 +5468,8 @@
commonKey := rawKeySymTranslation at:key ifAbsent:key.
self keyPress:commonKey x:x y:y view:view.
+
+ "Modified: / 28-07-2018 / 12:05:02 / Claus Gittinger"
!
keyRelease:view key:key code:keyCode state:state x:x y:y rootX:rX rootY:rY time:time
@@ -8647,14 +8651,24 @@
The modifierMaskOrNil is as mask as returned by altModifierMask, ctrlModifierMask, etc.
if nil, the key is grabbed with AnyModifier.
Only the key is passed to myself - no permanent grab is installed.
- (GrabModeAsync)"
+ (GrabModeAsync).
+ While the grab is active, key events for this key will be sent to
+ the DisplayRootWindow"
^ self
- grabKey:keySymCodeOrChar
- modifier:modifierMaskOrNil
- grabModeKeyboard:#GrabModeAsync
- grabModePointer:#GrabModeAsync
- window:aWindowIdOrNil
+ grabKey:keySymCodeOrChar
+ modifier:modifierMaskOrNil
+ grabModeKeyboard:#GrabModeAsync
+ grabModePointer:#GrabModeAsync
+ window:aWindowIdOrNil
+
+ "
+ Display grabKey:#Escape modifier:nil window:nil.
+ Delay waitForSeconds:15.
+ Display ungrabKey:#Escape modifier:nil window:nil.
+ "
+
+ "Modified (comment): / 28-07-2018 / 09:19:04 / Claus Gittinger"
!
ungrabKey:keySymCodeOrChar modifier:modifierMaskOrNil window:aWindowIdOrNil