aboutsummaryrefslogtreecommitdiff
path: root/quantum/process_keycode/process_haptic.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/process_keycode/process_haptic.c')
-rw-r--r--quantum/process_keycode/process_haptic.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/quantum/process_keycode/process_haptic.c b/quantum/process_keycode/process_haptic.c
index 64d455d00..466c8e554 100644
--- a/quantum/process_keycode/process_haptic.c
+++ b/quantum/process_keycode/process_haptic.c
@@ -17,6 +17,7 @@
17#include "process_haptic.h" 17#include "process_haptic.h"
18#include "quantum_keycodes.h" 18#include "quantum_keycodes.h"
19#include "action_tapping.h" 19#include "action_tapping.h"
20#include "usb_device_state.h"
20 21
21__attribute__((weak)) bool get_haptic_enabled_key(uint16_t keycode, keyrecord_t *record) { 22__attribute__((weak)) bool get_haptic_enabled_key(uint16_t keycode, keyrecord_t *record) {
22 switch (keycode) { 23 switch (keycode) {
@@ -32,6 +33,7 @@ __attribute__((weak)) bool get_haptic_enabled_key(uint16_t keycode, keyrecord_t
32 break; 33 break;
33 case KC_LCTRL ... KC_RGUI: 34 case KC_LCTRL ... KC_RGUI:
34 case QK_MOMENTARY ... QK_MOMENTARY_MAX: 35 case QK_MOMENTARY ... QK_MOMENTARY_MAX:
36 case QK_LAYER_MOD ... QK_LAYER_MOD_MAX:
35#endif 37#endif
36#ifdef NO_HAPTIC_FN 38#ifdef NO_HAPTIC_FN
37 case KC_FN0 ... KC_FN31: 39 case KC_FN0 ... KC_FN31:
@@ -130,7 +132,7 @@ bool process_haptic(uint16_t keycode, keyrecord_t *record) {
130 } 132 }
131 } 133 }
132 134
133 if (haptic_get_enable()) { 135 if (haptic_get_enable() && ((!HAPTIC_OFF_IN_LOW_POWER) || (usb_device_state == USB_DEVICE_STATE_CONFIGURED))) {
134 if (record->event.pressed) { 136 if (record->event.pressed) {
135 // keypress 137 // keypress
136 if (haptic_get_feedback() < 2 && get_haptic_enabled_key(keycode, record)) { 138 if (haptic_get_feedback() < 2 && get_haptic_enabled_key(keycode, record)) {