View previous topic :: View next topic |
Author |
Message |
bokopperud n00b
Joined: 30 Sep 2004 Posts: 20 Location: Lillehammer, Norway
|
Posted: Sat Dec 04, 2004 11:20 pm Post subject: Unknown key and 'setkeycodes'? |
|
|
I'm using a MicroSoft wierless "natural" keyboard with additional
keys for various functions (play, pause, my documents, sleep, mail,
calculator,...) and have an annoying problem. For one reason or the
other, the keyboard generate a code that results in a "Unknown key
released... Use 'setkeycodes e001 <keycode>' to make it known".
This typically happens when I press a key after the keyboard has been
idle for a little while... mind you, the code of the key I actually did
press is also sent. It's just annoying when this error pops-up in
the middle of what I'm doing and disrupt curses-based programms...
or fill-up my logs. It *only* happens when I'm using the virtual-
terminals, so apparently X traps it whatever it is. I'm assuming it is
some sort of "attention" signal the keyboard sends...
What I wonder about is the 'setkeycodes e001 <keycode>'
command:
First -- as I *don't* want this "keysequence" to *do* anything,
what is a *safe* value to use for <keycode>? What *is* the keycode
supposed to be anyway? I've tried 00 which didn't seem to work, and 01
which seem to, but for all I know, my computer may have been sending
Bill Gates porn everytime my keyboard sends this code.
Second -- using the 'setkeycode' command on *one* terminal, seems to
solve the problem until next boot, but could I do it a better way?
E.g. making a run-level script or put it in some script (I want the
command to be run just once, but I don't want it to be ignored).
Third -- I know there are programs under X for handling these sorts of
extra keys my keyboard has... but can I do something similar for the
VTs? For some other distros I've used, these keys cause similar
errors, but with different keycode, so could I use 'setkeycode' to have
those keys emitting custom keycodes?
And if I did that, is it possible to make them trigger commands? (E.g.
"Calculator" starts 'bc', "My Documents" runs 'ls ~' or 'cd ~',
"Mail" starts 'pine', "Web" starts 'links',...) How?
BTW, does anybody knows -- at the top of their heads -- a good program
for handling such special keys under X ?
TIA,
-bokopperud |
|
Back to top |
|
|
harrison n00b
Joined: 31 Mar 2003 Posts: 13 Location: Hong Kong
|
Posted: Sun Dec 05, 2004 7:57 am Post subject: Extra keys issue |
|
|
Hmm.. I may be able to help you set up the hotkeys issue, but I'm not sure what you mean by
Quote: | "Unknown key
released... Use 'setkeycodes e001 <keycode>' to make it known" |
First, run xev which is located at /usr/X11R6/bin/ (run from console)
Make sure it has focus and then hit one of your special functionality keys. Search the console for the KeyRelease event that just occured when you hit the key. There is where you'll find out the keycode # it has.
Your next step is to use /usr/X11R6/xmodmap to generate your current list of keys-keycode connections avialbe to your X-server.
Code: | /usr/X11R6/xmodmap -pke > ~/keys.map |
Edit the keys.map file and find the "keycode *** =" line that deals with your keycode you found earlier.
Now depending on the button is what you'll put here. I'm not sure about general commands but for instance, when I did this for my sound keys on my laptop I ented in this:
Quote: | keycode 144 = XF86AudioPrev
keycode 153 = XF86AudioNext
keycode 160 = XF86AudioMute
keycode 162 = XF86AudioPlay
keycode 164 = XF86AudioStop
keycode 174 = XF86AudioLowerVolume
keycode 176 = XF86AudioRaiseVolume
|
And that is disregarding the spaces inbetween the keycodes.
I'll look more into what type of commands are aviable to you when I have more time.
Anywho. After you changed this file you can use
Code: | /usr/X11R6/bin/xmodmap ~/keys.map |
To update your X-servers interpretation of your keyboard
Run xev again and this time when you press your multimedia key, instead of getting an unresolved symbol you should get the notification-command-thingy that you typed in perviously.
If that is working, then you can save that as your ~/.xmodmap file which is loaded by most windows managers by default as you login.
The next step is to configure the window managers to deal with those notifications and that depends on what you use (obviously)
If you use fluxbox or gnome I may be able to help you some more. But I need to go for now.
Good luck |
|
Back to top |
|
|
Schwin97 n00b
Joined: 25 Oct 2002 Posts: 65 Location: Frisco, TX
|
Posted: Mon Dec 06, 2004 12:05 am Post subject: |
|
|
Try lineakd, it worked to setup my special keys on my microsoft wireless. Still have the problem with 2 or 3 unknown keys, but I am looking into getting that fixed as well. |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20067
|
Posted: Mon Dec 06, 2004 12:21 am Post subject: |
|
|
Moved from Installing Gentoo. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|