Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mouse gesture control #53

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

cybermaus
Copy link

Redo after cleaning up my own fork, I messed it up, this should be a clean offer.
Apologies for the mess of retracted PR, I am new to this.

Simple mouse gesture control

A monitoring station can now simply use a mouse as a cheap simple ubiquitous control device, so no keyboard or IR remote needs to be present. The gestures are made so that accidental moving or touching of the mouse will not do anything, or not do anything significant:

Tested with when running from CLI and from GUI desktops. This gesture driver does not need a mouse being maintained by X The mouse will not be visible and there is no need for a absolute mouse position.

-normal left click --> does nothing
-normal mouse movement --> does nothing
-normal right click --> injects SPACE (pause/unpause)
-normal scroll wheel down, up --> injects ENTER, ESC (single/grid view)

The latter two do not require the video stream to be stopped and restarted, so is acceptable if it happens by accidental touch

While left mouse button down:

-move left, right, up, down --> injects LEFT, RIGHT, UP, DOWN keystroke
-right click --> injects B keystroke (blank screen, this is a separate addition in my fork, but does not hurt here)

Special sequence to insert Q (Quit)

  • Left down; Right down; Left release; Right Release

I purposely did not assign/use double click, as I presume that would directly zoom to a specific camera, once we also add absolute positioning and a visible mouse.

raspicamplayer and others added 13 commits July 24, 2021 09:46
I have 10 old DVI monitors that result in tvservice yielding "state 0x6 [DVI CUSTOM RGB full unknown AR], 1440x900 @ 60.00Hz, progressive" which is not properly processed by utils.py. Since tvservice does this for every resolution the monitors support, rather then keep changing the config, I traced the source.

Sidenote: tvservice does normally read and list the monitors mode. Only when asking the active status does it list custom. So the root problem is probably somewhere in tvservice:

pi@raspberrypi:~ $ tvservice --device 2 -s
state 0x6 [DVI CUSTOM RGB full unknown AR], 1440x900 @ 60.00Hz, progressive
pi@raspberrypi:~ $ tvservice --device 2 -m DMT
Group DMT has 16 modes:
           mode 4: 640x480 @ 60Hz 4:3, clock:25MHz progressive
           mode 5: 640x480 @ 72Hz 4:3, clock:31MHz progressive
           mode 6: 640x480 @ 75Hz 4:3, clock:31MHz progressive
           mode 8: 800x600 @ 56Hz 4:3, clock:36MHz progressive
           mode 9: 800x600 @ 60Hz 4:3, clock:40MHz progressive
           mode 10: 800x600 @ 72Hz 4:3, clock:50MHz progressive
           mode 11: 800x600 @ 75Hz 4:3, clock:49MHz progressive
           mode 16: 1024x768 @ 60Hz 4:3, clock:65MHz progressive
           mode 17: 1024x768 @ 70Hz 4:3, clock:75MHz progressive
           mode 18: 1024x768 @ 75Hz 4:3, clock:78MHz progressive
           mode 21: 1152x864 @ 75Hz 4:3, clock:108MHz progressive
           mode 32: 1280x960 @ 60Hz 4:3, clock:108MHz progressive
           mode 35: 1280x1024 @ 60Hz 5:4, clock:108MHz progressive
           mode 36: 1280x1024 @ 75Hz 5:4, clock:135MHz progressive
  (prefer) mode 47: 1440x900 @ 60Hz 16:10, clock:106MHz progressive
           mode 48: 1440x900 @ 75Hz 16:10, clock:136MHz progressive
normal left click --> does nothing
normal mouse movement --> does nothing

while left mouse button down:
  left, right, up, down  --> inserts left, right, up, down keystroke
  right click --> inserts Q keystroke (quit program)

normal right click --> inserts SPACE keystroke (pause/unpause)
normal scroll up/down --> inserts 1 or 0 keystroke (zoom/unzoom)

Example: to enlarge camera 3, zoom with scroll will, then holding
the mouse button down move right 2 times
This reverts commit 1dc83b5.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants