Add "Call Mute" combo key for darp9
The proprietary firmware for the darp9 adds the mic mute hotkey using the new "Call Mute" hotkey from Windows 11 22H2, which is mapped to `Super+Alt+K` [1]. Match the behavior in open firmware. [1]: https://support.microsoft.com/en-us/windows/keyboard-shortcuts-in-windows-dcc61a57-8ff0-cffe-9796-cb9706c75eec#WindowsVersion=Windows_11 Signed-off-by: Tim Crawford <tcrawford@system76.com>
This commit is contained in:
committed by
Jeremy Soller
parent
399415fdf6
commit
2dd33ffec5
@ -255,6 +255,18 @@ bool kbscan_press(uint16_t key, bool pressed, uint8_t *layer) {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case COMBO_CALL_MUTE:
|
||||
if (kbscan_enabled) {
|
||||
if (pressed) {
|
||||
kbc_scancode(K_LEFT_SUPER, true);
|
||||
kbc_scancode(K_LEFT_ALT, true);
|
||||
kbc_scancode(K_K, true);
|
||||
kbc_scancode(K_LEFT_SUPER, false);
|
||||
kbc_scancode(K_LEFT_ALT, false);
|
||||
kbc_scancode(K_K, false);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case (KT_SCI):
|
||||
|
@ -57,6 +57,9 @@ uint16_t keymap_translate(uint16_t key);
|
||||
#define K_PRINT_SCREEN (KT_COMBO | COMBO_PRINT_SCREEN)
|
||||
#define COMBO_PAUSE 2
|
||||
#define K_PAUSE (KT_COMBO | COMBO_PAUSE)
|
||||
// Windows 11 22H2 "Call Mute" hotkey
|
||||
#define COMBO_CALL_MUTE 3
|
||||
#define K_CALL_MUTE (KT_COMBO | COMBO_CALL_MUTE)
|
||||
|
||||
// SCI
|
||||
#define KT_SCI (0x4000)
|
||||
|
@ -1,8 +1,10 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
// Darter Pro 9 layout
|
||||
// Nearly identical to the default layout, but replaces `K_KBD_COLOR` with
|
||||
// `K_KBD_BKL` as the RGB keyboard option was removed.
|
||||
// Nearly identical to the default layout. Replaces `K_KBD_COLOR` with
|
||||
// `K_KBD_BKL` as the RGB keyboard option was removed. Replaces
|
||||
// `K_DISPLAY_TOGGLE` with `K_CALL_MUTE` to match new keyboard legends and
|
||||
// proprietary firmware behavior.
|
||||
|
||||
#include <board/keymap.h>
|
||||
|
||||
@ -17,7 +19,7 @@ LAYOUT(
|
||||
K_LEFT_CTRL, KT_FN, K_LEFT_SUPER, K_LEFT_ALT, K_SPACE, K_RIGHT_ALT, K_APP, K_RIGHT_CTRL, K_LEFT, K_DOWN, K_RIGHT, K_NUM_0, K_NUM_PERIOD
|
||||
),
|
||||
LAYOUT(
|
||||
K_ESC, K_TOUCHPAD, K_DISPLAY_TOGGLE, K_MUTE, K_F4, K_VOLUME_DOWN, K_VOLUME_UP, K_DISPLAY_MODE, K_BRIGHTNESS_DOWN, K_BRIGHTNESS_UP, K_CAMERA_TOGGLE, K_AIRPLANE_MODE, K_SUSPEND, K_PRINT_SCREEN, K_SCROLL_LOCK, K_DEL, K_HOME, K_END, K_PAUSE, K_PAUSE,
|
||||
K_ESC, K_TOUCHPAD, K_CALL_MUTE, K_MUTE, K_F4, K_VOLUME_DOWN, K_VOLUME_UP, K_DISPLAY_MODE, K_BRIGHTNESS_DOWN, K_BRIGHTNESS_UP, K_CAMERA_TOGGLE, K_AIRPLANE_MODE, K_SUSPEND, K_PRINT_SCREEN, K_SCROLL_LOCK, K_DEL, K_HOME, K_END, K_PAUSE, K_PAUSE,
|
||||
K_PLAY_PAUSE, K_FAN_TOGGLE, K_2, K_3, K_4, K_5, K_6, K_7, K_8, K_9, K_0, K_MINUS, K_EQUALS, K_BKSP, K_NUM_LOCK, K_KBD_BKL, K_KBD_TOGGLE, K_KBD_DOWN,
|
||||
K_TAB, K_Q, K_W, K_E, K_R, K_T, K_Y, K_U, K_I, K_O, K_P, K_BRACE_OPEN, K_BRACE_CLOSE, K_BACKSLASH, K_NUM_7, K_NUM_8, K_NUM_9, K_KBD_UP,
|
||||
K_CAPS, K_A, K_S, K_D, K_F, K_G, K_H, K_J, K_K, K_L, K_SEMICOLON, K_QUOTE, K_ENTER, K_NUM_4, K_NUM_5, K_NUM_6,
|
||||
|
Reference in New Issue
Block a user