mirror of
https://github.com/deunix-educ/mediadeck.git
synced 2026-11-25 04:39:42 +01:00
Add held mouse buttons (Left click / Right click toggles) to the Touchpad tab
Two toggle buttons in the free corners of the D-pad press and hold the PC's
left or right mouse button until tapped again, for drag and drop, text
selection and window moves, with the touchpad moving the pointer in between.
- New input action "button" ({button, pressed}); the state carries
input.buttons. VirtualInput remembers which connection pressed each button.
- A click on a held button is ignored so a touchpad tap does not drop the
drag; the other button stays usable. Repeating a state is a no-op.
- A held button is always released: when its client disconnects (only its own
buttons), when the server stops, and in the client when the tab is left or
the page is hidden.
- Incoming states are set aside for 500 ms after a local tap, so a state
already in flight cannot undo the toggle for a moment.
- D-pad rows are equal-sized (minmax(0, 1fr)) so the corner buttons do not
stretch the top row.
tests/test_input.py covers the device logic and the full server (disconnect,
several clients); tests/test_ui_mouse_hold.py drives a real Chromium. Also
checked through the real uinput device with its pointer grabbed exclusively.
README (fr/en) and CLAUDE.md are updated.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
+14
-1
@@ -12,7 +12,7 @@ The PC runs a small Python bridge; the tablet only needs a browser.
|
||||
| **Playing** | Cover art (or, failing that, an image of the file played), title (or file name), progress, play/pause, next/previous, shuffle, repeat, player volume, player selection | MPRIS (session D-Bus): Elisa, VLC, mpv, Firefox, Chromium, Spotify, Kodi… |
|
||||
| | **Volume bar** under the player: master volume, mute; the active output's button opens a window with the output selection (HDMI, Bluetooth…) and per-output volume; the bar is always visible | `pactl` (PipeWire or PulseAudio) |
|
||||
| **Media** | Sound, image and video files from the PC's folders, as icons or thumbnails, with search and sorting (name, date, size); a tap opens the file **on the PC** with the player chosen for its type | `gio`; folders and players: see "Media" |
|
||||
| **Touchpad** | Touchpad (click, right click, 2-finger scroll), D-pad, Esc, Space, F, F11…, text entry with the tablet's keyboard | `/dev/uinput`: works on X11 **and** Wayland |
|
||||
| **Touchpad** | Touchpad (click, right click, 2-finger scroll), D-pad with two **held** "Left click" / "Right click" toggle buttons (drag and drop, text selection), Esc, Space, F, F11…, text entry with the tablet's keyboard | `/dev/uinput`: works on X11 **and** Wayland |
|
||||
| **Launchers** | Configurable buttons: websites and installed applications (`/admin` page) | browser, `gio launch` |
|
||||
| **System** | Lock, sleep, restart, shut down (1 s long press): sensitive operations, kept apart from launchers | logind, `org.freedesktop.ScreenSaver` |
|
||||
|
||||
@@ -192,6 +192,19 @@ PC**; the tablet stays a remote control. A **long press** (or a right click) off
|
||||
or a frame taken from the video. Without an MPRIS player (image viewer, silent player), the tab shows the **last file
|
||||
opened** from the Media tab, with its title and image.
|
||||
|
||||
## Held mouse buttons (drag and drop)
|
||||
|
||||
In the Touchpad tab, the two free corners of the D-pad hold **Left click** and **Right click**: one tap **presses**
|
||||
the PC's mouse button, a second tap **releases** it (the button turns orange while it is down). In between, the
|
||||
touchpad moves the pointer: that is a drag and drop, a text selection or a window move. The two buttons are independent.
|
||||
|
||||
- While held, tapping the touchpad for the same button is ignored (it does not drop the drag); the other button stays
|
||||
usable (right click while the left one is held).
|
||||
- **Release is guaranteed**: a held button is released when you leave the Touchpad tab, when the page is hidden
|
||||
(screen off, another app) and by the server when the client's connection drops or the service stops. A button
|
||||
can never stay stuck on the PC.
|
||||
- Several tablets see the same state; one tablet disconnecting only releases its own buttons.
|
||||
|
||||
## Text entry
|
||||
|
||||
The **Keyboard** button of the Touchpad tab opens an entry window. You type with the tablet's own keyboard (accents,
|
||||
|
||||
Reference in New Issue
Block a user