Active Topics

 


Reply
Thread Tools
Posts: 45 | Thanked: 30 times | Joined on Feb 2010 @ Germany
#1
When running native applications, we always face the following problems:
  • You can't do right or middle clicks with the stylus
  • You can't do mouse-wheel
  • Even double-clicks are hard, because with the stylus it is difficult to hit the exact same spot twice

I remember a thread where qole tried to solve this problem, AFAIK without fully satisfying results

There is libktkstylus.so which solves the right-click problem, albeit only in gtk applications.

Then there are some solutions involving xbindkeys and xdotool, but they are difficult do set up and a bit messy.

So I was wondering: wouldn't it be possible to take the sources of xbindkeys and xdotool, do some copy-and-paste and some editing and end up with a simple stand-alone program ("stylus2mouse") which solves these problems one and for all on X11-level, i.e. regardless of the toolkit used?

Something like:
  • tap-tap-right is a right click
  • tap-tap-left is a middle-click
  • tap-tap-up is wheel-up
  • tap-tap-down is wheel down

I am not asking anyone to write this, I know I'll have to do this myself, but I'd like to hear some advice, so I don't set out to try the impossible. There are quite a number of things I am not sure about:
  • Can a stand-alone programm really eat up X-events? E.g. a mouse-down must be withheld until stylus2mouse decided that it is really a mouse-down and not part of a more complex gensture. This needs to be based on time.
  • Is xbindkeys a good source to lookup how to capture mouse-events or does it handle only keyboard events, as the name suggests?
 
Posts: 1,680 | Thanked: 3,685 times | Joined on Jan 2011
#2
mmm.

I have left + right + middle click on my stylus using xbindkeys. Stick the following in ~/.xbindkeysrc and invoke with:

Code:
xbindkeys -f /home/user/.xbindkeysrc
.xbindkeysrc:

Code:
"wmctrl -r :ACTIVE: -b toggle,fullscreen"                         
m:0x4 + c:65                                                    
Control + space

"xdotool click 2"
m:0x80 + b:1 + release

"xdotool click 3"
m:0x01 + b:1 + release

This puts middle click on blue+stylus down and right on shift+stylus down.

You can have it auto-start it by your favorite method of auto-starting. The above allows me to copy/paste in lxterm (under maemo) with just the mouse and keyboard, i.e. no stupid menu which is great if you like to run fullscreen.

This is simple, robust and not at all hacky.
__________________
N900: One of God's own prototypes. A high-powered mutant of some kind never even considered for mass production. Too weird to live, and too rare to die.
 

The Following 4 Users Say Thank You to vi_ For This Useful Post:
Posts: 85 | Thanked: 38 times | Joined on Sep 2010 @ Canada
#3
I won't be able to help out with anything technical i hope the knowledgeable folk jump in to do so. I'll just jump on the brainstorming bandwagon and suggest tap and hold to be the starting point for such mouse-events. What do others feel to be more natural?
 
Posts: 1,523 | Thanked: 1,997 times | Joined on Jul 2011 @ not your mom's FOSS basement
#4
Tap-and-hold for a right-click is achievable.
 
XiliX's Avatar
Posts: 356 | Thanked: 217 times | Joined on Aug 2010 @ Netherlands
#5
@vi
I installed xdotool and xbindkeys, but i dont get the idea that the rightclick works...
I want to use it to make the menu from livewallpaper-flash come up, so i can change the quality settings.
Can you tell me how i can check if it works, and how to fix it? Thanks!
 
Reply


 
Forum Jump


All times are GMT. The time now is 22:12.