LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Using all buttons of my trackball (https://www.linuxquestions.org/questions/linux-hardware-18/using-all-buttons-of-my-trackball-593957/)

calande 01-08-2008 05:18 AM

Ah, no, "%" is just to tell you it's from your prompt as a user (not as root). When I type:
Code:

%xev
You actually have to type:
Code:

xev
In your terminal as a user. Also remove the "#", when you see it, it means you have to type the command as root ;)

KohlInGA 01-08-2008 06:53 AM

Is my face :D RED! Its times like these that I've never appreciated Internet Anonymity more! Thanks again calande for all the help (and pointing out that painfully obvious error on my part)!

calande 01-09-2008 05:08 AM

No problem ;)
So, what functions did you assign to what buttons, just out of curiosity? :)

KohlInGA 01-09-2008 06:28 AM

Nothing special really. I pretty much have it programmed the same way it was when I ran Windows. Upper-left is now a single click. The lower-left is the right-click. I'd like to make upper-right drag & drop but I haven't figured out how to do that just yet. And the lower-right is now double click.

A Linux driver wasn't a concern when I bought this trackball (which I've been very happy with) because I wasn't using Linux back then. But it is now and if I'm going to drop 100+ USD on any hardware from now on, "Linux compatible" (drivers included) be a issue.

Many thanks again! Cheers!

calande 01-10-2008 04:52 AM

No problem. Personally, I don't know any trackball that comes with Linux drivers released by the manufacturer. But what functionality are you missing exactly? Is your trackball a Kensington one?

You would like to assign a button a drag & drop, but how can you drag something with a button? If you explain, I may be able to help you, as xmacroplay allows pretty much anything :)

KohlInGA 01-10-2008 07:47 AM

calande, you're a godsend!

Firstly, yes. My trackball is the Kensington Expert Mouse Pro. Exact same model pictured in werner1975's original post (don't know why they changed the name).

By drag I mean simulate holding down the left button. When used with Windows (driver installed), drag was one of the programmable options. It came in very handy for moving icons/objects which can be a bit of a knuckle buster if you have 10 thumbs like I do. Instead of holding down the left-click button and moving to another location with the rollerball then releasing the button, I could assign a button to just click and hold until released with a click from the normal left-click button. Its also great way to group objects.

calande 01-11-2008 04:47 AM

I see. I assume you would still have to move your marble to move the files elsewhere, right? If you want to just hold down your button, here's what you could try, assuming you want to assign the function to button 9:

Code:

"echo 'ButtonRelease 9 ButtonPress 1' | xmacroplay :0"
b:9

As you see, when you press and release button 9, it'll do as if you clicked and holded the click button down :)

KohlInGA 01-11-2008 07:17 PM

That should have been the last part of the puzzle but now when I start xbindkeys some kind of weird looping takes over the buttons and the only way to stop it is to reboot.

My modifications to xbindkeysrc:
Code:

"echo 'ButtonRelease 8 ButtonPress 1 ButtonRelease 1' | xmacroplay :0"
b:8

"echo 'ButtonRelease 1 ButtonPress 3 ButtonRelease 3' | xmacroplay :0"
b:1

"echo 'ButtonRelease 9 ButtonPress 1' | xmacroplay :0"
b:9

"echo 'ButtonRelease 3 ButtonPress 1 ButtonRelease 1 Delay 0.1 ButtonPress 1 ButtonRelease 1' | xmacroplay :0"
b:3

Trying to record what's going on:
Code:

