You are not logged in.

#1 2009-01-10 05:23:00

oni5115
Member
Registered: 2009-01-10
Posts: 38

[Solved] xmacro/btnx alternatives?

I'm really trying to get my mouse buttons to simply act as keyboard buttons - particularly shift ctrl and alt.  The idea is to be able to hold a mouse button and press a numer key and have it act like shift+1, shift+2, etc. while in wine for playing WoW.  I did a search and most of the threads on the topic are over a year or two old now. 

I migrated from Ubuntu, since I wanted to try out Arch and I'd heard BTNX still works on it.  It does, but the shift/ctrl/atl modifiers seem to be broken, at least for me.  I've also seem some solutions that may work using xmacro - but I can't seem to get xmacro installed, even using AUR.  I've tried doing a make from the 0.3 source code from sourceforge and tried using yaourt to get it from AUR.  Both have the same problem and won't install.

chartbl.h:283: warning: deprecated conversion from string constant to 'char*'
... repeated a buch of times...
chartbl.h:543: warning: deprecated conversion from string constant to 'char*'
... repeated a buch of times...
xmacroplay.cpp: In function 'void usage(int)':
xmacroplay.cpp:91: error: 'cerr' was not declared in this scope
xmacroplay.cpp:91: error: 'endl' was not declared in this scope
xmacroplay.cpp: In function 'void version()':
xmacroplay.cpp:113: error: 'cerr' was not declared in this scope
xmacroplay.cpp:113: error: 'endl' was not declared in this scope
xmacroplay.cpp: In function 'void parseCommandLine(int, char**)':
xmacroplay.cpp:160: error: 'cerr' was not declared in this scope
xmacroplay.cpp:160: error: 'endl' was not declared in this scope
xmacroplay.cpp:173: error: 'cerr' was not declared in this scope
xmacroplay.cpp:173: error: 'endl' was not declared in this scope
xmacroplay.cpp:188: error: 'cerr' was not declared in this scope
xmacroplay.cpp:188: error: 'endl' was not declared in this scope
xmacroplay.cpp: In function 'Display* remoteDisplay(const char*)':
xmacroplay.cpp:215: error: 'cerr' was not declared in this scope
xmacroplay.cpp:216: error: 'endl' was not declared in this scope
xmacroplay.cpp:223: error: 'cerr' was not declared in this scope
xmacroplay.cpp:224: error: 'endl' was not declared in this scope
xmacroplay.cpp:232: error: 'cerr' was not declared in this scope
xmacroplay.cpp:233: error: 'endl' was not declared in this scope
xmacroplay.cpp: In function 'void sendChar(Display*, char)':
xmacroplay.cpp:280: error: 'cerr' was not declared in this scope
xmacroplay.cpp:280: error: 'endl' was not declared in this scope
xmacroplay.cpp:285: error: 'cerr' was not declared in this scope
xmacroplay.cpp:285: error: 'endl' was not declared in this scope
xmacroplay.cpp:292: error: 'cerr' was not declared in this scope
xmacroplay.cpp:292: error: 'endl' was not declared in this scope
xmacroplay.cpp:298: error: 'cerr' was not declared in this scope
xmacroplay.cpp:298: error: 'endl' was not declared in this scope
xmacroplay.cpp: In function 'void eventLoop(Display*, int)':
xmacroplay.cpp:336: error: 'cin' was not declared in this scope
xmacroplay.cpp:340: error: 'cout' was not declared in this scope
xmacroplay.cpp:340: error: 'endl' was not declared in this scope
xmacroplay.cpp:346: error: 'cout' was not declared in this scope
xmacroplay.cpp:346: error: 'endl' was not declared in this scope
xmacroplay.cpp:352: error: 'cout' was not declared in this scope
xmacroplay.cpp:352: error: 'endl' was not declared in this scope
xmacroplay.cpp:358: error: 'cout' was not declared in this scope
xmacroplay.cpp:358: error: 'endl' was not declared in this scope
xmacroplay.cpp:364: error: 'cout' was not declared in this scope
xmacroplay.cpp:364: error: 'endl' was not declared in this scope
xmacroplay.cpp:370: error: 'cout' was not declared in this scope
xmacroplay.cpp:370: error: 'endl' was not declared in this scope
xmacroplay.cpp:376: error: 'cout' was not declared in this scope
xmacroplay.cpp:376: error: 'endl' was not declared in this scope
xmacroplay.cpp:382: error: 'cout' was not declared in this scope
xmacroplay.cpp:382: error: 'endl' was not declared in this scope
xmacroplay.cpp:385: error: 'cerr' was not declared in this scope
xmacroplay.cpp:395: error: 'cout' was not declared in this scope
xmacroplay.cpp:395: error: 'endl' was not declared in this scope
xmacroplay.cpp:398: error: 'cerr' was not declared in this scope
xmacroplay.cpp:406: error: 'cout' was not declared in this scope
xmacroplay.cpp:406: error: 'endl' was not declared in this scope
xmacroplay.cpp:409: error: 'cerr' was not declared in this scope
xmacroplay.cpp:417: error: 'cout' was not declared in this scope
xmacroplay.cpp:417: error: 'endl' was not declared in this scope
xmacroplay.cpp:421: error: 'cerr' was not declared in this scope
xmacroplay.cpp:431: error: 'cout' was not declared in this scope
xmacroplay.cpp:431: error: 'endl' was not declared in this scope
xmacroplay.cpp:435: error: 'cerr' was not declared in this scope
xmacroplay.cpp:443: error: 'cout' was not declared in this scope
xmacroplay.cpp:443: error: 'endl' was not declared in this scope
xmacroplay.cpp:447: error: 'cerr' was not declared in this scope
xmacroplay.cpp:455: error: 'cout' was not declared in this scope
xmacroplay.cpp:455: error: 'endl' was not declared in this scope
xmacroplay.cpp:459: error: 'cout' was not declared in this scope
xmacroplay.cpp:459: error: 'endl' was not declared in this scope
xmacroplay.cpp: In function 'int main(int, char**)':
xmacroplay.cpp:497: error: 'cerr' was not declared in this scope
xmacroplay.cpp:497: error: 'endl' was not declared in this scope
make: *** [xmacroplay] Error 1

