Quellcode durchsuchen

fix button direction to match flipper orientation

Rory O Hayes vor 3 Jahren
Ursprung
Commit
08b94b14d0
2 geänderte Dateien mit 8 neuen und 8 gelöschten Zeilen
  1. 4 4
      views/bt_mouse.c
  2. 4 4
      views/usb_mouse.c

+ 4 - 4
views/bt_mouse.c

@@ -83,13 +83,13 @@ static void bt_mouse_process(BtMouse* bt_mouse, InputEvent* event) {
         void* model,
         void* model,
         {
         {
             UNUSED(model);
             UNUSED(model);
-            if(event->key == InputKeyLeft) {
+            if(event->key == InputKeyUp) {
                 if(event->type == InputTypePress) {
                 if(event->type == InputTypePress) {
                     bt_mouse_button_state(bt_mouse, HID_MOUSE_BTN_LEFT, true);
                     bt_mouse_button_state(bt_mouse, HID_MOUSE_BTN_LEFT, true);
                 } else if(event->type == InputTypeRelease) {
                 } else if(event->type == InputTypeRelease) {
                     bt_mouse_button_state(bt_mouse, HID_MOUSE_BTN_LEFT, false);
                     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) {
                 if(event->type == InputTypePress) {
                     bt_mouse_button_state(bt_mouse, HID_MOUSE_BTN_RIGHT, true);
                     bt_mouse_button_state(bt_mouse, HID_MOUSE_BTN_RIGHT, true);
                 } else if(event->type == InputTypeRelease) {
                 } else if(event->type == InputTypeRelease) {
@@ -101,11 +101,11 @@ static void bt_mouse_process(BtMouse* bt_mouse, InputEvent* event) {
                 } else if(event->type == InputTypeRelease) {
                 } else if(event->type == InputTypeRelease) {
                     bt_mouse_button_state(bt_mouse, HID_MOUSE_BTN_WHEEL, false);
                     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) {
                 if(event->type == InputTypePress) {
                     bt_mouse->wheel = MOUSE_SCROLL;
                     bt_mouse->wheel = MOUSE_SCROLL;
                 }
                 }
-            } else if(event->key == InputKeyDown) {
+            } else if(event->key == InputKeyLeft) {
                 if(event->type == InputTypePress) {
                 if(event->type == InputTypePress) {
                     bt_mouse->wheel = -MOUSE_SCROLL;
                     bt_mouse->wheel = -MOUSE_SCROLL;
                 }
                 }

+ 4 - 4
views/usb_mouse.c

@@ -29,13 +29,13 @@ static void usb_mouse_process(UsbMouse* usb_mouse, InputEvent* event) {
         void* model,
         void* model,
         {
         {
             UNUSED(model);
             UNUSED(model);
-            if(event->key == InputKeyLeft) {
+            if(event->key == InputKeyUp) {
                 if(event->type == InputTypePress) {
                 if(event->type == InputTypePress) {
                     furi_hal_hid_mouse_press(HID_MOUSE_BTN_LEFT);
                     furi_hal_hid_mouse_press(HID_MOUSE_BTN_LEFT);
                 } else if(event->type == InputTypeRelease) {
                 } else if(event->type == InputTypeRelease) {
                     furi_hal_hid_mouse_release(HID_MOUSE_BTN_LEFT);
                     furi_hal_hid_mouse_release(HID_MOUSE_BTN_LEFT);
                 }
                 }
-            } else if(event->key == InputKeyRight) {
+            } else if(event->key == InputKeyDown) {
                 if(event->type == InputTypePress) {
                 if(event->type == InputTypePress) {
                     furi_hal_hid_mouse_press(HID_MOUSE_BTN_RIGHT);
                     furi_hal_hid_mouse_press(HID_MOUSE_BTN_RIGHT);
                 } else if(event->type == InputTypeRelease) {
                 } else if(event->type == InputTypeRelease) {
@@ -47,11 +47,11 @@ static void usb_mouse_process(UsbMouse* usb_mouse, InputEvent* event) {
                 } else if(event->type == InputTypeRelease) {
                 } else if(event->type == InputTypeRelease) {
                     furi_hal_hid_mouse_release(HID_MOUSE_BTN_WHEEL);
                     furi_hal_hid_mouse_release(HID_MOUSE_BTN_WHEEL);
                 }
                 }
-            } else if(event->key == InputKeyUp) {
+            } else if(event->key == InputKeyRight) {
                 if(event->type == InputTypePress) {
                 if(event->type == InputTypePress) {
                     furi_hal_hid_mouse_scroll(MOUSE_SCROLL);
                     furi_hal_hid_mouse_scroll(MOUSE_SCROLL);
                 }
                 }
-            } else if(event->key == InputKeyDown) {
+            } else if(event->key == InputKeyLeft) {
                 if(event->type == InputTypePress) {
                 if(event->type == InputTypePress) {
                     furi_hal_hid_mouse_scroll(-MOUSE_SCROLL);
                     furi_hal_hid_mouse_scroll(-MOUSE_SCROLL);
                 }
                 }