LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Enable modifiers via xmodmap (http://www.linuxquestions.org/questions/linux-newbie-8/enable-modifiers-via-xmodmap-779393/)

guivho 01-02-2010 06:39 AM

Enable modifiers via xmodmap
 
I recently got a Logitech G11-keyboard for my Ubuntu 9.10 64-bit box. My question is xmodmap related and not restricted to this particular keyboard, nor to the distro I am using. The keyboard has a.o. 18 G-keys. These have been successfully defined in /usr/share/X11/XKeysymDB as per https://help.ubuntu.com/community/LogitechG15 and I have a ~/.Xmodmap file that matches keycodes to the names in XKeysymDB.

My .Xmodmap definitions are rather simple, e.g. 'keycode 175 = G1'. So I do not define any value for modifier combinations, nor do I know how to do this.

And here's my real question. How should I define these keys so that the Crl-, Alt-, Meta-, Super- etc modifiers work with these keys?

With the current setup, the modifier versions of these keys do only work for the second keypress, e.g. the first Ctrl-G17 is perceived as a G17 keypress, and the second and remaining Ctrl-G17 presses are correctly received as a Ctrl-G17.

I would be happy to read an explanation of this behaviour, and even more so, about how to properly define them so that the base key as well as the modifier versions would be available.


Guido

--
If the odds are a million to one against something occurring, chances are 50-50 it will.

http://vanhoecke.org ... and go2 places!

tommyttt 01-05-2010 09:46 PM

Had to search for this keyboard to see what it does. Basically, it has 18 macro programmable keys. The specs say it requires winblows but it should work under linux. I tried xmodmap but didn't get it to work consistently. Instead I use xbindkeys (http://www.nongnu.org/xbindkeys/xbindkeys.html) which is fairly easy to set up. One requirement is that the keys return an explicit keycode for each key combination. Use "xev" in a terminal to see if your keyboard qualifies.

You also might be interested in this article of LinuxPro magazine (Dec 09) issue 109. It is about using acpid hotkeys but I haven't tried it since xbindkeys work fine for me. Some of the key definitions in my distro (openSUSE 11.2) didn't work. I've got a Dell studio 1745 laptop which was made for winblows:(

Here is a fragment of my .xbindkeysrc file
Quote:

###########################
# xbindkeys configuration #
###########################
#
# Version: 1.8.3
#
# If you edit this file, do not forget to uncomment any lines
# that you change.
#<<<< snip >>>>>
# Control + b:2 + Release
#
# keys added by TTT 10/23/09
"eject &"
m:0x0 + c:170

# keys added by TTT 10/23/09
# this key not working yet
"xterm -geometry 132x50-0-0 -e 'ps -ux; read'"
Control_R

# keys added by TTT 10/23/09
"kfind &"
Alt_R

##################################
# End of xbindkeys configuration #
##################################
The "windblows" key on my keyboard doesn't return a keycode so can't use it.

Tom (retired penguin)

guivho 01-06-2010 02:48 AM

As I said b4, the combined XKeysymDB en ~/.Xmodmap work well for me. Tje 18 G-keys as well as the 3 M-keys and the MR key work fine for me. I just do not know why the first keypress of one of these keys together with a modifier key is detected as the unmodified key, while the same modified key pressed immediately thereafter is detected as the modified key. And of course, I'd like to fix it so that one single modified keypress is detected as such.


All times are GMT -5. The time now is 11:15 AM.