Skip to content

Emulate proper drawing-tablet behavior via uinput#5

Open
sciboy12 wants to merge 1 commit intocodex/consolidate-cleanup-patch-for-abs-c.c-and-tosuhandler.cfrom
codex/update-abs-c.c-for-drawing-tablet-support
Open

Emulate proper drawing-tablet behavior via uinput#5
sciboy12 wants to merge 1 commit intocodex/consolidate-cleanup-patch-for-abs-c.c-and-tosuhandler.cfrom
codex/update-abs-c.c-for-drawing-tablet-support

Conversation

@sciboy12
Copy link
Copy Markdown
Owner

Summary

  • update the virtual uinput device to advertise tablet-like capabilities instead of mouse-like minimal ABS_X/ABS_Y only
  • add tablet keys (BTN_TOUCH, BTN_TOOL_PEN, BTN_STYLUS) and direct-input property (INPUT_PROP_DIRECT)
  • expose and emit ABS_PRESSURE with passthrough ranges when the source device supports pressure
  • synthesize basic pressure from left-button state when pressure is unavailable so tablet consumers still receive contact data
  • emit in-range / out-of-range transitions for BTN_TOOL_PEN, including cleanup when Tosu deactivates absolute mode

Notes

  • this keeps existing area mapping logic intact while making emitted events closer to what drawing tablet consumers expect.

Codex Task

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread abs-c.c
Comment on lines +525 to +529
{ .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;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread abs-c.c
Comment on lines 501 to 503
if (config.enable_buttons &&
ev.type == EV_KEY &&
ev.code == BTN_LEFT) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant