Skip to content

[Bug] Caps Lock leaves the paw pressed on macOS #19

Description

@huaer9000

Environment

  • macOS
  • BongoCat Next 0.2.11
  • Interactive keyboard model

Steps to reproduce

  1. Start BongoCat Next.
  2. Press Caps Lock once.
  3. Observe the paw assigned to Caps Lock.

Actual behavior

The paw remains in the pressed position until Caps Lock is pressed again.

Expected behavior

Caps Lock should behave like a tap: after the key is pressed, the paw should return to its default raised state.

Cause

On macOS, Caps Lock is delivered through FlagsChanged rather than a normal physical KeyUp. The current rdev event mapping turns the first toggle into KeyboardPress(CapsLock), while the frontend removes pressed keys only after receiving KeyboardRelease. The key therefore remains in the pressed set.

Proposed fix

In src-tauri/src/core/device.rs, allow one rdev event to produce multiple app events. On macOS only, when receiving KeyPress(Key::CapsLock), emit the normal KeyboardPress followed immediately by KeyboardRelease for CapsLock. Other keys and platforms remain unchanged.

I verified this locally with a regression test that asserts the Caps Lock press produces the paired press/release events, and by manually testing the development build.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions