Skip to content

Modifier key events have their modifier bits set differently on Linux vs OSX #6913

Closed

Description

@neurocyte

Edited by @kovidgoyal to add the poll:

We are discussing the best approach to take for fixing this issue, the two options are below with updated votes.

  1. The modifier bits should reflect the modifier state taking into account the current key event. This is the platform behavior of macOS , Windows and Qt ( @neurocyte @j4james @dankamongmen @kovidgoyal @rockorager )
  2. The modifier bits should reflect the modifier state as it was before the current key event. This is the platform behavior of Linux and GTK on Linux (havent been able to test GTK on other platforms). (@kchibisov @mitchellh)

(1) requires no changes to the existing kitty keyboard protocol beyond specifying the behavior. (2) requires adding a new "fake key code" and sending these events to update the modifier state.

Original issue is below:

On linux the modifier bit is clear on press events and set on release events. OSX is the other way around.

For example:

Linux:
LEFT_CONTROL PRESS
CSI 57442 u

ctrl+LEFT_CONTROL RELEASE
CSI 57442 ; 5 : 3 u

macOS:
ctrl+LEFT_CONTROL PRESS
CSI 57442 ; 5 u

LEFT_CONTROL RELEASE
CSI 57442 ; 1 : 3 u

This comes from a discussion with ghostty dev on which behaviour should be considered correct.

See: ghostty-org/ghostty#1082

Activity

  1. mitchellh commented on Dec 13, 2023

    @mitchellh
  2. mitchellh commented on Dec 14, 2023

    @mitchellh
  3. kovidgoyal commented on Dec 14, 2023

    @kovidgoyal
  4. mitchellh commented on Dec 14, 2023

    @mitchellh
  5. neurocyte commented on Dec 14, 2023

    @neurocyte
    Author
  6. kovidgoyal commented on Dec 14, 2023

    @kovidgoyal
  7. mitchellh commented on Dec 14, 2023

    @mitchellh
  8. kchibisov commented on Dec 14, 2023

    @kchibisov
  9. kchibisov commented on Dec 14, 2023

    @kchibisov
  10. kovidgoyal commented on Dec 14, 2023

    @kovidgoyal
  11. mitchellh commented on Dec 14, 2023

    @mitchellh
  12. kchibisov commented on Dec 14, 2023

    @kchibisov
  13. mitchellh commented on Dec 14, 2023

    @mitchellh
  14. 111 remaining items

  15. kovidgoyal commented on Dec 17, 2023

    @kovidgoyal
    Owner
  16. kovidgoyal commented on Dec 24, 2023

    @kovidgoyal
    Owner

    Voting was 5 to 2 in favor of (1). I have implemented (1) in master.

  17. added 2 commits that reference this issue on Jan 28, 2024
    a9b424e
    91cdf4a
  18. added 2 commits that reference this issue on Jul 8, 2026
    4c8d552
    397f551
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions