Skip to content

Conversation

@Bot-wxt1221
Copy link
Contributor

@Bot-wxt1221 Bot-wxt1221 commented Jan 11, 2026

WM need keymap to process input. So change_keymap is neccessary.

Follow by #1803.

Problem mainly on YaLTeR/niri#2314

Current impl is stupid. The correct way should be simulate a virtual keyboard handler like libinput backend.

But I have no interest in it. So let's just make it possible to solve all issue.

@Bot-wxt1221 Bot-wxt1221 force-pushed the virtual_keyboard branch 2 times, most recently from 3d6c503 to a9a6e0a Compare January 11, 2026 10:22
@Bot-wxt1221
Copy link
Contributor Author

@PolyMeilex

@Bot-wxt1221 Bot-wxt1221 changed the title fix: use change_keymap to allow WM handle keycode with the correct keymap fix: allow ignore keymap reset to fix virtual_keyboard Jan 12, 2026
@Bot-wxt1221 Bot-wxt1221 force-pushed the virtual_keyboard branch 5 times, most recently from 67f4c7e to b114ff2 Compare January 12, 2026 15:45
@Bot-wxt1221 Bot-wxt1221 marked this pull request as draft January 12, 2026 15:47
@Bot-wxt1221 Bot-wxt1221 changed the title fix: allow ignore keymap reset to fix virtual_keyboard fix: use change_keymap to edit virtual_keyboard's keymap Jan 17, 2026
@Bot-wxt1221 Bot-wxt1221 marked this pull request as ready for review January 17, 2026 16:00
@Bot-wxt1221
Copy link
Contributor Author

@PolyMeilex

@YaLTeR
Copy link
Contributor

YaLTeR commented Jan 18, 2026

Seems this PR is necessary to unbreak wtype that broke after the last virtual keyboard PR.

@Bot-wxt1221 with this PR, wtype works for clients, but for compositor binds it still uses the wrong keymap. I'm actually not sure what's happening. In winit backend, wtype -M alt -k p -m alt results in

2026-01-18T05:53:17.396689Z DEBUG niri::input: on_keyboard modified=XK_Escape pressed=true
2026-01-18T05:53:17.400344Z DEBUG niri::input: on_keyboard modified=XK_Escape pressed=false

inside the self.niri.seat.get_keyboard().unwrap().input(... closure (and no r somehow?) and ^[r produced in the terminal.

If I do wtype -M alt then something really weird happens where niri still sees all the keys as normal, and compositor binds work, but keys stop doing input to any client.

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.

2 participants