On Thu, 1 Aug 2002, Adam Gouge wrote:
> I am using RedHat 6.0 with a minimal install for use only as terminals to
> our AS400. I have installed TN5250 and it works great, but I need to change
> a few key mappings. Before they will allow this Linux installation to be
> implemented, I have to make the key mappings as close to Client Access
> defaults as possible. Specifically the RESET and ATTENTION key sequences.
> Currently these are set to the defaults, c-r and c-a respectively. I need
> to change the resent sequence to be just the ESC key and the ATTENTION
> sequence to be just the left CTRL key. Can someone point me in the right
> direction here? What keymap files need to be edited? Do I have to edit the
> source and recompile? Is there a HOWTO document that may help with this?
> Thanks in advance for the help.
>
Hi,
I think you got that backwards... you want ESC to be attention, and the
left-control key to be RESET. (Either that, or your version of Client
Access has very strange defaults! :) )
I'm doing this on some RedHat 6.2 boxes, and this is what I did....
fair warning: changing the keyboard mapping in this way doesn't only
change TN5250 sessions, but all console sessions will use the new
key mappings. (example: if you've mapped ESC to send Ctrl-A, it will
send Ctrl-A in all console sessions)
Here's what I did:
1) Make a copy of the default map, so that upgrades to tn5250 don't
wipe out your changes:
cd /usr/local/share/tn5250
cp us5250.map custom.map
2) Create a shell script to be run instead of the tn5250 binary, which
will load the keyboard map & term type automatically. On my system
I called it /usr/local/bin/tn5250-auto. Here's a sample:
#!/bin/sh
export TERM=5250
/bin/loadkeys /usr/local/share/tn5250/custom.map
echo -n "Type host to connect to: "
read CONNTO
/usr/local/bin/tn5250 ${CONNTO}
(Unfortunately, loadkeys requires root authority... so, you might
alternatively have loadkeys run at system startup, and omit it
from the script above...)
3) Make your keyboard mapping changes to the custom.map file. In mine,
I made ESC send Ctrl-A to the console, and Shift-ESC is still
escape so that the system is still usable for Linux. I mapped
the left control key to RESET, but left the right control key
alone. Also made mappings for back-tab, SysRq, set scroll lock to
help, and some other things. The following patch shows how I
did this:
--- us5250.map Thu Aug 1 10:39:49 2002
+++ custom.map Thu Aug 1 10:39:58 2002
@@ -1,6 +1,6 @@
keymaps 0-2,4-6,8-9,12
alt_is_meta
-keycode 1 = Escape Escape
+keycode 1 = Control_a Escape
keycode 2 = one exclam
keycode 3 = two at at nul nul
keycode 4 = three numbersign
@@ -17,7 +17,7 @@
keycode 12 = minus underscore backslash Control_underscore
Control_underscore
keycode 13 = equal plus
keycode 14 = Delete Delete
-keycode 15 = Tab Meta_Tab
+keycode 15 = Tab F25
keycode 16 = q
keycode 17 = w
keycode 18 = e
@@ -33,7 +33,7 @@
keycode 27 = bracketright braceright asciitilde Control_bracketright
keycode 28 = Return
alt keycode 28 = Meta_Control_m
-keycode 29 = Control
+keycode 29 = Control_r
keycode 30 = a
keycode 31 = s
keycode 32 = d
@@ -99,7 +99,7 @@
alt keycode 68 = Console_10
control alt keycode 68 = Console_10
keycode 69 = Num_Lock
-keycode 70 = Scroll_Lock Show_Memory Show_Registers Show_State
+keycode 70 = Help Scroll_Lock Show_Registers Show_State
alt keycode 70 = Scroll_Lock
keycode 71 = KP_7
alt keycode 71 = Ascii_7
@@ -114,7 +114,7 @@
alt keycode 76 = Ascii_5
keycode 77 = KP_6
alt keycode 77 = Ascii_6
-keycode 78 = KP_Add
+keycode 78 = Pause KP_Add
keycode 79 = KP_1
alt keycode 79 = Ascii_1
keycode 80 = KP_2
@@ -138,7 +138,7 @@
keycode 89 =
keycode 90 =
keycode 91 =
-keycode 92 =
+keycode 92 = Control_p Control_c Control_c Control_c
keycode 93 =
keycode 94 =
keycode 95 =
@@ -205,6 +205,7 @@
string F22 = "\033[36~"
string F23 = "\033[37~"
string F24 = "\033[38~"
+string F25 = "\033[Z"
string Find = "\033[1~"
string Insert = "\033[2~"
string Remove = "\033[3~"
@@ -212,7 +213,8 @@
string Prior = "\033[5~"
string Next = "\033[6~"
string Macro = "\033[M"
-string Pause = "\033[P"
+string Pause = "\030"
+string Help = "\033H"
compose '`' 'A' to '�'
compose '`' 'a' to '�'
compose '\'' 'A' to '�'
_______________________________________________
This is the Linux 5250 Development Project (LINUX5250) mailing list
To post a message email: [EMAIL PROTECTED]
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/linux5250
or email: [EMAIL PROTECTED]
Before posting, please take a moment to review the archives
at http://archive.midrange.com/linux5250.