Help - Search - Members - Calendar
Full Version: Right Click
OESF Forums > Distros, Development, and Model Specific Forums > Distro Support and Discussion > Debian
kkazakov13
Is it possible to have something like

Fn + tap = right click ( ONE time only ) ?

Not like "To change in right click mode, press something, to change it back to left click mode, press something else". I hate this.

smile.gif any ideas?

Ah, even tap and hold would work when keyboard cannot be used.
Capn_Fish
I'm slowly working on an Xlib program that does just that (Angstrom has the same issue), but, not having used Xlib before, it's going VERY slowly.
kkazakov13
How slowly means "Slowly" ? smile.gif Can I help? I'm programmer in real life.
ca1eb
QUOTE(kkazakov13 @ Feb 3 2008, 04:09 AM) *
Is it possible to have something like
Fn + tap = right click ( ONE time only ) ?

It seems that xbindkeys can do that (I have not tried it).

.xbindkeysrc segment in yonggun's setting:
#Middle Click
"xmodmap -e "pointer = 2 3 1""
m:0x0 + c:68
XF86LaunchB

#Right click
"xmodmap -e "pointer = 3 1 2""
m:0x0 + c:76
XF86LaunchC

And, you can try libgtkstylus in GTK+ 2.x based applications. It emulates stylus right click effect.
You can download it here.
Capn_Fish
QUOTE(kkazakov13 @ Feb 3 2008, 12:41 AM) *
How slowly means "Slowly" ? smile.gif Can I help? I'm programmer in real life.

Well, right now I'm trying to figure out how to just make a click event happen. Once I get that, it ought to just be a matter of checking for a key's state (ex, Fn) at every mouse button event. If it's down, grab the mouse button event and make a new one, except with a different button.

So if you know how to use Xlib or can figure out how to do that with Xlib, that would be very helpful.

EDIT: I think I've got it now. Hopefully some code will be up soon.
Capn_Fish
OK, it appears I'd either need to put the code in the WM (going to do that for EvilWM) or give the daemon a window (no idea how that would work).

Here's the code that will instantly click the right mouse button. Do what you want with it, I'll hopefully be able to post something more functional later.

It should compile with the command
CODE
g++ -o mouseclick mouseclick.cpp -lX11
ZDevil
Here are the compiled EABI binaries for mouse right and middle buttons. The source is included.

To use: Just drop the binaries somewhere, and use a WM configuration tool to assign the keymapping. Press them to make the "clicks". No tap or no switching back and forth is needed.

Thanks, Capn_Fish!

(The tarball is corrected now)
canguy247
QUOTE(ZDevil @ Mar 16 2008, 02:48 AM) *
Here are the compiled EABI binaries for mouse right and middle buttons. The source is included.

To use: Just drop the binaries somewhere, and use a WM configuration tool to assign the keymapping. Press them to make the "clicks". No tap or no switching back and forth is needed.

Thanks, Capn_Fish!


Thanks for the file zdevil! Just to let you know though, this is the source file, not binary.

Canguy
ZDevil
Oh sorry, just corrected the tarball. Please download again.
ca1eb
QUOTE(Capn_Fish @ Feb 4 2008, 10:01 AM) *
mouseclick.tar.gz

Hi, I simplified this C++ program to pure C program.
It links less libraries and responds a little more quickly (for machine).
(Of course, human can not feel the tiny speed up...)

Just extract the tarball and run "make" in the directory.
Thanks to Capn_Fish for the information. smile.gif

Download:
mouseclick-20080424.tar.gz
gojira
QUOTE(kkazakov13 @ Feb 3 2008, 07:09 AM) *
Is it possible to have something like

Fn + tap = right click ( ONE time only ) ?

Not like "To change in right click mode, press something, to change it back to left click mode, press something else". I hate this.

smile.gif any ideas?

Ah, even tap and hold would work when keyboard cannot be used.


If the X server supports the XKB extension you can use xmodmap to map the mouse buttons onto the keyboard, see http://www.geocities.jp/fred_b_maciel/kbd/kbd-e.html.
ZDevil
QUOTE(gojira @ Mar 20 2008, 11:55 AM) *
If the X server supports the XKB extension you can use xmodmap to map the mouse buttons onto the keyboard, see http://www.geocities.jp/fred_b_maciel/kbd/kbd-e.html.