I'd like to get xmacro installed to try out the response posted in the replacement thread.  The BTNX thread was posted just for reference.
Ubuntu 8.10 BTNX replacement tutorial
Ubuntu BTNX thread


The following link has some code that might do it, but it requires the record exentsion being loaded in Xorg, I'm not sure I have that installed.  I don't seem to have a librecord.so in /usr/lib/xorg/modules/extensions as mentioned in the thread (though maybe it is in a new location in newer versions of xorg).   I'm also not sure if I have the modules or extensions required for the Xtest commands.  My searches haven't really revealed much of anything about how to figure that out.
Older post here with some info


I've done further searches trying to find similar apps and found rebind, but that also failed to make.   So far, nothing seems to work just yet.  Could I just use XTestFakeKeyEvent commands with Xbindkeys?  Would that properly hold down the key if I held the mouse button?


Edit:  I've also been reading the wiki entry - http://wiki.archlinux.org/index.php/Get … rking#kbde
Is Enemey Territory run under Wine?  Is that why you need evrouter instead of xbindkeys?  The instructions there are a bit confusing.

Last edited by oni5115 (2009-01-13 10:22:18)

Offline

#2 2009-01-13 06:19:02

oni5115
Member
Registered: 2009-01-10
Posts: 38

Re: [Solved] xmacro/btnx alternatives?

Is there any other information I can provide that would be helpful to more experienced users? (and bump)

Update: I have figured out how to do this now using xdotool

I have set my .xkeybindrc to have the following:

##################################
#  Logitech MX1000 Button Layout #
##################################
# 01: Left Click
# 02: Wheel Press OR Left + Right Click.
# 03: Right Click
# 04: Wheel Up
# 05: Wheel Down
# 06: ??
# 07: ??
# 08: Thumb Down
# 09: Thumb Up
# 10: Thumb Middle
# 11: Cruise Up
# 12: Cruise Down
# 13: Wheel Left
# 14: Wheel Right

#######################
# Mouse Configuration #
#######################
# Mouse 8 to Tab
"xdotool key Tab"
 b:8

# Mouse 9 to multiply
"xdotool keydown KP_Multiply"
 b:9
"xdotool keyup KP_Multiply"
 release + KP_Multiply + b:9

# Mouse 10 to shift
"xdotool keydown shift"
 b:10
"xdotool keyup shift"
 release + shift + b:10

# Mouse 11 to alt
"xdotool keydown alt"
 b:11
"xdotool keyup alt"
 release + alt + b:11

# Mouse 12 to ctrl
"xdotool keydown ctrl"
 b:12
"xdotool keyup ctrl"
 release + control + b:12

The tab button doesn't work for alt+tab'ing through applications though.  I'm not sure how to do that.  It does add tab in leafpad and terminal though.  I haven't tested this under wine yet, but it should work fine.

Last edited by oni5115 (2009-01-13 09:15:51)

Offline

Board footer

Powered by FluxBB