Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

setkeycodes annoyance

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
User avatar
utrrrongeeb
Posts: 254
Joined: 2006-05-14 09:48
Location: Eastern Canada

setkeycodes annoyance

#1 Post by utrrrongeeb »

Hi,
I'm using a Microsoft Wireless Natural MultiMedia Keyboard. In Bash, my screen gets screwed up every few seconds with messages saying

Code: Select all

atkbd.c: Unknown key pressed (translated set 2, code 0xd9 in isa0060/serio0).
atkbd.c: Use 'setkeycodes e059 <keycode>' to make it known.

atkbd.c: Unknown key pressed (translated set 2, code 0x81 in isa0060/serio0).
atkbd.c: Use 'setkeycodes e001 <keycode>' to make it known.
I'm wondering what keycode to use that will result in nothing happening, and how I can make that setting permanent.
utrrrongeeb formerly lecaro
Art #429775 on 'Etch' 4.0r0

User avatar
utrrrongeeb
Posts: 254
Joined: 2006-05-14 09:48
Location: Eastern Canada

#2 Post by utrrrongeeb »

Anyone reading this post? It is a problem of large forums is that unanswered posts tend to get buried.
utrrrongeeb formerly lecaro
Art #429775 on 'Etch' 4.0r0

Grifter
Posts: 1554
Joined: 2006-05-04 07:53
Location: Svea Rike

#3 Post by Grifter »

I just don't think anyone knows what to do
Eagles may soar, but weasels don't get sucked into jet engines...

User avatar
utrrrongeeb
Posts: 254
Joined: 2006-05-14 09:48
Location: Eastern Canada

#4 Post by utrrrongeeb »

Thanks for pointing that out.
Ok, I'll explain more clearly:
According to manuals and help text, setkeycodes is run as setkeycodes [scancode] [keycode]. The errors from the kernel provide the scancode. I want to know what keycode will be accepted but will result in either nothing happening, or something harmless happening (such as a beep). Once I've found a functional keycode, I need to make it so it always associates the scancode wit hthe keycode, as setkeycodes is reset after a reboot. Can anyone help me with this?
utrrrongeeb formerly lecaro
Art #429775 on 'Etch' 4.0r0

lacek
Posts: 764
Joined: 2004-03-11 18:49
Location: Budapest, Hungary
Contact:

#5 Post by lacek »

Use the dumpkeys command to see what keycodes are recognized and which is used to what. Pick a keycode with no function (in my computer, 120 was such one), and assign your scancodes to that keycode.
To make this setting permanent, you probably need to create an init script.
If you don't know how to create an init script, this thread may help.

User avatar
utrrrongeeb
Posts: 254
Joined: 2006-05-14 09:48
Location: Eastern Canada

#6 Post by utrrrongeeb »

Thanks for the help!
I'll try it the next time I'm in Debian.
utrrrongeeb formerly lecaro
Art #429775 on 'Etch' 4.0r0

User avatar
utrrrongeeb
Posts: 254
Joined: 2006-05-14 09:48
Location: Eastern Canada

#7 Post by utrrrongeeb »

Thanks a lot! :D Now I can do my Bash work without being interrupted constantly. I used keycode 120, and the init script is something like this:

Code: Select all

#!/bin/bash
case $1 in
  start)
    setkeycodes e059 120
    setkeycodes e001 120
  ;;
  stop)
  ;;
esac
Just wondering, but how can I assign key commands to specific actions (such as launching a program) in X?
utrrrongeeb formerly lecaro
Art #429775 on 'Etch' 4.0r0

lacek
Posts: 764
Joined: 2004-03-11 18:49
Location: Budapest, Hungary
Contact:

#8 Post by lacek »

X keycodes has nothing to do with the console key assignments. You may find this thread useful. It discusses the using of "multimedia keyboards" under linux, but you can use the method described there to map any unknown keycodes under X.

User avatar
utrrrongeeb
Posts: 254
Joined: 2006-05-14 09:48
Location: Eastern Canada

#9 Post by utrrrongeeb »

Just what I've been looking for! Thanks a lot! :D
I assumed it was going to have to use extra packages, as the GNOME key commands are limited. Maybe I should switch to Xfce...
In the mean time, I added more setkeycodes to the init script, and now the function keys behave like function keys, regardless of that evil F Lock. However, FLock still screws up PrtScn/SysRq, Insert, Pause/Break, and Scroll Lock. Also, it seems Bash freezes if I'm fooling around with FLock and the keys it affects.
utrrrongeeb formerly lecaro
Art #429775 on 'Etch' 4.0r0

User avatar
SpEcIeS
Posts: 62
Joined: 2006-07-20 15:52
Location: Canada

#10 Post by SpEcIeS »

If you want to stop seeing the messages you may want to add dmesg -n1 to your boot up. I have a M$ Wireless keyboard and mouse and this was one of my issues, but not anymore. However, the messages do show up on the logs.

Next setup will be Logitech.. not sacrelig :)

User avatar
utrrrongeeb
Posts: 254
Joined: 2006-05-14 09:48
Location: Eastern Canada

#11 Post by utrrrongeeb »

I have a M$ keyboard and mouse, but I prevented the error messages from coming rather then hiding them. Look at the seventh post from the top here.
utrrrongeeb formerly lecaro
Art #429775 on 'Etch' 4.0r0

User avatar
utrrrongeeb
Posts: 254
Joined: 2006-05-14 09:48
Location: Eastern Canada

#12 Post by utrrrongeeb »

Hotkeys works all right when I manually run it, but how do I make it run on startup?

Also, the "Sleep" key says it is pressed about 30 times when it's only pressed once. This can screw up everything.
utrrrongeeb formerly lecaro
Art #429775 on 'Etch' 4.0r0

lacek
Posts: 764
Joined: 2004-03-11 18:49
Location: Budapest, Hungary
Contact:

#13 Post by lacek »

You have to run hotkeys with the X server. That is, if you log in from console and use the 'startx' command, you have to enter the command to your .xinitrc. If you log in from kdm for example, you'll have to find a way to run hotkeys at startup. With KDE, there is a ~/.kde/Autostart directory you can symlink the application there, and KDE will start it automatically.

User avatar
utrrrongeeb
Posts: 254
Joined: 2006-05-14 09:48
Location: Eastern Canada

#14 Post by utrrrongeeb »

At the moment I'm using GDM as the display manager and Gnome as the WM, but I might switch the WM to KDE or Xfce at some point. I'll look around for a file like that. Would it be for the display manager or the window manager?

Other than that, I've configured the keyboard to my preferences.
utrrrongeeb formerly lecaro
Art #429775 on 'Etch' 4.0r0

lacek
Posts: 764
Joined: 2004-03-11 18:49
Location: Budapest, Hungary
Contact:

#15 Post by lacek »

I don't really know which should be better. I think it doesn't really matter which will start the hotkeys program, I just used the KDE autostart feature to start it. It was the easiest solution for me.

User avatar
utrrrongeeb
Posts: 254
Joined: 2006-05-14 09:48
Location: Eastern Canada

#16 Post by utrrrongeeb »

:D I have it working at last!!!!
Obviously, if I switch window managers, I'll have some fiddling to do, but I think I can check "keyboard" of my list. Now for the mouse, the UPS, ............
utrrrongeeb formerly lecaro
Art #429775 on 'Etch' 4.0r0

Post Reply