Skip to content

Commit

Permalink
feat: allows to switch layers via hid
Browse files Browse the repository at this point in the history
  • Loading branch information
fdidron committed Mar 20, 2024
1 parent 983736e commit 1cd6926
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 7 additions & 2 deletions quantum/oryx.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,14 @@ void raw_hid_receive(uint8_t *data, uint8_t length) {
break; // Keeping this for backwards compatibility with older versions of Wally / Keymapp

case ORYX_SET_LAYER:
// The first param's byte is on / off
// The second param's byte is the layer number
if (rawhid_state.paired == true) {
layer_clear();
layer_on(param[0]);
if (param[0] == 0) {
layer_off(param[1]);
} else {
layer_on(param[1]);
}
}
break;

Expand Down
3 changes: 2 additions & 1 deletion quantum/oryx.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Once the host has paired, it can freely use the commands define in the Oryx_Comm
# define RAW_EPSIZE 32
#endif

#define ORYX_PROTOCOL_VERSION = 0x02
#define ORYX_PROTOCOL_VERSION = 0x03
#define ORYX_STOP_BIT -2

enum Oryx_Command_Code {
Expand All @@ -47,6 +47,7 @@ enum Oryx_Event_Code {
ORYX_EVT_KEYDOWN,
ORYX_EVT_KEYUP,
ORYX_EVT_RGB_CONTROL,
ORYX_EVT_TOGGLE_SMART_LAYER,
ORYX_EVT_GET_PROTOCOL_VERSION = 0XFE,
ORYX_EVT_ERROR = 0xFF,
};
Expand Down

0 comments on commit 1cd6926

Please sign in to comment.