keychron_common.h (1496B)
1 /* Copyright 2022 @ Keychron (https://www.keychron.com) 2 * 3 * This program is free software: you can redistribute it and/or modify 4 * it under the terms of the GNU General Public License as published by 5 * the Free Software Foundation, either version 2 of the License, or 6 * (at your option) any later version. 7 * 8 * This program is distributed in the hope that it will be useful, 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * GNU General Public License for more details. 12 * 13 * You should have received a copy of the GNU General Public License 14 * along with this program. If not, see <http://www.gnu.org/licenses/>. 15 */ 16 17 #pragma once 18 19 #include <stdint.h> 20 #include <stdbool.h> 21 #include "action.h" 22 23 #ifdef VIA_ENABLE 24 # include "via.h" 25 #endif 26 27 #include "quantum_keycodes.h" 28 29 enum custom_keycodes { 30 KC_LOPTN = QK_KB_2, // TECH DEBT: Starts at QK_KB_2 to maintain ordering with VIA definitions. See #19884. Revert to QK_KB_0 when VIA catches up with QMK. 31 KC_ROPTN, 32 KC_LCMMD, 33 KC_RCMMD, 34 KC_SIRI, 35 KC_TASK_VIEW, 36 KC_FILE_EXPLORER, 37 KC_SCREEN_SHOT, 38 KC_CORTANA 39 }; 40 41 #define KC_TASK KC_TASK_VIEW 42 #define KC_FLXP KC_FILE_EXPLORER 43 #define KC_SNAP KC_SCREEN_SHOT 44 #define KC_CRTA KC_CORTANA 45 46 typedef struct PACKED { 47 uint8_t len; 48 uint8_t keycode[3]; 49 } key_combination_t; 50 51 void housekeeping_task_keychron(void); 52 bool process_record_keychron(uint16_t keycode, keyrecord_t *record);