...\" ** (c) Copyright 1993, 1994 Hewlett-Packard Company ...\" ** (c) Copyright 1993, 1994 International Business Machines Corp. ...\" ** (c) Copyright 1993, 1994 Sun Microsystems, Inc. ...\" ** (c) Copyright 1993, 1994 Novell, Inc ...\" ** ...\" ** ...\" ** ...\" ** (c) Copyright 1989, 1992 by Open Software Foundation, Inc. ...\" ** All Rights Reserved. ...\" ** ...\" ** (c) Copyright 1987, 1988, 1989, by Hewlett-Packard Company ...\" ** ...\" ** (c) Copyright 1987, 1988 by Digital Equipment Corporation, ...\" ** Maynard, MA. All Rights Reserved. ...\" ** ...\" ** .TH VirtualBindings 3X "" "" "" "" .ds )H Hewlett-Packard Company .ds ]W Motif Release 1.2: May 1992 .SH NAME \fIVirtualBindings\fP \- Bindings for virtual mouse and key events .SH DESCRIPTION .fi The 1/Motif manual pages describe translations in terms of \fBvirtual bindings\fP, based on those described in the \fBOSF/Motif Style Guide\fP. Mouse events are described in terms of \fBvirtual buttons\fP, and key events are described in terms of \fBvirtual keys\fP. The term \fBvirtual\fP 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. .SS "Virtual Modifiers" Both virtual buttons and virtual keys may contain \fBvirtual modifiers\fP. Each virtual modifier corresponds to one or more actual modifiers. The following table lists the bindings of virtual modifiers to actual modifiers in 1/Motif: .PP .sp 1 .in 0 .KS .TS tab(@) center; cb s lb lb. Virtual Modifier Bindings Virtual Modifier@Actual Modifiers _ MAlt@Mod1 MCopy@Ctrl MCtrl@Ctrl MLink@Ctrl Shift MMove@Shift MShift@Shift .TE .KE .in .sp 1 .PP \fIMod1\fP refers to the first modifier key. 1/Motif requires that it correspond to either \fIAlt\fP or \fIMeta\fP. .PP The virtual modifier \fIMAny\fP indicates that any modifier can be used. If \fIMAny\fP 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. .SS "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 1/Motif: .PP .sp 1 .in 0 .KS .TS tab(@) center; cb s lb lb. Virtual Button Bindings Virtual Button@Actual Button Events _ BCustom@ BDrag@ BExtend@Shift BMenu@ BSelect@ BToggle@Ctrl .TE .KE .in .sp 1 .SS "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, .ne 15 are used in translation tables. The following table lists the bindings of virtual keys to actual key event descriptions in 1/Motif: .PP .sp 1 .in 0 .KS .TS tab(@) center; cb s lb | lb. Virtual Key Bindings _ Virtual Key@Actual Key Events = KActivate@Return @CtrlReturn @osfActivate _ KAddMode@osfAddMode _ KBackSpace@osfBackSpace _ KBackTab@ShiftTab _ KBeginData@CtrlosfBeginLine _ KBeginLine@osfBeginLine _ KCancel@osfCancel _ KClear@osfClear _ KCopy@osfCopy @CtrlosfInsert _ KCut@osfCut @ShiftosfDelete _ KDelete@osfDelete _ KDeselectAll@Ctrlbackslash _ KDown@osfDown _ KEndData@CtrlosfEndLine _ KEndLine@osfEndLine _ KEnter@Return _ KEscape@Escape _ KExtend@Ctrl Shiftspace @ShiftosfSelect _ KHelp@osfHelp _ KInsert@osfInsert _ .TE .KE .in .sp 1 .nL .ne 40 .sp 1 .in 0 .KS .TS tab(@) center; cb s lb | lb. Virtual Key Bindings (Continued) _ Virtual Key@Actual Key Events = KLeft@osfLeft _ KMenu@osfMenu _ KMenuBar@osfMenuBar _ KNextField@Tab @CtrlTab _ KNextMenu@CtrlosfDown @CtrlosfRight _ KPageDown@osfPageDown _ KPageLeft@CtrlosfPageUp @osfPageLeft _ KPageRight@CtrlosfPageDown @osfPageRight _ KPageUp@osfPageUp _ KPaste@osfPaste @ShiftosfInsert _ KPrevField@ShiftTab @Ctrl ShiftTab _ KPrevMenu@CtrlosfUp @CtrlosfLeft _ KPrimaryCopy@CtrlosfPrimaryPaste @Mod1osfCopy @Mod1 CtrlosfInsert _ KPrimaryCut@Mod1osfPrimaryPaste @Mod1osfCut @Mod1 ShiftosfDelete _ KPrimaryPaste@osfPrimaryPaste _ KQuickCopy@CtrlosfQuickPaste _ KQuickCut@Mod1osfQuickPaste _ KQuickExtend@ShiftosfQuickPaste _ .TE .KE .in .sp 1 .nL .ne 20 .sp 1 .in 0 .KS .TS tab(@) center; cb s lb | lb. Virtual Key Bindings (Continued) _ Virtual Key@Actual Key Events = KQuickPaste@osfQuickPaste _ KReselect@Ctrl ShiftosfSelect _ KRestore@Ctrl ShiftosfInsert _ KRight@osfRight _ KSelect@space @Ctrlspace @osfSelect _ KSelectAll@Ctrlslash _ KSpace@space _ KTab@Tab _ KUndo@osfUndo @Mod1osfBackSpace _ KUp@osfUp _ KAny@ _ .TE .KE .in .sp 1 .SS "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 \fIXmTranslateKey\fP, 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: .TP \(bu A \fIdefaultVirtualBindings\fP application resource in the resource database. .TP \(bu A property on the root window, which can be set by \fImwm\fP on startup, or by the \fIxmbind\fP client, or on prior startup of a Motif application. .TP \(bu The file \fI\&.motifbind\fP in the user's home directory. .TP \(bu A set of bindings based on the vendor string and optionally the vendor release of the X server. Motif searches for these bindings in the following steps: .TP \(bu If the file \fIxmbind.alias\fP exists in the user's home directory, Motif searches this file for a pathname associated with the vendor string or with the vendor string and vendor release. If it finds such a pathname and if that file exists, Motif loads the bindings contained in that file. .TP \(bu If it has found no bindings, Motif next looks for the file \fIxmbind.alias\fP in the directory specified by the environment variable \fIXMBINDDIR\fP, if \fIXMBINDDIR\fP is set, or in the directory \fI/usr/lib/Xm/bindings\fP if \fIXMBINDDIR\fP is not set. If this file exists Motif searches it for a pathname associated with the vendor string or with the vendor string and vendor release. If it finds such a pathname and if that file exists, Motif loads the bindings contained in that file. .TP \(bu If it still has found no bindings, Motif loads a set of hard-coded fallback bindings. .LE .PP The \fIxmbind.alias\fP file contains zero or more lines of the form: .PP .na .wH .in +3n .ta 1.75i .nf "\fBvendor_string\fP[ \fBvendor_release\fP]" \fBbindings_file\fP .wH .in .ad .PP where \fBvendor_string\fP is the X server vendor name as returned by the X client \fIxdpyinfo\fP or the Xlib function \fIXServerVendor\fP, and must appear in double quotes. If \fBvendor_release\fP is included, it is the X server vendor release number as returned by the X client \fIxdpyinfo\fP or the Xlib function \fIXVendorRelease\fP, and must also be contained within the double quotes separated by one space from \fBvendor_string\fP. \fBvendor_release\fP 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. .PP \fBbindings_file\fP 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 \fIxmbind.alias\fP file. .PP Comment lines in the \fIxmbind.alias\fP file begin with \fI!\fP. .PP The bindings found in either the \fI\&.motifbind\fP 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. .PP On startup \fImwm\fP attempts to load the file \fI\&.motifbind\fP 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. .PP \fIxmbind\fP 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 \fI\&.motifbind\fP 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. .PP 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: .PP .wH .in +3n .na .ta 1i .nf [\fBa\fP] Means either nothing or \fBa\fP .nL {\fBa\fP} Means zero or more occurrences of \fBa\fP .ad .wH .in .PP Terminals are enclosed in double quotation marks. .PP The syntax of an "osf" keysym binding specification is as follows: .PP .wH .in +3n .na .ta 1.5i 1.75i .nf binding_spec = {line "\en"} [line] .nL line = virtual_keysym ":" key_event .nL key_event = {modifier_name} "" actual_keysym .nL virtual_keysym = keysym .nL actual_keysym = keysym .nL keysym = A valid X11 keysym name that is .nL mapped by \fIXStringToKeysym\fP .ad .wH .in .PP 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. .PP Following is an example of a specification for the \fIdefaultVirtualBindings\fP resource in a resource file: .wH .in +3n .oS .ta 0.5i 2i 2.5i 3.75i .nf *defaultVirtualBindings: \e osfBackSpace : BackSpace \en\e osfInsert : InsertChar \en\e \&... osfDelete : DeleteChar .oE .wH .in .PP The format of a \fI\&.motifbind\fP 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 \fI\&.motifbind\fP or vendor bindings file: .wH .in +3n .oS .ta 1.5i 2i .nf osfBackSpace : BackSpace osfInsert : InsertChar \&... osfDelete : DeleteChar .oE .wH .in .PP The following table lists the fixed fallback default bindings for "osf" keysyms: .PP .ne 7 .sp 1 .in 0 .KS .TS tab(@) center; cb s lb lb. Fallback Default Bindings for "osf" Keysyms "osf" Keysym@Fallback Default Binding _ osfActivate@ osfAddMode@Shift F8 osfBackSpace@Backspace osfBeginLine@Home osfClear@Clear osfCopy@ osfCut@ osfDelete@Delete osfDown@Down osfEndLine@End osfCancel@Escape osfHelp@F1 osfInsert@Insert osfLeft@Left osfMenu@F4 osfMenuBar@F10 osfPageDown@Next osfPageLeft@ osfPageRight@ osfPageUp@Prior osfPaste@ osfPrimaryPaste@ osfQuickPaste@ osfRight@Right osfSelect@Select osfUndo@Undo osfUp@Up .TE .KE .in .sp 1 .SH RELATED INFORMATION \fIxmbind(1X)\fP