keyboard extra keys - xmodmap
Hello,
I configured the extra keys on my keyboard in ~/.Xmodmap. After putting xmodmap ~/.Xmodmap in my .xsession they work. But if I change the keyboard layout they stop working until I re-enter the command xmodmap .Xmodmap. I use kde, slackware 12. Any ideas how to keep the keycodes? Thanks in advance. |
I just always leave my kaymaps in /etc/X11/Xmodmap file.
Brian |
Thanks, but it did not help. The file didn't exist, so I copied .Xmodmap into /etc/X11/Xmodmap but to no avail. And I found out that .xsession entry is not working either, I have to manually enter xmodmap .Xmodmap in a terminal each time.
|
Not sure what to do to fix the issue.
Brian |
The only thing I can think of instead of using the tray icon or shortcut, make your shortcut in kde menu like:
setxkbmap -model pc104 -layout gb && xmodmap .Xmodmap There is a command line in options but it's not editable. |
Yes, this setxkbmap command which you cannot edit in kcontrol is really provoking, especially if you can see that it is wrong, which was the case with qwerty czech on kde ??- slack 10.2. Qwerty czech is fixed by now but the the whole thing is annoying and unnecessary. Why put the command there if you can't edit it?
|
I had this problem too. First of all, read the kxkb help file; it's really informative, especially the page titled "xkb Files and Layouts." If you can find a keyboard map in /etc/X11/xkb/symbos/inet, then choose that layout in the Keyboard Model section of the Keyboard Layout screen. All of my special keys (Inspiron 1520) were listed in the "inspiron" layout, so I chose "Laptop/Notebook Dell Inspiron 6xxx/8xxx" in the Keyboard Layout screen. If you can't one matching your keyboard, you'll have to add a layout as described in the help file.
One other thing I read in the help file is kxkb uses the xkb extension instead of xmodmap, which is why it was clobbering your configurations set up there. |
Ok, I spoke too soon. I had to do one extra step.
I had to modify the follwing file: /etc/X11/xkb/symbols/inet Code:
// Laptop/notebook Dell Inspiron 8xxx |
Hiya people :)
I have been very busy, working shiftwork, but am still here! Currently with 2 video cards now, 4GB of ram, 3 monitors running finally, and now: this cheap, but kinda cool, but VERY frustrating wireless keyboard. Kernel is 2.6.24.4. Slack 11. And to get right to it, here's the issue (which I have posted here because this thread is the perfect place): I too now have a (relatively cheap) GE wireless keyboard with a bunch of useless buttons on the top. I have spent much of the day trying to figure out in which file on Slack 11 to put the necessary stuff into, to get these stupid keys to do something. Accordingly, I have gone through COUNTLESS threads here on LQ, as well as Google, plus the Ubuntu Forums, and have downloaded the XF86 Protocol PDF document, and it basically is full of technical mumbojumbo that didn't help.. All of the keys I wish to program ARE recognized, and they can be read using XEV. Here's an example: Code:
KeyPress event, serial 31, synthetic NO, window 0x1e00001, Now, what do I do with that info? Here's what I made for an Xmodmap file (and also a .Xmodmap file): Code:
keycode 162 = wk_play_pause Thing is, WHERE do I now tell the X server what these 'macro thingies' mean? What action to take when encountering these keys?? Also, no matter what I put in any file anywhere, the XEV output remains the same; ie There is no symbol (NoSymbol) associated with any of the special keys. Now, RE the above post: The things in <> are what?? Like for example: key <I2E> { [ XF86AudioLowerVolume ] }; So what is <I2E> and where did it come from? Obviously it looks like a hex code, but from where did it come? Using kcalc I converted many of my decimal codes from XEV into HEX, and they do not match or even remotely come close to any of the preconfigured keyboards in ../X11R6/lib/xkb/whatever-that-file-is-called.. Here's what I did in KeySymsDB: Code:
! Sashas wireless keyboard upper row keys Now what? I am totally perplexed at this point.. Is it just Slackware, or maybe KDE, or does every Linux have LOADS & LOADS of similar-looking files intended to define keymaps? Any input is as always GREATLY appreciated!!! I give up for today-- back to work tomorrow so early to bed tonight. Cheers everyone :) Sasha |
The <I2E> etc. stuff comes from /etc/X11/xkb/keycodes/xfree86 -- it maps codes like these to keycodes from your keyboard. Check to see if the keys you are trying to assign have these keycodes already defined there -- if not, add it yourself I guess. However, if you are using KDE or another major DE like XFCE (or even IceWM, I think) you can just map actions to them using their own utilities. For example, in KDE you can go to "Regional & Accessibility">"Keyboard Shortcuts" in the Control Center and set up everything there.
|
T3slider:
Thank you for that suggestion. I did try that, and it tried to work but it seemed rather limited in its functionality, particularly where concerns non-XF86 standard applications. For example, if I press the MAILBOX key, the built in action might open some kind of email tool like KMail or something. I would want it to open my webmail url in a firefox tab.. Let me explain further: The most helpful tutorial I had used while messing with all this was HERE. The fellow there was using FVWM as a desktop/WM and so his key configs for getting weird keys to do things were to be done in the file /usr/X11R6/lib/X11/fvwm2/system.fvwmrc2 (so named on my system) which when I look at that file on MY system it contains stuff like: Quote:
He identified his keys using XEV, then added functionality by making 'names' or 'Symbols' for the keys in XkeysymDB (which I also did) Adding a multimedia key to make (for example) firefox start might read something like: Quote:
Reasons I would like to know how to create this functionality independently of KDE (or its configuration tool) are 1) maybe I would like special keys to work outside KDE, or 2) what if I switch desktops? Like use something besides KDE.. I would be one step ahead by doing this in an X context, rather that just a KDE context. Finally, as this IS slackware I am using, I would like to know how I can do this without the KDE tool, whether it (the tool) works or not. Assuming the KDE keyboard config tool DOES work (but not to my liking) then presumably the settings and mappings created with it are saved *somewhere* comparable to that fvwm config file mentioned above; so where might that be?? What file gets edited by KDE? Even if it is useful "in-KDE-only" at least I could see how the key mapping gets done. Thanks again! Sasha |
OK, I've come with some help after some brief googling. First of all, as for the simplicity of the keyboard shortcuts that you can set, I just made some scripts and assigned them to run (ie I added them to an unused portion of the menu and then I was allowed to launch those actions on a keyboard shortcut). However, I've found a great page here: http://dev-loki.blogspot.com/2006/04...h-xmodmap.html that explains basically everything you will ever need to know. It outlines KDE-specific stuff to launch ANY action without resorting to my hackish method. If you want a WM/DE-independent solution, it suggests xbindkeys (you would have to install this), located here: http://hocwp.free.fr/xbindkeys/xbindkeys.html (However, even if you use xbindkeys, you should still read the first link since it has information on how to set your keys up and such).
Good luck -- if you have any other problems with that solution (I know, it requires installing something) just say so. |
will look it over in the morn - thanks :)
|
T3slider--
THANKS for pointing me/us to 'xbindkeys' as it looks like the solution, at least to my own situation. As an aside, using XEV I have discovered that this keyboard I bought (GE SKU 98055 model# wk0804 for very cheap-- that's why I got it) is truly a 'Windoze-destined' product. As an example, the LOGOUT button on it actually doesn't produce a scan code number; it instead emits a macro of the keys WINKEY+UP+UP+RETURN which if you press those keys on a windoze machine will select 'Logout' from the START menu :P lol.. Luckily there are only 3 keys like that on here. However, just by reading the docs for xbindkeys' I get the impression that xbindkeys might be able to deal with that too :) I'll update again when I try it out. Thx again! Sasha |
GrapefruiTgirl, I've got two that do nothing as well -- but I wasn't aware that xbindkeys could deal with this. I may have to look into it myself. It looks like there's a SlackBuild at slackbuilds.org too. :)
[edit]If your goofy logout key emits that particular macro (which is admittedly very humourous), I wonder what would happen if your mouse cursor was positioned where the start menu pops up...would it accidentally select the wrong item? ;)[/edit] |
All times are GMT -5. The time now is 04:49 PM. |