Skip to content

Commit 1862ef0

Browse files
fwk: map fn+left win to right win
Allows users to customize the behavior of fn+win by remapping right win in the OS. Signed-off-by: Jules Bertholet <[email protected]>
1 parent 553827c commit 1862ef0

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

board/hx20/keyboard_customization.c

+4
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,10 @@ int hotkey_special_key(uint16_t *key_code, int8_t pressed)
384384
/*if (!fn_table_set(pressed, KB_FN_S))*/
385385

386386
break;
387+
case SCANCODE_LEFT_WIN: /* RIGHT WIN */
388+
if (fn_table_set(pressed, KB_FN_LEFT_WIN))
389+
*key_code = SCANCODE_RIGHT_WIN;
390+
break;
387391
case SCANCODE_LEFT: /* HOME */
388392
if (fn_table_set(pressed, KB_FN_LEFT))
389393
*key_code = 0xe06c;

board/hx20/keyboard_customization.h

+1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ enum kb_fn_table {
9696
KB_FN_B = BIT(20),
9797
KB_FN_P = BIT(21),
9898
KB_FN_SPACE = BIT(22),
99+
KB_FN_LEFT_WIN = BIT(24),
99100
};
100101

101102
#ifdef CONFIG_KEYBOARD_BACKLIGHT

board/hx30/keyboard_customization.c

+4
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,10 @@ int hotkey_special_key(uint16_t *key_code, int8_t pressed)
384384
/*if (!fn_table_set(pressed, KB_FN_S))*/
385385

386386
break;
387+
case SCANCODE_LEFT_WIN: /* RIGHT WIN */
388+
if (fn_table_set(pressed, KB_FN_LEFT_WIN))
389+
*key_code = SCANCODE_RIGHT_WIN;
390+
break;
387391
case SCANCODE_LEFT: /* HOME */
388392
if (fn_table_set(pressed, KB_FN_LEFT))
389393
*key_code = 0xe06c;

board/hx30/keyboard_customization.h

+1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ enum kb_fn_table {
9696
KB_FN_B = BIT(20),
9797
KB_FN_P = BIT(21),
9898
KB_FN_SPACE = BIT(22),
99+
KB_FN_LEFT_WIN = BIT(24),
99100
};
100101

101102
#ifdef CONFIG_KEYBOARD_BACKLIGHT

0 commit comments

Comments
 (0)