opensteno_qmk/users/xulkal/process_records.c

57 lines
1.5 KiB
C
Raw Normal View History

2019-03-01 03:20:26 +00:00
#include "process_records.h"
#ifdef TAP_DANCE_ENABLE
//Tap Dance Definitions
qk_tap_dance_action_t tap_dance_actions[] = {
[COMM_QUOT] = ACTION_TAP_DANCE_DOUBLE(KC_COMM, KC_QUOT),
[BACKSPACE] = ACTION_TAP_DANCE_DOUBLE (KC_BSPACE, LCTL(KC_BSPACE)),
[TAP_TAB] = ACTION_TAP_DANCE_DOUBLE (KC_TAB, LSFT(KC_TAB)),
[CTRL_MINUS] = ACTION_TAP_DANCE_DOUBLE (KC_LCTL, KC_MINS),
[CTRL_PLUS] = ACTION_TAP_DANCE_DOUBLE (KC_RCTL, KC_EQL)
};
#endif
#if defined(RGB_MATRIX_ENABLE)
extern void eeconfig_update_rgb_matrix_default(void);
#endif
#ifdef TRILAYER_ENABLED
uint32_t layer_state_set_user(uint32_t state) {
return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
}
#endif
2019-03-01 03:20:26 +00:00
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
2019-05-13 14:58:15 +00:00
static uint16_t reset_timer;
2019-03-01 03:20:26 +00:00
switch (keycode) {
case RGBRST:
#if defined(RGBLIGHT_ENABLE)
2019-03-01 03:20:26 +00:00
if (record->event.pressed) {
eeconfig_update_rgblight_default();
rgblight_enable();
}
#elif defined(RGB_MATRIX_ENABLE)
if (record->event.pressed) {
eeconfig_update_rgb_matrix_default();
}
#endif
2019-03-01 03:20:26 +00:00
return false;
2019-05-13 14:58:15 +00:00
case RESET:
if (record->event.pressed) {
reset_timer = timer_read();
} else {
if (timer_elapsed(reset_timer) >= 500) {
reset_keyboard();
}
}
return false;
2019-03-01 03:20:26 +00:00
}
return process_record_keymap(keycode, record);
2019-03-01 03:20:26 +00:00
}
__attribute__ ((weak))
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
return true;
}