Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Multimedia Mouse - HOW TO
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
vorgas
n00b
n00b


Joined: 02 Nov 2005
Posts: 48

PostPosted: Sat Nov 05, 2005 6:11 pm    Post subject: Multimedia Mouse - HOW TO Reply with quote

Version 0.51 "Divide and conquerl" has been released

One instance of mmm3k can now monitor multiple devices. See the USAGE file for how to start mmm3k.

!! Runs as a service again !!

NOT JUST FOR MICE ANYMORE!!!!!!

  • Now mmm3k works with keyboards, joysticks, and remotes. Anything that sends events through the evdev framework.
  • No reconfiguration of X is required.
  • Utilities to help you set up your events
  • User level and global configuration
  • Send different events depending on the active window
  • Rapid fire (autorepeat) now available
  • Definable Profiles
  • Works in a terminal!


Oh man, this is getting so sweet, I'm about to wet myself!
I'm working on an ebuild (anybody that can help me with this?) and a configuration front end.

INTRODUCTION
Do you have usb remote control? Got one of those mice with more buttons than the crusty old guards think you need? Tired of only being able to send keysyms with imwheel? Want your volume buttons to adjust something other than Master? Want your wireless mouse to be your convergence remote control? How about joystick events? Can't use your multimedia keyboard at the same time as your mouse?

If you answered yes to any of these, then this is for you.

A few bits before continuing:

  • Your device must actually work. Getting your usb mouse to move its pointer about the screen is outside the scope of this how-to.
  • If you don't have evdev in your kernel, you'll need to recompile. If so, find the necessary docs elsewhere if you need to.
  • More than likely you need to have udev system. I don't have a devfs system around, so I can't test it.
  • You have to be running a 2.6 kernel. There is a possibility that a 2.6.12 or greater kernel is required, but I don't know for a fact.
  • You need to do everything as root.
  • I assume you know how to edit a file. If you don't, you really to find the appropriate tutorial.


MMM3K
mmm3k is a hack of evtest by Vojtech Pavlik. It translates raw evdev events into commands. This means it exists outside the normal xevent framework. That's right. No hacking about with xmodmap, trying to get it to run. You can get mmm3k from:
http://sourceforge.net/projects/mmm3k

In fact, you need to go get it. Right now. Not a lot can be done until you have it.
Once you get it, extract the tarball and change to that directory. Then compile
and install:
Code:
tar -xvjf mmm3k-0.51.tar.bz2
cd mmm3k


Now, check out the README file, and follow the instructions therein. It includes
instructions on the new mapping utility.
Code:
less README


OTHER PACKAGES
mmm3k can translate any button press into any command, so you'll need the programs that provide the commands you want. But, most of what you want is to adjust your volume and send some keypresses to a running window. By default, mmm3k uses xvkbd and amixer, so get those. You'll also need xdpyinfo and xprop, along with python.
Code:
emerge xvkbd alsa-utils xdpyinfo xprop python


GETTING HELP
If you need help with mmm3k, please don't post questions here. Use the support forum at https://forums.gentoo.org/viewtopic-p-2854506.html#2854506
or better yet the sourceforge help forum at
http://sourceforge.net/forum/?group_id=152154

Please reserve this area for tips on getting your specific mouse to work.


Last edited by vorgas on Fri Jul 28, 2006 6:42 pm; edited 7 times in total
Back to top
View user's profile Send private message
obsrv
Apprentice
Apprentice


Joined: 19 Aug 2005
Posts: 167
Location: Panevėžys, Lithuania

PostPosted: Sun Jan 08, 2006 1:01 pm    Post subject: Reply with quote

I think this should be posted to www.gentoo-wiki.org :)
Back to top
View user's profile Send private message
Stolz
Moderator
Moderator


Joined: 19 Oct 2003
Posts: 3007
Location: Hong Kong

PostPosted: Sun Jan 08, 2006 3:32 pm    Post subject: Reply with quote

What are the advantages of using mmm3k instead of xbindkeys? xbindkeys can translate any button press into any command. I've used it for years and it works like a charm :)

It's easy to configure. Supose you want button8 opens xedit, button9 opens xcalc and button10 mounts /mnt/backup

Step 1:
Code:
# emerge xbindkeys


