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

Missing ModifiersChanged events on macOS #1396

Closed
chrisduerr opened this issue Jan 15, 2020 · 1 comment
Closed

Missing ModifiersChanged events on macOS #1396

chrisduerr opened this issue Jan 15, 2020 · 1 comment
Labels
B - bug Dang, that shouldn't have happened C - needs investigation Issue must be confirmed and researched DS - macos

Comments

@chrisduerr
Copy link
Contributor

It seems like on macOS, not all modifier changes cause a ModifiersChanged event, regardless of focus. This has been initially reported to Alacritty in alacritty/alacritty#3206.

Looking at the output of the event log, there seems to be a key event with modifiers: LOGO attached, without any prior ModifiersChanged event. The Window is in full focus at this point and has not had any modifier or focus changes since then.

The following log contains only the relevant information, full log can be found in the issue. It has been filtered using grep -E ".*event: (KeyboardInput|ReceivedCharacter|Focused|(DeviceEvent.*ModifiersChanged))".

glutin event: WindowEvent { window_id: WindowId(Id(140354613817120)), event: Focused(true) }
glutin event: WindowEvent { window_id: WindowId(Id(140354613817120)), event: KeyboardInput { device_id: DeviceId(DeviceId), input: KeyboardInput { scancode: 41, state: Pressed, virtual_keycode: Some(Semicolon), modifiers: (empty) }, is_synthetic: false } }
glutin event: WindowEvent { window_id: WindowId(Id(140354613817120)), event: ReceivedCharacter(';') }
glutin event: WindowEvent { window_id: WindowId(Id(140354613817120)), event: KeyboardInput { device_id: DeviceId(DeviceId), input: KeyboardInput { scancode: 41, state: Released, virtual_keycode: Some(Semicolon), modifiers: (empty) }, is_synthetic: false } }
glutin event: WindowEvent { window_id: WindowId(Id(140354613817120)), event: KeyboardInput { device_id: DeviceId(DeviceId), input: KeyboardInput { scancode: 8, state: Pressed, virtual_keycode: Some(C), modifiers: (empty) }, is_synthetic: false } }
glutin event: WindowEvent { window_id: WindowId(Id(140354613817120)), event: ReceivedCharacter('c') }
glutin event: WindowEvent { window_id: WindowId(Id(140354613817120)), event: KeyboardInput { device_id: DeviceId(DeviceId), input: KeyboardInput { scancode: 8, state: Released, virtual_keycode: Some(C), modifiers: (empty) }, is_synthetic: false } }
glutin event: WindowEvent { window_id: WindowId(Id(140354613817120)), event: KeyboardInput { device_id: DeviceId(DeviceId), input: KeyboardInput { scancode: 37, state: Pressed, virtual_keycode: Some(L), modifiers: (empty) }, is_synthetic: false } }
glutin event: WindowEvent { window_id: WindowId(Id(140354613817120)), event: ReceivedCharacter('l') }
glutin event: WindowEvent { window_id: WindowId(Id(140354613817120)), event: KeyboardInput { device_id: DeviceId(DeviceId), input: KeyboardInput { scancode: 51, state: Pressed, virtual_keycode: Some(Back), modifiers: (empty) }, is_synthetic: false } }
glutin event: WindowEvent { window_id: WindowId(Id(140354613817120)), event: ReceivedCharacter('\u{7f}') }
glutin event: WindowEvent { window_id: WindowId(Id(140354613817120)), event: KeyboardInput { device_id: DeviceId(DeviceId), input: KeyboardInput { scancode: 51, state: Released, virtual_keycode: Some(Back), modifiers: (empty) }, is_synthetic: false } }
glutin event: WindowEvent { window_id: WindowId(Id(140354613817120)), event: KeyboardInput { device_id: DeviceId(DeviceId), input: KeyboardInput { scancode: 51, state: Pressed, virtual_keycode: Some(Back), modifiers: (empty) }, is_synthetic: false } }
glutin event: WindowEvent { window_id: WindowId(Id(140354613817120)), event: ReceivedCharacter('\u{7f}') }
glutin event: WindowEvent { window_id: WindowId(Id(140354613817120)), event: KeyboardInput { device_id: DeviceId(DeviceId), input: KeyboardInput { scancode: 51, state: Released, virtual_keycode: Some(Back), modifiers: (empty) }, is_synthetic: false } }
glutin event: WindowEvent { window_id: WindowId(Id(140354613817120)), event: KeyboardInput { device_id: DeviceId(DeviceId), input: KeyboardInput { scancode: 51, state: Pressed, virtual_keycode: Some(Back), modifiers: (empty) }, is_synthetic: false } }
glutin event: WindowEvent { window_id: WindowId(Id(140354613817120)), event: ReceivedCharacter('\u{7f}') }
glutin event: WindowEvent { window_id: WindowId(Id(140354613817120)), event: KeyboardInput { device_id: DeviceId(DeviceId), input: KeyboardInput { scancode: 51, state: Released, virtual_keycode: Some(Back), modifiers: (empty) }, is_synthetic: false } }
glutin event: WindowEvent { window_id: WindowId(Id(140354613817120)), event: KeyboardInput { device_id: DeviceId(DeviceId), input: KeyboardInput { scancode: 37, state: Released, virtual_keycode: Some(L), modifiers: (empty) }, is_synthetic: false } }
glutin event: WindowEvent { window_id: WindowId(Id(140354613817120)), event: KeyboardInput { device_id: DeviceId(DeviceId), input: KeyboardInput { scancode: 9, state: Pressed, virtual_keycode: Some(V), modifiers: LOGO }, is_synthetic: false } }
glutin event: WindowEvent { window_id: WindowId(Id(140354613817120)), event: ReceivedCharacter('v') }
glutin event: WindowEvent { window_id: WindowId(Id(140354613817120)), event: KeyboardInput { device_id: DeviceId(DeviceId), input: KeyboardInput { scancode: 9, state: Released, virtual_keycode: Some(V), modifiers: LOGO }, is_synthetic: false } }
glutin event: DeviceEvent { device_id: DeviceId(DeviceId), event: ModifiersChanged((empty)) }
glutin event: WindowEvent { window_id: WindowId(Id(140354613817120)), event: KeyboardInput { device_id: DeviceId(DeviceId), input: KeyboardInput { scancode: 123, state: Pressed, virtual_keycode: Some(Left), modifiers: (empty) }, is_synthetic: false } }
glutin event: WindowEvent { window_id: WindowId(Id(140354613817120)), event: KeyboardInput { device_id: DeviceId(DeviceId), input: KeyboardInput { scancode: 123, state: Released, virtual_keycode: Some(Left), modifiers: (empty) }, is_synthetic: false } }
glutin event: WindowEvent { window_id: WindowId(Id(140354613817120)), event: KeyboardInput { device_id: DeviceId(DeviceId), input: KeyboardInput { scancode: 55, state: Pressed, virtual_keycode: Some(LWin), modifiers: LOGO }, is_synthetic: false } }
glutin event: DeviceEvent { device_id: DeviceId(DeviceId), event: ModifiersChanged(LOGO) }
glutin event: WindowEvent { window_id: WindowId(Id(140354613817120)), event: KeyboardInput { device_id: DeviceId(DeviceId), input: KeyboardInput { scancode: 13, state: Pressed, virtual_keycode: Some(W), modifiers: LOGO }, is_synthetic: false } }
glutin event: WindowEvent { window_id: WindowId(Id(140354613817120)), event: ReceivedCharacter('w') }

There are no synthetic events sent, so that shouldn't be an issue either (they're not implemented on macOS anyways afaik). What surprised me a bit was that there were only two DeviceEvents, since I'm used to a lot more on Linux, but that might be normal.

@kchibisov
Copy link
Member

I don't think it's an issue anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B - bug Dang, that shouldn't have happened C - needs investigation Issue must be confirmed and researched DS - macos
Development

No branches or pull requests

3 participants