xbindkeys -n -v >> | xbindkeys_what_is_going_on
ButtonRelease: 8
ButtonPress: 1
ButtonRelease: 1
ButtonRelease: 1
ButtonPress: 3
ButtonRelease: 3
ButtonRelease: 3
ButtonPress: 1
ButtonRelease: 1
Delay: 0
ButtonPress: 1
ButtonRelease: 1
ButtonRelease: 1
ButtonPress: 3
ButtonRelease: 3
ButtonRelease: 3
ButtonPress: 1
ButtonRelease: 1
Delay: 0
ButtonPress: 1
ButtonRelease: 1
ButtonRelease: 1
ButtonPress: 3
ButtonRelease: 3
ButtonRelease: 1
ButtonPress: 3
ButtonRelease: 3
ButtonRelease: 3
ButtonPress: 1
ButtonRelease: 1
Delay: 0
ButtonPress: 1
ButtonRelease: 1
displayName = :0
rc file = /home/kohl/.xbindkeysrc
4 keys in /home/kohl/.xbindkeysrc

min_keycode=8    max_keycode=255 (ie: know keycodes)
"echo 'ButtonRelease 8 ButtonPress 1 ButtonRelease 1' | xmacroplay :0"
    m:0x0 + b:8  (mouse)
"echo 'ButtonRelease 1 ButtonPress 3 ButtonRelease 3' | xmacroplay :0"
    m:0x0 + b:1  (mouse)
"echo 'ButtonRelease 9 ButtonPress 1' | xmacroplay :0"
    m:0x0 + b:9  (mouse)
"echo 'ButtonRelease 3 ButtonPress 1 ButtonRelease 1 Delay 0.1 ButtonPress 1 ButtonRelease 1' | xmacroplay :0"
    m:0x0 + b:3  (mouse)
starting loop...
Button press !
e.xbutton.button=8
e.xbutton.state=16
"echo 'ButtonRelease 8 ButtonPress 1 ButtonRelease 1' | xmacroplay :0"
    m:0x0 + b:8  (mouse)
got screen 0 for window a3
Start program with fork+exec call
Button release !
e.xbutton.button=8
e.xbutton.state=16
Button press !
e.xbutton.button=1
e.xbutton.state=16
"echo 'ButtonRelease 1 ButtonPress 3 ButtonRelease 3' | xmacroplay :0"
    m:0x0 + b:1  (mouse)
got screen 0 for window a3
Start program with fork+exec call
Button release !
e.xbutton.button=1
e.xbutton.state=272
Button press !
e.xbutton.button=3
e.xbutton.state=16
"echo 'ButtonRelease 3 ButtonPress 1 ButtonRelease 1 Delay 0.1 ButtonPress 1 ButtonRelease 1' | xmacroplay :0"
    m:0x0 + b:3  (mouse)
got screen 0 for window a3
Start program with fork+exec call
Catch CHLD signal -> pid 7278 terminated
Button release !
e.xbutton.button=3
e.xbutton.state=1040
Button press !
e.xbutton.button=1
e.xbutton.state=16
"echo 'ButtonRelease 1 ButtonPress 3 ButtonRelease 3' | xmacroplay :0"
    m:0x0 + b:1  (mouse)
got screen 0 for window a3
Start program with fork+exec call
Catch CHLD signal -> pid 7282 terminated
Button release !
e.xbutton.button=1
e.xbutton.state=272
Button press !
e.xbutton.button=1
e.xbutton.state=16
"echo 'ButtonRelease 1 ButtonPress 3 ButtonRelease 3' | xmacroplay :0"
    m:0x0 + b:1  (mouse)
got screen 0 for window a3
Start program with fork+exec call
Catch CHLD signal -> pid 7286 terminated
Button release !
e.xbutton.button=1
e.xbutton.state=272
Button press !
e.xbutton.button=3
e.xbutton.state=16
"echo 'ButtonRelease 3 ButtonPress 1 ButtonRelease 1 Delay 0.1 ButtonPress 1 ButtonRelease 1' | xmacroplay :0"
    m:0x0 + b:3  (mouse)
got screen 0 for window a3
Start program with fork+exec call
Catch CHLD signal -> pid 7290 terminated
Button release !
e.xbutton.button=3
e.xbutton.state=1040
Button press !
e.xbutton.button=1
e.xbutton.state=16
"echo 'ButtonRelease 1 ButtonPress 3 ButtonRelease 3' | xmacroplay :0"
    m:0x0 + b:1  (mouse)
