Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up[UWP] Key events #27114
[UWP] Key events #27114
Conversation
highfive
commented
Jun 29, 2020
|
Heads up! This PR modifies the following files:
|
highfive
commented
Jun 29, 2020
| catch_any_panic(|| { | ||
| debug!("key_down"); | ||
| let name = unsafe { CStr::from_ptr(name) }; | ||
| let key = Key::from_str(&name.to_str().expect("Can't read string")); |
This comment has been minimized.
This comment has been minimized.
| catch_any_panic(|| { | ||
| debug!("key_up"); | ||
| let name = unsafe { CStr::from_ptr(name) }; | ||
| let key = Key::from_str(&name.to_str().expect("Can't read string")); |
This comment has been minimized.
This comment has been minimized.
| auto keystr = *hstring2char((e.Text())); | ||
| RunOnGLThread([=] { mServo->KeyDown(keystr); }); |
This comment has been minimized.
This comment has been minimized.
jdm
Jun 29, 2020
Member
This is scary due to #27115. We should dereference keystr inside of the closure, rather than storing a pointer to the inner string value and using that.
| auto keyname = *keystr; | ||
| RunOnGLThread([=] { mServo->KeyUp(keyname); }); |
This comment has been minimized.
This comment has been minimized.
jdm
Jun 29, 2020
Member
Same concern about #27115, even though this is a std::optional value. We should dereference keyname inside the closure to avoid references to memory that isn't owned by the closure.
|
I will address Addressed your comments. |
|
@bors-servo r+ |
|
|
[UWP] Key events This is the initial work required for proper keyboard events. The text controller implementation is very basic, just enough to show the virtual keyboard when it's needed, and have basic key events.
|
|
|
@bors-servo retry |
|
|
paulrouget commentedJun 29, 2020
This is the initial work required for proper keyboard events.
The text controller implementation is very basic, just enough to show the virtual keyboard when it's needed, and have basic key events.