PDA

View Full Version : [Linux] Logitech G700 & Ubuntu 11.04 & xbindkeys



theShrimp
01-21-2011, 04:27 PM
Hey there,

I just bought a new mouse, the Logitech G700.
It works pretty well under Ubuntu 11.04.

The mouse has following buttons:

All those work with HoN:

Leftclick
Rightclick
Middleclick
Wheelup
Wheeldown
Wheelleft (tilt)
Wheelright (tilt)
G4 (aka MouseX1 in HoN)
G5 (aka MouseX2 in HoN)


Those don't:

G6
G7


(G8 - G11 are used for DPI, profile change and battery status)


I would like to use G6 and G7 in HoN! So I decided to use "xbindkeys" (on a certain event it runs a command) in combination with "xvkbd" (this emulates keyboard presses) to map some keyboard-button-combinations to those two keys.
This works pretty well. I mapped the letter "k" to G7 and "l" to G7. That's my "~/.xbindkeysrc" config:


#G7 B11 front
"/usr/bin/X11/xvkbd -xsendevent -text "k""
m:0x0 + b:11
#G6 B10 back
"/usr/bin/X11/xvkbd -xsendevent -text "l""
m:0x0 + b:10

When I press G7 now in for example "gedit" it writes the letter "k". Working as intended.
My only problem is, all that stops working as soon as I maximize HoN! I can't bind "k" to an itemslot and use it with my mouse. I can't write the letter "k" into the chat with pressing the G7 button. Is there a workaround/fix avail? Maybe some "anticheat" machanism blocks it. idk

SHORT, what I try to do:
Map a keyboard-letter to a G# button -> press that G# button ingame -> do an action ingame using the redirected keyboard-button

Thanks for any respons and sorry for my bad english.

edit: There is an other tool called xdotool, works like xvkbd, it simulates keyboard presses. Doesn't work as well.
edit2: http://picfu.net/db2cea/original.png -- this is the G6 button event that happens when I press the button
edit3: This work when I play in window mode.

theShrimp
01-22-2011, 02:12 PM
anyone?

Naib
01-23-2011, 08:20 AM
iirc there is a limited number of mousekeys that hon can bind to

theShrimp
01-24-2011, 09:00 AM
well, I don't try to bind a mouse key. I just try to bind a keyboard letter which is bound to my mouse.

theShrimp
01-27-2011, 06:04 AM
*bump*

Naib
01-27-2011, 07:14 AM
Like I said, HoN isn't aware of additional mouse keys which is essencially what you are after.
You may argue that it isn't and more keyboard extension but HON just isn't aware of additional mousebuttons (HoN only supports upto 9 mouse buttons and one keyboard)

If you want this to work you will need to refer to your distro's docu w.r.t. Xorg and keymapping to make this secondary keyboard (which essencially what it is) appear as part of the main keyboard

theShrimp
01-27-2011, 10:32 AM
I found a lil fix. When I play HoN in window mode, my bound keys are working.

Now I have to find a way to maximize the window over my whole screen (so that it looks like fullscreen)
or
get it working in fullscreen mode.

Naib
01-27-2011, 11:58 AM
ok thats interesting, so it is window-manager based.
might be worth spawning HoN in a second Xserver, ill paste the 1liner in a bit

theShrimp
01-27-2011, 12:56 PM
sounds promising :D

Naib
01-27-2011, 03:35 PM
newx() { DISPLAY=:1.0; xinit $* -- :1; };


execute that in a terminal, then type:
newx /path/to/hon.sh


I have that newx bash fn in my .bashrc

theShrimp
01-27-2011, 05:12 PM
dominik@Dome-desktop:~/Desktop$ newx() { DISPLAY=:1.0; xinit $* -- :1; };
dominik@Dome-desktop:~/Desktop$ newx /home/dominik/Applications/HoN/hon.sh

X: user not authorized to run the X server, aborting.
^Cgiving up.
xinit: No such file or directory (errno 2): unable to connect to X server
xinit: No such process (errno 3): unexpected signal 2.
dominik@Dome-desktop:~/Desktop$ sudo newx /home/dominik/Applications/HoN/hon.sh
sudo: newx: command not found
dominik@Dome-desktop:~/Desktop$


I think Im just to stupid, but something is not working ;)

edit: run those commands in the root-terminal now and it started hon at least... but well, hon didnt load my config at all (no login/pass was saved etc). nvm though, i tried to write into the chat with my mapped mousebuttons (testreasons), it didnt work.
but i think its because "xbindkeys" wasnt loaded/started (didnt run)
edit2: tried to change the hon-settings to window-mode to test whether my mapped keys work or not, but i cant change those. as soon as i apply the window-mode settings nothing happens^^

ty for your help anyways :)