Skip to content

input(macOS): preserve Caps Lock key releases - #7840

Open
lprazdnik wants to merge 1 commit into
utmapp:mainfrom
lprazdnik:fix/caps-lock-release
Open

input(macOS): preserve Caps Lock key releases#7840
lprazdnik wants to merge 1 commit into
utmapp:mainfrom
lprazdnik:fix/caps-lock-release

Conversation

@lprazdnik

Copy link
Copy Markdown

Summary

  • Preserve Caps Lock key-down and key-up events when “Caps Lock is treated as a key” is enabled.
  • Temporarily remap Caps Lock while guest input is captured and restore the host mapping afterward.
  • Prevent Caps Lock-based guest modifiers, such as NVDA commands, from remaining stuck after the key is released.

Resolves #7838

Testing

Tested by a human on a MacBook Pro with Apple M5 Max running macOS 26.6.2, using Windows 11 ARM as a QEMU guest with NVDA.

Verified repeated commands while Caps Lock remained held, normal input after releasing Caps Lock, and restoration of the host keyboard mapping after releasing VM input.

The author acknowledges that this change has been tested and/or reviewed by a human in accordance with UTM's AI contribution guidelines.

macOS exposes Caps Lock as a locking modifier without a physical key-up event, which leaves it held in QEMU guests when the treated-as-key option is enabled. Temporarily map Caps Lock to F19 while input is captured, translate its normal key events back to the guest scan code, and restore the host mapping when capture ends or UTM recovers.

Fixes utmapp#7838

Assisted-by: Codex:gpt-5
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.

Caps Lock remains held in guest after key is released

1 participant