DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

VirtualBindings(Xm)


VirtualBindings -- bindings for virtual mouse and key events

Description

The Motif manual pages describe translations in terms of virtual bindings, based on those described in the OSF/Motif Style Guide. Mouse events are described in terms of virtual buttons, and key events are described in terms of virtual keys. The term virtual implies that the events as described do not necessarily correspond to a fixed set of X Window System events. Instead, virtual buttons and keys are linked to actual events by means of virtual bindings.

Virtual modifiers

Both virtual buttons and virtual keys may contain virtual modifiers. Each virtual modifier corresponds to one or more actual modifiers. The following table lists the bindings of virtual modifiers to actual modifiers in Motif:

Virtual modifier bindings

Virtual modifier Actual modifiers
MAlt Mod1
MCopy Ctrl
MCtrl Ctrl
MLink Ctrl Shift
MMove Shift
MShift Shift

 +-----------------+------------------+
 |Virtual modifier | Actual modifiers |
 +-----------------+------------------+
 |MAlt             | Mod1             |
 +-----------------+------------------+
 |MCopy            | Ctrl             |
 +-----------------+------------------+
 |MCtrl            | Ctrl             |
 +-----------------+------------------+
 |MLink            | Ctrl Shift       |
 +-----------------+------------------+
 |MMove            | Shift            |
 +-----------------+------------------+
 |MShift           | Shift            |
 +-----------------+------------------+
Mod1 refers to the first modifier key. Motif requires that it correspond to either <Alt> or <Meta>.

The virtual modifier MAny indicates that any modifier can be used. If MAny is not specified and the user presses an actual modifier that is not explicitly included in a translation, that modifier may prevent the translation from being matched.

Virtual buttons

Each virtual button corresponds to one or more actual button event descriptions. Each button event description contains a button name and possibly modifiers. These button event descriptions, appropriately ordered and possibly further modified, are used in translation tables. The following table lists the bindings of virtual buttons to actual button event descriptions in Motif:

Virtual button bindings

Virtual button Actual button events
BCustom <Btn3>
BDrag <Btn2>
BExtend Shift<Btn1>
BMenu <Btn3>
BSelect <Btn1>
BToggle Ctrl<Btn1>

 +---------------+----------------------+
 |Virtual button | Actual button events |
 +---------------+----------------------+
 |BCustom        | <Btn3>               |
 +---------------+----------------------+
 |BDrag          | <Btn2>               |
 +---------------+----------------------+
 |BExtend        | Shift<Btn1>          |
 +---------------+----------------------+
 |BMenu          | <Btn3>               |
 +---------------+----------------------+
 |BSelect        | <Btn1>               |
 +---------------+----------------------+
 |BToggle        | Ctrl<Btn1>           |
 +---------------+----------------------+

Virtual keys

Each virtual key corresponds to one or more actual key event descriptions. Each key event description contains a keysym name and possibly modifiers. These key event descriptions, appropriately ordered and possibly further modified, are used in translation tables. The following table lists the bindings of virtual keys to actual key event descriptions in Motif:

Virtual key bindings

Virtual key Actual key events
KActivate <Key>Return
  Ctrl<Key>Return
  <Key>osfActivate
KAddMode <Key>osfAddMode
KBackSpace <Key>osfBackSpace
KBackTab Shift<Key>Tab
KBeginData Ctrl<Key>osfBeginLine
KBeginLine <Key>osfBeginLine
KCancel <Key>osfCancel
KClear <Key>osfClear
KCopy <Key>osfCopy
  Ctrl<Key>osfInsert
KCut <Key>osfCut
  Shift<Key>osfDelete
KDelete <Key>osfDelete
KDeselectAll Ctrl<Key>backslash
KDown <Key>osfDown
KEndData Ctrl<Key>osfEndLine
KEndLine <Key>osfEndLine
KEnter <Key>Return
KEscape <Key>Escape
KExtend Ctrl Shift<Key>space
  Shift<Key>osfSelect
KHelp <Key>osfHelp
KInsert <Key>osfInsert
KLeft <Key>osfLeft
KMenu <Key>osfMenu
KMenuBar <Key>osfMenuBar
KNextField <Key>Tab
  Ctrl<Key>Tab
KNextMenu Ctrl<Key>osfDown
  Ctrl<Key>osfRight
KPageDown <Key>osfPageDown
KPageLeft Ctrl<Key>osfPageUp
  <Key>osfPageLeft
KPageRight Ctrl<Key>osfPageDown
  <Key>osfPageRight
KPageUp <Key>osfPageUp
KPaste <Key>osfPaste
  Shift<Key>osfInsert
KPrevField Shift<Key>Tab
  Ctrl Shift<Key>Tab
