× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Thank you for the input on this item.  This remapping works great, and I am
now loading the mappings via init.d.  I don't think this will cause any
problem with other apps because the only shell thing the user can run is
tn5250.

-----Original Message-----
From: Scott Klement [mailto:klemscot@klements.com]
Sent: Thursday, August 01, 2002 10:50 AM
To: 'LINUX5250@midrange.com'
Subject: Re: [LINUX5250] Remapping of keys


 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 cha=
nge
> 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=3D5250
        /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 =3D Escape           Escape
+keycode   1 =3D Control_a        Escape
 keycode   2 =3D one              exclam
 keycode   3 =3D two              at               at               nul    =
          nul
 keycode   4 =3D three            numbersign
@@ -17,7 +17,7 @@
 keycode  12 =3D minus            underscore       backslash        Control=
_underscore Control_underscore
 keycode  13 =3D equal            plus
 keycode  14 =3D Delete           Delete
-keycode  15 =3D Tab              Meta_Tab
+keycode  15 =3D Tab              F25
 keycode  16 =3D q
 keycode  17 =3D w
 keycode  18 =3D e
@@ -33,7 +33,7 @@
 keycode  27 =3D bracketright     braceright       asciitilde       Control=
_bracketright
 keycode  28 =3D Return
        alt     keycode  28 =3D Meta_Control_m
-keycode  29 =3D Control
+keycode  29 =3D Control_r
 keycode  30 =3D a
 keycode  31 =3D s
 keycode  32 =3D d
@@ -99,7 +99,7 @@
        alt     keycode  68 =3D Console_10
        control alt     keycode  68 =3D Console_10
 keycode  69 =3D Num_Lock
-keycode  70 =3D Scroll_Lock      Show_Memory      Show_Registers   Show_St=
ate
+keycode  70 =3D Help      Scroll_Lock      Show_Registers   Show_State
        alt     keycode  70 =3D Scroll_Lock
 keycode  71 =3D KP_7
        alt     keycode  71 =3D Ascii_7
@@ -114,7 +114,7 @@
        alt     keycode  76 =3D Ascii_5
 keycode  77 =3D KP_6
        alt     keycode  77 =3D Ascii_6
-keycode  78 =3D KP_Add
+keycode  78 =3D Pause     KP_Add
 keycode  79 =3D KP_1
        alt     keycode  79 =3D Ascii_1
 keycode  80 =3D KP_2
@@ -138,7 +138,7 @@
 keycode  89 =3D
 keycode  90 =3D
 keycode  91 =3D
-keycode  92 =3D
+keycode  92 =3D Control_p  Control_c  Control_c  Control_c
 keycode  93 =3D
 keycode  94 =3D
 keycode  95 =3D
@@ -205,6 +205,7 @@
 string F22 =3D "\033[36~"
 string F23 =3D "\033[37~"
 string F24 =3D "\033[38~"
+string F25 =3D "\033[Z"
 string Find =3D "\033[1~"
 string Insert =3D "\033[2~"
 string Remove =3D "\033[3~"
@@ -212,7 +213,8 @@
 string Prior =3D "\033[5~"
 string Next =3D "\033[6~"
 string Macro =3D "\033[M"
-string Pause =3D "\033[P"
+string Pause =3D "\030"
+string Help =3D "\033H"
 compose '`' 'A' to '=C0'
 compose '`' 'a' to '=E0'
 compose '\'' 'A' to '=C1'

_______________________________________________
This is the Linux 5250 Development Project (LINUX5250) mailing list
To post a message email: LINUX5250@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/linux5250
or email: LINUX5250-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/linux5250.


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.