removed layer haptic except for mouse layer, added copy paste haptic

This commit is contained in:
Sadek Baroudi 2022-09-14 01:26:28 -07:00
parent a770872595
commit b26c67fa01
3 changed files with 43 additions and 9 deletions

View File

@ -7,27 +7,27 @@ layer_state_t layer_state_set_haptic(layer_state_t state) {
case _ALPHA_ALT:
case _ALPHA:
#ifdef HAPTIC_ENABLE
DRV_pulse(soft_bump);
// DRV_pulse(soft_bump);
#endif
break;
case _NAVIGATION:
#ifdef HAPTIC_ENABLE
DRV_pulse(sh_dblsharp_tick);
// DRV_pulse(sh_dblsharp_tick);
#endif
break;
case _SYMBOLS:
#ifdef HAPTIC_ENABLE
DRV_pulse(lg_dblclick_str);
// DRV_pulse(lg_dblclick_str);
#endif
break;
case _FUNCTION:
#ifdef HAPTIC_ENABLE
DRV_pulse(pulsing_sharp);
// DRV_pulse(pulsing_sharp);
#endif
break;
case _MEDIA:
#ifdef HAPTIC_ENABLE
DRV_pulse(transition_rampup_short_smooth1);
// DRV_pulse(transition_rampup_short_smooth1);
#endif
break;
case _MOUSE:
@ -41,3 +41,12 @@ layer_state_t layer_state_set_haptic(layer_state_t state) {
return state;
}
// manually handle haptic
bool get_haptic_enabled_key(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
default:
return false;
break;
}
}

View File

@ -1,4 +1,5 @@
#pragma once
#include "quantum.h"
layer_state_t layer_state_set_haptic(layer_state_t state);
layer_state_t layer_state_set_haptic(layer_state_t state);
bool get_haptic_enabled_key(uint16_t keycode, keyrecord_t *record);

View File

@ -179,19 +179,43 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
break;
#endif
case KC_BTN1:
if (record->event.pressed) {
#ifdef HAPTIC_ENABLE
DRV_pulse(medium_click1);
DRV_pulse(medium_click1);
#endif
}
break;
case KC_BTN2:
if (record->event.pressed) {
#ifdef HAPTIC_ENABLE
DRV_pulse(sh_dblclick_str);
DRV_pulse(sh_dblclick_str);
#endif
}
break;
case KC_BTN3:
if (record->event.pressed) {
#ifdef HAPTIC_ENABLE
DRV_pulse(lg_dblclick_med);
// DRV_pulse(lg_dblclick_med);
#endif
}
break;
case KC_C: // copy
if (record->event.pressed) {
#ifdef HAPTIC_ENABLE
if (get_mods() & MOD_MASK_CTRL) {
DRV_pulse(lg_dblclick_str);
}
#endif
}
break;
case KC_V: // paste
if (record->event.pressed) {
#ifdef HAPTIC_ENABLE
if (get_mods() & MOD_MASK_CTRL) {
DRV_pulse(soft_bump);
}
#endif
}
break;
case C_CAPSWORD:
// NOTE: if you change this behavior, may want to update in keymap.c for COMBO behavior