KPrevMenu Ctrl<Key>osfUp
  Ctrl<Key>osfLeft
KPrimaryCopy Ctrl<Key>osfPrimaryPaste
  Mod1<Key>osfCopy
  Mod1 Ctrl<Key>osfInsert
KPrimaryCut Mod1<Key>osfPrimaryPaste
  Mod1<Key>osfCut
  Mod1
  Shift<Key>osfDelete
KPrimaryPaste <Key>osfPrimaryPaste
KQuickCopy Ctrl<Key>osfQuickPaste
KQuickCut Mod1<Key>osfQuickPaste
KQuickExtend Shift<Key>osfQuickPaste
KQuickPaste <Key>osfQuickPaste
KReselect Ctrl
  Shift<Key>osfSelect
KRestore Ctrl
  Shift<Key>osfInsert
KRight <Key>osfRight
KSelect <Key>space
  Ctrl<Key>space
  <Key>osfSelect
KSelectAll Ctrl<Key>slash
KSpace <Key>space
KTab <Key>Tab
KUndo <Key>osfUndo
  Mod1<Key>osfBackSpace
KUp <Key>osfUp
KAny <Key>

 +--------------+--------------------------+
 |Virtual key   | Actual key events        |
 +--------------+--------------------------+
 |KActivate     | <Key>Return              |
 +--------------+--------------------------+
 |              | Ctrl<Key>Return          |
 +--------------+--------------------------+
 |              | <Key>osfActivate         |
 +--------------+--------------------------+
 |KAddMode      | <Key>osfAddMode          |
 +--------------+--------------------------+
 |KBackSpace    | <Key>osfBackSpace        |
 +--------------+--------------------------+
 |KBackTab      | Shift<Key>Tab            |
 +--------------+--------------------------+
 |KBeginData    | Ctrl<Key>osfBeginLine    |
 +--------------+--------------------------+
 |KBeginLine    | <Key>osfBeginLine        |
 +--------------+--------------------------+
 |KCancel       | <Key>osfCancel           |
 +--------------+--------------------------+
 |KClear        | <Key>osfClear            |
 +--------------+--------------------------+
 |KCopy         | <Key>osfCopy             |
 +--------------+--------------------------+
 |              | Ctrl<Key>osfInsert       |
 +--------------+--------------------------+
 |KCut          | <Key>osfCut              |
 +--------------+--------------------------+
 |              | Shift<Key>osfDelete      |
 +--------------+--------------------------+
 |KDelete       | <Key>osfDelete           |
 +--------------+--------------------------+
 |KDeselectAll  | Ctrl<Key>backslash       |
 +--------------+--------------------------+
 |KDown         | <Key>osfDown             |
 +--------------+--------------------------+
 |KEndData      | Ctrl<Key>osfEndLine      |
 +--------------+--------------------------+
 |KEndLine      | <Key>osfEndLine          |
 +--------------+--------------------------+
 |KEnter        | <Key>Return              |
 +--------------+--------------------------+
 |KEscape       | <Key>Escape              |
 +--------------+--------------------------+
 |KExtend       | Ctrl Shift<Key>space     |
 +--------------+--------------------------+
 |              | Shift<Key>osfSelect      |
 +--------------+--------------------------+
 |KHelp         | <Key>osfHelp             |
 +--------------+--------------------------+
 |KInsert       | <Key>osfInsert           |
 +--------------+--------------------------+
 |KLeft         | <Key>osfLeft             |
 +--------------+--------------------------+
 |KMenu         | <Key>osfMenu             |
 +--------------+--------------------------+
 |KMenuBar      | <Key>osfMenuBar          |
 +--------------+--------------------------+
 |KNextField    | <Key>Tab                 |
 +--------------+--------------------------+
 |              | Ctrl<Key>Tab             |
 +--------------+--------------------------+
 |KNextMenu     | Ctrl<Key>osfDown         |
 +--------------+--------------------------+
 |              | Ctrl<Key>osfRight        |
 +--------------+--------------------------+
 |KPageDown     | <Key>osfPageDown         |
 +--------------+--------------------------+
 |KPageLeft     | Ctrl<Key>osfPageUp       |
 +--------------+--------------------------+
 |              | <Key>osfPageLeft         |
 +--------------+--------------------------+
 |KPageRight    | Ctrl<Key>osfPageDown     |
 +--------------+--------------------------+
 |              | <Key>osfPageRight        |
 +--------------+--------------------------+
 |KPageUp       | <Key>osfPageUp           |
 +--------------+--------------------------+
 |KPaste        | <Key>osfPaste            |
 +--------------+--------------------------+
 |              | Shift<Key>osfInsert      |
 +--------------+--------------------------+
 |KPrevField    | Shift<Key>Tab            |
 +--------------+--------------------------+
 |              | Ctrl Shift<Key>Tab       |
 +--------------+--------------------------+
 |KPrevMenu     | Ctrl<Key>osfUp           |
 +--------------+--------------------------+
 |              | Ctrl<Key>osfLeft         |
 +--------------+--------------------------+
 |KPrimaryCopy  | Ctrl<Key>osfPrimaryPaste |
 +--------------+--------------------------+
 |              | Mod1<Key>osfCopy         |
 +--------------+--------------------------+
 |              | Mod1 Ctrl<Key>osfInsert  |
 +--------------+--------------------------+
 |KPrimaryCut   | Mod1<Key>osfPrimaryPaste |
 +--------------+--------------------------+
 |              | Mod1<Key>osfCut          |
 +--------------+--------------------------+
 |              | Mod1                     |
 +--------------+--------------------------+
 |              | Shift<Key>osfDelete      |
 +--------------+--------------------------+
 |KPrimaryPaste | <Key>osfPrimaryPaste     |
 +--------------+--------------------------+
 |KQuickCopy    | Ctrl<Key>osfQuickPaste   |
 +--------------+--------------------------+
 |KQuickCut     | Mod1<Key>osfQuickPaste   |
 +--------------+--------------------------+
 |KQuickExtend  | Shift<Key>osfQuickPaste  |
 +--------------+--------------------------+
 |KQuickPaste   | <Key>osfQuickPaste       |
 +--------------+--------------------------+
 |KReselect     | Ctrl                     |
 +--------------+--------------------------+
 |              | Shift<Key>osfSelect      |
 +--------------+--------------------------+
 |KRestore      | Ctrl                     |
 +--------------+--------------------------+
 |              | Shift<Key>osfInsert      |
 +--------------+--------------------------+
 |KRight        | <Key>osfRight            |
 +--------------+--------------------------+
 |KSelect       | <Key>space               |
 +--------------+--------------------------+
 |              | Ctrl<Key>space           |
 +--------------+--------------------------+
 |              | <Key>osfSelect           |
 +--------------+--------------------------+
 |KSelectAll    | Ctrl<Key>slash           |
 +--------------+--------------------------+
 |KSpace        | <Key>space               |
 +--------------+--------------------------+
 |KTab          | <Key>Tab                 |
 +--------------+--------------------------+
 |KUndo         | <Key>osfUndo             |
 +--------------+--------------------------+
 |              | Mod1<Key>osfBackSpace    |
 +--------------+--------------------------+
 |KUp           | <Key>osfUp               |
 +--------------+--------------------------+
 |KAny          | <Key>                    |
 +--------------+--------------------------+

