diff --git a/wayvr/src/assets/gui/keyboard.xml b/wayvr/src/assets/gui/keyboard.xml index ca94b8aa..405823d8 100644 --- a/wayvr/src/assets/gui/keyboard.xml +++ b/wayvr/src/assets/gui/keyboard.xml @@ -98,7 +98,7 @@ diff --git a/wayvr/src/overlays/keyboard/mod.rs b/wayvr/src/overlays/keyboard/mod.rs index 13c56cd3..70dd9471 100644 --- a/wayvr/src/overlays/keyboard/mod.rs +++ b/wayvr/src/overlays/keyboard/mod.rs @@ -555,7 +555,6 @@ fn handle_release(app: &mut AppState, key: &KeyState, k_cap_type: &KeyCapType, k } } else { // pointer must have been released on the same key it was pressed on - println!("swipe reset"); swipe_manager.reset(); // drop swipe tracking that was started on press app.hid_provider diff --git a/wayvr/src/overlays/keyboard/swipe_type.rs b/wayvr/src/overlays/keyboard/swipe_type.rs index 7132ff2c..62ee3f62 100644 --- a/wayvr/src/overlays/keyboard/swipe_type.rs +++ b/wayvr/src/overlays/keyboard/swipe_type.rs @@ -43,7 +43,7 @@ impl SwipeTypingManager { pub fn select_word(&mut self, word: &String, app: &mut AppState, original_keyboard_mods: KeyModifier) { self.last_swiped_word = Some(word.clone()); - if let Ok(_) = self.copy_text_to_primary_clipboard(word.as_ref()) { + if let Ok(_) = self.copy_text_to_clipboard(word.as_ref()) { Self::paste(app, original_keyboard_mods); } } @@ -70,7 +70,7 @@ impl SwipeTypingManager { .set_modifiers_routed(app.wvr_server.as_mut(), original_keyboard_mods); } - fn copy_text_to_primary_clipboard(&mut self, text: &str) -> Result<(), arboard::Error> { + fn copy_text_to_clipboard(&mut self, text: &str) -> Result<(), arboard::Error> { self.clipboard.set_text(format!("{text} ")) } @@ -180,6 +180,12 @@ impl SwipeTypingManager { pub fn add_swipe(&mut self, within_key_pos_normalized: &Vec2, key_label: char, device: usize) { if let Some(pos) = self.keyboard_gird.key_positions.get(&key_label.to_ascii_lowercase()) { + if let Some(current_device) = self.current_swipe_device { + if current_device != device { + return; + } + } + if self.first_swipe_char != char::default() && self.first_swipe_char != key_label.to_ascii_lowercase() { @@ -196,12 +202,6 @@ impl SwipeTypingManager { None => self.start_swipe(key_label, device), }; - if let Some(current_device) = self.current_swipe_device { - if current_device != device { - return; - } - } - let within_key_pos_from_center = Vec2 { x: within_key_pos_normalized.x - 0.5, y: 0.5 - within_key_pos_normalized.y,