2022-11-28 19:27:16 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <furi.h>
|
|
|
|
#include <furi_hal_bt.h>
|
|
|
|
#include <furi_hal_bt_hid.h>
|
|
|
|
#include <furi_hal_usb.h>
|
|
|
|
#include <furi_hal_usb_hid.h>
|
|
|
|
|
|
|
|
#include <bt/bt_service/bt.h>
|
|
|
|
#include <gui/gui.h>
|
|
|
|
#include <gui/view.h>
|
|
|
|
#include <gui/view_dispatcher.h>
|
|
|
|
#include <notification/notification.h>
|
2022-12-20 15:32:24 +03:00
|
|
|
#include <storage/storage.h>
|
2022-11-28 19:27:16 +03:00
|
|
|
|
|
|
|
#include <gui/modules/submenu.h>
|
|
|
|
#include <gui/modules/dialog_ex.h>
|
|
|
|
#include <gui/modules/popup.h>
|
|
|
|
#include "views/hid_keynote.h"
|
2023-04-20 22:45:19 +03:00
|
|
|
#include "views/hid_keynote_vertical.h"
|
2022-11-28 19:27:16 +03:00
|
|
|
#include "views/hid_keyboard.h"
|
2023-05-02 20:25:05 +03:00
|
|
|
#include "views/hid_numpad.h"
|
2022-11-28 19:27:16 +03:00
|
|
|
#include "views/hid_media.h"
|
|
|
|
#include "views/hid_mouse.h"
|
2022-12-12 12:47:22 +03:00
|
|
|
#include "views/hid_mouse_jiggler.h"
|
2022-11-28 19:27:16 +03:00
|
|
|
#include "views/hid_tiktok.h"
|
2023-04-14 03:35:42 +03:00
|
|
|
#include "views/hid_ytshorts.h"
|
2022-11-28 19:27:16 +03:00
|
|
|
|
2023-03-01 20:57:27 +03:00
|
|
|
#define HID_BT_KEYS_STORAGE_NAME ".bt_hid.keys"
|
2022-12-20 15:32:24 +03:00
|
|
|
|
2022-11-28 19:27:16 +03:00
|
|
|
typedef enum {
|
|
|
|
HidTransportUsb,
|
|
|
|
HidTransportBle,
|
|
|
|
} HidTransport;
|
|
|
|
|
|
|
|
typedef struct Hid Hid;
|
|
|
|
|
|
|
|
struct Hid {
|
|
|
|
Bt* bt;
|
|
|
|
Gui* gui;
|
|
|
|
NotificationApp* notifications;
|
|
|
|
ViewDispatcher* view_dispatcher;
|
|
|
|
Submenu* device_type_submenu;
|
|
|
|
DialogEx* dialog;
|
|
|
|
HidKeynote* hid_keynote;
|
2023-04-20 22:45:19 +03:00
|
|
|
HidKeynoteVertical* hid_keynote_vertical;
|
2022-11-28 19:27:16 +03:00
|
|
|
HidKeyboard* hid_keyboard;
|
2023-05-02 20:25:05 +03:00
|
|
|
HidNumpad* hid_numpad;
|
2022-11-28 19:27:16 +03:00
|
|
|
HidMedia* hid_media;
|
|
|
|
HidMouse* hid_mouse;
|
2022-12-12 12:47:22 +03:00
|
|
|
HidMouseJiggler* hid_mouse_jiggler;
|
2022-11-28 19:27:16 +03:00
|
|
|
HidTikTok* hid_tiktok;
|
2023-04-14 03:35:42 +03:00
|
|
|
HidYTShorts* hid_ytshorts;
|
2022-11-28 19:27:16 +03:00
|
|
|
|
|
|
|
HidTransport transport;
|
|
|
|
uint32_t view_id;
|
|
|
|
};
|
|
|
|
|
|
|
|
void hid_hal_keyboard_press(Hid* instance, uint16_t event);
|
|
|
|
void hid_hal_keyboard_release(Hid* instance, uint16_t event);
|
|
|
|
void hid_hal_keyboard_release_all(Hid* instance);
|
|
|
|
|
|
|
|
void hid_hal_consumer_key_press(Hid* instance, uint16_t event);
|
|
|
|
void hid_hal_consumer_key_release(Hid* instance, uint16_t event);
|
|
|
|
void hid_hal_consumer_key_release_all(Hid* instance);
|
|
|
|
|
|
|
|
void hid_hal_mouse_move(Hid* instance, int8_t dx, int8_t dy);
|
|
|
|
void hid_hal_mouse_scroll(Hid* instance, int8_t delta);
|
|
|
|
void hid_hal_mouse_press(Hid* instance, uint16_t event);
|
|
|
|
void hid_hal_mouse_release(Hid* instance, uint16_t event);
|
2023-04-20 22:45:19 +03:00
|
|
|
void hid_hal_mouse_release_all(Hid* instance);
|