Interesting...
So what does "...On .xinitrc, I read the symbols with xmodmap from a file that contains the lines below. This maps the keys to the buttons; shift-key combinations lock/unlock the buttons..." means? How to check the keycodes for Pointer_Button1/2/3 (not in /etc/X11/kb/blah/*.xmodmap)?
gojira
QUOTE(ZDevil @ Mar 21 2008, 05:08 AM) *
QUOTE(gojira @ Mar 20 2008, 11:55 AM) *
If the X server supports the XKB extension you can use xmodmap to map the mouse buttons onto the keyboard, see http://www.geocities.jp/fred_b_maciel/kbd/kbd-e.html.

Interesting...
So what does "...On .xinitrc, I read the symbols with xmodmap from a file that contains the lines below. This maps the keys to the buttons; shift-key combinations lock/unlock the buttons..." means? How to check the keycodes for Pointer_Button1/2/3 (not in /etc/X11/kb/blah/*.xmodmap)?


ok, for this to work, you need these 3 things:

1) an x server with XKB support. xfree/x.org and commercial servers have this. check with
CODE
xdpyinfo|grep XKEYBOARD

I haven't checked with the x servers on the z (xfbdev or something?) but I think I saw someone using the standard debian x.org server...

2) a key with a keysym called Pointer_Button[1-3]. e.g. use
CODE
xmodmap -e 'keysym F12 = Pointer_Button3'

see the xmodmap man page for more

3) MouseKeys turned on. this makes the keys with the Pointer_Button keysyms generate the click event. get Freeware AccessX from http://cita.disability.uiuc.edu/software/a...wareaccessx.php and build, then run
CODE
ax +mousekeys

to turn it on. there's a few other options at http://www.math.missouri.edu/%7Estephen/software/#accessx if you have trouble building that one

this all works fine on a debian/i386 system, haven't tried it on the z yet
gojira
QUOTE(gojira @ Mar 20 2008, 09:55 PM) *
If the X server supports the XKB extension you can use xmodmap to map the mouse buttons onto the keyboard

Of course, that's not really useful for a touchscreen! I was distracted by the program to generate click events and forgot about the original idea... This is great for a one-button trackpad (I'm looking at you, MacBook), but for a touchscreen, there's no mouse move, just click and drag, so it only lets you right/middle-click somewhere where you already just left clicked...

xbindkeys might do what you want though if you use the press event to change the mapping and the release event to put it back.
gojira
QUOTE(Capn_Fish @ Feb 4 2008, 01:01 PM) *
OK, it appears I'd either need to put the code in the WM (going to do that for EvilWM) or give the daemon a window (no idea how that would work).


I guess you can use XSelectInput. See xsnoop.c for an example.
ZDevil
QUOTE(gojira @ Mar 23 2008, 02:38 AM) *
QUOTE(gojira @ Mar 20 2008, 09:55 PM) *
If the X server supports the XKB extension you can use xmodmap to map the mouse buttons onto the keyboard

My mistake, that's not really useful for a touchscreen. It's great for a one-button trackpad (I'm looking at you, MacBook), but for a touchscreen, there's no mouse move, just click and drag, so it only lets you right/middle-click somewhere where you already just left clicked...
xbindkeys might do what you want if you use the press event to change the mapping and the release event to put it back.

True, but xbindkeys has a bit lagging and a little overhead in real use on the Z.
So far I find the mouseclick solution the best in terms of resource and ease of use, despite, as you mention, the need to implement the click where the pointer/cursor goes. But I can live with that.
datathief
QUOTE(kkazakov13 @ Feb 2 2008, 08:09 PM) *
Is it possible to have something like

Fn + tap = right click ( ONE time only ) ?

Not like "To change in right click mode, press something, to change it back to left click mode, press something else". I hate this.

smile.gif any ideas?

Ah, even tap and hold would work when keyboard cannot be used.

Might evrouter help with this?
ca1eb
I updated the C version of mouseclick, and provides armel stripped binaries.

Source code has no change, just add strip option in the Makefile.

mouseclick-20080424.tar.gz

And, I found xdotool may help on this topic:
http://www.semicomplete.com/projects/xdotool/
scottlfa
there going to be a deb of this, would be cool once done. I liked the Fn + Tap for the right click.
axeTail
QUOTE(scottlfa @ Jul 21 2008, 05:34 AM) *
there going to be a deb of this, would be cool once done. I liked the Fn + Tap for the right click.


Yeah, could someone please provide a deb file ???? thanks....
scottlfa
Seems 2ro0 and ZDevil I think have found a solution that works.

First part is in .xbindkeysrc this one works for me with the fn as the right click button.
CODE
#mouse-click-m
"mouse-r"
    m:0x10 + b:1
    Mod2 + Mode_switch

#mouse-click-m
"mouse-m"
    m:0x1 + b:1
    Shift + Shift_L


and ZDevil's program here
axellira
QUOTE(kkazakov13 @ Feb 2 2008, 12:09 PM) *
Ah, even tap and hold would work when keyboard cannot be used.


I personaly prefer this way. In case you guys are still looking for this, there is Mousetweaks, from the gnome project. Don't worry, it won't hurt to install. Just some minor gnome libraries.It can be downloaded here. For debian, you can get the mousetweaks and at-spi packages. To make it work, just run:

CODE
/usr/lib/at-spi/at-spi-registryd
mousetweaks -e delay


You can make it run with your favorite session manager by adding these two to the init scripts.
The debian packages can be easily (?) ported to angstrom and pdaxrom.

Regards.
Axel Lira
Capn_Fish
I might as well throw my latest in here as well...

My current setup just uses Fluxbox's event grabber to run "xmodmap -e 'pointer = 3 2 1'" or similar commands. I also have it change the cursor so I can visually check what button will be pressed at any given time.

The other option (I haven't tried this yet) is to add
CODE
Option          "EmulateRightButton"    "1"

to the "input" section of xorg.conf. That SHOULD enable press-and-hold right clicking.

Like I said, I haven't tried it, so YMMV.

Hope that helps somebody.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.