OESF Portables Forum

Everything Else => Zaurus Distro Support and Discussion => Distros, Development, and Model Specific Forums => Archived Forums => Debian => Topic started by: kkazakov13 on February 02, 2008, 03:09:31 pm

Title: Right Click
Post by: kkazakov13 on February 02, 2008, 03:09:31 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.

 any ideas?

Ah, even tap and hold would work when keyboard cannot be used.
Title: Right Click
Post by: Capn_Fish on February 02, 2008, 04:37:39 pm
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.
Title: Right Click
Post by: kkazakov13 on February 03, 2008, 01:41:38 am
How slowly means "Slowly" ?  Can I help? I'm programmer in real life.
Title: Right Click
Post by: ca1eb on February 03, 2008, 11:06:05 am
Quote from: kkazakov13
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 (http://packages.debian.org/libgtkstylus).
Title: Right Click
Post by: Capn_Fish on February 03, 2008, 11:57:57 am
Quote from: kkazakov13
How slowly means "Slowly" ?  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.
Title: Right Click
Post by: Capn_Fish on February 03, 2008, 09:01:09 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).

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: [Select]
g++ -o mouseclick mouseclick.cpp -lX11
Title: Right Click
Post by: ZDevil on March 16, 2008, 02:48:03 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!

(The tarball is corrected now)
Title: Right Click
Post by: canguy247 on March 16, 2008, 04:34:28 am
Quote from: 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!

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

Canguy
Title: Right Click
Post by: ZDevil on March 16, 2008, 04:52:55 am
Oh sorry, just corrected the tarball. Please download again.
Title: Right Click
Post by: ca1eb on March 18, 2008, 03:47:25 am
Quote from: Capn_Fish
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.  

Download:
mouseclick-20080424.tar.gz (http://www.calno.com/moto/gcin/mouseclick-20080424.tar.gz)
Title: Right Click
Post by: gojira on March 20, 2008, 06:55:16 am
Quote from: 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.

 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 (http://www.geocities.jp/fred_b_maciel/kbd/kbd-e.html).
Title: Right Click
Post by: ZDevil on March 20, 2008, 02:08:07 pm
Quote from: gojira
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 (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)?
Title: Right Click
Post by: gojira on March 21, 2008, 06:17:47 am
Quote from: ZDevil
Quote from: gojira
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 (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: [Select]
xdpyinfo|grep XKEYBOARDI 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: [Select]
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 (http://cita.disability.uiuc.edu/software/accessx/freewareaccessx.php) and build, then run
Code: [Select]
ax +mousekeysto turn it on.  there's a few other options at http://www.math.missouri.edu/%7Estephen/software/#accessx (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
Title: Right Click
Post by: gojira on March 22, 2008, 09:38:54 pm
Quote from: gojira
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.
Title: Right Click
Post by: gojira on March 22, 2008, 09:57:48 pm
Quote from: 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).

I guess you can use XSelectInput.  See xsnoop.c for an example.
Title: Right Click
Post by: ZDevil on March 23, 2008, 07:36:42 am
Quote from: gojira
Quote from: gojira
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.
Title: Right Click
Post by: datathief on April 21, 2008, 10:22:32 am
Quote from: 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.

 any ideas?

Ah, even tap and hold would work when keyboard cannot be used.
Might evrouter (http://www.bedroomlan.org/~alexios/coding_evrouter.html) help with this?
Title: Right Click
Post by: ca1eb on April 24, 2008, 06:22:16 am
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 (http://www.calno.com/moto/gcin/mouseclick-20080424.tar.gz)

And, I found xdotool may help on this topic:
http://www.semicomplete.com/projects/xdotool/ (http://www.semicomplete.com/projects/xdotool/)
Title: Right Click
Post by: scottlfa on July 20, 2008, 11:34:30 pm
there going to be a deb of this, would be cool once done.  I liked the Fn + Tap for the right click.
Title: Right Click
Post by: axeTail on July 24, 2008, 06:46:17 am
Quote from: scottlfa
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....
Title: Right Click
Post by: scottlfa on August 30, 2008, 01:35:35 pm
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: [Select]
#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 (https://www.oesf.org/forum/index.php?s=&showtopic=25459&view=findpost&p=175322)
Title: Right Click
Post by: axellira on June 21, 2009, 04:34:03 am
Quote from: kkazakov13
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 (http://live.gnome.org/Mousetweaks/Home). For debian, you can get the mousetweaks and at-spi packages. To make it work, just run:

Code: [Select]
/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
Title: Right Click
Post by: Capn_Fish on June 29, 2009, 11:44:45 am
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: [Select]
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.