Author Topic: mapping additional mouse buttons  (Read 7346 times)

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
mapping additional mouse buttons
« on: August 15, 2008, 04:52:00 am »
Just wondering if anybody has done this.

I have a Fiire remote and like it, however frankly most of the time we are using it just for the Menu button and then a standard Logitech wireless USB mouse to navigate and select as it is much faster and more acurate!

Problem of course is the mouse doesn't have a menu button (or media for that matter)

It does, however, have a couple of back/forward buttons and a wheel, etc.

Has anybody managed to map additional mouse buttons to do any LMCE functions? This is just a standard wireless mouse, no additional drivers, just plug and play with LMCE.

I know a device template is supposed to be set up for it but I wouldn't have a clue where to start with that - and my logic(?!) Is that the current buttons are mapped by something (either Kubuntu or LMCE) so perhaps I can just extend that...

I would love to have the back/forward buttons mapped as Menu and Media, and perhaps the wheel as volume. But I'm guessing the latter would require not just mapping but also and event handler to receive those events from the orbiter (?) And in turn generate the appropriate DCE commands and send them to the pipe to control the Amp...

seth

  • Guru
  • ****
  • Posts: 485
  • A day w/o LinuxMCE is like a day w/o sunshine!
    • View Profile
Re: mapping additional mouse buttons
« Reply #1 on: August 15, 2008, 01:36:28 pm »
 ;)
This is the wiki entry for enabling your mouse buttons to function for menu, ambience, and chapter/channel : http://wiki.linuxmce.org/index.php/Use_Additional_Mouse_Buttons.

I used to use this with my wireless mouse until I purchased the Gyration Remote.

Hope that helps. And always remember, the wiki is your friend.  ;D

Regards,

Seth
".....Because Once you've LinuxMCE'd....."
System stats located at my user page:

http://wiki.linuxmce.org/index.php/User:Seth

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: mapping additional mouse buttons
« Reply #2 on: August 15, 2008, 10:58:05 pm »
Cool, thanks boys! Will try that today :)

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: mapping additional mouse buttons
« Reply #3 on: August 16, 2008, 02:21:54 am »
hmmm.... seems to work perfectly in KDE desktop (I even substituted the command it runs for echo "Hello" >> /tmp/test & and it is writing to the file, no problem)

But in LMCE it doesn't work at all... Does it need somehow to specify that the mouse events are captured from all screens/windows?

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: mapping additional mouse buttons
« Reply #4 on: August 17, 2008, 03:30:48 am »
Seth - have you any more suggestions? I have searched high and low, but can't find anything that suggests how to capture the events when in the Orbiter. Works perfectly on the desktop, just not actually in LMCE!

xbindkeys seems to have a display option (assuming this the the X display number), so I'm assuming that this set's which display it is capturing the events from (but it doesn't explain it) - LMCE seems to use virtual desktops and switches between them for KDE and LMCE itself, do these equate to X displaynames? Could that be the problem? And why does this not appear to have been an issue in the past???  So closeeee.....

seth

  • Guru
  • ****
  • Posts: 485
  • A day w/o LinuxMCE is like a day w/o sunshine!
    • View Profile
Re: mapping additional mouse buttons
« Reply #5 on: August 18, 2008, 01:38:17 pm »
 :)
