Dhertz' keymaps (#3094)
* Port my keymap to QMK * Add Percent Canoe keyboard * Fix row of nonus backslash * Update info.json to be correct for canoe * fix alignment * Use qmk shortcuts rather than tmk functions * Move over first macro * Move rest of macros over * clean up unused functions * Move files to userspace for HHKB * Add keymaps for hhkb * Change LAYOUT_ISO to LAYOUT_iso * Remove bootloader key in info.json * Remove tilde remap from Karabiner * Add country_iso_alpha2_code to macros * Add my keymap for canoe * Add layer colour indicator * Fix bad rebase * Fix naming of keymap from rebase * Add GRV to function layer * Fix keymap to use new LAYOUT_JP * Update keymaps to use process_record_* rather than action functions * Update hhkb imports to be just what is needed * Update whitefox to use LAYOUT macro instead of KEYMAP * Remove redundant imports from user definition * Move TAPPING_TERM to config.h * Use layer change events to change RGB LED colour * temp * Fix layer switching to iPad on HHKB * Fix Canoe pictures
This commit is contained in:
parent
2196dc9f86
commit
d8478351d7
16 changed files with 396 additions and 16 deletions
9
users/dhertz/config.h
Normal file
9
users/dhertz/config.h
Normal file
|
@ -0,0 +1,9 @@
|
|||
#ifndef USERSPACE_CONFIG_H
|
||||
#define USERSPACE_CONFIG_H
|
||||
|
||||
#ifdef TAPPING_TERM
|
||||
#undef TAPPING_TERM
|
||||
#endif // TAPPING_TERM
|
||||
#define TAPPING_TERM 200
|
||||
|
||||
#endif // !USERSPACE_CONFIG_H
|
101
users/dhertz/dhertz.c
Normal file
101
users/dhertz/dhertz.c
Normal file
|
@ -0,0 +1,101 @@
|
|||
#include "dhertz.h"
|
||||
|
||||
// Add reconfigurable functions here, for keymap customization
|
||||
// This allows for a global, userspace functions, and continued
|
||||
// customization of the keymap. Use _keymap instead of _user
|
||||
// functions in the keymaps
|
||||
__attribute__ ((weak))
|
||||
void matrix_init_keymap(void) {}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_scan_keymap(void) {}
|
||||
|
||||
__attribute__ ((weak))
|
||||
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
}
|
||||
__attribute__ ((weak))
|
||||
uint32_t layer_state_set_keymap (uint32_t state) {
|
||||
return state;
|
||||
}
|
||||
__attribute__ ((weak))
|
||||
void led_set_keymap(uint8_t usb_led) {}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void action_function_keymap(keyrecord_t *record, uint8_t id, uint8_t opt) {}
|
||||
|
||||
// Call user matrix init, then call the keymap's init function
|
||||
void matrix_init_user(void) {
|
||||
matrix_init_keymap();
|
||||
}
|
||||
|
||||
// No global matrix scan code, so just run keymap's matix
|
||||
// scan function
|
||||
void matrix_scan_user(void) {
|
||||
matrix_scan_keymap();
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch(keycode) {
|
||||
case CMD_TAB_CMD:
|
||||
mod_or_mod_with_macro(record, KC_LGUI, SS_TAP(X_TAB));
|
||||
return false;
|
||||
case CMD_GRV_CMD:
|
||||
mod_or_mod_with_macro(record, KC_RGUI, SS_TAP(X_GRAVE));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (record->event.pressed) {
|
||||
switch(keycode) {
|
||||
case HSH_TLD:
|
||||
if (get_mods()&(MOD_BIT(KC_LSFT)|MOD_BIT(KC_RSFT))) {
|
||||
SEND_STRING(SS_TAP(X_NONUS_BSLASH));
|
||||
} else {
|
||||
SEND_STRING(SS_LALT("3"));
|
||||
}
|
||||
break;
|
||||
case CTRL_A:
|
||||
SEND_STRING(SS_LCTRL("a"));
|
||||
break;
|
||||
case CMD_ALT_C:
|
||||
SEND_STRING(SS_LGUI(SS_LALT("c")));
|
||||
break;
|
||||
case CMD_SFT_L:
|
||||
SEND_STRING(SS_LGUI("L"));
|
||||
break;
|
||||
case ISO_COUNTRY_CODE:
|
||||
SEND_STRING("country_iso_alpha2_code");
|
||||
break;
|
||||
default:
|
||||
return process_record_keymap(keycode, record);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return process_record_keymap(keycode, record);
|
||||
}
|
||||
|
||||
static uint16_t sunds_timer;
|
||||
|
||||
void mod_or_mod_with_macro(keyrecord_t *record, uint16_t kc_mod, char* macro) {
|
||||
if (record->event.pressed) {
|
||||
sunds_timer = timer_read();
|
||||
register_code(kc_mod);
|
||||
} else {
|
||||
if (timer_elapsed(sunds_timer) < TAPPING_TERM) {
|
||||
send_string(macro);
|
||||
}
|
||||
unregister_code(kc_mod);
|
||||
}
|
||||
}
|
||||
|
||||
// Runs state check and changes underglow color and animation
|
||||
// on layer change, no matter where the change was initiated
|
||||
// Then runs keymap's layer change check
|
||||
uint32_t layer_state_set_user (uint32_t state) {
|
||||
return layer_state_set_keymap (state);
|
||||
}
|
||||
|
||||
void led_set_user(uint8_t usb_led) {
|
||||
led_set_keymap(usb_led);
|
||||
}
|
||||
|
23
users/dhertz/dhertz.h
Normal file
23
users/dhertz/dhertz.h
Normal file
|
@ -0,0 +1,23 @@
|
|||
#ifndef USERSPACE
|
||||
#define USERSPACE
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
#define SRCH_CTL CTL_T(KC_F19)
|
||||
#define LYR_SPC LT(1, KC_SPC)
|
||||
#define NC_CTL CTL_T(KC_F18)
|
||||
|
||||
enum custom_keycodes {
|
||||
HSH_TLD = SAFE_RANGE,
|
||||
CTRL_A,
|
||||
CMD_ALT_C,
|
||||
CMD_SFT_L,
|
||||
ISO_COUNTRY_CODE,
|
||||
CMD_TAB_CMD,
|
||||
CMD_GRV_CMD,
|
||||
NEW_SAFE_RANGE,
|
||||
};
|
||||
|
||||
void mod_or_mod_with_macro(keyrecord_t *record, uint16_t kc_mod, char* cmd_or_macro);
|
||||
|
||||
#endif
|
1
users/dhertz/rules.mk
Normal file
1
users/dhertz/rules.mk
Normal file
|
@ -0,0 +1 @@
|
|||
SRC += dhertz.c
|
Loading…
Add table
Add a link
Reference in a new issue