Bindings for osf keysyms

Keysym strings that begin with ``osf'' are not part of the X server's keyboard mapping. Instead, these keysyms are produced on the client side at run time. They are interpreted by the routine XmTranslateKey, and are used by the translation manager when the server delivers an actual key event. For each application, a mapping is maintained between ``osf'' keysyms and keysyms that correspond to actual keys. This mapping is based on information obtained at application startup from one of the following sources, listed in order of precedence:

The xmbind.alias file contains zero or more lines of the form:

"vendor_string[ vendor_release]" bindings_file

where vendor_string is the X server vendor name as returned by the X client xdpyinfo or the Xlib function XServerVendor, and must appear in double quotes. If vendor_release is included, it is the X server vendor release number as returned by the X client xdpyinfo or the Xlib function XVendorRelease, and must also be contained within the double quotes separated by one space from vendor_string. vendor_release is provided to allow support of changes in keyboard hardware from a vendor, assuming that the vendor increments the release number to flag such changes. Alternatively, the vendor may simply use a unique vendor string for each different keyboard.

bindings_file is the pathname of the file containing the bindings themselves. It can be a relative or absolute pathname. If it it is a relative pathname, it is relative to the location of the xmbind.alias file.

Comment lines in the xmbind.alias file begin with ``!''.

The bindings found in either the .motifbind file or the vendor mapping are placed in a property on the root window. This property is used to determine the bindings for subsequent Motif applications.

On startup mwm attempts to load the file .motifbind in the user's home directory. If this is unsuccessful, it loads the vendor bindings as described above. It places the bindings it loads in a property on the root window for use by subsequent Motif applications.

xmbind loads bindings from a file if that file is specified on the command line. If no file is specified on the command line, it attempts to load the file .motifbind in the user's home directory. If this fails, it loads the vendor bindings as described above. It places the bindings it loads in a property on the root window for use by subsequent Motif applications.

