vial: add security-related features

This commit is contained in:
Ilya Zhuravlev
2020-12-27 08:03:10 -05:00
parent 77ddf078f5
commit 6716b76f6c
6 changed files with 90 additions and 2 deletions

View File

@ -22,6 +22,10 @@
#include "dynamic_keymap.h"
#include "via.h" // for default VIA_EEPROM_ADDR_END
#ifdef VIAL_ENABLE
#include "vial.h"
#endif
#ifndef DYNAMIC_KEYMAP_MACRO_COUNT
# define DYNAMIC_KEYMAP_MACRO_COUNT 16
#endif
@ -183,6 +187,12 @@ extern uint16_t g_vial_magic_keycode_override;
// This overrides the one in quantum/keymap_common.c
uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key) {
#ifdef VIAL_ENABLE
/* Disable any keycode processing while unlocking */
if (vial_unlock_in_progress)
return KC_NO;
#endif
#ifdef VIAL_ENCODERS_ENABLE
if (key.row == 254 && key.col == 254)
return g_vial_magic_keycode_override;