Estep 2: Create ~./xbindkeysrc with the content
Quote:
"xedit"
b:8

"xcalc"
b:9

"mount /mnt/backup"
b:10


easy. doesn't it?
Back to top
View user's profile Send private message
vorgas
n00b
n00b


Joined: 02 Nov 2005
Posts: 48

PostPosted: Mon Jan 09, 2006 2:30 am    Post subject: xbindkeys Reply with quote

Well, the real problem with xbindkeys, AFAIK, is that it moves through the X framework. I have not been able to get X to recognize all the buttons on my mouse, even following every guide I could find. Some buttons would be duplicated, like wheel-left was the same as button 2. So, while it may be easier to bind keys to actions, the problem lies in getting those button presses recognized IN THE FIRST PLACE.

That's where mmm3k comes in.

But, if you happen to have a mouse with left button, right button, middle button, wheel up, wheel down, wheel left, wheel right, volume up, volume down, skip forward, skip back, page forward, page back, pause, and media and you can figure out how to get them all to work with xbindkeys, then PLEASE PLEASE PLEASE let me know. I would rather not continue development of something that's not necessary.
Back to top
View user's profile Send private message
Stolz
Moderator
Moderator


Joined: 19 Oct 2003
Posts: 3007
Location: Hong Kong

PostPosted: Mon Jan 09, 2006 10:50 am    Post subject: Re: xbindkeys Reply with quote

So mmm3k works for mouses that are not recognized by evedev, interesting... that was what I want to know :) (BTW, I did't know there were mouses that don't work with evedev 8O )

Well, I've a Logitech MX500. I don't know what are the 'official' names of the buttons. I name them as the program xev does, that is: Button1, Button2 .... Button10.

Currently I've all the non standar buttonts binded, either to a key combination, either to a program. For me, standar buttons are Button1, Button2 and Button3, which by default use to be binded in all systems to left click, right click and paste respectively. So I can say evdev+xbindkeys+imwheel works for me for Buttons 7 to 10. That's the reason I was asking what are the advantages of mmm3k.

I don't know if the MX500 can be considered similar to your mouse, but if it helps here is my configuration (only for a X scenario, if you need to bind buttons in a non X scenario, go for mmm3k :)). If you want to know anything else, just let me know and I'll try to help you as much as I can.

First, enable evedev support in the kernel:
Code:
Device Drivers --->
    Input device support --->
        <M> Event interface

Load the 'evdev' module and then run 'xev' to see if all buttons are recognized
Code:
# xev


If they are, configure you mouse like:
Code:
Section "InputDevice"
        Identifier "Logitech MX500 evdev"
        Driver     "mouse"
        Option     "Device" "/dev/input/event1"
        Option     "Protocol" "evdev"
        Option     "Buttons" "10"
        Option     "ZAxisMapping"  "9 10"
        Option     "Emulate3Buttons"    "0"
EndSection


If ther are not, or some of them are duplicated, check Logiech Applet, MCtl or Locomoto.

Make sure you load the next commands when X starts (see the wiki to learn how to do it):
Code:
xmodmap -e "pointer = 1 2 3 6 7 8 9 10 4 5"
imwheel -k -b "67"
xbindkeys


Emerge xbindkeys to bind buttons to commands, and/or imwheel to bind buttons to keys combinations:
Code:
# emerge xbindkeys imwheel


The sample config for xbindkeys and buttons 8,9, and 10 is in my previous post.

With the current mouse config, buttons 6 and 7 are binded to the scroll function. So at the moment, ony buttons 4 an 5 are not binded to anything useful but we are going to solve it right now :)

To configure imwheel in order it execs "ALT+F4"(close aplication) when button4 is pressed and execs "ALT+TAB"(window switch) when button5 is pressed, create the file ~/.imwheelrc with the content:
Code:
".*"
None, Down,Alt_L|F4
None, Up,Alt_L|Tab


And thats all. Now the 10 buttons of my mouse have the functions:
Button1: left click
Button2: Rigt click (usually contextual menu)
Button3: Middel click (usually paste funtion)
Button4: ALT+F4 (usually close application) This button is in the upper left side of my mouse
Button5: ALT+TAB (usually window switch funtion) This button is in the botton left side of my mouse
Button6: Wheel up (usually scroll up)
Button7: Wheel down (usually scroll down)
Button8: Execs "xedit". This button is upon the wheel up button.
Button9: Execs "xcalc". This button is down the wheel down button.
Button10: Execs "mount /mnt/backup". This button is down the Button9.

