Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some Ctrl + Alt combinations don't work as expected on nordic layout #2899

Open
SirPaws opened this issue Dec 19, 2024 · 2 comments
Open

Some Ctrl + Alt combinations don't work as expected on nordic layout #2899

SirPaws opened this issue Dec 19, 2024 · 2 comments
Labels
bug Something isn't working keyboard Input Catch all category for keyboard issues Windowing This issue may be fixed by Winit

Comments

@SirPaws
Copy link

SirPaws commented Dec 19, 2024

Describe the bug
Not sure if this should be considered a bug or not, neovide is technically correct in what it's doing, it's just that, this isn't the behaviour I would expect from it.

It's probably related to keyboard layout, I'm on a Nordic layout (specifically Danish) and some ctrl + alt combinations don't behave how I'd expect.

To Reproduce
On nordic layout when I press ctrl + alt + 2 behaves as ctrl + alt + @ (instead of just inserting the @ character)
But pressing ctrl + alt + 3 inserts the £ character (as I would expect)

I tried running with neovide -- --clean and the behaviour is the same

Expected behavior
I would expect it to act as Altgr, which is how gvim and nvim-qt handles it, but I'm not sure if that would be considered correct, I could see the case being made for this to be the intended behaviour, or alternatively that it would use the key without modifiers used instead (as in instead of <C-M-@> it would be interpreted as <C-M-2>)

Desktop (please complete the following information):

  • OS: Windows 11
  • Neovide Version 0.13.3
  • Neovim Version 0.10.2

Please run neovide --log and paste the contents of the .log file created in the current directory here:
looking at the .log file it does do the "correct" thing and sends the <C-M-WHATEVER> when it's pressed, but the character is only really reachable through either Altgr (or ctrl + alt)

I've skipped some stuff for brevity but the full log also attached here
neovide_r2024-12-19_22-41-01.log

