Skip to content

Commit

Permalink
fixup! refactor(core): unify touch and button handling, enable usage …
Browse files Browse the repository at this point in the history
…of both in one model
  • Loading branch information
TychoVrahe committed Jun 15, 2023
1 parent 0663e94 commit 753b4e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/embed/rust/src/ui/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ pub enum ButtonEvent {

impl ButtonEvent {
pub fn new(event: u32, button: u32) -> Result<Self, error::Error> {
let button = match button & 0xFF {
let button = match button {
0 => PhysicalButton::Left,
1 => PhysicalButton::Right,
_ => return Err(error::Error::OutOfRange),
};
let result = match event {
let result = match event & 0xFF {
1 => Self::ButtonPressed(button),
2 => Self::ButtonReleased(button),
_ => return Err(error::Error::OutOfRange),
Expand Down

0 comments on commit 753b4e8

Please sign in to comment.