Development item: NumLock

Thomas Chadwick j_tetazoo@hotmail.com
Wed Jun 19 16:43:00 GMT 2002


After doing some research on the web, I came up with a plausible workaround 
for the Numlock problem.  I've implemented it and it works great on my 
computer.  Probably don't want to make this a default, but perhaps could go 
into the FAQ.

The idea is that it removes the NumLock modifier from the keyboard map, and 
forces the Keypad keycodes to always be interpretted as numeric keystrokes.

Part 1. Add the following to your XWin startup file of choice 
(startxwin.bat, startxwin.sh, .xinitrc, etc. with appropriate 
modifications):

  xmodmap -e "clear mod2" ${HOME}/.Xmodmap

Part 2. Add the following entries to the file ${HOME}/.Xmodmap:

  keycode 79 = KP_7 KP_Home
  keycode 80 = KP_8 KP_Up
  keycode 81 = KP_9 KP_Prior
  keycode 83 = KP_4 KP_Left
  keycode 84 = KP_5 KP_Begin
  keycode 85 = KP_6 KP_Right
  keycode 87 = KP_1 KP_End
  keycode 88 = KP_2 KP_Down
  keycode 89 = KP_3 KP_Next
  keycode 90 = KP_0 KP_Insert
  keycode 91 = KP_Decimal KP_Delete

>From: "Harold Hunt" <huntharo@msu.edu>
>To: "cygx" <cygwin-xfree@cygwin.com>
>Subject: Development item: NumLock
>Date: Fri, 14 Jun 2002 09:25:24 -0400
>
>For anyone looking for something to do:
>
>Take a look at how we are messing up the handling of NumLock.  For a simple
>test case, install the lesstif package via Cygwin's setup.exe, run mwm.exe
>as your window manager, make sure NumLock is on, then try to move a MWM
>managed window.  The window won't budge.  Turn NumLock off and the window
>can move freely.
>
>It may be incorrect to treat NumLock as a 'modifier key', see
>xc/programs/Xserver/hw/xwin/winkeybd.c/winGetKeyMappings (), but not
>treating NumLock as a modifier key causes the NumLock key to have no effect
>on whether the numerical keypad gives you numbers (NumLock on behavior) or
>arrows (NumLock off behavior).  I think that both states of NumLock give 
>you
>arrows in that case.
>
>For clues you can take a look at other servers, such as XDarwin over in
>xc/programs/Xserver/hw/darwin/darwinKeyboard.c.  Notice that they use
>modifier masks LockMask (CapsLock), ShiftMask, ControlMask, AltMask,
>MetaMask and FunctionMask.  But they don't use NumLockMask.
>
>What gives?  Is NumLock a modifier key or not?  If not, why doesn't it do
>anything in Cygwin/XFree86 when we don't treat it as a modifier?
>
>Hopefully that provides enough food for thought.
>
>Good luck,
>
>Harold


_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx



More information about the Cygwin-xfree mailing list