eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'KeyboardProcessor':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: KeyboardProcessor


Inheritance:

   Object
   |
   +--KeyboardProcessor

Package:
stx:libview2
Category:
Interface-Framework
Version:
rev: 1.54 date: 2018/07/03 14:17:48
user: sr
file: KeyboardProcessor.st directory: libview2
module: stx stc-classLibrary: libview2
Author:
Claus Gittinger

Description:


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 not be complete or compatible 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.


Class protocol:

defaults
o  isCommandKey: aKeyCode
returns true if the keyCode is for a Command key (such as Cmda)

o  isFunctionKey: aKeyCode
returns true if the key code is for a Function key (such as F10)

o  isKeyEventIgnoredAsShortcut: aKeyEvent
returns true if the key event ignored is a shortCut key

o  isMnemonicKeyEvent: aKeyEvent
returns true if the key event is a mnemonic key (such as Cmda)


Instance protocol:

Compatibility-VW
o  keyboardConsumers

o  removeKeyboardReceiver: aController

o  sendKeyboardTo: aController

o  setActive: aWidget

accessing
o  addAccelerator: aKey action: aSelectorOrBlock
add a global accelerator - these are handled even if no corresponding
menu shortcut is defined

o  cancelAction: aBlock
this entry allows for another cancel action to be installed,
to overwrite the default action, which closes a dialog without accept

o  componentWithInitialFocus

o  componentWithInitialFocus: aComponent

o  escapeIsCancelInDialog: aBoolean
set the escapeIsCancel flag.
If off, Escape is NOT handled as cancel (the builder defaults it to true,)

o  eventFilter: something

o  menuBar
return the value of the instance variable 'menuBar' (automatically generated)

o  menuBar: something
set the value of the instance variable 'menuBar' (automatically generated)

o  returnAction: aBlock
this entry allows for another return action to be installed,
to overwrite the default action, which closes a dialog with accept

o  returnIsOKInDialog: aBoolean
set the returnIsOK flag.
If off, Return is NOT handled as accept (the builder defaults it to true,)

event handling
o  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.

o  requestForWindowClose
about to close the window.

o  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
o  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 ;-)



ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Fri, 19 Apr 2024 20:10:30 GMT