summaryrefslogtreecommitdiffstats
path: root/native/src
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-12-05 03:16:50 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-12-05 03:16:50 +0100
commit7c8799e4936ccea35ad936e4098df75bf3257639 (patch)
treef86c4634bd877c5c37c5cee3b4c621e86c09c4a6 /native/src
parentef987ae2ec2b2fed3e22fda89625483d15d79927 (diff)
downloadiced-7c8799e4936ccea35ad936e4098df75bf3257639.tar.gz
iced-7c8799e4936ccea35ad936e4098df75bf3257639.tar.bz2
iced-7c8799e4936ccea35ad936e4098df75bf3257639.zip
Support `Home` and `End` keys for `TextInput`
Diffstat (limited to 'native/src')
-rw-r--r--native/src/widget/text_input.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/native/src/widget/text_input.rs b/native/src/widget/text_input.rs
index 122f8973..dae772bc 100644
--- a/native/src/widget/text_input.rs
+++ b/native/src/widget/text_input.rs
@@ -238,6 +238,12 @@ where
keyboard::KeyCode::Right => {
self.state.move_cursor_right(&self.value);
}
+ keyboard::KeyCode::Home => {
+ self.state.cursor_position = 0;
+ }
+ keyboard::KeyCode::End => {
+ self.state.move_cursor_to_end(&self.value);
+ }
_ => {}
},
_ => {}