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.60 date: 2024/04/19 15:04:16
user: cg
file: KeyboardProcessor.st directory: libview2
module: stx stc-classLibrary: libview2

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 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.

copyright

COPYRIGHT (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.

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.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 21 Dec 2024 16:20:38 GMT