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

Support for older hardware #86

Open
Esgeriath opened this issue Oct 13, 2023 · 0 comments
Open

Support for older hardware #86

Esgeriath opened this issue Oct 13, 2023 · 0 comments

Comments

@Esgeriath
Copy link

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.

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

No branches or pull requests

1 participant