got screen 0 for window a3
Start program with fork+exec call
Button press !
e.xbutton.button=3
e.xbutton.state=272
"echo 'ButtonRelease 3 ButtonPress 1 ButtonRelease 1 Delay 0.1 ButtonPress 1 ButtonRelease 1' | xmacroplay :0"
    m:0x0 + b:3  (mouse)
got screen 0 for window a3
Start program with fork+exec call
Button release !
e.xbutton.button=1
e.xbutton.state=1296
Button release !
e.xbutton.button=3
e.xbutton.state=1040
Button press !
e.xbutton.button=1
e.xbutton.state=16
"echo 'ButtonRelease 1 ButtonPress 3 ButtonRelease 3' | xmacroplay :0"
    m:0x0 + b:1  (mouse)
got screen 0 for window a3
Start program with fork+exec call
Button release !
e.xbutton.button=1
e.xbutton.state=272
Button press !
e.xbutton.button=3
e.xbutton.state=16
"echo 'ButtonRelease 3 ButtonPress 1 ButtonRelease 1 Delay 0.1 ButtonPress 1 ButtonRelease 1' | xmacroplay :0"
    m:0x0 + b:3  (mouse)
got screen 0 for window a3
Start program with fork+exec call
Catch CHLD signal -> pid 7302 terminated
Button release !
e.xbutton.button=3
e.xbutton.state=1040
Button press !
e.xbutton.button=1
e.xbutton.state=16
"echo 'ButtonRelease 1 ButtonPress 3 ButtonRelease 3' | xmacroplay :0"
    m:0x0 + b:1  (mouse)
got screen 0 for window a3
Start program with fork+exec call
Catch CHLD signal -> pid 7306 terminated
Button release !
e.xbutton.button=1
e.xbutton.state=272
Button press !
e.xbutton.button=1
e.xbutton.state=16
"echo 'ButtonRelease 1 ButtonPress 3 ButtonRelease 3' | xmacroplay :0"
    m:0x0 + b:1  (mouse)
got screen 0 for window a3
StButtonRelease: 3
ButtonPress: 1
ButtonRelease: 1
Delay: 0
ButtonPress: 1
ButtonRelease: 1
ButtonRelease: 1
ButtonPress: 3
ButtonRelease: 3
ButtonRelease: 1
ButtonPress: 3
ButtonRelease: 3
ButtonRelease: 3
ButtonPress: 1
ButtonRelease: 1
Delay: 0
ButtonPress: 1
ButtonRelease: 1
ButtonRelease: 1
ButtonPress: 3
ButtonRelease: 3
ButtonRelease: 1
ButtonPress: 3
ButtonRelease: 3
ButtonRelease: 1
ButtonPress: 3
ButtonRelease: 3
ButtonRelease: 3
ButtonPress: 1
ButtonRelease: 1
Delay: 0
ButtonPress: 1
ButtonRelease: 1
ButtonRelease: 1
ButtonPress: 3
ButtonRelease: 3
ButtonRelease: 3
ButtonPress: 1
ButtonRelease: 1
Delay: 0
ButtonPress: 1
ButtonRelease: 1
ButtonRelease: 3
ButtonPress: 1
ButtonRelease: 1
Delay: 0
ButtonPress: 1
ButtonRelease: 1
ButtonRelease: 1
ButtonPress: 3
ButtonRelease: 3
art program with fork+exec call
        .
        .
        .
(Repeat above)

Way above my pay grade.

calande 01-11-2008 07:38 PM

Yep, you need to tidy xbindkeysrc a little bit. I can see that button 8 depends on button 1, which depends on button 3, and so forth... So if you click the upper-right button, I guess the computer may go crazy :)


All times are GMT -5. The time now is 12:42 AM.