mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-07-17 13:12:08 +00:00
Reordered the callback methods, shortened brief documentation
This commit is contained in:
parent
3cf4965ec7
commit
86214ec55b
@ -47,54 +47,6 @@ extern inline void add_key(uint8_t key);
|
|||||||
extern inline void del_key(uint8_t key);
|
extern inline void del_key(uint8_t key);
|
||||||
extern inline void clear_keys(void);
|
extern inline void clear_keys(void);
|
||||||
|
|
||||||
/** \brief Callback which is called when the one shot modifiers have been locked.
|
|
||||||
*/
|
|
||||||
__attribute__((weak))
|
|
||||||
void oneshot_locked_mods_set_user(uint8_t mods) { }
|
|
||||||
|
|
||||||
/** \brief Callback which is called when the locked one shot modifiers have been locked.
|
|
||||||
*/
|
|
||||||
__attribute__((weak))
|
|
||||||
void oneshot_locked_mods_set_kb(uint8_t mods) {
|
|
||||||
oneshot_locked_mods_set_user(mods);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** \brief Callback which is called when the one shot modifiers have been locked.
|
|
||||||
*/
|
|
||||||
__attribute__((weak))
|
|
||||||
void oneshot_locked_mods_cleared_user(void) { }
|
|
||||||
|
|
||||||
/** \brief Callback which is called when the locked one shot modifiers have been locked.
|
|
||||||
*/
|
|
||||||
__attribute__((weak))
|
|
||||||
void oneshot_locked_mods_cleared_kb(void) {
|
|
||||||
oneshot_locked_mods_cleared_user();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** \brief Callback which is called when the one shot modifiers have been set.
|
|
||||||
*/
|
|
||||||
__attribute__((weak))
|
|
||||||
void oneshot_mods_set_user(uint8_t mods) { }
|
|
||||||
|
|
||||||
/** \brief Callback which is called when the one shot modifiers have been cleared.
|
|
||||||
*/
|
|
||||||
__attribute__((weak))
|
|
||||||
void oneshot_mods_cleared_user(void) { }
|
|
||||||
|
|
||||||
/** \brief Callback which is called when the one shot modifiers have been set.
|
|
||||||
*/
|
|
||||||
__attribute__((weak))
|
|
||||||
void oneshot_mods_set_kb(uint8_t mods) {
|
|
||||||
oneshot_mods_set_user(mods);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** \brief Callback which is called when the one shot modifiers have been cleared.
|
|
||||||
*/
|
|
||||||
__attribute__((weak))
|
|
||||||
void oneshot_mods_cleared_kb() {
|
|
||||||
oneshot_mods_cleared_user();
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef NO_ACTION_ONESHOT
|
#ifndef NO_ACTION_ONESHOT
|
||||||
static int8_t oneshot_mods = 0;
|
static int8_t oneshot_mods = 0;
|
||||||
static int8_t oneshot_locked_mods = 0;
|
static int8_t oneshot_locked_mods = 0;
|
||||||
@ -339,6 +291,54 @@ uint8_t get_oneshot_mods(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/** \brief Called when the one shot modifiers have been locked.
|
||||||
|
*/
|
||||||
|
__attribute__((weak))
|
||||||
|
void oneshot_locked_mods_set_user(uint8_t mods) { }
|
||||||
|
|
||||||
|
/** \brief Called when the locked one shot modifiers have been locked.
|
||||||
|
*/
|
||||||
|
__attribute__((weak))
|
||||||
|
void oneshot_locked_mods_set_kb(uint8_t mods) {
|
||||||
|
oneshot_locked_mods_set_user(mods);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** \brief Called when the one shot modifiers have been locked.
|
||||||
|
*/
|
||||||
|
__attribute__((weak))
|
||||||
|
void oneshot_locked_mods_cleared_user(void) { }
|
||||||
|
|
||||||
|
/** \brief Called when the locked one shot modifiers have been locked.
|
||||||
|
*/
|
||||||
|
__attribute__((weak))
|
||||||
|
void oneshot_locked_mods_cleared_kb(void) {
|
||||||
|
oneshot_locked_mods_cleared_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** \brief Called when the one shot modifiers have been set.
|
||||||
|
*/
|
||||||
|
__attribute__((weak))
|
||||||
|
void oneshot_mods_set_user(uint8_t mods) { }
|
||||||
|
|
||||||
|
/** \brief Called when the one shot modifiers have been set.
|
||||||
|
*/
|
||||||
|
__attribute__((weak))
|
||||||
|
void oneshot_mods_set_kb(uint8_t mods) {
|
||||||
|
oneshot_mods_set_user(mods);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** \brief Called when the one shot modifiers have been cleared.
|
||||||
|
*/
|
||||||
|
__attribute__((weak))
|
||||||
|
void oneshot_mods_cleared_user(void) { }
|
||||||
|
|
||||||
|
/** \brief Called when the one shot modifiers have been cleared.
|
||||||
|
*/
|
||||||
|
__attribute__((weak))
|
||||||
|
void oneshot_mods_cleared_kb() {
|
||||||
|
oneshot_mods_cleared_user();
|
||||||
|
}
|
||||||
|
|
||||||
/** \brief inspect keyboard state
|
/** \brief inspect keyboard state
|
||||||
*
|
*
|
||||||
* FIXME: needs doc
|
* FIXME: needs doc
|
||||||
|
@ -28,15 +28,6 @@ extern report_keyboard_t *keyboard_report;
|
|||||||
|
|
||||||
void send_keyboard_report(void);
|
void send_keyboard_report(void);
|
||||||
|
|
||||||
void oneshot_locked_mods_set_user(uint8_t mods);
|
|
||||||
void oneshot_locked_mods_set_kb(uint8_t mods);
|
|
||||||
void oneshot_locked_mods_cleared_user(void);
|
|
||||||
void oneshot_locked_mods_cleared_kb(void);
|
|
||||||
void oneshot_mods_set_user(uint8_t mods);
|
|
||||||
void oneshot_mods_set_kb(uint8_t mods);
|
|
||||||
void oneshot_mods_cleared_user(void);
|
|
||||||
void oneshot_mods_cleared_kb(void);
|
|
||||||
|
|
||||||
/* key */
|
/* key */
|
||||||
inline void add_key(uint8_t key) {
|
inline void add_key(uint8_t key) {
|
||||||
add_key_to_report(keyboard_report, key);
|
add_key_to_report(keyboard_report, key);
|
||||||
@ -98,6 +89,15 @@ bool is_oneshot_layer_active(void);
|
|||||||
uint8_t get_oneshot_layer_state(void);
|
uint8_t get_oneshot_layer_state(void);
|
||||||
bool has_oneshot_layer_timed_out(void);
|
bool has_oneshot_layer_timed_out(void);
|
||||||
|
|
||||||
|
void oneshot_locked_mods_set_user(uint8_t mods);
|
||||||
|
void oneshot_locked_mods_set_kb(uint8_t mods);
|
||||||
|
void oneshot_locked_mods_cleared_user(void);
|
||||||
|
void oneshot_locked_mods_cleared_kb(void);
|
||||||
|
void oneshot_mods_set_user(uint8_t mods);
|
||||||
|
void oneshot_mods_set_kb(uint8_t mods);
|
||||||
|
void oneshot_mods_cleared_user(void);
|
||||||
|
void oneshot_mods_cleared_kb(void);
|
||||||
|
|
||||||
/* inspect */
|
/* inspect */
|
||||||
uint8_t has_anymod(void);
|
uint8_t has_anymod(void);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user