Skip to content

Commit

Permalink
fix(TargetTouchpad): minor performance improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadowApex committed Nov 20, 2024
1 parent 0d40c7a commit 0eb697b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/input/target/touchpad.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,13 @@ impl TouchpadDevice {
let mut events = vec![];
let cap = event.as_capability();

let button_events: Vec<Capability> = vec![
let button_events = [
Capability::Touchpad(Touchpad::CenterPad(Touch::Button(TouchButton::Press))),
Capability::Touchpad(Touchpad::LeftPad(Touch::Button(TouchButton::Press))),
Capability::Touchpad(Touchpad::RightPad(Touch::Button(TouchButton::Press))),
];

let motion_events: Vec<Capability> = vec![
let motion_events = [
Capability::Touchpad(Touchpad::CenterPad(Touch::Motion)),
Capability::Touchpad(Touchpad::LeftPad(Touch::Motion)),
Capability::Touchpad(Touchpad::RightPad(Touch::Motion)),
Expand All @@ -191,7 +191,7 @@ impl TouchpadDevice {

/// Translate the given native [Touch::Motion] event into a sereis of evdev events
fn translate_motion(&mut self, event: NativeEvent) -> Vec<InputEvent> {
let mut events = vec![];
let mut events = Vec::with_capacity(10);

// Destructure the input value
let InputValue::Touch {
Expand Down

0 comments on commit 0eb697b

Please sign in to comment.