2007/08/13

nedit / keyboard shortcuts (accelerator keys) are not working ...

copied from: http://www.nedit.org/faq/sect_bugs.php#N900

You have probably NumLock or CapsLock ON ...



1. The keyboard shortcuts (accelerator keys) are not working when 'Caps' or 'Num Lock' are switched on. Have I overlooked something obvious?

You haven't overlooked anything, it's a Motif design flaw. Netscape painfully works around this and the Alt/Meta key reversal on Sun workstations by internally re-implementing the Motif menu accelerator mechanism. NEdit will likely follow suit with the release of version 5.2.

Another possibility (writes Peter Daifuku of SGI):

There's another answer which unfortunately isn't widespread as yet. For an X11R6.3 X server supporting the XKB extension, there is a mechanism to ignore the NumLock and CapsLock key as modifiers. The file /usr/lib/X11/xkb/X0-config.keyboard should contain the string IgnoreLockMods=NumLock+Lock . For systems with multiple displays, display 1 would be controlled by the file X1-config.keyboard, etc.

On SGI systems, this mechanism is support on IRIX 6.2 with X server patch 1574 or later, on IRIX 6.3 and IRIX 6.4 and all later releases.


2. Sometimes NEdit inserts instead of saving the file when I type ^S. Other keyboard shortcuts (accelerator keys) don't work either.

You have probably NumLock or CapsLock ON. See the answer to this question. 3. I use the numeric keypad really often, so I keep NumLock on. But NEdit shortcuts don't work when NumLock is on.

The bug is not in NEdit, but in Motif. This is fixed as of NEdit 5.2, but that might not help you much. Older versions have the same problem.

Here's how you tell X to interpret the keypad keys as numbers without turning NumLock on. Create a file .Xmodmap in your home directory, and put the following lines in it:

    keycode 79 = KP_7
    keycode 80 = KP_8
    keycode 81 = KP_9
    keycode 83 = KP_4
    keycode 84 = KP_5
    keycode 85 = KP_6
    keycode 87 = KP_1
    keycode 88 = KP_2
    keycode 89 = KP_3
    keycode 90 = KP_0
    keycode 91 = KP_Decimal


Then make sure the script that starts your X session parses this file with the command:

    xmodmap -merge ~/.Xmodmap


This script can be ~/.xinitrc (called by startx) or something like Xsession if you use xdm/kdm/gdm. Then again, it might be an entirely different script on some systems.

Then turn off numlock, and just continue using the keypad. The only thing is, you loose the alternate set of functions (cursor/home/pgdown/etc).

No comments: