logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

secure.md (3196B)


  1. # Secure
  2. The secure feature aims to prevent unwanted interaction without user intervention.
  3. ::: tip
  4. Secure does **not** currently implement encryption/decryption/etc and should not be a replacement where a strong hardware/software based solution is required.
  5. :::
  6. ### Unlock sequence
  7. To unlock, the user must perform a set of actions. This can optionally be configured to be multiple keys.
  8. * While unlocking all keyboard input is ignored
  9. * Incorrect attempts will revert back to the previously locked state
  10. ### Automatic Locking
  11. Once unlocked, the keyboard will revert back to a locked state after the configured timeout.
  12. The timeout can be refreshed by using the `secure_activity_event` function, for example from one of the various [hooks](../custom_quantum_functions).
  13. ## Usage
  14. Add the following to your `rules.mk`:
  15. ```make
  16. SECURE_ENABLE = yes
  17. ```
  18. ## Keycodes
  19. | Key |Aliases | Description |
  20. |---------------------|---------|--------------------------------------------------------------------------------|
  21. | `QK_SECURE_LOCK` |`SE_LOCK`| Revert back to a locked state |
  22. | `QK_SECURE_UNLOCK` |`SE_UNLK`| Forces unlock without performing a unlock sequence |
  23. | `QK_SECURE_TOGGLE` |`SE_TOGG`| Toggle directly between locked and unlock without performing a unlock sequence |
  24. | `QK_SECURE_REQUEST` |`SE_REQ` | Request that user perform the unlock sequence |
  25. ## Configuration
  26. | Define | Default | Description |
  27. |-------------------------|----------------|---------------------------------------------------------------------------------|
  28. |`SECURE_UNLOCK_TIMEOUT` | `5000` | Timeout for the user to perform the configured unlock sequence - `0` to disable |
  29. |`SECURE_IDLE_TIMEOUT` | `60000` | Timeout while unlocked before returning to locked - `0` to disable |
  30. |`SECURE_UNLOCK_SEQUENCE` | `{ { 0, 0 } }` | Array of matrix locations describing a sequential sequence of keypresses |
  31. ## Functions
  32. | Function | Description |
  33. |---------------------------|----------------------------------------------------------------------------|
  34. | `secure_is_locked()` | Check if the device is currently locked |
  35. | `secure_is_unlocking()` | Check if an unlock sequence is currently in progress |
  36. | `secure_is_unlocked()` | Check if the device is currently unlocked |
  37. | `secure_lock()` | Lock down the device |
  38. | `secure_unlock()` | Force unlock the device - bypasses user unlock sequence |
  39. | `secure_request_unlock()` | Begin listening for an unlock sequence |
  40. | `secure_activity_event()` | Flag that user activity has happened and the device should remain unlocked |