Author Topic: How to emulate right mouse click  (Read 1828 times)

DReymann

  • Newbie
  • *
  • Posts: 34
    • View Profile
How to emulate right mouse click
« on: December 24, 2018, 06:25:14 am »
Hi,

after playing around with X11 on zalarm there is one thing I do net get solved. Btw., it is a great way of understanding arch linux more and more ...

A lot of the desktop environments make use of the right mouse click, e.g. for opening the menu.
On other devices with touch screen it is mostly done by having a long touch on the screen. But that does not work on the zaurus.

I tried some "tricks" like mapping a key to a mouseclick within Xmodmap (e.g. "keycode 68 = PointerButton2", keycode 68 is the Button for the addressbook down left on the keyboard).
Testing with xev shows, that the keyevent happens, but there seem to be no mouse device?

Clicking on the screen shows events e.g. "ButtonRelease event, serial 45" or "MotionNotify event, serial 45". 45 is related to the touchscreen?
Holding the pen on the screen leads to a permanent row of events, nothing like a "long press" event or so.

So, is there any way to have a right click on the touch screen?

I will look on the internet, whether there are other examples for this touchscreen. Maybe with a raspberry.
Any hint would great.

Detlev

Just to add:

the output of cat /proc/bus/input/devices is


I: Bus=0019 Vendor=0000 Product=0000 Version=0000
N: Name="matrix-keypad"
P: Phys=
S: Sysfs=/devices/platform/matrix-keypad/input/input0
U: Uniq=
H: Handlers=kbd event0
B: PROP=0
B: EV=100013
B: KEY=168a 1800017 fb5ff47f f3ffdffc
B: MSC=10

I: Bus=0019 Vendor=0001 Product=0001 Version=0100
N: Name="gpio-keys"
P: Phys=gpio-keys/input0
S: Sysfs=/devices/platform/gpio-keys/input/input1
U: Uniq=
H: Handlers=event1 apm-power
B: PROP=0
B: EV=400021
B: SW=3

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="ADS7846 Touchscreen"
P: Phys=spi2.0/input0
S: Sysfs=/devices/platform/pxa2xx-spi.2/spi_master/spi2/spi2.0/input/input2
U: Uniq=
H: Handlers=mouse0 event2
B: PROP=0
B: EV=b
B: KEY=400 0 0 0 0 0 0 0 0 0 0
B: ABS=1000003
« Last Edit: December 24, 2018, 06:43:21 am by DReymann »

greguu

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 393
    • View Profile
    • http://github.com/greguu
How to emulate right mouse click
« Reply #1 on: December 24, 2018, 04:03:24 pm »
Quote from: DReymann
Hi,

after playing around with X11 on zalarm there is one thing I do net get solved. Btw., it is a great way of understanding arch linux more and more ...

A lot of the desktop environments make use of the right mouse click, e.g. for opening the menu.
On other devices with touch screen it is mostly done by having a long touch on the screen. But that does not work on the zaurus.

I tried some "tricks" like mapping a key to a mouseclick within Xmodmap (e.g. "keycode 68 = PointerButton2", keycode 68 is the Button for the addressbook down left on the keyboard).
Testing with xev shows, that the keyevent happens, but there seem to be no mouse device?

Clicking on the screen shows events e.g. "ButtonRelease event, serial 45" or "MotionNotify event, serial 45". 45 is related to the touchscreen?
Holding the pen on the screen leads to a permanent row of events, nothing like a "long press" event or so.

So, is there any way to have a right click on the touch screen?

I will look on the internet, whether there are other examples for this touchscreen. Maybe with a raspberry.
Any hint would great.

Detlev

Just to add:

the output of cat /proc/bus/input/devices is


I: Bus=0019 Vendor=0000 Product=0000 Version=0000
N: Name="matrix-keypad"
P: Phys=
S: Sysfs=/devices/platform/matrix-keypad/input/input0
U: Uniq=
H: Handlers=kbd event0
B: PROP=0
B: EV=100013
B: KEY=168a 1800017 fb5ff47f f3ffdffc
B: MSC=10