Of course, all the functions asigned to the buttons can be customized. I think the files ~/.imwheelrc and ~/.xbindkeysrc are self-explanatory :)

Hope it helps.


Last edited by Stolz on Mon Jan 09, 2006 11:01 am; edited 1 time in total
Back to top
View user's profile Send private message
dpetka2001
l33t
l33t


Joined: 04 Mar 2005
Posts: 804

PostPosted: Mon Jan 09, 2006 11:01 am    Post subject: Reply with quote

if someone wants horizontal scrolling aswell how would the above configuration file be altered?? i have the MX3100 wireless desktop set and have difficulties setting it to work correctly using evdev...so is mmm3k the solution to me for making it to work??
Back to top
View user's profile Send private message
Stolz
Moderator
Moderator


Joined: 19 Oct 2003
Posts: 3007
Location: Hong Kong

PostPosted: Mon Jan 09, 2006 11:08 am    Post subject: Reply with quote

dpetka2001 wrote:
if someone wants horizontal scrolling aswell how would the above configuration file be altered?? i have the MX3100 wireless desktop set and have difficulties setting it to work correctly using evdev...so is mmm3k the solution to me for making it to work??

I don't know how mmm3k works, but, with above config I've suggested, omit all the imwheel related instructions and buttons 4 and 5 will be binded to horizontal scroll by default and without extra config :)

If you want to asign other buttons distinct than 4 and 5, just play a little with xmodmap.
Back to top
View user's profile Send private message
vorgas
n00b
n00b


Joined: 02 Nov 2005
Posts: 48

PostPosted: Mon Jan 09, 2006 12:29 pm    Post subject: Button Failure Reply with quote

Yes, it appears that if you have less than 12 buttons, using the X framework will work just fine, as Stotz mentions. The problem I had, with the media mouse, is there are 15 buttons. So I had real issues getting everything to work the way I wanted. Also, and I'm not positive about this, but it seemed that I couldn't get the imwheel/xbindkeys thing to recognize when a button was held down. This would be important for things like volume control.


As to it working for mice that aren't recognized by evdev, I believe that's wrong. In fact, the evdev framework is a requirement for mmm3k. mmm3k provides a workaround to the limitations of X. And, as you mentioned, it can be set to work in a non-X scenario.

I hadn't seen lomoco in my research, so I'll definately look into that. Thanks for the info!
Back to top
View user's profile Send private message
Rick
Tux's lil' helper
Tux's lil' helper


Joined: 18 Dec 2002
Posts: 141

PostPosted: Sat May 20, 2006 1:16 am    Post subject: Reply with quote

I'm currently using mmm3k and it looks like it's working ok :P

Altough I'd have to say an ebuild would be nice and making a service out of it wouldn't be a bad idea either but for now it works very good :)

Great job :D
_________________
Have you ever noticed how stable windows is?
Neither have I :D
Back to top
View user's profile Send private message
vorgas
n00b
n00b


Joined: 02 Nov 2005
Posts: 48

PostPosted: Sat May 20, 2006 3:38 pm    Post subject: Working Reply with quote

Thanks Rick,

I will be working on ebuild/service issues, along with some other issues raised by slalomsk8er, when I get done with this movie shoot. Should be another week.

Once you have it up and running, I would dearly like to get ahold of the config file for your mouse so I can include it in the distro. Be sure to put any credit info you want at the top of the file.
Thanks!
Back to top
View user's profile Send private message
Rick
Tux's lil' helper
Tux's lil' helper


Joined: 18 Dec 2002
Posts: 141

PostPosted: Sat May 20, 2006 4:04 pm    Post subject: Reply with quote

I'm not really using a mouse though, I was looking for a way to get my new remote working ;)

The Logitech UltraX Media Remote
This thing: http://www.aware.ch/images/oem_ultrax_med_rem_r_3qr_mr.jpg

I'm not completely done configuring yet, I just want it to work with Amarok so I can control my music from anywhere in my room (and probably outside of my room too, it an RF remote)
_________________
Have you ever noticed how stable windows is?
Neither have I :D
Back to top
View user's profile Send private message
Rick
Tux's lil' helper
Tux's lil' helper


