LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
Search this Thread
Old 12-07-2007, 05:39 AM   #1
belda
LQ Newbie
 
Registered: Dec 2006
Posts: 15

Rep: Reputation: 0
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?
 
Old 12-07-2007, 05:36 PM   #2
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 3,513

Rep: Reputation: 64
Quote:
Originally Posted by belda View Post
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
 
Old 12-11-2007, 02:52 PM   #3
belda
LQ Newbie
 
Registered: Dec 2006
Posts: 15

Original Poster
Rep: Reputation: 0
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

Last edited by belda; 12-11-2007 at 03:06 PM. Reason: forget to write something
 
1 members found this post helpful.
Old 06-25-2009, 11:37 AM   #4
uni4dfx
LQ Newbie
 
Registered: Jun 2009
Posts: 6

Rep: Reputation: Disabled
I would like to know this too.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using winkey et al as modifier / compose keys noranthon Linux - Newbie 6 03-15-2007 12:14 PM
Alt+ctrl+F Keys stopped working Xorg miner49er Linux - General 6 04-08-2006 06:00 AM
How to disable Ctrl and Alt keys? (and maybe sysrq) bigperk420 Slackware 13 12-07-2004 06:53 PM
xfce4 modifier keys question acidream Linux - General 3 10-11-2004 04:17 PM
Ctrl-Alt-Esc keys Mojojo Linux - General 3 07-02-2003 04:26 PM


All times are GMT -5. The time now is 01:05 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration