Skip to content

Commit

Permalink
fix button direction to match flipper orientation
Browse files Browse the repository at this point in the history
  • Loading branch information
rorosaurus authored Dec 27, 2022
1 parent 7007db8 commit 08b94b1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions views/bt_mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ static void bt_mouse_process(BtMouse* bt_mouse, InputEvent* event) {
void* model,
{
UNUSED(model);
if(event->key == InputKeyLeft) {
if(event->key == InputKeyUp) {
if(event->type == InputTypePress) {
bt_mouse_button_state(bt_mouse, HID_MOUSE_BTN_LEFT, true);
} else if(event->type == InputTypeRelease) {
bt_mouse_button_state(bt_mouse, HID_MOUSE_BTN_LEFT, false);
}
} else if(event->key == InputKeyRight) {
} else if(event->key == InputKeyDown) {
if(event->type == InputTypePress) {
bt_mouse_button_state(bt_mouse, HID_MOUSE_BTN_RIGHT, true);
} else if(event->type == InputTypeRelease) {
Expand All @@ -101,11 +101,11 @@ static void bt_mouse_process(BtMouse* bt_mouse, InputEvent* event) {
} else if(event->type == InputTypeRelease) {
bt_mouse_button_state(bt_mouse, HID_MOUSE_BTN_WHEEL, false);
}
} else if(event->key == InputKeyUp) {
} else if(event->key == InputKeyRight) {
if(event->type == InputTypePress) {
bt_mouse->wheel = MOUSE_SCROLL;
}
} else if(event->key == InputKeyDown) {
} else if(event->key == InputKeyLeft) {
if(event->type == InputTypePress) {
bt_mouse->wheel = -MOUSE_SCROLL;
}
Expand Down
8 changes: 4 additions & 4 deletions views/usb_mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ static void usb_mouse_process(UsbMouse* usb_mouse, InputEvent* event) {
void* model,
{
UNUSED(model);
if(event->key == InputKeyLeft) {
if(event->key == InputKeyUp) {
if(event->type == InputTypePress) {
furi_hal_hid_mouse_press(HID_MOUSE_BTN_LEFT);
} else if(event->type == InputTypeRelease) {
furi_hal_hid_mouse_release(HID_MOUSE_BTN_LEFT);
}
} else if(event->key == InputKeyRight) {
} else if(event->key == InputKeyDown) {
if(event->type == InputTypePress) {
furi_hal_hid_mouse_press(HID_MOUSE_BTN_RIGHT);
} else if(event->type == InputTypeRelease) {
Expand All @@ -47,11 +47,11 @@ static void usb_mouse_process(UsbMouse* usb_mouse, InputEvent* event) {
} else if(event->type == InputTypeRelease) {
furi_hal_hid_mouse_release(HID_MOUSE_BTN_WHEEL);
}
} else if(event->key == InputKeyUp) {
} else if(event->key == InputKeyRight) {
if(event->type == InputTypePress) {
furi_hal_hid_mouse_scroll(MOUSE_SCROLL);
}
} else if(event->key == InputKeyDown) {
} else if(event->key == InputKeyLeft) {
if(event->type == InputTypePress) {
furi_hal_hid_mouse_scroll(-MOUSE_SCROLL);
}
Expand Down

0 comments on commit 08b94b1

Please sign in to comment.