aboutsummaryrefslogtreecommitdiff
path: root/quantum/layer_lock.h
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2024-11-21 13:02:49 +0000
committerGitHub <noreply@github.com>2024-11-21 13:02:49 +0000
commit968a611476c7add787f737be9521d2968d1f4451 (patch)
tree57038a01ca75e2a33870696a84665d452ce6cc98 /quantum/layer_lock.h
parent65a8a5ff69289a5cb8fce6555b774573e4452a79 (diff)
Review fixes for layer lock feature (#24627)
Diffstat (limited to 'quantum/layer_lock.h')
-rw-r--r--quantum/layer_lock.h45
1 files changed, 4 insertions, 41 deletions
diff --git a/quantum/layer_lock.h b/quantum/layer_lock.h
index 6d7285da2a..97f6c60d70 100644
--- a/quantum/layer_lock.h
+++ b/quantum/layer_lock.h
@@ -49,13 +49,6 @@
*
* #define LAYER_LOCK_IDLE_TIMEOUT 60000 // Turn off after 60 seconds.
*
- * and call `layer_lock_task()` from your `matrix_scan_user()` in keymap.c:
- *
- * void matrix_scan_user(void) {
- * layer_lock_task();
- * // Other tasks...
- * }
- *
* For full documentation, see
* <https://getreuer.info/posts/keyboards/layer-lock>
*/
@@ -67,24 +60,6 @@
#include "action_layer.h"
#include "action_util.h"
-/**
- * Handler function for Layer Lock.
- *
- * In your keymap, define a custom keycode to use for Layer Lock. Then handle
- * Layer Lock from your `process_record_user` function by calling
- * `process_layer_lock`, passing your custom keycode for the `lock_keycode` arg:
- *
- * #include "features/layer_lock.h"
- *
- * bool process_record_user(uint16_t keycode, keyrecord_t* record) {
- * if (!process_layer_lock(keycode, record, LLOCK)) { return false; }
- * // Your macros ...
- *
- * return true;
- * }
- */
-
-#ifndef NO_ACTION_LAYER
/** Returns true if `layer` is currently locked. */
bool is_layer_locked(uint8_t layer);
@@ -116,20 +91,8 @@ void layer_lock_invert(uint8_t layer);
bool layer_lock_set_kb(layer_state_t locked_layers);
bool layer_lock_set_user(layer_state_t locked_layers);
+/** Handle various background tasks */
void layer_lock_task(void);
-#else // NO_ACTION_LAYER
-static inline bool is_layer_locked(uint8_t layer) {
- return false;
-}
-static inline void layer_lock_on(uint8_t layer) {}
-static inline void layer_lock_off(uint8_t layer) {}
-static inline void layer_lock_all_off(void) {}
-static inline void layer_lock_invert(uint8_t layer) {}
-static inline bool layer_lock_set_kb(layer_state_t locked_layers) {
- return true;
-}
-static inline bool layer_lock_set_user(layer_state_t locked_layers) {
- return true;
-}
-static inline void layer_lock_task(void) {}
-#endif // NO_ACTION_LAYER
+
+/** Update any configured timeouts */
+void layer_lock_activity_trigger(void);