I: Bus=0019 Vendor=0001 Product=0001 Version=0100
N: Name="gpio-keys"
P: Phys=gpio-keys/input0
S: Sysfs=/devices/platform/gpio-keys/input/input1
U: Uniq=
H: Handlers=event1 apm-power
B: PROP=0
B: EV=400021
B: SW=3

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="ADS7846 Touchscreen"
P: Phys=spi2.0/input0
S: Sysfs=/devices/platform/pxa2xx-spi.2/spi_master/spi2/spi2.0/input/input2
U: Uniq=
H: Handlers=mouse0 event2
B: PROP=0
B: EV=b
B: KEY=400 0 0 0 0 0 0 0 0 0 0
B: ABS=1000003

Yes, there is away. pdaxrom used [Fn] + [screen tap] = right-click.
I do not have the Xorg mapping required in front of me, but this information may be in the pdaxrom forum here on oesf.org if you search for it or inside the pdaxrom rootfs itself.

Xorg has builtin mouse emulation, too - you can try:

Code: [Select]
Option "XkbOptions" "keypad:pointerkeys""-" would then perform a right click.
To activate the mouse emulation press: (you may need to map Num Lock first as I do not believe it is mapped in the default keymap):

 Alt+Left Shift+Num Lock
Gemini-PDA (Stock Android) / LG Nexus 5 (Sailfish OS) / Nokia N9 (MeeGo/Harmattan)
Sharp Zaurus C3100 (Borzoi) - Void Linux (voidz) Kernel 5.0.0 - Hardware (Buffalo CF LAN, DLink 660 CF WiFi, ASIX AX88772 USB Ethernet)

DReymann

  • Newbie
  • *
  • Posts: 34
    • View Profile
How to emulate right mouse click
« Reply #2 on: December 25, 2018, 10:35:39 am »
Quote from: greguu
Yes, there is away. pdaxrom used [Fn] + [screen tap] = right-click.
I do not have the Xorg mapping required in front of me, but this information may be in the pdaxrom forum here on oesf.org if you search for it or inside the pdaxrom rootfs itself.

Xorg has builtin mouse emulation, too - you can try:

Code: [Select]
Option "XkbOptions" "keypad:pointerkeys""-" would then perform a right click.
To activate the mouse emulation press: (you may need to map Num Lock first as I do not believe it is mapped in the default keymap):

 Alt+Left Shift+Num Lock

Hi,

thanks for the answer.

So to get it correct. Add the Option line to /etc/X11/xorg.conf.d/99-touchscreen.conf ?

And where are Alt and Num Lock on the zaurus. Alt might be Fn, but Num Lock?

Detlev

greguu

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 393
    • View Profile
    • http://github.com/greguu
How to emulate right mouse click
« Reply #3 on: January 11, 2019, 01:24:46 am »
Quote from: DReymann
Quote from: greguu
Yes, there is away. pdaxrom used [Fn] + [screen tap] = right-click.
I do not have the Xorg mapping required in front of me, but this information may be in the pdaxrom forum here on oesf.org if you search for it or inside the pdaxrom rootfs itself.

Xorg has builtin mouse emulation, too - you can try:

Code: [Select]
Option "XkbOptions" "keypad:pointerkeys""-" would then perform a right click.
To activate the mouse emulation press: (you may need to map Num Lock first as I do not believe it is mapped in the default keymap):

 Alt+Left Shift+Num Lock

Hi,

thanks for the answer.

So to get it correct. Add the Option line to /etc/X11/xorg.conf.d/99-touchscreen.conf ?

And where are Alt and Num Lock on the zaurus. Alt might be Fn, but Num Lock?

Detlev

Hi Detlev,
probably not much help, but you can use the borzoi Xorg keyboard config file and modify it to map NumLock to another key.
https://www.oesf.org/forum/index.php?showto...st&p=282236
Greguu
Gemini-PDA (Stock Android) / LG Nexus 5 (Sailfish OS) / Nokia N9 (MeeGo/Harmattan)
Sharp Zaurus C3100 (Borzoi) - Void Linux (voidz) Kernel 5.0.0 - Hardware (Buffalo CF LAN, DLink 660 CF WiFi, ASIX AX88772 USB Ethernet)