Skip to content

Commit

Permalink
Add keycodes KC_CONTROL_PANEL and KC_ASSISTANT
Browse files Browse the repository at this point in the history
  • Loading branch information
spidey3 committed Aug 30, 2022
1 parent 757a03c commit 774f13c
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docs/keycodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ See also: [Basic Keycodes](keycodes_basic.md)
|`KC_MEDIA_REWIND` |`KC_MRWD` |Previous Track |✔<sup>6</sup>|✔<sup>5</sup>||
|`KC_BRIGHTNESS_UP` |`KC_BRIU` |Brightness Up ||||
|`KC_BRIGHTNESS_DOWN` |`KC_BRID` |Brightness Down ||||
|`KC_CONTROL_PANEL` |`KC_CPNL` |Open Control Panel || | |
|`KC_ASSISTANT` |`KC_ASST` |Launch Context-Aware Assistant || | |

<sup>1. The Linux kernel HID driver recognizes [nearly all keycodes](https://github.com/torvalds/linux/blob/master/drivers/hid/hid-input.c), but the default bindings depend on the DE/WM.</sup><br/>
<sup>2. Treated as F13-F15.</sup><br/>
Expand Down
2 changes: 2 additions & 0 deletions docs/keycodes_basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ These keycodes are not part of the Keyboard/Keypad usage page. The `SYSTEM_` key
|`KC_MEDIA_REWIND` |`KC_MRWD`|Previous Track |
|`KC_BRIGHTNESS_UP` |`KC_BRIU`|Brightness Up |
|`KC_BRIGHTNESS_DOWN` |`KC_BRID`|Brightness Down |
|`KC_CONTROL_PANEL` |`KC_CPNL`|Open Control Panel |
|`KC_ASSISTANT` |`KC_ASST`|Launch Assistant |

## Number Pad

Expand Down
8 changes: 6 additions & 2 deletions quantum/keycode.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

#define IS_SPECIAL(code) ((0xA5 <= (code) && (code) <= 0xDF) || (0xE8 <= (code) && (code) <= 0xFF))
#define IS_SYSTEM(code) (KC_PWR <= (code) && (code) <= KC_WAKE)
#define IS_CONSUMER(code) (KC_MUTE <= (code) && (code) <= KC_BRID)
#define IS_CONSUMER(code) (KC_MUTE <= (code) && (code) <= KC_ASST)

#define IS_MOUSEKEY(code) (KC_MS_UP <= (code) && (code) <= KC_MS_ACCEL2)
#define IS_MOUSEKEY_MOVE(code) (KC_MS_UP <= (code) && (code) <= KC_MS_RIGHT)
Expand Down Expand Up @@ -205,6 +205,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define KC_MRWD KC_MEDIA_REWIND
#define KC_BRIU KC_BRIGHTNESS_UP
#define KC_BRID KC_BRIGHTNESS_DOWN
#define KC_CPNL KC_CONTROL_PANEL
#define KC_ASST KC_ASSISTANT

/* System Specific */
#define KC_BRMU KC_PAUSE
Expand Down Expand Up @@ -502,7 +504,9 @@ enum internal_special_keycodes {
KC_MEDIA_FAST_FORWARD,
KC_MEDIA_REWIND,
KC_BRIGHTNESS_UP,
KC_BRIGHTNESS_DOWN
KC_BRIGHTNESS_DOWN,
KC_CONTROL_PANEL,
KC_ASSISTANT // 0xC0
};

enum mouse_keys {
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ action_t action_for_keycode(uint16_t keycode) {
case KC_SYSTEM_POWER ... KC_SYSTEM_WAKE:
action.code = ACTION_USAGE_SYSTEM(KEYCODE2SYSTEM(keycode));
break;
case KC_AUDIO_MUTE ... KC_BRIGHTNESS_DOWN:
case KC_AUDIO_MUTE ... KC_ASSISTANT:
action.code = ACTION_USAGE_CONSUMER(KEYCODE2CONSUMER(keycode));
break;
#endif
Expand Down
2 changes: 2 additions & 0 deletions quantum/via_ensure_keycode.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ _Static_assert(KC_MFFD == 0x00BB, "");
_Static_assert(KC_MRWD == 0x00BC, "");
_Static_assert(KC_BRIU == 0x00BD, "");
_Static_assert(KC_BRID == 0x00BE, "");
_Static_assert(KC_CPNL == 0x00BF, "");
_Static_assert(KC_ASST == 0x00C0, "");

_Static_assert(KC_LEFT_CTRL == 0x00E0, "");
_Static_assert(KC_LEFT_SHIFT == 0x00E1, "");
Expand Down
4 changes: 4 additions & 0 deletions tmk_core/protocol/report.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,10 @@ static inline uint16_t KEYCODE2CONSUMER(uint8_t key) {
return AL_CALCULATOR;
case KC_MY_COMPUTER:
return AL_LOCAL_BROWSER;
case KC_CONTROL_PANEL:
return AL_CONTROL_PANEL;
case KC_ASSISTANT:
return AL_ASSISTANT;
case KC_WWW_SEARCH:
return AC_SEARCH;
case KC_WWW_HOME:
Expand Down

0 comments on commit 774f13c

Please sign in to comment.