Joined: 18 Dec 2002
Posts: 141

PostPosted: Sat May 20, 2006 6:51 pm    Post subject: Re: Working Reply with quote

The config file (after a few sed/grep/awk's)

lsusb output: 046d:c101
Logitech UltraX Media Remote
Filename: 46dc101
Code:
Action=1 Code=102 Value=1 Command=IGNORE #Home#
Action=1 Code=113 Value=1 Command=IGNORE #Mute#
Action=1 Code=114 Value=1 Command=IGNORE #VolumeDown#
Action=1 Code=115 Value=1 Command=IGNORE #VolumeUp#
Action=1 Code=119 Value=1 Command=IGNORE #Pause#
Action=1 Code=129 Value=1 Command=IGNORE #Again#
Action=1 Code=130 Value=1 Command=IGNORE #Props#
Action=1 Code=139 Value=1 Command=IGNORE #Menu#
Action=1 Code=140 Value=1 Command=IGNORE #Calc#
Action=1 Code=144 Value=1 Command=IGNORE #File#
Action=1 Code=156 Value=1 Command=IGNORE #Bookmarks#
Action=1 Code=158 Value=1 Command=IGNORE #Back#
Action=1 Code=159 Value=1 Command=IGNORE #Forward#
Action=1 Code=163 Value=1 Command=IGNORE #NextSong#
Action=1 Code=164 Value=1 Command=IGNORE #PlayPause#
Action=1 Code=165 Value=1 Command=IGNORE #PreviousSong#
Action=1 Code=166 Value=1 Command=IGNORE #StopCD#
Action=1 Code=167 Value=1 Command=IGNORE #Record#
Action=1 Code=168 Value=1 Command=IGNORE #Rewind#
Action=1 Code=172 Value=1 Command=IGNORE #HomePage#
Action=1 Code=173 Value=1 Command=IGNORE #Refresh#
Action=1 Code=206 Value=1 Command=IGNORE #Close#
Action=1 Code=207 Value=1 Command=IGNORE #Play#
Action=1 Code=208 Value=Forward Command=IGNORE #Fast Forward#
Action=1 Code=226 Value=1 Command=IGNORE #Media#
Action=1 Code=362 Value=1 Command=IGNORE #Program#
Action=1 Code=368 Value=1 Command=IGNORE #Language#
Action=1 Code=370 Value=1 Command=IGNORE #Subtitle#
Action=1 Code=371 Value=1 Command=IGNORE #Angle#
Action=1 Code=377 Value=1 Command=IGNORE #TV#
Action=1 Code=385 Value=1 Command=IGNORE #Radio#
Action=1 Code=389 Value=1 Command=IGNORE #DVD#
Action=1 Code=391 Value=1 Command=IGNORE #MP3#
Action=1 Code=392 Value=1 Command=IGNORE #Audio#
Action=1 Code=393 Value=1 Command=IGNORE #Video#
Action=1 Code=398 Value=1 Command=IGNORE #Red#
Action=1 Code=402 Value=1 Command=IGNORE #ChannelUp#
Action=1 Code=403 Value=1 Command=IGNORE #ChannelDown#
Action=1 Code=405 Value=1 Command=IGNORE #Last#
Action=1 Code=410 Value=1 Command=IGNORE #Shuffle#

_________________
Have you ever noticed how stable windows is?
Neither have I :D
Back to top
View user's profile Send private message
vorgas
n00b
n00b


Joined: 02 Nov 2005
Posts: 48

PostPosted: Tue May 23, 2006 1:12 am    Post subject: New version Reply with quote

version 0.33 is released. I've edited the top post to reflect changes.
Back to top
View user's profile Send private message
Rick
Tux's lil' helper
Tux's lil' helper


Joined: 18 Dec 2002
Posts: 141

PostPosted: Tue May 23, 2006 2:38 am    Post subject: Reply with quote

I see the ebuild is not working yet, still need help with that?

The problem is quite simple, gentoo uses a sandbox for compiling, your Makefile is trying to write outside of that sandbox, moving/copying files should be done in the ebuild :)

