remove println, minor fix

This commit is contained in:
Diamond White 2026-03-16 00:53:25 +00:00
parent 5891c4b5b6
commit 9382af67e2
3 changed files with 9 additions and 10 deletions

View File

@ -98,7 +98,7 @@
<!-- Word prediction key for swipe typing -->
<template name="KeyPrediction">
<rectangle id="${id}" macro="prediction_rect" height="60" min_height="60" flex_grow="1" flex_shrink="1" flex_basis="0">
<label text="${text}" size="16" wrap="true" />
<label text="${text}" size="16" flex_wrap="wrap" />
</rectangle>
</template>

View File

@ -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

View File

@ -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,