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

Double Press to undo #2

Closed
isaacwisdom opened this issue Jun 20, 2021 · 4 comments
Closed

Double Press to undo #2

isaacwisdom opened this issue Jun 20, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@isaacwisdom
Copy link
Owner

How this will be implemented:

  1. Detect a double press of the button by watching the BTN_STYLUS events.
  2. On a double press, write events that do this:
    Tap the screen where the undo button is
    Tap the screen where the panel button is
    Tap the screen where the undo button is
    Tap the screen where the panel button is

We do the commands in that specific order so that it doesn't matter if the tool panel is out, the undo button will be pressed exactly once and the panel will be returned to its starting state.

Writing the tap events should be easy, but some testing will be needed to see if pen events should be used at /dev/input/event1 or touchscreen events at /dev/input/event2.
In either case, I think something will have to be done to prevent any data being written while the above events are written. Otherwise, conflicting data about the location of the touch (most likely from your palm being on the screen) or the location of the pen (from the pen hovering over the screen) will get in the way of the above commands.

Using ioctl and EVGIOC might help help that, but I think those are more for capturing the input generated by the kernel, and not for blocking the input events made by the kernel.

There is also the question of how quickly the above events can be written. The limiting factor will probably be how quickly the tool panel can open and close.

@isaacwisdom isaacwisdom added the enhancement New feature or request label Jun 20, 2021
@isaacwisdom
Copy link
Owner Author

So some preliminary testing suggests that using the touch events will actually work without having to capture the event data. Since the reMarkable supports multitouch (up to 10 points I believe), you can send in another point fairly easily. It'll just get interpreted as another touch point without interrupting the other events, and from what I can tell so far, xochitl will still acknowledge a press on the undo button when other touch points are still active.

@Toorero
Copy link

Toorero commented Jun 22, 2021

That sounds great. Will this work regardless of the orientation or left-/righthand-mode?

@isaacwisdom
Copy link
Owner Author

That sounds great. Will this work regardless of the orientation or left-/righthand-mode?

Good point, I forgot about that. It'll just be a different location to press if the orientation is different. I'll make sure to add an argument to accommodate the left hand orientation

@isaacwisdom
Copy link
Owner Author

closed with release 1.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants