Merge pull request #1150 from thenlevy/submit_with_numpadenter

Make TextInput emit a Submit message when the key NumpadEnter is pressed
This commit is contained in:
Héctor Ramón 2021-12-09 17:21:53 +07:00 committed by GitHub
commit a98a8c1c51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -519,7 +519,8 @@ where
let modifiers = self.state.keyboard_modifiers;
match key_code {
keyboard::KeyCode::Enter => {
keyboard::KeyCode::Enter
| keyboard::KeyCode::NumpadEnter => {
if let Some(on_submit) = self.on_submit.clone() {
shell.publish(on_submit);
}