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.17 date: 2024/04/19 15:05:23
user: cg
file: KeyboardMap.st directory: libview
module: stx stc-classLibrary: libview

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.

copyright

COPYRIGHT (c) 1993 by Claus Gittinger 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.

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  keyForValue: logicalKey
retrieve a physical key, given a logical function

o  valueFor: aKey
retrieve a logical key



ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Tue, 03 Dec 2024 17:10:57 GMT