alacritty / alacritty

A cross-platform, OpenGL terminal emulator.
https://alacritty.org
Apache License 2.0
56.1k stars 3.01k forks source link

Control behaving like shift on macos #7060

Open tomcumming opened 1 year ago

tomcumming commented 1 year ago

My config only changes font size. Version is alacritty 0.12.2

When I type control + ' it is treated as " , as if I am pressing shift + '.

This is in the events:

[3.976546375s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(5443422048)), event: KeyboardInput { device_id: DeviceId(DeviceId), input: KeyboardInput { scancode: 39, state: Pressed, virtual_keycode: Some(Apostrophe), modifiers: CTRL }, is_synthetic: false } }
[3.976612666s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(5443422048)), event: ReceivedCharacter('"') }
kchibisov commented 1 year ago

What do you want exactly? Do you have software changing the keyboard input?

tomcumming commented 1 year ago

What do you want exactly? Do you have software changing the keyboard input?

I would prefer if it behaved like every other text input, for instance this text box in firefox or the stock macos terminal application. When I press control + ' nothing happens.

I would like to use this as a shortcut in tmux but instead it just behaves like I am typing ".

I have a feeling this might be a winit issue rather than an alacritty one.

kchibisov commented 1 year ago

Try https://github.com/alacritty/alacritty/pull/6958

tomcumming commented 1 year ago

Try #6958

Seems to behave the same on kchibisov:winit-update unfortunatly.

It seems that most [a-z] keys are handled properly, [;'] act like shift is pressed, [,.] act like no mod is pressed.

Edit

I have just found that iterm2 behaves the same as alacritty until I enable this setting https://iterm2.com/documentation-csiu.html

kchibisov commented 1 year ago

What is your layout and do you have special software for keyboard? I don't have such issue on us layout.

tomcumming commented 1 year ago

British layout apple magic keyboard, no special settings or software

waymost commented 1 year ago

I have the same issue as mentioned in this comment on macos with alacritty 0.12.2 and a US keyboard.

When I hit ctrl-shift-. I get the following:

[INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(140676285092112)), event: KeyboardInput { device_id: DeviceId(DeviceId), input: KeyboardInput { scancode: 59, state: Pressed, virtual_keycode: Some(LControl), modifiers: CTRL }, is_synthetic: false } }
[INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(140676285092112)), event: KeyboardInput { device_id: DeviceId(DeviceId), input: KeyboardInput { scancode: 56, state: Pressed, virtual_keycode: Some(LShift), modifiers: SHIFT | CTRL }, is_synthetic: false } }
[INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(140676285092112)), event: KeyboardInput { device_id: DeviceId(DeviceId), input: KeyboardInput { scancode: 47, state: Pressed, virtual_keycode: Some(Period), modifiers: SHIFT | CTRL }, is_synthetic: false } }
[INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(140676285092112)), event: ReceivedCharacter('.') }

But if I hit option-shift-. I get the following:

[INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(140676285092112)), event: KeyboardInput { device_id: DeviceId(DeviceId), input: KeyboardInput { scancode: 58, state: Pressed, virtual_keycode: Some(LAlt), modifiers: ALT }, is_synthetic: false } }
[INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(140676285092112)), event: KeyboardInput { device_id: DeviceId(DeviceId), input: KeyboardInput { scancode: 56, state: Pressed, virtual_keycode: Some(LShift), modifiers: SHIFT | ALT }, is_synthetic: false } }
[INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(140676285092112)), event: KeyboardInput { device_id: DeviceId(DeviceId), input: KeyboardInput { scancode: 47, state: Pressed, virtual_keycode: Some(Period), modifiers: SHIFT | ALT }, is_synthetic: false } }
[INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(140676285092112)), event: ReceivedCharacter('>') }

Attempting to bind the key sequence (with the below) doesn't change this behavior and results in half of the raw sequence (2;5u) being output to the terminal.

{ key: Period, mods: Control|Shift, chars: "\x1b[62;5u" }

As such, an emacs binding such as C-> doesn't work as a period is what is received.

kchibisov commented 1 year ago

@waymost but what you're saying has nothing to do with the original issue, your output is expected and I don't see any issue with it, what emacs wants is extended modifiers sequence, not just period which is what you should get for ctrl + ..

The same about other output with Option, but given that macOS alters what option produces you get >.