I found that I had to patch setkeycodes under MDK 10.1 to allow me to specify keycodes greater than 127. For my Logitech Access Keyboard I managed to map most of the multimedia keys so that I can use the xkb layout unmodified:
Code:
#!/bin/sh Code:
#!/bin/sh Quote:
Since there doesn't appear to be an xkb layout defined for your keyboard you could use the keycodes defined in include/input.h of the kernel source. For example, if you had a Mail multimedia key with a scancode of e06c, then you could use the keycode defined in input.h: #define KEY_MAIL 155 You could then use a setkeycodes script of: Code:
#!/bin/sh |
Ok, bare with me, ... this is going to be long and wordy, but I'm tired and it's just easier to put my train of thought down in words than to concentrate on making it short/comprehendable.
I just bought a Logitech COrdless Desktop LX 700 combo, and was trying to get it setup on gentoo (Gnome 2.8, gentoo-dev-sources 2.6.9 kernel). I spent a lot of time on this forum and many others trying to figure out all my problems, and bit by bit, I was able to figure some things out, while others still remain a mystery. My old Dell Multimedia keyboard was having problems where it would not send any scancodes that were greater than a certain max (not sure where it cut off, but I would assume at 255, or even 127). The keys wouldn't even show up in `showkey -s`, which means the kernel was dropping it at a very early stage. So anyway, I had heard a lot of good things about Logitech in general for linux, so I decided to try it. One thing I noticed is that it was reading scancodes, which was good, but no keycodes, and checking dmesg explained why (use setkeycodes). So I mapped the scancodes to available keycodes, and stuck that in my local.start -- now xev was able to pick up the keycodes (NOTE that the keycodes you feed to setkeycodes are NOT the same keycodes that xev/X detects!) So, next I wanted to get all the buttons working on my mouse (10 buttons including scroll, 2 of which are the tilt wheel) Well, no matter what I did with xorg.conf, it wouldn't detect the 2 side buttons, the top "extra" button, or the tilt positions. I read that only evdev would allow more than 7 buttons, but before trying that, I wanted to see if connecting it via USB would help any, so I removed the USB-to-PS/2 adapter from the keyboard cord and unplugged the mouse cord, and tried it out. At that point I could get all the mouse buttons to work (including tilt wheel, woohoo!), but then realized that my media keys stopped working again. I checked showkey -s and got nothing (well, certain keys do work, like Mute, Vol Up/Dn, E-mail, Play, Prev, Next, but none of the others), but showkey -k surprisingly did show keycodes for those keys (all > 255, ... not surprisingly) So basically, I was back at the same point with my old keyboard, not being able to use the extra keys because the keycodes were too high. It's kind of strange that the only difference was the USB/PS2 connection. With PS/2, the scancodes work properly and you can map them to a good keycode, which you can then map to a XF86 symbol, which can then be mapped to an action (whew), but with USB, you get no scancode, invalid keycode, and thus no way to use those keys. So... I'm back at PS/2, my keyboard works (at least all the keys are usable - I haven't done anything useful with any of them other than the media keys, mainly because Gnome's new keyboard shortcut handler sucks), and I've managed to get 7 buttons working on the mouse (tilt L/R don't work, nor does the top extra button, but the scroll wheel and the two side buttons get a response from xev on unique Button numbers). I know that's a lot of rambling (excuse me, it's 2am and I need sleep), but that might help someone out who runs into the same issues. If I had more time I would look through keyboard.c, hid-input.c, atkbd.c, etc, and just hack my way through it, but right now I don't feel like it. So at the moment, the only part that is not working are those 3 "buttons" on the mouse. I think the tilt wheel is just because it's new and hasn't been fully supported in evdev yet (soon I hope), and I have no clue why button #8 doesn't work. |
By the way, it seems that some actions would work best as keystrokes, and others as commands, but I'm running into problems with Gnome... Gnome only lets you map a key to a preset action, and it doesn't let you customize it any further than that. For example... the "Media" key would usually be used to execute XMMS or something like that, but Gnome doesn't give you that option. SO what would be the most logical way to have that key execute xmms? And for the zoom in/out buttons, I know of the symbols XF86ZoomIn and ZoomOut, but once it's mapped to that, what can you actually do with it? I'd like them to adjust text size in applications that allow it (^+/^-). I really hate to have to use multiple programs to handle the keys like that, but it seems with Gnome's key binding, we really don't have much of a choice. :/
Oh, and does anyone know what the point of the "%" key is, next to zoom in and out? |
I've also bought the LX700 combo, and I'm starting to set up the multimedia keys.
Can you post your scancodes and keycodes? btw, I can't get the mouse to work. If I connect the mouse, the keyboard won't respond, and if I then connect the keyboard, the mouse stops working. Right now I have my mouse in Xfree assigned to /dev/psaux (or /dev/input/mice, works too). How did you assign the mouse? |
I guess I should have mentioned that I did fall back on using evdev for the mouse. Here is my mouse section of the xorg.conf file:
Code:
Section "InputDevice" Code:
pointer = 1 2 3 6 7 8 4 5 9 10 Code:
setkeycodes 6a 231 By the way, you mention one device working while the other isn't -- make sure you aren't using the USB connection and the PS/2 at the same time. It is designed to work either a) Mouse and Keyboard both connected via PS/2 (with the USB->PS/2 converter on the keyboard cable), or b) ONLY the keyboard connected via USB. Mine is currently working using the two PS/2 connectors. |
If you are working on mapping the multimedia keys of a keyboard that doesn't already have an XKB layout in X then this script will help with finding keycodes to use with setkeycodes:
Code:
#!/bin/sh |
I used getkeycodes (as root) to show a list of all the used keycodes. The output is somewhat difficult to read, but at least I didn't had an issue assinging the correct keycodes:)
This is a complete list of my keycodes, functions, scancodes and the issues setkeycodes: Code:
keycode 36 = Enter So far so good:) After that, i made the following script, to be sure that they scancodes are always assinged to a keycode: Code:
#!/bin/sh Then I adjusted rcS.d and init.d so that it would automatically launch the /root/multimediakeys script. |
Just tested the mouse on a Win 2k machine. Doesn't work either.
Guess i simply bought the wrong box.. :cry: I also found out that having a .xmodmap config file in your homedir doesn't work in Gnome, because gnome has its own keyboard shortcuts, and those overrule the xmodmap settings. So now I am setting my machine up like this: http://foolish.fedorausers.org/gnome...uts/index.html Works fine, though it takes more time to set it up.. |
Quote:
|
Followup on setkeycodes
A probably stupid question following up on Lightner's post.
When I try to use setkeycodes, I get an error: Code:
setkeycodes e011 216 Am I doing something wrong? I'm using a 2.6.x kernel (Mandrake 10.0 Official). Thanks! |
You might want to try to map a lower keycode to the scancode..?
|
I'm sorry --- I think I still don't understand well enough. It seems from other examples in this thread, that SOMETHING happens to the second argument to setkeycodes inside --- it seems like those numbers from 0-127 turn into some other numbers internally. Is there any way, short of reading the code, to figure out what that process is?
If I'm restricted to only 0-127, and those are just 0-127, don't I end up crushing the normal alphanumeric keys? I'm sorry to be asking such dumb questions, but I haven't had much luck figuring out how the keyboard driver works from just the manpages. Thanks! |
Quote:
Code:
--- console-tools-0.2.3/kbdtools/setkeycodes.c.old 2005-01-15 11:20:34.257857000 +1030 |
Hello,
I haven't read all of this post, so if this is in the wrong direction excuse me. To use the multimedia functions on my keyboard I use a simple utlity called lineak http://lineak.sourceforge.net/ , what it does is its a daemon that waits for the multimedia function to be pressed. Hence when I press the play button xmms starts or pauses depending on the state. Forward for the next song, previous for the previous song. And its simple to set up. Also I checked using lineakd -l command and your keyboard is supported. Using this config paramter, lineakd -c LTCDP Logitech Cordless Desktop Pro, then you edit the .lineak file for what you want each command to do. Plus if you install the on display program, it comes up with a cool little text on your monitor depending on what your doing. Lazyuser |
I have been working on configuring the multimedia keys for an Acer Aspire 1691 WLMi notebook. My setkeycodes script so far is:
Code:
KEY_HELP[0]=e025 # mapping key changes scancode to e075 Code:
--- xkb/rules/xorg.lst.orig 2004-12-18 05:21:35.000000000 +1030 |
All times are GMT -5. The time now is 06:09 PM. |