Handle Haptic Feedback play on each half with support for remote sending
This commit is contained in:
parent
26ec38782e
commit
7ba6f4d639
5 changed files with 38 additions and 12 deletions
|
@ -129,19 +129,28 @@ bool process_haptic(uint16_t keycode, keyrecord_t *record) {
|
|||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void haptic_handle_key_event(uint8_t row, uint8_t col, bool pressed) {
|
||||
keyevent_t event = MAKE_KEYEVENT(row, col, pressed);
|
||||
keyrecord_t record = {.event = event};
|
||||
uint16_t keycode = get_event_keycode(event, false);
|
||||
|
||||
if (haptic_get_enable() && ((!HAPTIC_OFF_IN_LOW_POWER) || (usb_device_state_get_configure_state() == USB_DEVICE_STATE_CONFIGURED))) {
|
||||
if (record->event.pressed) {
|
||||
if (record.event.pressed) {
|
||||
// keypress
|
||||
if (haptic_get_feedback() < 2 && get_haptic_enabled_key(keycode, record)) {
|
||||
if (haptic_get_feedback() < 2 && get_haptic_enabled_key(keycode, &record)) {
|
||||
haptic_play();
|
||||
}
|
||||
} else {
|
||||
// keyrelease
|
||||
if (haptic_get_feedback() > 0 && get_haptic_enabled_key(keycode, record)) {
|
||||
if (haptic_get_feedback() > 0 && get_haptic_enabled_key(keycode, &record)) {
|
||||
haptic_play();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue