home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / admin / 4313 < prev    next >
Encoding:
Internet Message Format  |  1992-07-25  |  8.7 KB

  1. Xref: sparky comp.unix.admin:4313 comp.unix.questions:9395
  2. Path: sparky!uunet!dtix!darwin.sura.net!tulane!hernande
  3. From: hernande@cs.tulane.edu (Oliver Hernandez)
  4. Newsgroups: comp.unix.admin,comp.unix.questions
  5. Subject: keymapping
  6. Message-ID: <9207242001.AA24035@sksun0.ews.dseg.ti.com>
  7. Date: 24 Jul 92 20:01:08 GMT
  8. Sender: news@cs.tulane.edu
  9. Organization: Computer Science Dept., Tulane Univ., New Orleans, LA
  10. Lines: 156
  11. Status: OR
  12. To: hernande@rex.cs.tulane.edu
  13. Nntp-Posting-Host-[nntpd-8061]: okeanos
  14.  
  15.  
  16.     About two weeks ago, I saw some postings asking about keymapping.  The
  17. person asking got many responses e-mailed to him, and later posted to the net
  18. to e-mail him for the responses he received about keymapping.  I mailed him,
  19. but haven't gotten a response from him yet.  I include the message that I
  20. sent him asking him about my keymapping problem hoping that someone here
  21. could answer my question.  I am a student at Tulane working for TI this sum-
  22. mer and I'm using the newsgroup service on the systems at Tulane because I
  23. don't have access to the newsgroup services here.  So my inquiry is serious.
  24. I would greatly appreciate any help and I thank you in advance.  Please send
  25. e-mail to hernande@lobby.ti.com.\
  26. [appended file]
  27.  
  28.      I see that you've gotten some responses as to how to map a keypad
  29. to an EDT keypad.  I had to work on the same problem here at TI in
  30. Lewisville, TX, and the following was my solution.  There are 2 problems
  31. with it, though, that makes it less that ideal for our users.  One, I
  32. had to map the numlock key as a shift key in order to give the keys on
  33. the keypad a second function, since the requirements were to be able to
  34. use the arrows keys as well as EDT functions on a Sun type4 keyboard.  (
  35. I see that you were mapping the keypad on an RS6000, right?  Well I'm
  36. hoping that you got a response that has a solution for Sun keyboards.)
  37. So this obviously was not accepted well as users had to constanly turn
  38. numlock on and off so that they wouldn't get letters in all caps while
  39. typing.  My second problem was that one could not get any menus with the
  40. mouse while the numlock key was on.  But if the numlock key was off and
  41. one holds down a shift key, the menus work fine.  *Very Strange*.  There
  42. probably isn't a solution to my second bug, and I'm sure it's due to my
  43. solution to mapping the keypad.  So David, if you know of any way to
  44. give keys a second function while numlock is on (not shiftlock) from the
  45. solutions to keymapping that were e-mailed to you, I would greatly
  46. appreciate any help that you can give me.  The following is a summary
  47. of my solution, and if you could, modify the example keymap file in it
  48. to show me what to do.  Use the Internet address hernande@lobby.ti.com,
  49. not the address you see at the head of this message because mail sent to
  50. the return address will bounce back.  Thank you in advance for your time
  51. and help.
  52. **
  53.  Oliver Hernandez                       |  Voice: (214) 462-4099
  54.  Texas Instruments, Inc.                |  FAX: (214) 462-3375
  55.  DSEG Computer Services, Denton County  |  Pager: (817) 432-7237
  56.  Workstation Engineer                   |  Internet: hernande@lobby.ti.com
  57.  
  58.  
  59. MSG #_ 02351028 Pg 01 05           MSG - EDIT             07/07/92 12:22 AUMIMA
  60.  
  61.    To: DCS Eng. WKST  Support     *ENGW     DCS Eng. VAX Support       *ENGV
  62.  
  63.  Cc: Anil Keswani      ANK        Margie Delaughter     MDEL
  64.  
  65.  From: Oliver Hernandez           OCH
  66.  
  67.  Subj: Unix to VAX/EDT keymapping
  68.  
  69.  FYI.
  70.  
  71.  I have worked on this problem and found how to map the keypad on a Sun type
  72.  keyboard to a VT* type keyboard when connected to a VAX from a workstation.
  73.  The following is my documented solution:
  74.  
  75.  
  76.  MAPPING SUN KEYBOARDS TO VAX/VT* KEYBOARDS
  77.  ------------------------------------------
  78.  
  79.       The tools needed to accomplish this compatibility between the two types
  80.  of keyboards are the "xmodmap" and "xterm" utilities in the Unix/X-Windows
  81.  system.  The xmodmap utility modifies the keys on the Sun keyboard, allowing
  82.  them to execute different functions.  The xterm utility is the terminal emu-
  83.  lator for the X-Windowing system, used for connecting to remote machines via
  84.  a pop-up window.  Both work together to make the Sun keymapping possible.
  85.       To map the keypad on a Sun keyboard to function as a VT* style keypad,
  86.  a file has to be created with the new keypad assignments.  The file must
  87.  follow the syntax that xmodmap requires for reading and executing.  See the
  88.  man pages for more details on the syntax used by xmodmap.  The following is
  89.  the file that I created for xmodmap:
  90.  
  91.              keycode 52 = KP_F1
  92.              keycode 53 = KP_F2
  93.              keycode 54 = KP_F3
  94.              keycode 17 = KP_F4
  95.              keycode 77 = F29 KP_9
  96.              keycode 76 = Up KP_8
  97.              keycode 75 = F27 KP_7
  98.              keycode 100 = Right KP_6
  99.              keycode 99 = F31 KP_5
  100.              keycode 98 = Left KP_4
  101.              keycode 121 = F35 KP_3
  102.              keycode 120 = Down KP_2
  103.              keycode 119 = R13 KP_1
  104.              keycode 101 = KP_0
  105.              keycode 78 = KP_Subtract
  106.              keycode 132 = KP_Add KP_Separator
  107.              keycode 57 = Delete KP_Decimal
  108.              add shift = Num_Lock
  109.  
  110.  This file can be given any arbitrary name, but it is usually named
  111.  ".xmodmaprc" by convention.  The keymapping consists of assigning "keycodes"
  112.  to certain functions called "keysyms."  The keycodes refer to the actual
  113.  physical key on the keyboard.  The keys on every keyboard generate a certain
  114.  keycode by which they are identified.  The function, or keysym, that is
  115.  assigned to a key is looked up in a keymap table, and xmodmap is used to
  116.  change the key assignments in this table.  Run the "xev" event tester in the
  117.  X-Windowing system to find the keycodes generated by the keyboard, and run
  118.  xmodmap with the -pk option to print the default keymap table that has all
  119.  of the keysyms.  Refer to the man pages for more on xev.
  120.       To put the new keymappings into effect, type the following at the
  121.  command line prompt:
  122.             %  xmodmap <filename> <ENTER>
  123.  
  124.  To pop-up the xterm terminal emulator, type the following at the command
  125.  line prompt:
  126.             %  xterm +sf -tn vt100 & <ENTER>
  127.  
  128.  A window should appear with the xterm title on it.  In the window is a
  129.  command shell, from which a remote login can be initiated.  The +sf option
  130.  allows the function keys to act as standard function keys instead of Sun
  131.  function keys.  The -tn option specifies the terminal type, which in this
  132.  case is vt100.  There is also an option to automatically run a command that
  133.  starts a remote login in the xterm window.  See the man pages for more info
  134.  on all of the xterm options.
  135.       The keymap file above allows the Sun keypad to toggle between VT* mode
  136.  and standard Sun functions and arrow keys.  Turning Numlock on switches the
  137.  keypad to VT* mode, and turning Numlock off switches to standard mode.  In
  138.  VT* mode, keys R4-6 function as the PF1-3 keys.  The F4 key functions as the
  139.  PF4 key.  The keypad "plus" key functions as the keypad comma.  The remain-
  140.  ing keys on the keypad correspond to the VT* keypad, allowing the use of
  141.  "hotkey" commands such as in the EDT editor.  When Numlock is off, the use
  142.  of the arrow keys is enabled, allowing cursor movement when editing files.
  143.       The Sun keyboard compatibility with VT* type keyboards will only work
  144.  in the xterm terminal emulator.  The new keymappings will not be recognized
  145.  by the remote host if logged on through any other window.
  146.  
  147.  BUGS:
  148.  
  149.       The bugs that are known in this keymapping solution are due to the
  150.  way that it is implemented.  The numlock key on the Sun keyboard is
  151.  actually mapped as a shift-lock key.  So while numlock is on when VAX/
  152.  EDT functions are being used, all the other character keys are in caps.
  153.  In order for the Sun keypad to have the dual function of an EDT keypad
  154.  and arrow keys, the keys had to be modified in a way that they would
  155.  function differently when numlock is on.  In reading all of the docu-
  156.  mentation on xmodmap that I found, I have not learned how to modify the
  157.  function of a key while the numlock key is enabled.  The only example
  158.  of such a modification that I found is mapping a second function to a
  159.  key when it is shifted.  From that example, I was able to map second
  160.  functions to the keys on the Sun keypad by mapping the numlock key as a
  161.  shift key.  The other bug with this solution has to do with the menuing
  162.  system under the OpenWindows window manager.  For some reason unknown,
  163.  while numlock is on, the ability to get pop-up menus with the mouse is
  164.  lost.  I have tried getting the menus with numlock off and holding down
  165.  a shift key, and that works fine, so the problem has to do with the
  166.  mapping of numlock as a shift key.
  167.  
  168.       For all other details and specifics, please refer to the man pages.  If
  169.  there are any other questions, comments, or suggestions, feel free to con-
  170.  tact me at x4099, via MSGid OCH, or in person.  Thank you.
  171.