parent
f08d305d83
commit
8b99499ac0
|
@ -1,7 +1,7 @@
|
||||||
cmake_minimum_required(VERSION 3.6)
|
cmake_minimum_required(VERSION 3.6)
|
||||||
|
|
||||||
set(VERSION_MAJOR 00)
|
set(VERSION_MAJOR 00)
|
||||||
set(VERSION_MINOR 157)
|
set(VERSION_MINOR 158)
|
||||||
|
|
||||||
set(PICO_SDK_FETCH_FROM_GIT off)
|
set(PICO_SDK_FETCH_FROM_GIT off)
|
||||||
set(PICO_BOARD=pico)
|
set(PICO_BOARD=pico)
|
||||||
|
|
|
@ -68,9 +68,9 @@ void switchlock_hotkey_handler(device_t *state, hid_keyboard_report_t *report) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This key combo toggles gaming mode */
|
/* This key combo toggles gaming mode */
|
||||||
void toggle_relative_mode_handler(device_t *state, hid_keyboard_report_t *report) {
|
void toggle_gaming_mode_handler(device_t *state, hid_keyboard_report_t *report) {
|
||||||
state->relative_mouse ^= 1;
|
state->gaming_mode ^= 1;
|
||||||
send_value(state->relative_mouse, RELATIVE_MODE_MSG);
|
send_value(state->gaming_mode, GAMING_MODE_MSG);
|
||||||
};
|
};
|
||||||
|
|
||||||
/* This key combo locks both outputs simultaneously */
|
/* This key combo locks both outputs simultaneously */
|
||||||
|
@ -229,9 +229,9 @@ void handle_proxy_msg(uart_packet_t *packet, device_t *state) {
|
||||||
queue_packet(&packet->data[1], (enum packet_type_e)packet->data[0], PACKET_DATA_LENGTH - 1);
|
queue_packet(&packet->data[1], (enum packet_type_e)packet->data[0], PACKET_DATA_LENGTH - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Process request to reboot the board */
|
/* Process relative mouse command */
|
||||||
void handle_toggle_relative_msg(uart_packet_t *packet, device_t *state) {
|
void handle_toggle_gaming_msg(uart_packet_t *packet, device_t *state) {
|
||||||
state->relative_mouse = packet->data[0];
|
state->gaming_mode = packet->data[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Process api communication messages */
|
/* Process api communication messages */
|
||||||
|
|
|
@ -124,7 +124,7 @@ enum packet_type_e {
|
||||||
FLASH_LED_MSG = 9,
|
FLASH_LED_MSG = 9,
|
||||||
WIPE_CONFIG_MSG = 10,
|
WIPE_CONFIG_MSG = 10,
|
||||||
HEARTBEAT_MSG = 12,
|
HEARTBEAT_MSG = 12,
|
||||||
RELATIVE_MODE_MSG = 13,
|
GAMING_MODE_MSG = 13,
|
||||||
CONSUMER_CONTROL_MSG = 14,
|
CONSUMER_CONTROL_MSG = 14,
|
||||||
SYSTEM_CONTROL_MSG = 15,
|
SYSTEM_CONTROL_MSG = 15,
|
||||||
SAVE_CONFIG_MSG = 18,
|
SAVE_CONFIG_MSG = 18,
|
||||||
|
@ -185,7 +185,6 @@ typedef struct {
|
||||||
/********* Screen **********/
|
/********* Screen **********/
|
||||||
#define MIN_SCREEN_COORD 0
|
#define MIN_SCREEN_COORD 0
|
||||||
#define MAX_SCREEN_COORD 32767
|
#define MAX_SCREEN_COORD 32767
|
||||||
#define SCREEN_MIDPOINT 16384
|
|
||||||
|
|
||||||
/********* Configuration storage definitions **********/
|
/********* Configuration storage definitions **********/
|
||||||
|
|
||||||
|
@ -424,6 +423,7 @@ typedef struct {
|
||||||
bool switch_lock; // True when device is prevented from switching
|
bool switch_lock; // True when device is prevented from switching
|
||||||
bool onboard_led_state; // True when LED is ON
|
bool onboard_led_state; // True when LED is ON
|
||||||
bool relative_mouse; // True when relative mouse mode is used
|
bool relative_mouse; // True when relative mouse mode is used
|
||||||
|
bool gaming_mode; // True when gaming mode is on (relative passthru + lock)
|
||||||
bool config_mode_active; // True when config mode is active
|
bool config_mode_active; // True when config mode is active
|
||||||
bool digitizer_active; // True when digitizer Win/Mac workaround is active
|
bool digitizer_active; // True when digitizer Win/Mac workaround is active
|
||||||
|
|
||||||
|
@ -534,7 +534,7 @@ void fw_upgrade_hotkey_handler_B(device_t *, hid_keyboard_report_t *);
|
||||||
void mouse_zoom_hotkey_handler(device_t *, hid_keyboard_report_t *);
|
void mouse_zoom_hotkey_handler(device_t *, hid_keyboard_report_t *);
|
||||||
void all_keys_released_handler(device_t *);
|
void all_keys_released_handler(device_t *);
|
||||||
void switchlock_hotkey_handler(device_t *, hid_keyboard_report_t *);
|
void switchlock_hotkey_handler(device_t *, hid_keyboard_report_t *);
|
||||||
void toggle_relative_mode_handler(device_t *, hid_keyboard_report_t *);
|
void toggle_gaming_mode_handler(device_t *, hid_keyboard_report_t *);
|
||||||
void screenlock_hotkey_handler(device_t *, hid_keyboard_report_t *);
|
void screenlock_hotkey_handler(device_t *, hid_keyboard_report_t *);
|
||||||
void output_config_hotkey_handler(device_t *, hid_keyboard_report_t *);
|
void output_config_hotkey_handler(device_t *, hid_keyboard_report_t *);
|
||||||
void wipe_config_hotkey_handler(device_t *, hid_keyboard_report_t *);
|
void wipe_config_hotkey_handler(device_t *, hid_keyboard_report_t *);
|
||||||
|
@ -561,7 +561,7 @@ void handle_heartbeat_msg(uart_packet_t *, device_t *);
|
||||||
void handle_proxy_msg(uart_packet_t *, device_t *);
|
void handle_proxy_msg(uart_packet_t *, device_t *);
|
||||||
void handle_api_msgs(uart_packet_t *, device_t *);
|
void handle_api_msgs(uart_packet_t *, device_t *);
|
||||||
void handle_api_read_all_msg(uart_packet_t *, device_t *);
|
void handle_api_read_all_msg(uart_packet_t *, device_t *);
|
||||||
void handle_toggle_relative_msg(uart_packet_t *, device_t *);
|
void handle_toggle_gaming_msg(uart_packet_t *, device_t *);
|
||||||
|
|
||||||
void switch_output(device_t *, uint8_t);
|
void switch_output(device_t *, uint8_t);
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ hotkey_combo_t hotkeys[] = {
|
||||||
.keys = {HID_KEY_G},
|
.keys = {HID_KEY_G},
|
||||||
.key_count = 1,
|
.key_count = 1,
|
||||||
.acknowledge = true,
|
.acknowledge = true,
|
||||||
.action_handler = &toggle_relative_mode_handler},
|
.action_handler = &toggle_gaming_mode_handler},
|
||||||
|
|
||||||
/* Erase stored config */
|
/* Erase stored config */
|
||||||
{.modifier = KEYBOARD_MODIFIER_RIGHTSHIFT,
|
{.modifier = KEYBOARD_MODIFIER_RIGHTSHIFT,
|
||||||
|
|
|
@ -184,8 +184,8 @@ void check_screen_switch(const mouse_values_t *values, device_t *state) {
|
||||||
|
|
||||||
int direction = jump_left ? LEFT : RIGHT;
|
int direction = jump_left ? LEFT : RIGHT;
|
||||||
|
|
||||||
/* No switching allowed if explicitly disabled */
|
/* No switching allowed if explicitly disabled or in gaming mode */
|
||||||
if (state->switch_lock)
|
if (state->switch_lock || state->gaming_mode)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* No jump condition met == nothing to do, return */
|
/* No jump condition met == nothing to do, return */
|
||||||
|
@ -243,7 +243,7 @@ mouse_report_t create_mouse_report(device_t *state, mouse_values_t *values) {
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Workaround for Windows multiple desktops */
|
/* Workaround for Windows multiple desktops */
|
||||||
if (state->relative_mouse) {
|
if (state->relative_mouse || state->gaming_mode) {
|
||||||
mouse_report.x = values->move_x;
|
mouse_report.x = values->move_x;
|
||||||
mouse_report.y = values->move_y;
|
mouse_report.y = values->move_y;
|
||||||
mouse_report.mode = RELATIVE;
|
mouse_report.mode = RELATIVE;
|
||||||
|
|
|
@ -76,7 +76,7 @@ const uart_handler_t uart_handler[] = {
|
||||||
{.type = SWITCH_LOCK_MSG, .handler = handle_switch_lock_msg},
|
{.type = SWITCH_LOCK_MSG, .handler = handle_switch_lock_msg},
|
||||||
{.type = SYNC_BORDERS_MSG, .handler = handle_sync_borders_msg},
|
{.type = SYNC_BORDERS_MSG, .handler = handle_sync_borders_msg},
|
||||||
{.type = FLASH_LED_MSG, .handler = handle_flash_led_msg},
|
{.type = FLASH_LED_MSG, .handler = handle_flash_led_msg},
|
||||||
{.type = RELATIVE_MODE_MSG, .handler = handle_toggle_relative_msg},
|
{.type = GAMING_MODE_MSG, .handler = handle_toggle_gaming_msg},
|
||||||
{.type = CONSUMER_CONTROL_MSG, .handler = handle_consumer_control_msg},
|
{.type = CONSUMER_CONTROL_MSG, .handler = handle_consumer_control_msg},
|
||||||
|
|
||||||
/* Config */
|
/* Config */
|
||||||
|
|
Loading…
Reference in New Issue