From d7ba430537552f5bbdb81c532ba2ac54b2eaf52d Mon Sep 17 00:00:00 2001 From: moshix Date: Mon, 3 Jan 2022 03:29:00 -0600 Subject: [PATCH] Update c3270pro --- c3270pro | 168 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 156 insertions(+), 12 deletions(-) diff --git a/c3270pro b/c3270pro index d795d6a..1b16e40 100644 --- a/c3270pro +++ b/c3270pro @@ -1,12 +1,156 @@ -c3270.keymap.foo: \ - Escape : Clear() \n\ - ` : PA(1)\n\ - Ctrli : ToggleInsert()\n\ - Shift2 : PA(2)\n\ - Prior : PF(7)\n\ - Next : PF(8)\n\ - Ctrlq : PrintText()\n\ - Ctrlw : NextWord()\n\ - Return : Newline()\n\ - Mode_switch : Enter()\n\ - Ctrlx: Disconnect() +! vim: ts=8 noexpandtab + +! Keymap definitions for c3270 +! +! Date: Jan 3, 2021 (revised and documented) +! Original Author: ahd@kew.com (Drew Derbyshire) +! Address: Kendra Electronic Wonderworks +! Kenmore, WA +! Adapted and updated by moshix +! Now Enter is just a Newline, (as it should be) and Contrl-Z is Enter +! +! The generic map provides keys for functions like client-side +! editing and program control. The map overrides the compiled in base +! keymap in the following cases: +! +! * NPAGE (scroll client forward) and PPAGE (scroll client previous) +! are more useful to tell the host the standard PF keys for forward +! and back. +! * Ctrl-D (FieldMark) Dup and Ctrl-F (FieldMark) are two functions +! I never used during 16 years of daily 3270 work. The keys are +! better suited for Disconnect and NextWord +! +! Alt U+00D is Alt-ENTER, but c3270 doesn't let us call it that. +! U+007F is the ANSI DELETE character, not to be confused with the DELETE +! key (under INSERT/Help) + +c3270.keymap.generic: \ + BTAB: BackTab()\n\ + U+007F: Erase\n\ + AltU+000D: Newline()\n\ + Alta: Attn()\n\ + Altc: Clear()\n\ + Ctrlz: Enter()\n\ + Alte: EraseEOF()\n\ + Altq: Enter()\n\ + Return: Newline()\n\ + Altw: Enter() + +! The full Mac keyboard has "Help" where the PC key board has "Insert", and +! we use it as the latter. Set all Help key variations to toggle Insert on and +! off, as opposed to the real hardware which turns Insert ON with the key but +! turns it OFF via the RESET key. +! +! Alt is AltHelp, but c3270 doesn't let us call it that. +! +! Note: The bare Help key is eaten on by MacOS, hence the modified versions. +! +! +! Due to search order, shifted keys must be first! + +c3270.keymap.insert: \ + AltF: ToggleInsert()\n\ + Help: ToggleInsert()\n\ + CtrlA i: ToggleInsert()\n\ + Alti: ToggleInsert() + +! Make page up/down the standard PF keys for up (PF7) & down (PF8) + +c3270.keymap.scroll: \ + PPAGE: PF(7)\n\ + NPAGE: PF(8) + +! +! PA keys are important on IBM VM hosts, so we provide several mappings +! below to avoid making the user hit a chord every time they want a +! common function. (This is a reason in and of itself to use x3270, +! which doesn't have the problem nearly as much.) +! + +! The names of keys as defined by curses to the right of F12. + +c3270.keymap.curses-PAK: \ + F13: PA(1)\n\ + F14: PA(2)\n\ + F15: Enter()\n\ + +c3270.keymap.xterm-PFK: \ + Alt[ 1 1 ~: PF(1)\n\ + Alt[ 1 2 ~: PF(2)\n\ + Alt[ 1 3 ~: PF(3)\n\ + Alt[ 1 4 ~: PF(4) + +! The strings sent by Macs for keys to the right of F12. +! +! xterm-color256 F13-F15 on MacOS Catalina doesn't match the +! curses definition. + +c3270.keymap.xterm-256color-PAK: \ + Alt[ 2 5 ~: PA(1)\n\ + Alt[ 2 6 ~: PA(2)\n\ + Alt[ 2 8 ~: PA(3) + +! The strings sent by VT-100 terminals for keys to the right of F12. + +c3270.keymap.vt100-PAK: \ + U+00b1: PA(1)\n\ + U+00b2: PA(2)\n\ + U+00b3: PA(3) + +! c3270 doesn't know the names of most of the keypad keys, so we can +! only define ENTER by name, the rest by sequence. On the keypad: +! +! PF13-PF24 are (in order) 789 456 123 0 . (period) ENTER +! PA1 is - (minus) and PA2 is + (plus sign) +! +! Note if the emulator (i.e. Putty) enables the VT-100 PF keys, +! the top row including - (minus) returns PF1-PF4, not as documented +! above. + +c3270.keymap.pc-keypad: \ + AltO w: PF(13)\n\ + AltO x: PF(14)\n\ + AltO y: PF(15)\n\ + AltO t: PF(16)\n\ + AltO u: PF(17)\n\ + AltO v: PF(18)\n\ + AltO q: PF(19)\n\ + AltO r: PF(20)\n\ + AltO s: PF(21)\n\ + AltO p: PF(22)\n\ + AltO n: PF(23)\n\ + ENTER: PF(24)\n\ + AltO m: PA(1)\n\ + AltO l: PA(2)\n\ + +! The NetBSD 7.2 console with wscons claims to be a VT-100 but sends +! keys for a VT-220. This keymap is DISABLED. A better solution +! than enabling this keymap is to set TERM=wsvt25 when running c3270 +! on the NetBSD console. + +c3270.keymap.netbsd.console: \ + Alt[ 1 1 ~: PF(1)\n\ + Alt[ 1 2 ~: PF(2)\n\ + Alt[ 1 3 ~: PF(3)\n\ + Alt[ 1 4 ~: PF(4)\n\ + Alt[ 1 5 ~: PF(5)\n\ + Alt[ 1 7 ~: PF(6)\n\ + Alt[ 1 8 ~: PF(7)\n\ + Alt[ 1 9 ~: PF(8)\n\ + Alt[ 2 0 ~: PF(9)\n\ + Alt[ 2 1 ~: PF(10)\n\ + Alt[ 2 3 ~: PF(11)\n\ + Alt[ 2 4 ~: PF(12) + +! Use the keymaps defined above. +c3270.keymap: generic,insert,pc-keypad,vt100-PAK,xterm-256color-PAK,xterm-PFK,curses-PAK,scroll + +c3270.cursesColorForDefault: green +c3270.cursesColorForIntensified: magenta +c3270.cursesColorForProtected: cyan +c3270.cursesColorForProtectedIntensified: white + +! Use ugly but always available ASCII characters for pop up keymap +c3270.asciiBoxDraw: true + +c3270.ftHost: vm