[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Num lock disables alt- and ctrl-key shortcuts?



Rob Mahurin writes ("Re: Num lock disables alt- and ctrl-key shortcuts?"):
>On Sun, Sep 12, 1999 at 08:49:35PM -0400, Carl Fink wrote:
>> [This message has also been posted.]
>> I've just noticed that both Adobe's Acrobat Reader 3 and RealMedia's
>> Realplayer G2 have an interesting behavior:  if NumLock is activated,
>> their keyboard shortcuts that require shifted keys, like Alt-F for
>> the File menu or ^P for Print, don't work.  On the other hand,
>> StarOffice 5.1's shortcuts work fine with NumLock on.
>
>I have a similar problem with fvwm2.  With the NumLock off, Alt keys
>are used by the window manager, to give menus, move around the
>desktops, etc., and the windows key that everybody hates is Alt or
>Meta key for programs like Netscape and Emacs and xterm.  With the
>Numlock on, the windows key and the alt key behave the same way, and I
>lose my window manager shortcuts.

Well, this one definitely falls into the gray area between "bug" and
"feature".

In X windows, the NumLock key toggles a modifier bit, just like ctrl
and alt do.  So when numlock is toggles, every keystroke has another
modifier bit tacked on to it.  Run 'xev' and hit keys in the window,
with and without numlock applied.  You'll get different modifier
codes:

Without numlock:

KeyPress event, serial 18, synthetic NO, window 0x4000001,
    root 0x26, subw 0x0, time 927402886, (82,74), root:(240,198),
    state 0x0, keycode 38 (keysym 0x61, a), same_screen YES,
    XLookupString gives 1 characters:  "a"

With numlock:

KeyPress event, serial 18, synthetic NO, window 0x4000001,
    root 0x26, subw 0x0, time 927408681, (82,74), root:(240,198),
    state 0x10, keycode 38 (keysym 0x61, a), same_screen YES,
    XLookupString gives 1 characters:  "a"

The applications are behaving differently, because you are sending
them *different* input.

Some applications behave fairly intelligently and ignore this modifier
bit or use it intelligently (i.e. don't do anything different for most
keys, but for keypad ones do numbers, or somesuch).

Staroffice was written intelligently in this respect and "does the
Right Thing".  It appears that Realplayer does not.

FVWM2 does it because the default config file *asks* it to do it this
way.

For example, the system.fvwm2rc has

Key Up          A       M       Scroll +0 -100
                        ^
The 'M' tells it to do this action when *only* the Meta flag is set.
Unfortunately, fvwm2 doesn't seem to have any way in it's config file
to tell it to also allow these with the numlock modifier on.
So really  this is an fvwm2rc bug.



-- 
Richard W Kaszeta 			PhD. Candidate and Sysadmin
bofh@me.umn.edu				University of MN, ME Dept
http://www.menet.umn.edu/~kaszeta


Reply to: