Skip to content

Nonbreaking space is reported wrong on macOS #4059

@fredizzimo

Description

@fredizzimo

Description

This was reported for Neovide here

Input Option+Shift+Space, which should produce a non-breaking space. In Neovide, we receive the following event

KeyEvent {
    physical_key: Code(
        Space,
    ),
    logical_key: Named(
        Space,
    ),
    text: Some(
        " ",
    ),
    location: Standard,
    state: Pressed,
    repeat: false,
    platform_specific: KeyEventExtra {
        text_with_all_modifiers: Some(
            "\u{a0}",
        ),
        key_without_modifiers: Named(
            Space,
        ),
    },
}

The non-breaking space is correctly reported in text_with_all_modifiers, but I would expect it to be reported in text like any other input.

The same thing also happens with narrow non breaking space for example.

KeyEvent {
    physical_key: Code(
        Space,
    ),
    logical_key: Named(
        Space,
    ),
    text: None,
    location: Standard,
    state: Released,
    repeat: false,
    platform_specific: KeyEventExtra {
        text_with_all_modifiers: Some(
            "\u{202f}",
        ),
        key_without_modifiers: Named(
            Space,
        ),
    },
}

macOS version

macOS 15.1.1

Winit version

0.29.15

Metadata

Metadata

Assignees

No one assigned

    Labels

    B - bugDang, that shouldn't have happenedDS - appkitAffects the AppKit/macOS backend

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions