Skip to content

Blocking alt keys on macOS #768

Description

@chrisduerr

In a terminal emulator like Alacritty, it's possible to send control characters directly to the shell using the alt and control keys. However this gets problematic with keyboard layouts that use the alt key for accessing alternative key characters. This is mainly an issue on macOS since other platforms usually use the AltGr key.

The concrete problem is that when alt is held down, the modified key is received, instead of the normal key. So for example Option + F will generate ƒ instead of f. In iTerm it's possible to pick between sending escapes and sending modified keys, however Alacritty currently can't offer that since winit will always send the modified keys.

Now I'm not really familiar with how this works under the hood in winit, but ideally I'd like an option in the window builder (maybe possible to change at runtime?) to prevent alt from modifying the characters, so that Option + F will still send f.

Alternatively it would be necessary for Alacritty to define its own mappings and ignore the ReceivedCharacter event, which would likely result in a bit of duplication between winit and Alacritty.

More information about this issue can be found here:
alacritty/alacritty#2017

Metadata

Metadata

Assignees

No one assigned

    Labels

    B - bugDang, that shouldn't have happenedC - needs investigationIssue must be confirmed and researchedDS - appkitAffects the AppKit/macOS backend

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions