Emulate proper drawing-tablet behavior via uinput#5
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5fc7ff9af2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| { .type = EV_KEY, .code = BTN_TOOL_PEN, .value = touching ? 1 : 0 }, | ||
| { .type = EV_SYN, .code = SYN_REPORT, .value = 0 } | ||
| }; | ||
| write(tab_fd, btn, sizeof(btn)); | ||
| pen_in_range = touching; |
There was a problem hiding this comment.
Keep BTN_TOOL_PEN asserted while pointer remains in range
On every BTN_LEFT release this block emits BTN_TOOL_PEN=0 and immediately sets pen_in_range=false, even if the finger/stylus is still producing ABS movement. That creates spurious out-of-range/in-range transitions around normal click-release actions (the next ABS event re-asserts range), which can reset hover state or fragment strokes in tablet consumers.
Useful? React with 👍 / 👎.
| if (config.enable_buttons && | ||
| ev.type == EV_KEY && | ||
| ev.code == BTN_LEFT) { |
There was a problem hiding this comment.
Emit BTN_TOUCH for pressure-only input paths
Contact reporting is currently gated on EV_KEY/BTN_LEFT, so devices that provide ABS_PRESSURE but do not emit BTN_LEFT never produce BTN_TOUCH transitions. Since this commit now advertises tablet keys and forwards pressure, pressure-capable sources can still fail to register pen-down in apps that require BTN_TOUCH (common in tablet input handling).
Useful? React with 👍 / 👎.
Summary
BTN_TOUCH,BTN_TOOL_PEN,BTN_STYLUS) and direct-input property (INPUT_PROP_DIRECT)ABS_PRESSUREwith passthrough ranges when the source device supports pressureBTN_TOOL_PEN, including cleanup when Tosu deactivates absolute modeNotes
Codex Task