Skip to content

Support for older hardware #86

@Esgeriath

Description

@Esgeriath

When I first lunched remouse I experienced massive but variable lag. Delay was fluctuating between barely noticeable and up to 2 seconds. I figured out that this was probably due to my old processor not being able to process input stream. I managed to get no lag with the cost of performance - I stopped processing 4 out of 5 mouse movements. Here's my code:

--- pynput.py	2023-10-13 10:30:57.464006570 +0200
+++ /home/esgeriath/.local/bin/pip/remarkable-mouse/lib/python3.11/site-packages/remarkable_mouse/pynput.py 2023-10-12 22:25:44.204987123 +0200
@@ -37,6 +37,7 @@
     x = y = 0

     stream = rm_inputs['pen']
+    counter = 0
     while True:
         try:
             data = stream.read(16)
@@ -61,6 +62,11 @@
                 mouse.release(Button.left)

         if codes[e_type][e_code] == 'SYN_REPORT':
+            if counter < 5:
+                counter += 1
+                continue
+
+            counter = 0
             mapped_x, mapped_y = remap(
                 x, y,
                 wacom_max_x, wacom_max_y,

Perhaps this could be added as a feature, with appropriate flag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions