Skip to content

Emulate tablet-class pen capabilities for osu!lazer input#6

Open
sciboy12 wants to merge 2 commits intorewrite-scaling-config-reworkfrom
codex/modify-abs-c-for-pen-tablet-compatibility
Open

Emulate tablet-class pen capabilities for osu!lazer input#6
sciboy12 wants to merge 2 commits intorewrite-scaling-config-reworkfrom
codex/modify-abs-c-for-pen-tablet-compatibility

Conversation

@sciboy12
Copy link
Copy Markdown
Owner

Motivation

  • Make the virtual uinput device present as a real pen/tablet so libinput/osu!lazer treat it as a pen device rather than a generic ABS mouse.
  • Ensure the device exposes pressure, pen tool identity and SYN-frame batched updates so modern input stacks accept and correctly interpret events.

Description

  • Updated init_uinput() to advertise pen/tablet features by enabling BTN_TOOL_PEN, BTN_TOUCH, ABS_PRESSURE, and INPUT_PROP_DIRECT, and set ABS_PRESSURE range to 0..8191.
  • Added emit_pen_tool_state() and call it each active-loop iteration to continuously signal BTN_TOOL_PEN=1 with a SYN_REPORT so the OS sees a pen tool present.
  • Reworked ABS handling to cache ABS_X/ABS_Y values and only call emit_abs_delta(x, y, true, true) at a SYN-frame boundary (EV_SYN/SYN_REPORT) when both axes are available, preventing per-axis immediate emission.
  • Changed BTN_LEFT handling to mirror contact onto BTN_TOUCH and emit BTN_LEFT + BTN_TOUCH + SYN_REPORT in a single batched write, and added internal pressure/is_down tracking for future pressure emission.

Testing

  • Attempted to build with cd /workspace/Abs-C && make, but the build failed in this environment due to missing development headers (ini.h and cjson/cJSON.h), so full compile/runtime validation could not be completed.

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: 107f9fedc4

ℹ️ 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 +526 to +527
if (got_x && got_y) {
if (!emit_abs_delta(x, y, true, true)) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Emit movement when either axis changes per frame

Many evdev tablets emit only the axis that changed before SYN_REPORT (e.g., pure horizontal movement can be ABS_X only). The new if (got_x && got_y) condition drops those frames, so single-axis motion is not forwarded until the other axis changes, which makes the cursor stall or jump and is a functional regression from the previous x_dirty || y_dirty behavior.

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