Fix shake to undo

pull/5516/merge^2
skullY 6 years ago
parent 269de5f4d7
commit d8348bae56

@ -53,8 +53,10 @@ void matrix_scan_kb(void) {
if ((detected_shakes > 0) && (timer_elapsed(shake_timer) > SHAKE_TIMEOUT)) {
if (detected_shakes > SHAKE_COUNT) {
dprintf("Shake detected! We had %d shakes detected.\n", detected_shakes);
dprintf("Shake triggered! We detected %d shakes.\n", detected_shakes);
tap_code16(SHAKE_KEY);
} else {
dprintf("Shake not triggered! We detected %d shakes.\n", detected_shakes);
}
detected_shakes = 0;
}

@ -200,8 +200,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#endif
/*
* Key to press when we do shake to undo.
* Shake to undo configuration
*/
#define SHAKE_ENABLE
#define SHAKE_PIN_A E4
#define SHAKE_PIN_B E5
#define SHAKE_TIMEOUT 500 // How long after shaking stops before we register it

@ -12,11 +12,10 @@ BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
MOUSEKEY_ENABLE = yes # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = yes # Console for debug
COMMAND_ENABLE = no # Commands for debug and configuration
COMMAND_ENABLE = yes # Commands for debug and configuration
ENCODER_ENABLE = yes # Rotary encoder (knob) support
NKRO_ENABLE = yes # USB Nkey Rollover
MIDI_ENABLE = no # MIDI support
UNICODE_ENABLE = no # Unicode
RGBLIGHT_ENABLE = yes # RGB on pin C5
AUDIO_ENABLE = yes # Audio output on pin C4 and B7
SHAKE_ENABLE = yes # Shake to undo

Loading…
Cancel
Save