mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 15:21:12 +00:00
Use character codes, not keycodes, for backspace
This commit is contained in:
parent
056c3362b5
commit
50f7636f92
1 changed files with 2 additions and 10 deletions
|
@ -131,10 +131,8 @@ fn run_event_loop() -> Result<(), Box<dyn Error>> {
|
||||||
match ch {
|
match ch {
|
||||||
'\u{8}' | '\u{7f}' => {
|
'\u{8}' | '\u{7f}' => {
|
||||||
// In Linux, we get a '\u{8}' when you press backspace,
|
// In Linux, we get a '\u{8}' when you press backspace,
|
||||||
// but in macOS we get '\u{7f}'. In both, we
|
// but in macOS we get '\u{7f}'.
|
||||||
// get a Back keydown event. Therefore, we use the
|
text_state.pop();
|
||||||
// Back keydown event and ignore these, resulting
|
|
||||||
// in a system that works in both Linux and macOS.
|
|
||||||
}
|
}
|
||||||
'\u{e000}'..='\u{f8ff}'
|
'\u{e000}'..='\u{f8ff}'
|
||||||
| '\u{f0000}'..='\u{ffffd}'
|
| '\u{f0000}'..='\u{ffffd}'
|
||||||
|
@ -240,12 +238,6 @@ fn handle_keydown(
|
||||||
}
|
}
|
||||||
|
|
||||||
match virtual_keycode {
|
match virtual_keycode {
|
||||||
Back => {
|
|
||||||
// Backspace deletes a character.
|
|
||||||
// In Linux, we get a Unicode character for backspace events
|
|
||||||
// (which is handled elsewhere), but on macOS we only get one of these.
|
|
||||||
text_state.pop();
|
|
||||||
}
|
|
||||||
Copy => {
|
Copy => {
|
||||||
todo!("copy");
|
todo!("copy");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue