PeterCxy / evdev-right-click-emulation

Implement Long-Press-to-Right-Click on Touchscreen Linux Devices with Xorg or Wayland
Do What The F*ck You Want To Public License
90 stars 32 forks source link

Menu disappears once finger is off the screen #16

Open trifu22 opened 2 years ago

trifu22 commented 2 years ago

The menu disappears once the finger is off the screen. So one long click > right click is simulated and the menu shows up Need to select an option from the menu (finger is lifted from the touchscreen in order to select copy or paste for example) > menu disappears before I can do that. Using Raspbian Bullseye. Touchscreen: MageDok T116D Pro

richardquint commented 2 years ago

I think the problem has to do with the expected behaviour of a right click and the context menus and a timing issue.

Using a mouse, a right click brings up a context menu with no item selected. If you then move the mouse cursor over the menu, the items are highlighted as the cursor hovers over them and then a left click will select. If instead of a simple right click you hold the button down and move the cursor, if you release it over a highlighted item it is selected and if you release it while the cursor is not over the menu it just closes the menu.

Using evdev-rce, a long press brings up the context menu, but lifting the stylus or your finger usually causes the menu to close. Experimenting I have found you can slide over the menu and sometimes you get highlighting to work, but most of the time it doesn't. I have been unable to figure out what to do to consistently get it to work.

I'm using an Adafruit resistive PiTFT on a Pi3B with an up-to-date version of Bullseye. With the same hardware, I still have the SD card with my Buster installation and have right click working as described above using a separate file

/usr/share/X11/xorg.conf.d/98-calibration-right-click.conf

Section "InputClass" Identifier "RightClickCalibration" Driver "evdev" MatchProduct "stmpe-ts" Option "EmulateThirdButton" "1" Option "EmulateThirdButtonTimeout" "500" Option "EmulateThirdButtonMoveThreshold" "150" EndSection

arohrbacher commented 1 month ago

Hi all, I am having the same problem: when a long-touch registers as a right-click, a context menu appears, but it immediately disappears when I lift the finger again; "swiping" across the context menu doesn't let me select any items. Oddly, only when I swipe the cursor to a "greyed-out" context menu item, the context menu stays when lifting the finger (and I can actually select context menu items). However, this "workaround" doesn't always work: sometimes a context menu doesn't have any "greyed-out" items...

I am on a Raspberry Pi 4 4GB, 32bit Bullseye, the touch screen is a QDtech MPI7003

Is there anything one can do to make the context menus work? Unfortunately, without working context menus right-clicking is not too useful in my case...

Thanks...