OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

2 Pages V   1 2 >  
Reply to this topicStart new topic
> Right Click, the right way?
kkazakov13
post Feb 2 2008, 12:09 PM
Post #1





Group: Members
Posts: 409
Joined: 3-December 06
Member No.: 13,063



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.
Go to the top of the page
 
+Quote Post
Capn_Fish
post Feb 2 2008, 01:37 PM
Post #2





Group: Members
Posts: 2,350
Joined: 30-July 06
Member No.: 10,575



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.
Go to the top of the page
 
+Quote Post
kkazakov13
post Feb 2 2008, 10:41 PM
Post #3





Group: Members
Posts: 409
Joined: 3-December 06
Member No.: 13,063



How slowly means "Slowly" ? smile.gif Can I help? I'm programmer in real life.
Go to the top of the page
 
+Quote Post
ca1eb
post Feb 3 2008, 08:06 AM
Post #4





Group: Members
Posts: 28
Joined: 6-April 06
Member No.: 9,556



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.
Go to the top of the page
 
+Quote Post
Capn_Fish
post Feb 3 2008, 08:57 AM
Post #5





Group: Members
Posts: 2,350
Joined: 30-July 06
Member No.: 10,575



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.
Go to the top of the page
 
+Quote Post
Capn_Fish
post Feb 3 2008, 06:01 PM
Post #6





Group: Members
Posts: 2,350
Joined: 30-July 06
Member No.: 10,575



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

Attached File(s)
Attached File  mouseclick.tar.gz ( 684bytes ) Number of downloads: 12
 
Go to the top of the page
 
+Quote Post
ZDevil
post Mar 15 2008, 10:48 PM
Post #7





Group: Members
Posts: 2,003
Joined: 16-April 04
From: the Netherlands && /dev/null
Member No.: 2,882



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)
Attached File(s)
Attached File  mouseclick_debian.tar.gz ( 3.63K ) Number of downloads: 50
 
Go to the top of the page
 
+Quote Post
canguy247
post Mar 16 2008, 12:34 AM
Post #8





Group: Members
Posts: 70
Joined: 6-January 07
Member No.: 13,740



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
Go to the top of the page
 
+Quote Post
ZDevil
post Mar 16 2008, 12:52 AM
Post #9





Group: Members
Posts: 2,003
Joined: 16-April 04
From: the Netherlands && /dev/null
Member No.: 2,882



Oh sorry, just corrected the tarball. Please download again.
Go to the top of the page
 
+Quote Post
ca1eb
post Mar 17 2008, 11:47 PM
Post #10





Group: Members
Posts: 28
Joined: 6-April 06
Member No.: 9,556



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
Go to the top of the page
 
+Quote Post
gojira
post Mar 20 2008, 02:55 AM
Post #11





Group: Members
Posts: 124
Joined: 16-January 05
Member No.: 6,248



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.
Go to the top of the page
 
+Quote Post
ZDevil
post Mar 20 2008, 10:08 AM
Post #12





Group: Members
Posts: 2,003
Joined: 16-April 04
From: the Netherlands && /dev/null
Member No.: 2,882



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)?
Go to the top of the page
 
+Quote Post
gojira
post Mar 21 2008, 02:17 AM
Post #13





Group: Members
Posts: 124
Joined: 16-January 05
Member No.: 6,248



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
Go to the top of the page
 
+Quote Post
gojira
post Mar 22 2008, 05:38 PM
Post #14





Group: Members
Posts: 124
Joined: 16-January 05
Member No.: 6,248



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.
Go to the top of the page
 
+Quote Post
gojira
post Mar 22 2008, 05:57 PM
Post #15





Group: Members
Posts: 124
Joined: 16-January 05
Member No.: 6,248



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.
Go to the top of the page
 
+Quote Post

2 Pages V   1 2 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 20th October 2014 - 09:24 PM