|
On Thu, 21 Feb 2002, Henk de Swardt wrote: > > Please help. > > I am very new to Linux and tn5250! I must set-up the tn5250 > terminal to access our MRP system, running on a AS400. > > I connect without any problem, but I have difficulty with > the keyboard re-mapping. > > The keyboard re-mapping will apply to all users. > > 1. Can I merely change the Xterm file in the > /usr/local/share/tn5250/ directory to reflect the changes > in the keyboard mapping, in stead of creating a file for > each user? If you are running the xt5250 script, then yes, changing the XTerm file will affect keyboard mapping. Yes, the changes affect everyone. If you are running tn5250 directly (such as in console mode) then the Xterm file has no affect on keyboard mapping. > > 2. I tried to re-map the enter and plus keys on the keypad > (KP_Enter and KP_Add), but it does not seem to be working > properly. I used /033X in both instances, to make it > “field plus”. The plus key sometimes still place a “+” > when it is pressed??? It doesn't sound like you're mapping is working. In a numeric field, we make the "+" character act like a field plus, but in a non-numeric field it would show up as a normal "+" symbol. If you want it to always behave as field plus, you need to map it to the Field Plus keycode. Again, keep in mind that the XTerm file does _nothing_ if you're not running the xt5250 version of the emulator. In the xt5250 version, KP_Add is mapped to field+ by default. (assuming of course that you're running a recent release of tn5250.) Field Plus is "\030" (Ctrl-X) not "\033X" (ESC-X) Keep in mind that "\" is different from "/". In C and in Unix/Linux the "\" character is an "escaping character". It starts special codes, such as control characters. the "/" is not an escaping character, and would simply be sent to the terminal as-is if you put it in a string. > > 3. What are the octal codes for “reset” and “New Line”? Here's how you find out: 1) type "man tn5250". If you look down far enough it tells you that Reset is "C-r" (which is an abbreviation for Control-R. That means you must hold down the Control key and press R) 2) What you want to do is have your terminal send a C-r whenever you press a certain key. Most commonly, this is the left control key. 3) Looking at my handy-dandy ASCII chart, I see that C-r is ASCII code 18 in decimal. Since I need to know what that is in octal, I divide it by 8, and I get 2 with a remainder of 2. This means that the octal code for C-r is 022. (The leading zero tells the computer that it's in octal) 4) So now, since I want the Left Control key to send Reset, I add a line like this to my XTerm file: <Key>Control_L: string("\022") \n\ (This is already done for you by default in the current version of tn5250, though) The man page says that the code for Newline is C-M-j. That's a little weirder. It means "Control-Meta-j" In our man pages, because it's familiar to most Unix people, we use the term "Meta" instead of "Escape". So, what you really want to send for Newline is Esc followed by Control-j. Again, I whip out my handy-dandy ASCII chart, and I find out that the Esc key is decimal 27, and that Control-j is decimal 10. 27 divded by 8 is 3 with a remainder of 3, so Esc is octal 033. 10 divided by 8 is 1 with a remainder of 2, so C-j is octal 012. Now I have to decide which key I want to map to newline. Let's say I decided to map the Return key to newline, I'd do this: <Key>Return: string("\033\012") \n\ > > > PLEASE write replies in idiot-language. > What makes you think I speak that language? :) > Thank you. > > Henk de Swardt > South Africa One more thing -- being new to Linux, please keep in mind that almost everything is case sensitive. That means that "Return" and "RETURN" and "REturn" are 3 different words that cannot be used interchangably. If you're having trouble, one of the first things you'll want to do is make sure that you're using the correct capitalization. Hope some of this helps. If you need more help, please make sure you tell me (a) what version number of tn5250 you have. (You can do "tn5250 -version" to find out) (b) Whether you're using the "xt5250" script, or just "tn5250" or ?? (c) exactly which keys you are trying to map to which keycodes. (e.g. the "Left Control Key" to the "Reset" keycode) Good luck!
As an Amazon Associate we earn from qualifying purchases.
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.