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

No keyup events for letter keys on macOS #26880

Closed
jdm opened this issue Jun 11, 2020 · 3 comments
Closed

No keyup events for letter keys on macOS #26880

jdm opened this issue Jun 11, 2020 · 3 comments
Assignees
Labels

Comments

@jdm
Copy link
Member

@jdm jdm commented Jun 11, 2020

If I add println!("{:?}", key_event) to

.otherwise(|| WindowEvent::Keyboard(key_event))
, I see Down followed by Up for most keys like Return, Shift, Tab, etc. However I only ever see Down events for any letters I press.

@jdm jdm added P-mac A-input labels Jun 11, 2020
@jdm jdm added this to To do in Hubs support Jun 11, 2020
@jdm
Copy link
Member Author

@jdm jdm commented Jun 11, 2020

We're getting appropriate events from winit:

[2020-06-11T21:58:59Z INFO  servo::keyutils] winit keyboard input: KeyboardInput { scancode: 0, state: Pressed, virtual_keycode: Some(A), modifiers: ModifiersState { shift: false, ctrl: false, alt: false, logo: false } }
KeyboardEvent { state: Down, key: Character("a"), code: Unidentified, location: Standard, modifiers: (empty), repeat: false, is_composing: false }
[2020-06-11T21:58:59Z INFO  servo::keyutils] winit keyboard input: KeyboardInput { scancode: 0, state: Released, virtual_keycode: Some(A), modifiers: ModifiersState { shift: false, ctrl: false, alt: false, logo: false } }
@jdm
Copy link
Member Author

@jdm jdm commented Jun 11, 2020

get_servo_key_from_winit_key is missing all of the letter characters, of course.

@jdm
Copy link
Member Author

@jdm jdm commented Jun 11, 2020

That's intentional, because the letter characters are received from ReceivedCharacter events from winit. However we stash the KeyDown event that was missing the key and update it with the character; there's no special processing for a KeyUp event that is missing the key. That's why script never receives any KeyUp events for letter keys.

@jdm jdm self-assigned this Jun 12, 2020
@jdm jdm mentioned this issue Jun 12, 2020
4 of 4 tasks complete
bors-servo added a commit that referenced this issue Jun 13, 2020
Generate keyup events for printable keys

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #26880
- [x] These changes do not require tests because we have no automated way to test user input
bors-servo added a commit that referenced this issue Jun 13, 2020
Generate keyup events for printable keys

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #26880
- [x] These changes do not require tests because we have no automated way to test user input
@atouchet atouchet moved this from To do to Done in Hubs support Jun 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Hubs support
  
Done
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
@jdm and others
You can’t perform that action at this time.