Skip to content

uinput: support event types without codes - #260

Open
Spaskich wants to merge 1 commit into
gvalkov:mainfrom
Spaskich:feat/uinput-empty-event-types
Open

uinput: support event types without codes#260
Spaskich wants to merge 1 commit into
gvalkov:mainfrom
Spaskich:feat/uinput-empty-event-types

Conversation

@Spaskich

@Spaskich Spaskich commented Aug 18, 2026

Copy link
Copy Markdown

Summary

  • Add a low-level enable_type() wrapper for UI_SET_EVBIT.
  • Allow UInput capability mappings to enable an event type using an empty
    sequence of event codes.
  • Document the behavior and add a regression test using EV_REP.

Why?

Some Linux input event types, notably EV_REP, need the event type itself to
be enabled but do not have a corresponding UI_SET_*BIT ioctl for individual
codes.

Currently, passing:

{
    ecodes.EV_KEY: [ecodes.KEY_A],
    ecodes.EV_REP: [],
}

does not enable EV_REP, because the empty list produces no calls to the
low-level uinput API.

This change treats an empty sequence as a request to enable the event type
without enabling any event codes. It allows uinput keyboard implementations to
opt into kernel-managed key repeat through the public UInput API.

Testing

  • All tests passed.
  • Created a real uinput keyboard with EV_REP: [].
  • Verified that InputDevice.repeat reports non-zero delay and repeat values.
  • Verified that held keys generate kernel repeat events and stop on release.

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

Successfully merging this pull request may close these issues.

1 participant