TRACE [neovide::window::keyboard_manager] Modifiers { state: ModifiersState(ALT), pressed_mods: ModifiersKeys(0x0) }
TRACE [neovide::window::keyboard_manager] KeyEvent {
    physical_key: Code(
        AltLeft,
    ),
    logical_key: Named(
        Alt,
    ),
    text: None,
    location: Left,
    state: Pressed,
    repeat: false,
    platform_specific: KeyEventExtra {
        text_with_all_modifers: None,
        key_without_modifiers: Named(
            Alt,
        ),
    },
}
TRACE [neovide::window::keyboard_manager] Modifiers { state: ModifiersState(CONTROL | ALT), pressed_mods: ModifiersKeys(0x0) }
TRACE [neovide::window::keyboard_manager] KeyEvent {
    physical_key: Code(
        ControlLeft,
    ),
    logical_key: Named(
        Control,
    ),
    text: None,
    location: Left,
    state: Pressed,
    repeat: false,
    platform_specific: KeyEventExtra {
        text_with_all_modifers: None,
        key_without_modifiers: Named(
            Control,
        ),
    },
}
TRACE [neovide::window::keyboard_manager] KeyEvent {
    physical_key: Code(
        ControlLeft,
    ),
    logical_key: Named(
        Control,
    ),
    text: None,
    location: Left,
    state: Pressed,
    repeat: true,
    platform_specific: KeyEventExtra {
        text_with_all_modifers: None,
        key_without_modifiers: Named(
            Control,
        ),
    },
}
TRACE [neovide::window::keyboard_manager] KeyEvent {
    physical_key: Code(
        ControlLeft,
    ),
    logical_key: Named(
        Control,
    ),
    text: None,
    location: Left,
    state: Pressed,
    repeat: true,
    platform_specific: KeyEventExtra {
        text_with_all_modifers: None,
        key_without_modifiers: Named(
            Control,
        ),
    },
}
TRACE [neovide::window::keyboard_manager] KeyEvent {
    physical_key: Code(
        ControlLeft,
    ),
    logical_key: Named(
        Control,
    ),
    text: None,
    location: Left,
    state: Pressed,
    repeat: true,
    platform_specific: KeyEventExtra {
        text_with_all_modifers: None,
        key_without_modifiers: Named(
            Control,
        ),
    },
}
TRACE [neovide::window::keyboard_manager] KeyEvent {
    physical_key: Code(
        ControlLeft,
    ),
    logical_key: Named(
        Control,
    ),
    text: None,
    location: Left,
    state: Pressed,
    repeat: true,
    platform_specific: KeyEventExtra {
        text_with_all_modifers: None,
        key_without_modifiers: Named(
            Control,
        ),
    },
}
TRACE [neovide::window::keyboard_manager] KeyEvent {
    physical_key: Code(
        ControlLeft,
    ),
    logical_key: Named(
        Control,
    ),
    text: None,
    location: Left,
    state: Pressed,
    repeat: true,
    platform_specific: KeyEventExtra {
        text_with_all_modifers: None,
        key_without_modifiers: Named(
            Control,
        ),
    },
}
TRACE [neovide::window::keyboard_manager] KeyEvent {
    physical_key: Code(
        ControlLeft,
    ),
    logical_key: Named(
        Control,
    ),
    text: None,
    location: Left,
    state: Pressed,
    repeat: true,
    platform_specific: KeyEventExtra {
        text_with_all_modifers: None,
        key_without_modifiers: Named(
            Control,
        ),
    },
}
TRACE [neovide::window::keyboard_manager] KeyEvent {
    physical_key: Code(
        ControlLeft,
    ),
    logical_key: Named(
        Control,
    ),
    text: None,
    location: Left,
    state: Pressed,
    repeat: true,
    platform_specific: KeyEventExtra {
        text_with_all_modifers: None,
        key_without_modifiers: Named(
            Control,
        ),
    },
}
TRACE [neovide::window::keyboard_manager] KeyEvent {
    physical_key: Code(
        Digit2,
    ),
    logical_key: Character(
        "@",
    ),
    text: Some(
        "@",
    ),
    location: Standard,
    state: Pressed,
    repeat: false,
    platform_specific: KeyEventExtra {
        text_with_all_modifers: Some(
            "@",
        ),
        key_without_modifiers: Character(
            "2",
        ),
    },
}
TRACE [neovide::window::keyboard_manager] Key pressed <C-M-@> ModifiersState(CONTROL | ALT)
TRACE [neovide::channel_utils] UIComand Serial(Keyboard("<C-M-@>"))
TRACE [neovide::bridge::ui_commands] In Serial Command
TRACE [neovide::bridge::ui_commands] Keyboard Input Sent: <C-M-@>
TRACE [neovide::bridge::handler] Neovim notification: "redraw"
TRACE [neovide::channel_utils] neovim_handler GridLine { grid: 3, row: 0, column_start: 0, cells: [GridLineCell { text: " ", highlight_id: Some(1), repeat: Some(12) }] }
TRACE [neovide::channel_utils] neovim_handler GridLine { grid: 1, row: 32, column_start: 84, cells: [GridLineCell { text: "0", highlight_id: Some(36), repeat: None }, GridLineCell { text: "-", highlight_id: None, repeat: None }, GridLineCell { text: "1", highlight_id: None, repeat: None }] }
TRACE [neovide::channel_utils] neovim_handler GridLine { grid: 3, row: 0, column_start: 89, cells: [GridLineCell { text: "~", highlight_id: Some(1), repeat: None }, GridLineCell { text: "@", highlight_id: None, repeat: None }, GridLineCell { text: "", highlight_id: None, repeat: None }] }
TRACE [neovide::channel_utils] neovim_handler GridLine { grid: 3, row: 0, column_start: 89, cells: [GridLineCell { text: " ", highlight_id: Some(1), repeat: Some(3) }, GridLineCell { text: " ", highlight_id: Some(0), repeat: Some(0) }] }
TRACE [neovide::channel_utils] neovim_handler ModeChange { mode: Normal, mode_index: 0 }
TRACE [neovide::channel_utils] neovim_handler Flush
TRACE [neovide::editor] Image flushed
TRACE [neovide::editor] send_batch
TRACE [neovide::window::keyboard_manager] Modifiers { state: ModifiersState(CONTROL | ALT), pressed_mods: ModifiersKeys(0x0) }
TRACE [neovide::window::keyboard_manager] KeyEvent {
    physical_key: Code(
        ControlLeft,
    ),
    logical_key: Named(
        Control,
    ),
    text: None,
    location: Left,
    state: Pressed,
    repeat: false,
    platform_specific: KeyEventExtra {
        text_with_all_modifers: None,
        key_without_modifiers: Named(
            Control,
        ),
    },
}
TRACE [neovide::window::keyboard_manager] KeyEvent {
    physical_key: Code(
        Digit3,
    ),
    logical_key: Character(
        "£",
    ),
    text: Some(
        "£",
    ),
    location: Standard,
    state: Pressed,
    repeat: false,
    platform_specific: KeyEventExtra {
        text_with_all_modifers: Some(
            "£",
        ),
        key_without_modifiers: Character(
            "3",
        ),
    },
}
TRACE [neovide::window::keyboard_manager] Key pressed <C-M-£> ModifiersState(CONTROL | ALT)
TRACE [neovide::channel_utils] UIComand Serial(Keyboard("<C-M-£>"))
TRACE [neovide::bridge::ui_commands] In Serial Command
TRACE [neovide::bridge::ui_commands] Keyboard Input Sent: <C-M-£>
TRACE [neovide::bridge::handler] Neovim notification: "redraw"
TRACE [neovide::channel_utils] neovim_handler GridLine { grid: 2, row: 0, column_start: 0, cells: [GridLineCell { text: "£", highlight_id: Some(0), repeat: None }] }
TRACE [neovide::channel_utils] neovim_handler GridLine { grid: 2, row: 10, column_start: 34, cells: [GridLineCell { text: " ", highlight_id: Some(12), repeat: Some(32) }] }
TRACE [neovide::channel_utils] neovim_handler GridLine { grid: 2, row: 12, column_start: 28, cells: [GridLineCell { text: " ", highlight_id: Some(12), repeat: Some(44) }] }
TRACE [neovide::channel_utils] neovim_handler GridLine { grid: 2, row: 13, column_start: 38, cells: [GridLineCell { text: " ", highlight_id: Some(12), repeat: Some(23) }] }
TRACE [neovide::channel_utils] neovim_handler GridLine { grid: 2, row: 15, column_start: 27, cells: [GridLineCell { text: " ", highlight_id: Some(12), repeat: Some(46) }] }
TRACE [neovide::channel_utils] neovim_handler GridLine { grid: 2, row: 16, column_start: 27, cells: [GridLineCell { text: " ", highlight_id: Some(12), repeat: Some(46) }] }
TRACE [neovide::channel_utils] neovim_handler GridLine { grid: 2, row: 17, column_start: 27, cells: [GridLineCell { text: " ", highlight_id: Some(12), repeat: Some(46) }] }
TRACE [neovide::channel_utils] neovim_handler GridLine { grid: 2, row: 18, column_start: 27, cells: [GridLineCell { text: " ", highlight_id: Some(12), repeat: Some(46) }] }
TRACE [neovide::channel_utils] neovim_handler GridLine { grid: 2, row: 20, column_start: 26, cells: [GridLineCell { text: " ", highlight_id: Some(12), repeat: Some(47) }] }
TRACE [neovide::channel_utils] neovim_handler GridLine { grid: 2, row: 22, column_start: 35, cells: [GridLineCell { text: " ", highlight_id: Some(12), repeat: Some(29) }] }
TRACE [neovide::channel_utils] neovim_handler GridLine { grid: 2, row: 23, column_start: 27, cells: [GridLineCell { text: " ", highlight_id: Some(12), repeat: Some(46) }] }
TRACE [neovide::channel_utils] neovim_handler GridLine { grid: 1, row: 32, column_start: 10, cells: [GridLineCell { text: "[", highlight_id: Some(36), repeat: None }, GridLineCell { text: "+", highlight_id: None, repeat: None }, GridLineCell { text: "]", highlight_id: None, repeat: None }, GridLineCell { text: " ", highlight_id: Some(36), repeat: Some(69) }, GridLineCell { text: "1", highlight_id: None, repeat: None }, GridLineCell { text: ",", highlight_id: None, repeat: None }, GridLineCell { text: "3", highlight_id: None, repeat: None }, GridLineCell { text: "-", highlight_id: None, repeat: None }, GridLineCell { text: "2", highlight_id: None, repeat: None }] }
TRACE [neovide::channel_utils] neovim_handler WindowViewport { grid: 2, top_line: 0.0, bottom_line: 2.0, current_line: 0.0, current_column: 2.0, line_count: Some(1.0), scroll_delta: Some(0.0) }
TRACE [neovide::channel_utils] neovim_handler CursorGoto { grid: 2, row: 0, column: 1 }
TRACE [neovide::channel_utils] neovim_handler Flush
TRACE [neovide::editor] Image flushed
TRACE [neovide::editor] send_batch
@SirPaws SirPaws added the bug Something isn't working label Dec 19, 2024
@fredizzimo
Copy link
Member

Yes, Windows is a special case here, Linux for example does not threat CTRL + ALT the same as ALTGR.

Unfortunately, there's not much we can do about this on the Neovide side, Winit handles the keyboad input, and we can only operate on the information provided.

There does not however, seem to be a bug reported there for this, so I will create one soon. I reported a similar bug over a year ago, but in that case CTRL is not reported as it should, so it's not the same bug, but I suspect both buts still are codewise related

@fredizzimo
Copy link
Member

@fredizzimo fredizzimo added the keyboard Input Catch all category for keyboard issues label Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working keyboard Input Catch all category for keyboard issues Windowing This issue may be fixed by Winit
Projects
None yet
Development

No branches or pull requests

2 participants