Просмотр исходного кода

fix button direction to match flipper orientation

Rory O Hayes 3 лет назад
Родитель
Сommit
08b94b14d0
2 измененных файлов с 8 добавлено и 8 удалено
  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,
         {
             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) {
@@ -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;
                 }

+ 4 - 4
views/usb_mouse.c

@@ -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) {
@@ -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);
                 }