mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-12 04:34:43 +04:00
HID PTT: adding global zoom shortcuts for macos
This commit is contained in:
@@ -54,6 +54,7 @@ enum HidPushToTalkAppIndex {
|
|||||||
HidPushToTalkAppIndexTeamSpeak,
|
HidPushToTalkAppIndexTeamSpeak,
|
||||||
HidPushToTalkAppIndexWebex,
|
HidPushToTalkAppIndexWebex,
|
||||||
HidPushToTalkAppIndexZoom,
|
HidPushToTalkAppIndexZoom,
|
||||||
|
HidPushToTalkAppIndexZoomGlobal,
|
||||||
HidPushToTalkAppIndexSize,
|
HidPushToTalkAppIndexSize,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -109,6 +110,40 @@ static void hid_ptt_trigger_hand_zoom(HidPushToTalk* hid_ptt) {
|
|||||||
hid_hal_keyboard_release(hid_ptt->hid, KEY_MOD_LEFT_ALT | HID_KEYBOARD_Y);
|
hid_hal_keyboard_release(hid_ptt->hid, KEY_MOD_LEFT_ALT | HID_KEYBOARD_Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// zoom global macos
|
||||||
|
static void hid_ptt_trigger_mute_macos_zoom_global(HidPushToTalk* hid_ptt) {
|
||||||
|
hid_hal_keyboard_press(
|
||||||
|
hid_ptt->hid,
|
||||||
|
KEY_MOD_LEFT_GUI | KEY_MOD_RIGHT_ALT | KEY_MOD_LEFT_SHIFT |
|
||||||
|
HID_KEYBOARD_M);
|
||||||
|
hid_hal_keyboard_release(
|
||||||
|
hid_ptt->hid,
|
||||||
|
KEY_MOD_LEFT_GUI | KEY_MOD_RIGHT_ALT | KEY_MOD_LEFT_SHIFT |
|
||||||
|
HID_KEYBOARD_M);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void hid_ptt_trigger_camera_macos_zoom_global(HidPushToTalk* hid_ptt) {
|
||||||
|
hid_hal_keyboard_press(
|
||||||
|
hid_ptt->hid,
|
||||||
|
KEY_MOD_LEFT_GUI | KEY_MOD_RIGHT_ALT | KEY_MOD_LEFT_SHIFT |
|
||||||
|
HID_KEYBOARD_U);
|
||||||
|
hid_hal_keyboard_release(
|
||||||
|
hid_ptt->hid,
|
||||||
|
KEY_MOD_LEFT_GUI | KEY_MOD_RIGHT_ALT | KEY_MOD_LEFT_SHIFT |
|
||||||
|
HID_KEYBOARD_U);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void hid_ptt_trigger_hand_zoom_global(HidPushToTalk* hid_ptt) {
|
||||||
|
hid_hal_keyboard_press(
|
||||||
|
hid_ptt->hid,
|
||||||
|
KEY_MOD_LEFT_GUI | KEY_MOD_RIGHT_ALT | KEY_MOD_LEFT_SHIFT |
|
||||||
|
HID_KEYBOARD_Y);
|
||||||
|
hid_hal_keyboard_release(
|
||||||
|
hid_ptt->hid,
|
||||||
|
KEY_MOD_LEFT_GUI | KEY_MOD_RIGHT_ALT | KEY_MOD_LEFT_SHIFT |
|
||||||
|
HID_KEYBOARD_Y);
|
||||||
|
}
|
||||||
|
|
||||||
// this one is widely used across different apps
|
// this one is widely used across different apps
|
||||||
static void hid_ptt_trigger_cmd_shift_m(HidPushToTalk* hid_ptt) {
|
static void hid_ptt_trigger_cmd_shift_m(HidPushToTalk* hid_ptt) {
|
||||||
hid_hal_keyboard_press(hid_ptt->hid, KEY_MOD_LEFT_GUI | KEY_MOD_LEFT_SHIFT | HID_KEYBOARD_M);
|
hid_hal_keyboard_press(hid_ptt->hid, KEY_MOD_LEFT_GUI | KEY_MOD_LEFT_SHIFT | HID_KEYBOARD_M);
|
||||||
@@ -457,6 +492,13 @@ static void hid_ptt_menu_callback(
|
|||||||
model->callback_start_ptt = hid_ptt_start_ptt_meet_zoom;
|
model->callback_start_ptt = hid_ptt_start_ptt_meet_zoom;
|
||||||
model->callback_stop_ptt = hid_ptt_stop_ptt_meet_zoom;
|
model->callback_stop_ptt = hid_ptt_stop_ptt_meet_zoom;
|
||||||
break;
|
break;
|
||||||
|
case HidPushToTalkAppIndexZoomGlobal:
|
||||||
|
model->callback_trigger_mute = hid_ptt_trigger_mute_macos_zoom_global;
|
||||||
|
model->callback_trigger_camera = hid_ptt_trigger_camera_macos_zoom_global;
|
||||||
|
model->callback_trigger_hand = hid_ptt_trigger_hand_zoom_global;
|
||||||
|
model->callback_start_ptt = hid_ptt_trigger_mute_macos_zoom_global;
|
||||||
|
model->callback_stop_ptt = hid_ptt_trigger_mute_macos_zoom_global;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
} else if(osIndex == HidPushToTalkLinux) {
|
} else if(osIndex == HidPushToTalkLinux) {
|
||||||
switch(appIndex) {
|
switch(appIndex) {
|
||||||
@@ -569,6 +611,14 @@ static void hid_ptt_menu_callback(
|
|||||||
"Teams:\n"
|
"Teams:\n"
|
||||||
"Go to Settings > Privacy. Make sure Keyboard shortcut to unmute is toggled on.\n\n";
|
"Go to Settings > Privacy. Make sure Keyboard shortcut to unmute is toggled on.\n\n";
|
||||||
break;
|
break;
|
||||||
|
case HidPushToTalkAppIndexZoomGlobal:
|
||||||
|
app_specific_help =
|
||||||
|
"Zoom (Global):\n"
|
||||||
|
"1. Go to Settings > Keyboard Shortcuts.\n"
|
||||||
|
"2. Find the 'Mute/Unmute' shortcut and click 'Edit'.\n"
|
||||||
|
"3. Press the Mute button in the app to bind it.\n"
|
||||||
|
"4. Check global checkbox.\n"
|
||||||
|
"5. Repeat for video and hand shortcuts.\n\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
FuriString* msg = furi_string_alloc();
|
FuriString* msg = furi_string_alloc();
|
||||||
@@ -1030,6 +1080,13 @@ HidPushToTalk* hid_ptt_alloc(Hid* hid) {
|
|||||||
HidPushToTalkAppIndexZoom,
|
HidPushToTalkAppIndexZoom,
|
||||||
hid_ptt_menu_callback,
|
hid_ptt_menu_callback,
|
||||||
hid_ptt);
|
hid_ptt);
|
||||||
|
ptt_menu_add_item_to_list(
|
||||||
|
hid->hid_ptt_menu,
|
||||||
|
HidPushToTalkMacOS,
|
||||||
|
"Zoom Global",
|
||||||
|
HidPushToTalkAppIndexZoomGlobal,
|
||||||
|
hid_ptt_menu_callback,
|
||||||
|
hid_ptt);
|
||||||
ptt_menu_add_item_to_list(
|
ptt_menu_add_item_to_list(
|
||||||
hid->hid_ptt_menu,
|
hid->hid_ptt_menu,
|
||||||
HidPushToTalkLinux,
|
HidPushToTalkLinux,
|
||||||
|
|||||||
Reference in New Issue
Block a user