|
Class: KeyboardProcessor
Object
|
+--KeyboardProcessor
- Package:
- stx:libview2
- Category:
- Interface-Framework
- Version:
- rev:
1.60
date: 2024/04/19 15:04:16
- user: cg
- file: KeyboardProcessor.st directory: libview2
- module: stx stc-classLibrary: libview2
ST80 compatibility (mimicry) class.
The class is not completed yet and certainly not bug free.
Notice:
this class was implemented using protocol information
from alpha testers, literature and by reading public domain code
- it may be incomplete or oncompatible to the corresponding ST-80 class.
If you encounter any incompatibilities, please forward a note
describing the incompatibility verbal (i.e. no code) to the ST/X team.
KeyboardProcessor is going to take over the focus control
mechanism (which are currently located in the windowGroup).
Currently, it keeps track of inputFields, and allows for
a global accept to be forced.
This is especially useful with dialogs, where a global accept
should be performed on all inputFields, when the OK button
is pressed.
specials:
eventFilter ....................... if non-nil, a block to return false, if
the event is to be ignored.
copyrightCOPYRIGHT (c) 1997 by eXept Software AG
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
defaults
-
isCommandKey: aKeyCode
-
returns true if the keyCode is for a Command key (such as Cmda)
-
isFunctionKey: aKeyCode
-
returns true if the key code is for a Function key (such as F10)
-
isKeyEventIgnoredAsShortcut: aKeyEvent
-
returns true if the key event ignored is a shortCut key
-
isMnemonicKeyEvent: aKeyEvent
-
returns true if the key event is a mnemonic key (such as Cmda)
Compatibility-VW
-
keyboardConsumers
-
-
removeKeyboardReceiver: aController
-
-
sendKeyboardTo: aController
-
-
setActive: aWidget
-
accessing
-
addAccelerator: aKey action: aSelectorOrBlock
-
add a global accelerator - these are handled even if no corresponding
menu shortcut is defined
-
cancelAction: aBlock
-
this entry allows for another cancel action to be installed,
to overwrite the default action, which closes a dialog without accept
-
componentWithInitialFocus
-
-
componentWithInitialFocus: aComponent
-
-
escapeIsCancelInDialog: aBoolean
-
set the escapeIsCancel flag.
If off, Escape is NOT handled as cancel (the builder defaults it to true,)
-
eventFilter: something
-
-
menuBar
-
return the value of the instance variable 'menuBar' (automatically generated)
-
menuBar: something
-
set the value of the instance variable 'menuBar' (automatically generated)
-
returnAction: aBlock
-
this entry allows for another return action to be installed,
to overwrite the default action, which closes a dialog with accept
-
returnIsOKInDialog: aBoolean
-
set the returnIsOK flag.
If off, Return is NOT handled as accept (the builder defaults it to true,)
event handling
-
processEvent: event forModalView: modalTopOrNil
-
process a key-event; return true, if handled & eaten; false if not.
Here, first, we look for a globalAccelerator,
then for Return and Escape in modal applications,
(which lead to Accept & Cancel resp.)
Finally, menu-shortcuts are handled.
-
requestForWindowClose
-
about to close the window.
-
requestGlobalAutoAccept
-
about to close the window via return ok accept.
Ask all acceptListeners to accept their value and return true, if all of those fields
did.
setup
-
addAutoAcceptListener: aListener
-
add a aListener to my autoAcceptListeners.
Typically, inputFields add themself, to be notified (via requestForAutoAccept)
when the dialog is about to be closed with returnIsOK or accept.
(of course, other listeners are also invited ;-)
|