The format of the specification for mapping ``osf'' keysyms to actual keysyms is similar to that of a specification for an event translation. The syntax is specified here in EBNF notation using the following conventions:

[a] Means either nothing or a
{a} Means zero or more occurrences of a

Terminals are enclosed in double quotation marks.

The syntax of an ``osf'' keysym binding specification is as follows:

  binding_spec = {line "\n"} [line]
  line = virtual_keysym ":" key_event
  key_event = {modifier_name} "<Key>" actual_keysym
  virtual_keysym = keysym
  actual_keysym = keysym
  keysym = A valid X11 keysym name that is mapped by XStringToKeysym

      binding_spec     =   {line "\n"} [line]
      line             =   virtual_keysym ":" key_event
      key_event        =   {modifier_name} "<Key>" actual_keysym
      virtual_keysym   =   keysym
      actual_keysym    =   keysym
      keysym           =   A valid X11 keysym name that is
                           mapped by XStringToKeysym
As with event translations, more specific event descriptions must precede less specific descriptions. For example, an event description for a key with a modifier must precede a description for the same key without the same modifier.

Following is an example of a specification for the defaultVirtualBindings resource in a resource file:

   *defaultVirtualBindings: \
   	osfBackSpace	:	<Key>BackSpace	\n\
   	osfInsert	:	<Key>InsertChar	\n\
   ...
   	osfDelete	:	<Key>DeleteChar
The format of a .motifbind file or of a file containing vendor bindings is the same, except that the binding specification for each keysym is placed on a separate line. The example specification above appears as follows in a .motifbind or vendor bindings file:
   osfBackSpace	:	<Key>BackSpace
   osfInsert	:	<Key>InsertChar
   ...
   osfDelete	:	<Key>DeleteChar
The following table lists the fixed fallback default bindings for ``osf'' keysyms:

Fallback default bindings for ``osf'' keysyms

osf keysym Fallback default binding
osfActivate <unbound>
osfAddMode Shift F8
osfBackSpace Backspace
osfBeginLine Home
osfClear Clear
osfCopy <unbound>
osfCut <unbound>
osfDelete Delete
osfDown Down
osfEndLine End
osfCancel Escape
osfHelp F1
osfInsert Insert
osfLeft Left
osfMenu F4
osfMenuBar F10
osfPageDown Next
osfPageLeft <unbound>
osfPageRight <unbound>
osfPageUp Prior
osfPaste <unbound>
osfPrimaryPaste <unbound>
osfQuickPaste <unbound>
osfRight Right
osfSelect Select
osfUndo Undo
osfUp Up

 +----------------+--------------------------+
 |osf keysym      | Fallback default binding |
 +----------------+--------------------------+
 |osfActivate     | <unbound>                |
 +----------------+--------------------------+
 |osfAddMode      | Shift F8                 |
 +----------------+--------------------------+
 |osfBackSpace    | Backspace                |
 +----------------+--------------------------+
 |osfBeginLine    | Home                     |
 +----------------+--------------------------+
 |osfClear        | Clear                    |
 +----------------+--------------------------+
 |osfCopy         | <unbound>                |
 +----------------+--------------------------+
 |osfCut          | <unbound>                |
 +----------------+--------------------------+
 |osfDelete       | Delete                   |
 +----------------+--------------------------+
 |osfDown         | Down                     |
 +----------------+--------------------------+
 |osfEndLine      | End                      |
 +----------------+--------------------------+
 |osfCancel       | Escape                   |
 +----------------+--------------------------+
 |osfHelp         | F1                       |
 +----------------+--------------------------+
 |osfInsert       | Insert                   |
 +----------------+--------------------------+
 |osfLeft         | Left                     |
 +----------------+--------------------------+
 |osfMenu         | F4                       |
 +----------------+--------------------------+
 |osfMenuBar      | F10                      |
 +----------------+--------------------------+
 |osfPageDown     | Next                     |
 +----------------+--------------------------+
 |osfPageLeft     | <unbound>                |
 +----------------+--------------------------+
 |osfPageRight    | <unbound>                |
 +----------------+--------------------------+
 |osfPageUp       | Prior                    |
 +----------------+--------------------------+
 |osfPaste        | <unbound>                |
 +----------------+--------------------------+
 |osfPrimaryPaste | <unbound>                |
 +----------------+--------------------------+
 |osfQuickPaste   | <unbound>                |
 +----------------+--------------------------+
 |osfRight        | Right                    |
 +----------------+--------------------------+
 |osfSelect       | Select                   |
 +----------------+--------------------------+
 |osfUndo         | Undo                     |
 +----------------+--------------------------+
 |osfUp           | Up                       |
 +----------------+--------------------------+

See also

xmbind(Xm)
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 26 May 2005