mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-07-18 13:42:00 +00:00
initial implementation for #25163
This commit is contained in:
parent
d33aa82c51
commit
89dff4462f
@ -336,6 +336,13 @@ void send_keyboard_report(void) {
|
|||||||
uint8_t get_mods(void) {
|
uint8_t get_mods(void) {
|
||||||
return real_mods;
|
return real_mods;
|
||||||
}
|
}
|
||||||
|
/** \brief Get mods
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
|
mod_t get_mod_state(void) {
|
||||||
|
return (mod_t)get_mods();
|
||||||
|
}
|
||||||
/** \brief add mods
|
/** \brief add mods
|
||||||
*
|
*
|
||||||
* FIXME: needs doc
|
* FIXME: needs doc
|
||||||
@ -372,6 +379,13 @@ void clear_mods(void) {
|
|||||||
uint8_t get_weak_mods(void) {
|
uint8_t get_weak_mods(void) {
|
||||||
return weak_mods;
|
return weak_mods;
|
||||||
}
|
}
|
||||||
|
/** \brief get weak mods
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
|
mod_t get_weak_mod_state(void) {
|
||||||
|
return (mod_t)get_weak_mods();
|
||||||
|
}
|
||||||
/** \brief add weak mods
|
/** \brief add weak mods
|
||||||
*
|
*
|
||||||
* FIXME: needs doc
|
* FIXME: needs doc
|
||||||
@ -434,6 +448,14 @@ uint8_t get_oneshot_mods(void) {
|
|||||||
return oneshot_mods;
|
return oneshot_mods;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief get oneshot mods
|
||||||
|
*
|
||||||
|
* FIXME: needs doc
|
||||||
|
*/
|
||||||
|
mod_t get_oneshot_mod_state(void) {
|
||||||
|
return (mod_t)get_oneshot_mods();
|
||||||
|
}
|
||||||
|
|
||||||
void add_oneshot_mods(uint8_t mods) {
|
void add_oneshot_mods(uint8_t mods) {
|
||||||
if ((oneshot_mods & mods) != mods) {
|
if ((oneshot_mods & mods) != mods) {
|
||||||
# if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0))
|
# if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0))
|
||||||
|
@ -25,6 +25,20 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
typedef union {
|
||||||
|
uint8_t raw;
|
||||||
|
struct {
|
||||||
|
bool left_ctrl: 1;
|
||||||
|
bool left_shift: 1;
|
||||||
|
bool left_alt: 1;
|
||||||
|
bool left_gui: 1;
|
||||||
|
bool right_ctrl: 1;
|
||||||
|
bool right_shift: 1;
|
||||||
|
bool right_alt: 1;
|
||||||
|
bool right_gui: 1;
|
||||||
|
};
|
||||||
|
} mod_t;
|
||||||
|
|
||||||
extern report_keyboard_t *keyboard_report;
|
extern report_keyboard_t *keyboard_report;
|
||||||
#ifdef NKRO_ENABLE
|
#ifdef NKRO_ENABLE
|
||||||
extern report_nkro_t *nkro_report;
|
extern report_nkro_t *nkro_report;
|
||||||
@ -47,6 +61,7 @@ inline void clear_keys(void) {
|
|||||||
|
|
||||||
/* modifier */
|
/* modifier */
|
||||||
uint8_t get_mods(void);
|
uint8_t get_mods(void);
|
||||||
|
mod_t get_mod_state(void);
|
||||||
void add_mods(uint8_t mods);
|
void add_mods(uint8_t mods);
|
||||||
void del_mods(uint8_t mods);
|
void del_mods(uint8_t mods);
|
||||||
void set_mods(uint8_t mods);
|
void set_mods(uint8_t mods);
|
||||||
@ -54,6 +69,7 @@ void clear_mods(void);
|
|||||||
|
|
||||||
/* weak modifier */
|
/* weak modifier */
|
||||||
uint8_t get_weak_mods(void);
|
uint8_t get_weak_mods(void);
|
||||||
|
mod_t get_weak_mod_state(void);
|
||||||
void add_weak_mods(uint8_t mods);
|
void add_weak_mods(uint8_t mods);
|
||||||
void del_weak_mods(uint8_t mods);
|
void del_weak_mods(uint8_t mods);
|
||||||
void set_weak_mods(uint8_t mods);
|
void set_weak_mods(uint8_t mods);
|
||||||
@ -61,6 +77,7 @@ void clear_weak_mods(void);
|
|||||||
|
|
||||||
/* oneshot modifier */
|
/* oneshot modifier */
|
||||||
uint8_t get_oneshot_mods(void);
|
uint8_t get_oneshot_mods(void);
|
||||||
|
mod_t get_oneshot_mod_state(void);
|
||||||
void add_oneshot_mods(uint8_t mods);
|
void add_oneshot_mods(uint8_t mods);
|
||||||
void del_oneshot_mods(uint8_t mods);
|
void del_oneshot_mods(uint8_t mods);
|
||||||
void set_oneshot_mods(uint8_t mods);
|
void set_oneshot_mods(uint8_t mods);
|
||||||
@ -68,6 +85,7 @@ void clear_oneshot_mods(void);
|
|||||||
bool has_oneshot_mods_timed_out(void);
|
bool has_oneshot_mods_timed_out(void);
|
||||||
|
|
||||||
uint8_t get_oneshot_locked_mods(void);
|
uint8_t get_oneshot_locked_mods(void);
|
||||||
|
mod_t get_oneshot_locked_mod_state(void);
|
||||||
void add_oneshot_locked_mods(uint8_t mods);
|
void add_oneshot_locked_mods(uint8_t mods);
|
||||||
void set_oneshot_locked_mods(uint8_t mods);
|
void set_oneshot_locked_mods(uint8_t mods);
|
||||||
void clear_oneshot_locked_mods(void);
|
void clear_oneshot_locked_mods(void);
|
||||||
|
Loading…
Reference in New Issue
Block a user