Once xbindkeys is set, it should work with the orbiter. This is how I got the Gyration remote some additional functionality.  I have added the line `xbindkeys /etc/.Xbindkeys to the /usr/pluto/bin/lmce_launch_manager.sh scirpt before the KDE_DEBUG=1 line, so that it starts automatically when the core starts. I have not had to change anything else,

I am not sure why it is not working. The location of the .Xmodmap file can be just about anywhere, I just put it in /etc.

Did you use the `xev` command to find your mouse button numbers?

Just curious.


Regards,

Seth
".....Because Once you've LinuxMCE'd....."
System stats located at my user page:

http://wiki.linuxmce.org/index.php/User:Seth

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: mapping additional mouse buttons
« Reply #6 on: August 18, 2008, 02:07:44 pm »
yeah, I put it in lmce_launch_manager.sh where does the .xmodmap come into it?

I used xev and got the button numbers (and used your xorg tip so that all the button numbers are different, as they weren't, and that worked), and in KDE pressing the buttons generates the same characters as pressing the F keys. And when I changed the file to execute an echo command that works as well.... but all only in KDE, not within the Orbiter!

Open to any suggestions!!

unruhschuh

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: mapping additional mouse buttons
« Reply #7 on: January 15, 2009, 10:30:49 pm »
Same problem here: The two extra buttons on my logitech mouse are mapped to F6 and F7 which I confirmed with xev in xterm. But when I switch to the Orbiter the menus won't show up. They show up when I hit F6 or F7 on the keyboard. Any suggestions?

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: mapping additional mouse buttons
« Reply #8 on: January 15, 2009, 11:12:50 pm »
unruhschuh - sorry I never got to the bottom of this, didn't know where to go next! Let me know if you manage it :)

unruhschuh

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: mapping additional mouse buttons
« Reply #9 on: January 15, 2009, 11:55:13 pm »
That's sad :(

What I tried so far is to map an 'echo "something" > /home/linuxme/bla.txt' to one of the mouse buttons so everytime I hit that button there's a new line with "something" in the file. After activating the Orbiter and pressing the button several times there are no lines added to the file. My guess is, that Orbiter itself captures the mouse button events before xbindkeys does. Maybe there's a way to run xbindkeys with higher priority or whatever to be the first application to captere the events, but I don't know how.

I only wonder why this problem is not reported more often, as there must be a lot of people using their more-than-three-button-mouses with linuxmce instead of a gyromouse, or am I wrong?  Btw.: how are the three extra buttons on the gyro mouse mapped to the menu functions?

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: mapping additional mouse buttons
« Reply #10 on: January 16, 2009, 12:21:29 am »
Your echo test is precisely what I did too! Same result and conclusion. But the person I got this process from seemed to think it worked... My thought would be to start a new thread with a link to this thread and ensure it has a clear, descriptive and interesting subject line to attract attention. There are plenty of others out there that would know the inner working of this and perhaps a step we missed

unruhschuh

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: mapping additional mouse buttons
« Reply #11 on: January 16, 2009, 12:30:58 am »
The funny thing is, that it sometimes works. I don't know when and why, but after a fresh reboot the menus sometimes show up when I press the mouse buttons. Pretty random behavior. My next guess is that xbindkeys must be started before the Orbiter to capture the events and somehow sometimes Orbiter or xbindkeys starts first, but I seriously doubt that. I'll try to find out anyway.

Did it ever work with your mouse?

I downloaded the newest version of xbindkeys and compiled it but that doesn't solve the problem either.

unruhschuh

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: mapping additional mouse buttons
« Reply #12 on: January 16, 2009, 12:49:56 am »
Dude! It works! Here's how:

It's not a solution, but more like a work around. I'm shure there's a bug in Orbiter.

I just restarted LinuxMCE and the mappings didn't work. I played back a video and suddenly it worked. After stopping the video and playing back some audio it still works. As soon as I switch to the KDE-Desktop and back to the Orbiter it doesn't work anymore, but after starting a video it works again. I tried this three to four times and it always works. Could you try that and tell me your experiences?

So something happens when I start playing a video. That must be interesting for the developers. But I should have gone to bed hours ago so I'll try to submit a bugreport tomorrow.

nighty night zzzzZzzZzzzz

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: mapping additional mouse buttons
« Reply #13 on: January 16, 2009, 12:54:51 am »
hmmm... will check when I can...

But note, that clicking either left or right mouse click will bring up the menu anyway when no media is playing - this happens in a default install with no mods. Its only when media is playing that this function doesn't work for me, either in a default install (because that is per design) or after modding...

Let me know if it is still working for you when you wake up and take this into account.

Col.

unruhschuh

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: mapping additional mouse buttons
« Reply #14 on: January 16, 2009, 09:29:43 am »
It works while playing media as well. Not only the menu works, but I also can fast-forward/backward, change chapters. Stuff that you do with F6.