Oh, btw I'm running it on an AMD Opteron and it works so you can add ~amd64 to the ebuild ;)
_________________
Have you ever noticed how stable windows is?
Neither have I :D
Back to top
View user's profile Send private message
Rick
Tux's lil' helper
Tux's lil' helper


Joined: 18 Dec 2002
Posts: 141

PostPosted: Mon Jul 03, 2006 1:42 pm    Post subject: Reply with quote

I've edited the init script a bit :P
Code:
#!/sbin/runscript
# mmm3k     This shell script takes care of starting and stopping
#       the mmm3k evdev conversion utility

# Copyright (c) by Mike Hill <vorgas@gmail.com>

#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA

# ChangeLog:
#
# 2006.05.20 - Mike Hill
# Initial creation
#
# 2006.07.03 - Rick van Hattem
# Changed it to a Gentooish init script

OPTS="${opts}"
EXEC='/usr/bin/mmm3k'

depend() {
    need bootmisc localmount
}

terminate() {
    pcount=`ps -A | grep -c mmm3k`
    if [ $pcount -eq 0 ]
        then
        ewarn "No mmm3k processes running"
        return 0
    else
        killall -9 mmm3k
    fi
}

start() {
    if [ -z $USER ]
        then
        USER="root"
        ebegin "Starting mmm3k as $USER (insecure, set USER in /etc/conf.d/${SVCNAME})"
    else
        ebegin "Starting mmm3k as $USER"
    fi
    if [ -z $DEVICE ]
        then
        ewarn "No devices defined in /etc/conf.d/mmm3k"
        eend 1
    else
        for c in ${DEVICE}
            do
            if [ ! -e $DEVICE ]
                then
                ewarn "!! Device $c does not exist !!"
            else
                start-stop-daemon --start --exec ${EXEC} --chuid $USER --background -- $c
            fi
        done
    fi
    eend 0
}

stop() {
    ebegin "Stopping ${SVCNAME}"
    start-stop-daemon --signal 9 --exec ${EXEC}
    eend 0
}

_________________
Have you ever noticed how stable windows is?
Neither have I :D
Back to top
View user's profile Send private message
vorgas
n00b
n00b


Joined: 02 Nov 2005
Posts: 48

PostPosted: Sun Jul 09, 2006 11:54 pm    Post subject: Gentooish Reply with quote

Thanks for that init script. I've incorporated the changes you suggested. A bit of a warning though, the way you have it doesn't fail in a gentooish way if a device is listed in /etc/conf.d/mmm3k, but the device doesn't exist.
Back to top
View user's profile Send private message
Rick
Tux's lil' helper
Tux's lil' helper


Joined: 18 Dec 2002
Posts: 141

PostPosted: Mon Jul 10, 2006 12:09 am    Post subject: Reply with quote

Hmm, you are correct, and now I think of it, it probably doesn't handle multiple devices either...

Ah well, if I'll have some spare time then I'll see if I can change it, for now it works (atleast for me it is ;) )
_________________
Have you ever noticed how stable windows is?
Neither have I :D
Back to top
View user's profile Send private message
vorgas
n00b
n00b


Joined: 02 Nov 2005
Posts: 48

PostPosted: Mon Jul 10, 2006 4:53 pm    Post subject: Init Reply with quote

Don't worry about it. The new version also allows axis events, which is a whole other specification. I've folded your changes into the new one. So, thanks for making it work the Gentoo way!
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 2860
Location: Bay Area, CA

PostPosted: Mon Jul 10, 2006 6:28 pm    Post subject: Reply with quote

in portage, when?
Back to top
View user's profile Send private message
vorgas
n00b
n00b


Joined: 02 Nov 2005
Posts: 48

PostPosted: Tue Jul 11, 2006 4:12 pm    Post subject: Portage Reply with quote

I'm afraid that won't happen for a while. I've tried to do an ebuild, but can't seem to get it to work. The docs I've read say that any properly made Makefile should work, but I can't find docs on a properly made Makefile. The devs in irc just point me to the docs, but not even anywhere specific. I certainly understand that mentality, but at this point I have stuff I need to do that's more important than reading a couple hundred pages of documentation.

If anybody out there knows how to make an ebuild, than that's certainly one step closer to being in portage. Until then, I'm more interested in getting mmm3k to a point that makes me happy and works the way I want it to.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum