LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (http://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   mouse keys as modifier keys (ctrl & alt) (http://www.linuxquestions.org/questions/linux-desktop-74/mouse-keys-as-modifier-keys-ctrl-and-alt-605154/)

belda 12-07-2007 04:39 AM

mouse keys as modifier keys (ctrl & alt)
 
I am wondering if there is a way, to use my mouse side buttons to act as ctrl or alt. Just to map the button 6 to be ctrl. Is there a way to completely make some mousekey to act as alt?

HappyTux 12-07-2007 04:36 PM

Quote:

Originally Posted by belda (Post 2983047)
I am wondering if there is a way, to use my mouse side buttons to act as ctrl or alt. Just to map the button 6 to be ctrl. Is there a way to completely make some mousekey to act as alt?

Try xbindkeys this is what I use to have my extra buttons/side to side scroll wheel act like they should namely back/forward plus side to side scroll in a browser .

Try something like this as your ~/.xbindkeysrc config file.

Code:

"xvkbd -xsendevent -text "\[Control_L]""
b:6
"xvkbd -xsendevent -text "\[Alt_L]""
b:7

Now once you have created/edited the config file to have the contents above run xbindkeys from a console window and check with xev from the launched console window to see if it is sending the proper signal (either Control_L or Alt_L) you would see something similar to like this in the console window when using the button hovering over the xev window that opens.

Code:

KeyRelease event, serial 32, synthetic NO, window 0x3400002,
    root 0x288, subw 0x0, time 3065383044, (38,100), root:(42,920),
    state 0x4, keycode 109 (keysym 0xffe4, Control_L), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

To make it work all the time but the xbindkeys on a line by itself in your ~/.bashrc below is a article on using xbindkeys with a little different method you may want to read/try.

http://www.linux.com/articles/59494

belda 12-11-2007 01:52 PM

NO GO!
Im using ubuntu 7.10. Before doing this I had to
Code:

sudo apt-get install xbindkeys xvkbd
The xbindkeys part seems to work, I tried to replace the xvkbd command with another command, but it still is not sending the Alt_L keycode (according to xev, there are now even no Button presses/releases). Not mapped buttons do good, but these now do nothing

Code:

ConfigureNotify event, serial 30, synthetic YES, window 0x3a00001,
    event 0x3a00001, window 0x3a00001, (1077,816), width 178, height 178,
    border_width 2, above 0x10007b7, override NO

ButtonPress event, serial 30, synthetic NO, window 0x3a00001,
    root 0x52, subw 0x0, time 3401669569, (24,83), root:(1103,901),
    state 0x10, button 1, same_screen YES

ConfigureNotify event, serial 30, synthetic YES, window 0x3a00001,
    event 0x3a00001, window 0x3a00001, (1077,816), width 178, height 178,
    border_width 2, above 0x10007b7, override NO

ButtonRelease event, serial 30, synthetic NO, window 0x3a00001,
    root 0x52, subw 0x0, time 3401669687, (24,83), root:(1103,901),
    state 0x110, button 1, same_screen YES

LeaveNotify event, serial 30, synthetic NO, window 0x3a00001,
    root 0x52, subw 0x0, time 3401675888, (24,83), root:(1103,901),
    mode NotifyGrab, detail NotifyAncestor, same_screen YES,
    focus YES, state 16

EnterNotify event, serial 30, synthetic NO, window 0x3a00001,
    root 0x52, subw 0x0, time 3401675992, (24,83), root:(1103,901),
    mode NotifyUngrab, detail NotifyAncestor, same_screen YES,
    focus YES, state 16

KeymapNotify event, serial 30, synthetic NO, window 0x0,
    keys:  82  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
          0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0


When I typed it to console directly I get
Code:

belda@vrsek:~$ /usr/bin/xvkbd -xsendevent -text "\[Control_L]"
xvkbd: Mode_switch not available as a modifier
xvkbd: although ISO_Level3_Shift is used instead, AltGr may not work correctly

I am also using compiz-fusion, but I doubt, it is causing this.

It seems to me, that xvkbd can only send whole text at once and can not send the press event and than the release event

uni4dfx 06-25-2009 10:37 AM

I would like to know this too.


All times are GMT -5. The time now is 05:34 AM.