Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
jtroo committed Oct 28, 2024
1 parent 5402f8e commit cee6d2b
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/kanata/output_logic/zippychord.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,26 +333,25 @@ impl ZchState {
for key_to_send in &a.zch_output {
#[cfg(feature = "interception_driver")]
{
// Note: every 5 keys on Windows Interception, do a sleep because
// sending too quickly apparently causes weird behaviour...
// I guess there's some buffer in the Interception code that is filling up.
send_count += 1;
if send_count % 5 == 0 {
std::thread::sleep(std::time::Duration::from_millis(1));
}
}

let typed_osc;
// Note: every 5 keys on Windows Interception, do a sleep because
// sending too quickly apparently causes weird behaviour...
// I guess there's some buffer in the Interception code that is filling up.
match key_to_send {
let typed_osc = match key_to_send {
ZchOutput::Lowercase(osc) => {
type_osc(*osc, kb, &self.zchd)?;
typed_osc = osc;
osc
}
ZchOutput::Uppercase(osc) => {
maybe_press_sft_during_activation(released_lsft, kb, &self.zchd)?;
type_osc(*osc, kb, &self.zchd)?;
maybe_release_sft_during_activation(released_lsft, kb, &self.zchd)?;
typed_osc = osc;
osc
}
ZchOutput::AltGr(osc) => {
// Note, unlike shift which probably has a good reason to be maybe
Expand All @@ -362,17 +361,17 @@ impl ZchState {
kb.press_key(OsCode::KEY_RIGHTALT)?;
type_osc(*osc, kb, &self.zchd)?;
kb.release_key(OsCode::KEY_RIGHTALT)?;
typed_osc = osc;
osc
}
ZchOutput::ShiftAltGr(osc) => {
kb.press_key(OsCode::KEY_RIGHTALT)?;
maybe_press_sft_during_activation(released_lsft, kb, &self.zchd)?;
type_osc(*osc, kb, &self.zchd)?;
maybe_release_sft_during_activation(released_lsft, kb, &self.zchd)?;
kb.release_key(OsCode::KEY_RIGHTALT)?;
typed_osc = osc;
osc
}
}
};

if *typed_osc == OsCode::KEY_BACKSPACE {
self.zchd.zchd_characters_to_delete_on_next_activation -= 1;
Expand Down

0 comments on commit cee6d2b

Please sign in to comment.