qmk_firmware

QMK firmware for my keyboards (Corne, Sweep Ferris) and trackball (Ploopy Adept)
Log | Files | Refs | Submodules | LICENSE

secure.md (3196B)


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