eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'KeyboardMap':

Home

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

Class: KeyboardMap


Inheritance:

   Object
   |
   +--Collection
      |
      +--Set
         |
         +--Dictionary
            |
            +--IdentityDictionary
               |
               +--KeyboardMap

Package:
stx:libview
Category:
Interface-Support-UI
Version:
rev: 1.15 date: 2014/12/18 16:13:06
user: cg
file: KeyboardMap.st directory: libview
module: stx stc-classLibrary: libview
Author:
Claus Gittinger

Description:


instances of KeyboardMap are used for mapping keystrokes AND sequences
of keystrokes to a function key.
There is usually only one instance in the system - held in an instance
variable of Display.

The setup of this map is done in the 'smalltalk.rc' or one of the
'keyboard.rc' files during startup.
To add a mapping (for example, to attach the logical function 'DoIt' to
the key-combination Cmd-'d'):

    |m|

    m := Display keyboardMap.
    m bindValue:#DoIt to:#Cmdd.

Key sequences can also be defined (hey emacs fans ;-) as in:

    |m|

    m := Display keyboardMap.
    m bindValue:#DoIt to:#Ctrlx followedBy:#Ctrld

Key prefixes are defined in the DeviceWorkstation>>translateKey: method.
Typical prefixes are Cmd (for Alt or Meta), Ctrl etc.
Some keyboards offer both Alt and Meta keys - on those, the first has a
prefix of Alt, the second has Cmd as prefix. Keyboards with only an Alt
key will will create prefix codes of Cmd for that.

To remove a mapping, use the same value for both logical and physical key,
as in:

    |m|

    m := Display keyboardMap.
    m bindValue:#Cmdd to:#Cmdd.


Related information:

    WindowEvent
    WindowSensor
    WindowGroup
    View
    DeviceWorkstation

Instance protocol:

accessing
o  bindValue: logicalKey to: aKey
bind aLogicalKey to a rawKey.
The event mechanism uses this to pass logical keyboard events
to the application (such as #Copy, #Cut etc.)
instead of physical ones (such as #AltC, #AltX)

o  bindValue: logicalKey to: key1 followedBy: key2
bind aLogicalKey to a sequence of two rawKeys.
The event mechanism uses this to pass logical keyboard events
to the application (such as #Copy, #Cut etc.)
instead of physical ones (such as #AltC, #AltX)

o  hasBindingFor: aKey
retrieve a logical key

o  valueFor: aKey
retrieve a logical key



ST/X 7.1.0.0; WebServer 1.663 at exept.de:8081; Sun, 26 May 2019 13:02:23 GMT