fix: arrow keys in text editor on a layer_surface
This commit is contained in:
parent
6f1b3a7170
commit
0968a10fc1
1 changed files with 9 additions and 2 deletions
|
|
@ -627,7 +627,12 @@ impl SctkEvent {
|
|||
keyboard::Event::KeyPressed {
|
||||
key: key.clone(),
|
||||
location: location,
|
||||
text: ke.utf8.map(|s| s.into()),
|
||||
// sctk reports keys without a text representation (e.g. arrows, Home) as
|
||||
// Some("") but winit reports None. Widgets are written against winit's contract.
|
||||
text: ke
|
||||
.utf8
|
||||
.filter(|s| !s.is_empty())
|
||||
.map(|s| s.into()),
|
||||
modifiers: modifiers_to_native(*modifiers),
|
||||
physical_key,
|
||||
repeat: false,
|
||||
|
|
@ -653,7 +658,9 @@ impl SctkEvent {
|
|||
keyboard::Event::KeyPressed {
|
||||
key: key.clone(),
|
||||
location: location,
|
||||
text: utf8.map(|s| s.into()),
|
||||
text: utf8
|
||||
.filter(|s| !s.is_empty())
|
||||
.map(|s| s.into()),
|
||||
modifiers: modifiers_to_native(*modifiers),
|
||||
physical_key,
|
||||
repeat: true,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue