2 Copyright 2013 Jun Wako <wakojun@gmail.com>
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
27 extern report_keyboard_t *keyboard_report;
29 void send_keyboard_report(void);
32 inline void add_key(uint8_t key) {
33 add_key_to_report(keyboard_report, key);
36 inline void del_key(uint8_t key) {
37 del_key_from_report(keyboard_report, key);
40 inline void clear_keys(void) {
41 clear_keys_from_report(keyboard_report);
45 uint8_t get_mods(void);
46 void add_mods(uint8_t mods);
47 void del_mods(uint8_t mods);
48 void set_mods(uint8_t mods);
49 void clear_mods(void);
52 uint8_t get_weak_mods(void);
53 void add_weak_mods(uint8_t mods);
54 void del_weak_mods(uint8_t mods);
55 void set_weak_mods(uint8_t mods);
56 void clear_weak_mods(void);
59 uint8_t get_macro_mods(void);
60 void add_macro_mods(uint8_t mods);
61 void del_macro_mods(uint8_t mods);
62 void set_macro_mods(uint8_t mods);
63 void clear_macro_mods(void);
65 /* oneshot modifier */
66 void set_oneshot_mods(uint8_t mods);
67 uint8_t get_oneshot_mods(void);
68 void clear_oneshot_mods(void);
69 void oneshot_toggle(void);
70 void oneshot_enable(void);
71 void oneshot_disable(void);
72 bool has_oneshot_mods_timed_out(void);
74 int8_t get_oneshot_locked_mods(void);
75 void set_oneshot_locked_mods(int8_t mods);
76 void clear_oneshot_locked_mods(void);
79 ONESHOT_PRESSED = 0b01,
80 ONESHOT_OTHER_KEY_PRESSED = 0b10,
82 ONESHOT_TOGGLED = 0b100
83 } oneshot_fullfillment_t;
84 void set_oneshot_layer(uint8_t layer, uint8_t state);
85 uint8_t get_oneshot_layer(void);
86 void clear_oneshot_layer_state(oneshot_fullfillment_t state);
87 void reset_oneshot_layer(void);
88 bool is_oneshot_layer_active(void);
89 uint8_t get_oneshot_layer_state(void);
90 bool has_oneshot_layer_timed_out(void);
93 uint8_t has_anymod(void);