Files
RedBear-OS/local
vasilito 9bc6ba0b6e redbear-compositor: real keyboard modifier state tracking
Replace the all-zero WL_KEYBOARD_MODIFIERS stub with a real
modifier state model that tracks shift/ctrl/alt/logo/caps/num/mod5
state across key events.

* KeyboardState gains four modifier fields: depressed, latched,
  locked, group (all u32)
* New MOD_* constants: MOD_SHIFT(1<<0), MOD_CAPS(1<<1),
  MOD_CTRL(1<<2), MOD_ALT(1<<3), MOD_MOD2(1<<4), MOD_MOD3(1<<5),
  MOD_LOGO(1<<6), MOD_MOD5(1<<7)
* New KEY_* constants: KEY_LEFT_SHIFT(50), KEY_RIGHT_SHIFT(62),
  KEY_LEFT_CTRL(37), KEY_RIGHT_CTRL(105), KEY_LEFT_ALT(64),
  KEY_RIGHT_ALT(108), KEY_LEFT_LOGO(133), KEY_RIGHT_LOGO(134),
  KEY_CAPS_LOCK(66), KEY_NUM_LOCK(77), KEY_MOD5(116)
* KeyboardState::modifier_bit_for_key maps keycode -> modifier bit
* KeyboardState::apply_modifier_event updates modifier state on
  key press/release (caps/num lock toggle on press, others track
  depressed state)
* send_keyboard_setup reads the current modifier state and sends
  the real values (was always sending zeros before)
* New send_keyboard_modifiers function emits a
  WL_KEYBOARD_MODIFIERS event with the current state
* New set_modifier_state method allows programmatic updates
  (for future input daemon integration)
* WL_KEYBOARD_KEY dispatch now calls apply_modifier_event to
  track modifier state changes
* WL_KEYBOARD_MODIFIERS dispatch now stores modifier state from
  incoming events (for future input daemon)

cargo check passes on the standalone compositor binary. Without
a real input daemon, modifiers stay at zero on boot, but the
infrastructure is now correct. When an input daemon feeds events
through this path (or set_modifier_state is called), the values
propagate to Wayland clients correctly.
2026-07-27 09:38:51 +09:00
..