1dnl Copyright (c) 1993-2009, Paul Mattes. 2dnl All rights reserved. 3dnl 4dnl Redistribution and use in source and binary forms, with or without 5dnl modification, are permitted provided that the following conditions 6dnl are met: 7dnl * Redistributions of source code must retain the above copyright 8dnl notice, this list of conditions and the following disclaimer. 9dnl * Redistributions in binary form must reproduce the above copyright 10dnl notice, this list of conditions and the following disclaimer in the 11dnl documentation and/or other materials provided with the distribution. 12dnl * Neither the name of Paul Mattes nor his contributors may be used 13dnl to endorse or promote products derived from this software without 14dnl specific prior written permission. 15dnl 16dnl THIS SOFTWARE IS PROVIDED BY PAUL MATTES "AS IS" AND ANY EXPRESS 17dnl OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18dnl WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19dnl DISCLAIMED. IN NO EVENT SHALL PAUL MATTES BE LIABLE FOR ANY DIRECT, 20dnl INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21dnl (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22dnl SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23dnl HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 24dnl STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 25dnl IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26dnl POSSIBILITY OF SUCH DAMAGE. 27XX_SH(Keymaps) 28XX_PP 29The type of keyboard may be specified with the XX_FB(XX_DASHED(keymap)) 30switch or using either the XX_SM(KEYMAP) or XX_SM(KEYBD) environment variables. 31The types of supported keyboards `include' 32XX_FB(sun_k3), 33XX_FB(sun_k4), 34XX_FB(sun_k5), 35XX_FB(`hp'XX_DASH()k1), 36XX_FB(`hp'XX_DASH()pc) 37and 38XX_FB(ncd). 39XX_PP 40The keymap may also be specified as a comma-separated list of names. 41Later definitions override earlier ones. 42This is used to specify both a primary keyboard type and a set of modifiers. 43The modifiers defined `include': 44XX_TPS()dnl 45XX_TP(XX_FB(ow)) 46(OpenWindows) Swaps the middle and right mouse button definitions, so the 47middle button performs the "Extend" function and the right-hand button 48performs the "Paste" function. 49Also changes the cut and `paste' actions to use the OpenWindows XX_SM(CLIPBOARD). 50XX_TP(XX_FB(apl)) 51Allows entry of XX_SM(APL) characters (see XX_LINK(#APL-Support,XX_SM(APL SUPPORT)) 52below). 53XX_TP(XX_FB(finnish7)) 54Replaces the bracket, brace and bar keys with common Finnish characters. 55XX_TP(XX_FB(norwegian7)) 56Replaces the bracket, brace and bar keys with common Norwegian characters. 57XX_TPE()dnl 58XX_PP 59A temporary keymap can also be specified while XX_FB(x3270) 60is running with the XX_FB(Keymap) action. 61When the action XX_FB(Keymap)(XX_FI(n)) is executed, temporary keymap 62XX_FI(n) 63is added to or deleted from the current keymap. 64Multiple temporary keymaps can be active simultaneously. 65The action XX_FB(Keymap(None)) restores the original keymap. 66XX_FB(Note:) 67When Keymap() is specified as part of a list of multiple actions in a keymap, 68it must be the last action in the list. 69XX_PP 70The temporary keymap XX_FB(hebrew) 71is provided to allow entry of Hebrew characters. 72XX_PP 73The X Toolkit translation mechanism is used to provide keyboard emulation. 74It maps XX_FB(events) into XX_FB(actions.) 75The best documentation can be found with X toolkit documents, but the 76following should suffice for simple customization. 77XX_PP 78An Xt event consists of (at least) four fields. The first is called a 79XX_FB(modifier). 80It may be any combination of XX_FB(Meta), XX_FB(Shift) and XX_FB(Ctrl). If it 81is prefaced by XX_FB(!), 82it means those modifiers only. The second field is the specific event, 83in XX_FB(x3270) 84usually just XX_KEY. 85The third field is the detail field, which gives the actual key. 86The name of the key may be determined using the XX_FI(xev) 87program or with the "Trace X Events" menu option. 88The last field is the action, which is the internal emulator function. 89A complete list of actions may be found later in the manual. 90XX_PP 91There are three levels of translation tables in XX_FB(x3270). 92The first is a defined by the resource 93XX_FB(x3270.keymap.base). 94It defines alphabetic, numeric, 95function keys, and such basic functions as Enter and Delete. 96It allows a minimal useful functionality. 97It is generally compiled in XX_FB(x3270), but can be overridden. 98XX_PP 99The second level is a keyboard specific table, which is selected by the 100XX_FB(x3270.keymap) resource, and defined by the 101XX_FB(x3270.keymap.)`'XX_FI(name) resource (where XX_FI(name) is the value 102of the XX_FB(x3270.keymap) resource). 103This keymap defines actions for such things as keypad 104keys, and keys unique to certain keyboards. 105Several predefined keymaps are included with XX_FB(x3270). 106XX_PP 107The third level is a user customizable table which may be used to augment or 108override key definitions. 109This keymap is defined by the XX_FB(x3270.keymap.)`'XX_FI(name)`'XX_FB(.user) 110resource. 111XX_PP 112In addition, keymaps may be defined for use in 3270 mode or XX_SM(NVT) mode 113only. 114These keymaps use the suffixes XX_FB(.3270) and XX_FB(.nvt) in their names, 115respectively. 116If a keymap XX_FB(x3270.keymap.)`'XX_FI(name)`.'XX_FI(mode) is defined, it 117will augment the keymap XX_FB(x3270.keymap.)`'XX_FI(name) when XX_FB(x3270) 118is in the given XX_FI(mode). 119If a keymap XX_FB(x3270.keymap.)`'XX_FI(name)`.'XX_FB(user)`.'XX_FI(mode) is 120defined, it will augment the 121keymap XX_FB(x3270.keymap)`.'XX_FI(name)`.'XX_FB(user) when 122XX_FB(x3270) 123is in the given XX_FI(mode). 124XX_PP 125XX_TARGET(default-keymap)dnl 126The default translation table XX_FB(x3270.keymap.base) is: 127XX_TS(2,l l .) 128XX_TR(XX_TD(XX_KEY(,Multi_key)) XX_TD(Compose())) 129XX_TR(XX_TD(XX_KEY(Shift,Left)) XX_TD(KybdSelect(Left,PRIMARY))) 130XX_TR(XX_TD(XX_KEY(,Left)) XX_TD(Left())) 131XX_TR(XX_TD(XX_KEY(Meta,Right)) XX_TD(NextWord())) 132XX_TR(XX_TD(XX_KEY(Shift,Right)) XX_TD(KybdSelect(Right,PRIMARY))) 133XX_TR(XX_TD(XX_KEY(,Right)) XX_TD(Right())) 134XX_TR(XX_TD(XX_KEY(Shift,Up)) XX_TD(KybdSelect(Up,PRIMARY))) 135XX_TR(XX_TD(XX_KEY(,Up)) XX_TD(Up())) 136XX_TR(XX_TD(XX_KEY(Shift,Down)) XX_TD(KybdSelect(Down,PRIMARY))) 137XX_TR(XX_TD(XX_KEY(,Down)) XX_TD(Down())) 138XX_TR(XX_TD(XX_BTN(Ctrl,1Down)) XX_TD(HandleMenu(quitMenu))) 139XX_TR(XX_TD(XX_BTN(Ctrl,2Down)) XX_TD(HandleMenu(optionsMenu))) 140XX_TR(XX_TD(XX_BTN(Ctrl,3Down)) XX_TD(HandleMenu(hostMenu))) 141XX_TR(XX_TD(XX_BTN(Shift,1Down)) XX_TD(MoveCursor())) 142XX_TR(XX_TD(XX_BTN(,1Down)) XX_TD(`select'XX_DASH()start())) 143XX_TR(XX_TD(XX_BTN(,1Motion)) XX_TD(`select'XX_DASH()extend())) 144XX_TR(XX_TD(XX_BTN(,2Down)) XX_TD(ignore())) 145XX_TR(XX_TD(XX_BTN(,2Motion)) XX_TD(ignore())) 146XX_TR(XX_TD(XX_BTN(,2Up)) XX_TD(`insert'XX_DASH()selection(PRIMARY))) 147XX_TR(XX_TD(XX_BTN(,3Down)) XX_TD(`start'XX_DASH()extend())) 148XX_TR(XX_TD(XX_BTN(,3Motion)) XX_TD(`select'XX_DASH()extend())) 149XX_TR(XX_TD(XX_BTN(,Up)) XX_TD(`select'XX_DASH()end(PRIMARY))) 150XX_TR(XX_TD(XX_KEY(Meta,F1)) XX_TD(PF(13))) 151XX_TR(XX_TD(XX_KEY(Shift,F1)) XX_TD(PF(13))) 152XX_TR(XX_TD(XX_KEY(Meta,F2)) XX_TD(PF(14))) 153XX_TR(XX_TD(XX_KEY(Shift,F2)) XX_TD(PF(14))) 154XX_TR(XX_TD(XX_KEY(Meta,F3)) XX_TD(PF(15))) 155XX_TR(XX_TD(XX_KEY(Shift,F3)) XX_TD(PF(15))) 156XX_TR(XX_TD(XX_KEY(Meta,F4)) XX_TD(PF(16))) 157XX_TR(XX_TD(XX_KEY(Shift,F4)) XX_TD(PF(16))) 158XX_TR(XX_TD(XX_KEY(Meta,F5)) XX_TD(PF(17))) 159XX_TR(XX_TD(XX_KEY(Shift,F5)) XX_TD(PF(17))) 160XX_TR(XX_TD(XX_KEY(Meta,F6)) XX_TD(PF(18))) 161XX_TR(XX_TD(XX_KEY(Shift,F6)) XX_TD(PF(18))) 162XX_TR(XX_TD(XX_KEY(Meta,F7)) XX_TD(PF(19))) 163XX_TR(XX_TD(XX_KEY(Shift,F7)) XX_TD(PF(19))) 164XX_TR(XX_TD(XX_KEY(Meta,F8)) XX_TD(PF(20))) 165XX_TR(XX_TD(XX_KEY(Shift,F8)) XX_TD(PF(20))) 166XX_TR(XX_TD(XX_KEY(Meta,F9)) XX_TD(PF(21))) 167XX_TR(XX_TD(XX_KEY(Shift,F9)) XX_TD(PF(21))) 168XX_TR(XX_TD(XX_KEY(Meta,F10)) XX_TD(PF(22))) 169XX_TR(XX_TD(XX_KEY(Shift,F10)) XX_TD(PF(22))) 170XX_TR(XX_TD(XX_KEY(Meta,F11)) XX_TD(PF(23))) 171XX_TR(XX_TD(XX_KEY(Shift,F11)) XX_TD(PF(23))) 172XX_TR(XX_TD(XX_KEY(Meta,F12)) XX_TD(PF(24))) 173XX_TR(XX_TD(XX_KEY(Shift,F12)) XX_TD(PF(24))) 174XX_TR(XX_TD(XX_KEY(,F1)) XX_TD(PF(1))) 175XX_TR(XX_TD(XX_KEY(,F2)) XX_TD(PF(2))) 176XX_TR(XX_TD(XX_KEY(,F3)) XX_TD(PF(3))) 177XX_TR(XX_TD(XX_KEY(,F4)) XX_TD(PF(4))) 178XX_TR(XX_TD(XX_KEY(,F5)) XX_TD(PF(5))) 179XX_TR(XX_TD(XX_KEY(,F6)) XX_TD(PF(6))) 180XX_TR(XX_TD(XX_KEY(,F7)) XX_TD(PF(7))) 181XX_TR(XX_TD(XX_KEY(,F8)) XX_TD(PF(8))) 182XX_TR(XX_TD(XX_KEY(,F9)) XX_TD(PF(9))) 183XX_TR(XX_TD(XX_KEY(,F10)) XX_TD(PF(10))) 184XX_TR(XX_TD(XX_KEY(,F11)) XX_TD(PF(11))) 185XX_TR(XX_TD(XX_KEY(,F12)) XX_TD(PF(12))) 186XX_TR(XX_TD(XX_KEY(Alt,q)) XX_TD(Quit())) 187XX_TR(XX_TD(XX_KEY(,Prior)) XX_TD(`Scroll(backward)')) 188XX_TR(XX_TD(XX_KEY(,Next)) XX_TD(`Scroll(forward)')) 189XX_TR(XX_TD(:XX_KEY(,)) XX_TD(Default())) 190XX_TE() 191XX_PP 192The default 3270-mode table XX_FB(x3270.keymap.base.3270) adds the 193following definitions: 194XX_TS(2,l l .) 195XX_TR(XX_TD(XX_KEY(Shift,Return)) XX_TD(Newline())) 196XX_TR(XX_TD(XX_KEY(,Return)) XX_TD(Enter())) 197XX_TR(XX_TD(XX_KEY(,Linefeed)) XX_TD(Newline())) 198XX_TR(XX_TD(XX_KEY(Shift,Tab)) XX_TD(BackTab())) 199XX_TR(XX_TD(XX_KEY(,Tab)) XX_TD(Tab())) 200XX_TR(XX_TD(XX_KEY(,Home)) XX_TD(Home())) 201XX_TR(XX_TD(XX_KEY(Meta,Left)) XX_TD(PreviousWord())) 202XX_TR(XX_TD(XX_KEY(Meta,Right)) XX_TD(NextWord())) 203XX_TR(XX_TD(XX_KEY(,Insert)) XX_TD(Insert())) 204XX_TR(XX_TD(XX_KEY(,Delete)) XX_TD(Delete())) 205XX_TR(XX_TD(XX_KEY(,BackSpace)) XX_TD(BackSpace())) 206XX_TR(XX_TD(XX_BTN(Ctrl Shift,1Down)) XX_TD(MouseSelect())) 207XX_TR(XX_TD(XX_BTN(Shift,1Down)) XX_TD(MoveCursor())) 208XX_TR(XX_TD(XX_KEY(Meta,1)) XX_TD(PA(1))) 209XX_TR(XX_TD(XX_KEY(Meta,2)) XX_TD(PA(2))) 210XX_TR(XX_TD(XX_KEY(Meta,3)) XX_TD(PA(3))) 211XX_TR(XX_TD(XX_KEY(Ctrl,a)) XX_TD(SelectAll(PRIMARY))) 212XX_TR(XX_TD(XX_KEY(Meta,a)) XX_TD(Attn())) 213XX_TR(XX_TD(XX_KEY(Meta,b)) XX_TD(PrintWindow())) 214XX_TR(XX_TD(XX_KEY(Ctrl,c)) XX_TD(set-select(CLIPBOARD))) 215XX_TR(XX_TD(XX_KEY(Meta,c)) XX_TD(Clear())) 216XX_TR(XX_TD(XX_KEY(Meta,d)) XX_TD(Delete())) 217XX_TR(XX_TD(XX_KEY(Meta,e)) XX_TD(EraseEOF())) 218XX_TR(XX_TD(XX_KEY(Meta,f)) XX_TD(Flip())) 219XX_TR(XX_TD(XX_KEY(Meta,h)) XX_TD(Home())) 220XX_TR(XX_TD(XX_KEY(Meta,i)) XX_TD(Insert())) 221XX_TR(XX_TD(XX_KEY(Meta,l)) XX_TD(Redraw())) 222XX_TR(XX_TD(XX_KEY(Meta,p)) XX_TD(PrintText())) 223XX_TR(XX_TD(XX_KEY(Meta,r)) XX_TD(Reset())) 224XX_TR(XX_TD(XX_KEY(Meta,u)) XX_TD(Unselect())) 225XX_TR(XX_TD(XX_KEY(Ctrl,u)) XX_TD(DeleteField())) 226XX_TR(XX_TD(XX_KEY(Ctrl,v)) XX_TD(insert-selection(CLIPBOARD))) 227XX_TR(XX_TD(XX_KEY(Meta,v)) XX_TD(ToggleReverse())) 228XX_TR(XX_TD(XX_KEY(Ctrl,w)) XX_TD(DeleteWord())) 229XX_TR(XX_TD(XX_KEY(Ctrl,x)) XX_TD(Cut(CLIPBOARD))) 230XX_TE() 231XX_PP 232Meta is the diamond shaped key on a sun_k4, "Alt" on an XX_SM(NCD), 233"Extend Char" on an XX_SM(HP). 234The following 235XX_FI(xmodmap) 236command must be used on the XX_SM(NCD) to allow use the the "Alt" 237key: 238XX_PP 239XX_RS(xmodmap XX_DASHED(e) "keysym Alt_L = Meta_L") 240XX_PP 241The left mouse button may be used to make a selection. 242Clicking once unselects the current selection. 243Clicking twice selects the word under the mouse cursor. 244Clicking three times selects the line under the mouse cursor. 245Clicking and dragging selects a rectangular area of the display. 246XX_PP 247The middle mouse button may be used to `paste' a selection. 248XX_PP 249The right mouse button may also be used for selections, selecting the 250rectangular area between the current position and where the left button was 251last pressed. 252XX_PP 253XX_PP 254On color X displays, the "x3270.selectBackground" resource is used to 255distinguish the selected text from the rest of the screen. 256On monochrome X displays, selected text is in reverse video. 257(It can be distinguished from a block cursor because the block cursor covers 258slightly less than an entire character position on the screen.) 259XX_PP 260The left mouse button, when pressed with the "Shift" key held down, moves the 2613270 cursor to the where the mouse cursor is pointing. 262XX_PP 263This is the complete list of keymap-callable actions. 264Other actions are defined for use by scripts and are documented in 265XX_FI(x3270-script)(1); 266still others are defined for internal use by XX_FB(x3270) 267and are not documented here. 268Note that when an action with no parameters is used in a keymap, the 269parentheses and empty argument list are still required. 270