qmk/users/ridingqwerty/process_records.c
ridingqwerty 0c03811d6a [Keymap] add "ridingqwerty" user and keymap for atreus keyboard (#6533)
* add userspace and atreus keymap

* cleaning up notes/comments

* Update keyboards/atreus/keymaps/ridingqwerty/atreus.c

Co-Authored-By: Joel Challis <git@zvecr.com>

* Update keyboards/atreus/keymaps/ridingqwerty/atreus.c

Co-Authored-By: Joel Challis <git@zvecr.com>

* Create readme.md

* remove reference to matrix_init_kb from atreus.c

* correct atreus.c

* remove unnecessary defines

* merge register/unregister sequence into single tapcode

* move 'LAYOUT to keymap.c; remove atreus.h

* remove TAPPING_TERM from keyboard-level config.h
2019-08-16 16:54:16 -07:00

34 lines
859 B
C

#include "ridingqwerty.h"
__attribute__ ((weak))
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
return true;
}
__attribute__ ((weak))
bool process_record_secrets(uint16_t keycode, keyrecord_t *record) {
return true;
}
uint16_t user_key_timer;
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch(keycode) {
case RG_QUOT:
if (record->event.pressed) {
user_key_timer = timer_read();
layer_on(_NUMBER);
register_mods(MOD_BIT(KC_RGUI));
} else {
unregister_mods(MOD_BIT(KC_RGUI));
layer_off(_NUMBER);
if (timer_elapsed(user_key_timer) < TAPPING_TERM) {
register_code(KC_QUOT);
unregister_code(KC_QUOT);
}
}
return false; break;
}
return process_record_keymap(keycode, record) &&
process_record_secrets(keycode, record);
}