--- a/KeyboardProcessor.st Fri Jan 12 11:58:11 2001 +0100
+++ b/KeyboardProcessor.st Wed Jan 17 12:11:38 2001 +0100
@@ -77,6 +77,30 @@
!KeyboardProcessor class methodsFor:'defaults'!
+isKeyEventIgnoredAsShortcut:aKeyEvent
+ "returns true if the key event ignored is a shortCut key
+ "
+ |rawKey|
+
+ rawKey := aKeyEvent rawKey.
+ rawKey isSymbol ifFalse:[^ true].
+ "/ ignore cursor keys
+ (#(
+ Up Down Left Right
+ CursorUp CursorDown CursorLeft CursorRight
+ ) includes:rawKey) ifTrue:[^ true].
+
+ "/ ignore some meta keys
+ (#(
+ #'Control_L' #'Control_R' #'Control' #'Ctrl' #'CmdMenu' #'BackSpace'
+ ) includes:aKeyEvent key) ifTrue:[^ true].
+
+ ^ false
+
+ "Created: / 17.1.2001 / 11:57:07 / cg"
+ "Modified: / 17.1.2001 / 12:03:03 / cg"
+!
+
isMnemonicKeyEvent:aKeyEvent
"returns true if the key event is a mnemonic key
"
@@ -205,24 +229,19 @@
].
].
].
-
- rawKey isSymbol ifTrue:[
- ( #(Up Down Left Right
- ) includes:rawKey)
- ifFalse:[
- ( #( #'Control_L' #'Control_R' #'Control'
- ) includes:key)
- ifFalse:[
- wg notNil ifTrue:[
- (self class isMnemonicKeyEvent:event) ifTrue:[
- (wg processMnemonic:event) ifTrue:[
- ^ true
- ]
- ].
- (wg processShortcut:event) ifTrue:[
- ^ true
- ].
- ].
+ wg notNil ifTrue:[
+ (self class isMnemonicKeyEvent:event) ifTrue:[
+Transcript showCR:event rawKey.
+Transcript showCR:event key.
+ (wg processMnemonic:event) ifTrue:[
+ ^ true
+ ]
+ ].
+ (self class isKeyEventIgnoredAsShortcut:event) ifFalse:[
+Transcript showCR:event rawKey.
+Transcript showCR:event key.
+ (wg processShortcut:event) ifTrue:[
+ ^ true
].
].
].
@@ -230,6 +249,8 @@
"/ let view dispatch it.
^ false
+
+ "Modified: / 17.1.2001 / 12:00:18 / cg"
!
requestForWindowClose
@@ -270,5 +291,5 @@
!KeyboardProcessor class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview2/KeyboardProcessor.st,v 1.17 2001-01-11 17:37:46 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview2/KeyboardProcessor.st,v 1.18 2001-01-17 11:11:38 cg Exp $'
! !