[ Table Of Contents ][ Answer Guy Current Index ] greetings   bios   1   2   3   4   5   6   7   8   9   10   12   13   14   15   16   17   18   19   20 [ Index of Past Answers ]

(?) The Answer Gang (!)


By Jim Dennis, Ben Okopnik, Dan Wilder, Breen, Chris, and the Gang, the Editors of Linux Gazette... and You!
Send questions (or interesting answers) to tag@ssc.com

There is no guarantee that your questions here will ever be answered. You can be published anonymously - just let us know!


(?) RE: Question: special keys

From Helmut Heidegger

Answered By Karl-Heinz Herrmann

I would like to use the special keys on my Microsoft Natural Keyboard Pro under Linux. I have already found the keycodes (I think it was xevt), but I haven't been able to define a program for a key, e.g. the standby button starts xlock, the e-mail button starts kmail, volume + and - enables kmix and changes the volume, and so on.

(!) [K.H.] When you have the keycode (xev) you can setup the keys using xmodmap. This influences only keys in X -- not on conlsole. Basically it will map the hardware keycode to a symbolic keysymbol -- xev is showing the actual symbol along with the keycode.
For example I've set the "print" scroll" "pause" buttons to "front" back" "iconify" functionality. (doesn't even need .Xmodmap since the keys already produce keysymbols "print" "Scroll_Lock" and "pause").
If you want to use the Winkeys add something like to your .Xmodmap:
keycode 0x75 =  Menu      ! (is the menu key here)
then run:
xmodmap .Xmodmap
to read in the new settings.
But now the next problem: If your window manager does not know these keysymbols and what to do on key press, nothing will happen. I use the fvwm2 windowmanager here and I can set it in .fvwm2rc by something like:
Key Print        A       N       Raise
Key Scroll_Lock  A       N       Lower
Key Pause        A       N       Iconify
for the front, back, iconify
Key Delete       A       CM      Exec exec xlock -modelist "matrix"
will start the screen saver on Ctrl-Alt-Del
If you use kde or whatever windowmanager you will have to figure out how to define these key actions. The manual page of the windowmanager would be a good starting point.


This page edited and maintained by the Editors of Linux Gazette Copyright © 2001
Published in issue 67 of Linux Gazette June 2001
HTML script maintained by Heather Stern of Starshine Technical Services, http://www.starshine.org/


[ Table Of Contents ][ Answer Guy Current Index ] greetings   bios   1   2   3   4   5   6   7   8   9   10   12   13   14   15   16   17   18   19   20 [ Index of Past Answers ]