Author Topic: Right Click  (Read 26425 times)

kkazakov13

  • Sr. Member
  • ****
  • Posts: 408
    • View Profile
Right Click
« 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.
SL-C3200 ** FOR SALE :( **
https://www.oesf.org/forum/index.php?showtopic=25969

Canon K30225 CF wireless card
Taxan iTax-LAN10 wired card
My packages for customized pdaXrom beta 3

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
Right Click
« Reply #1 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.
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo

kkazakov13

  • Sr. Member
  • ****
  • Posts: 408
    • View Profile
Right Click
« Reply #2 on: February 03, 2008, 01:41:38 am »
How slowly means "Slowly" ?  Can I help? I'm programmer in real life.
SL-C3200 ** FOR SALE :( **
https://www.oesf.org/forum/index.php?showtopic=25969

Canon K30225 CF wireless card
Taxan iTax-LAN10 wired card
My packages for customized pdaXrom beta 3

ca1eb

  • Newbie
  • *
  • Posts: 22
    • View Profile
Right Click
« Reply #3 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.
« Last Edit: May 30, 2008, 05:04:38 am by ca1eb »
My OESF account is caONEeb, not caLeb.

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
Right Click
« Reply #4 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.
« Last Edit: February 03, 2008, 12:08:47 pm by Capn_Fish »
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
Right Click
« Reply #5 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
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Right Click
« Reply #6 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)
« Last Edit: March 16, 2008, 04:51:51 am by ZDevil »

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

canguy247

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
Right Click
« Reply #7 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
SL-C1000 - Debian 2.6.24.4-yonggun (from SD)
Pandora preordered
4GB Transcend 150X SD
16GB AData CF
USB Host cable
Bluetooth USB Dongle/Linksys WCF12 CF Wifi
TRENDnet TE-CF100 10/100 Wired ethernet CF / DM9601 usb ethernet
Palm III keyboard neoprene case

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Right Click
« Reply #8 on: March 16, 2008, 04:52:55 am »
Oh sorry, just corrected the tarball. Please download again.

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

ca1eb

  • Newbie
  • *
  • Posts: 22
    • View Profile
Right Click
« Reply #9 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
« Last Edit: April 24, 2008, 06:19:04 am by ca1eb »
My OESF account is caONEeb, not caLeb.

gojira

  • Full Member
  • ***
  • Posts: 122
    • View Profile
Right Click
« Reply #10 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.
Zaurus SL-C3200 Debian EABI / Sharp ROM (tetsu v18j), Socket CF Bluetooth (Rev E), BT747 GPS, Canon K30225 CF Wifi.  RIP: Zaurus SL-C860 Sharp ROM (1.40JP).

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Right Click
« Reply #11 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.
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)?

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

gojira

  • Full Member
  • ***
  • Posts: 122
    • View Profile
Right Click
« Reply #12 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.
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 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 if you have trouble building that one

this all works fine on a debian/i386 system, haven't tried it on the z yet
Zaurus SL-C3200 Debian EABI / Sharp ROM (tetsu v18j), Socket CF Bluetooth (Rev E), BT747 GPS, Canon K30225 CF Wifi.  RIP: Zaurus SL-C860 Sharp ROM (1.40JP).

gojira

  • Full Member
  • ***
  • Posts: 122
    • View Profile
Right Click
« Reply #13 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.
« Last Edit: March 23, 2008, 08:58:48 pm by gojira »
Zaurus SL-C3200 Debian EABI / Sharp ROM (tetsu v18j), Socket CF Bluetooth (Rev E), BT747 GPS, Canon K30225 CF Wifi.  RIP: Zaurus SL-C860 Sharp ROM (1.40JP).

gojira

  • Full Member
  • ***
  • Posts: 122
    • View Profile
Right Click
« Reply #14 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.
Zaurus SL-C3200 Debian EABI / Sharp ROM (tetsu v18j), Socket CF Bluetooth (Rev E), BT747 GPS, Canon K30225 CF Wifi.  RIP: Zaurus SL-C860 Sharp ROM (1.40JP).