[Keymap] Add new mod tap dances to Hacker Dvorak (#6155)
parent
2d15961855
commit
628e08c606
@ -1,19 +1,22 @@
|
||||
let gulp = require('gulp');
|
||||
let run = require('gulp-run-command').default;
|
||||
const gulp = require('gulp');
|
||||
const run = require('gulp-run-command').default;
|
||||
|
||||
|
||||
gulp.task('clean', run('rm -rf ../../../../.build'));
|
||||
const ROOT_DIR = '../../../../';
|
||||
const BUILD_DIR = `${ROOT_DIR}.build`;
|
||||
const HACKER_DVORAK_DIR = './**/*';
|
||||
|
||||
gulp.task('build', ['clean'], run('make -C ../../../../ ergodox_ez:hacker_dvorak', {
|
||||
ignoreErrors: true
|
||||
}));
|
||||
const CLEAN_CMD = `rm -rf ${BUILD_DIR}`;
|
||||
const BUILD_CMD = `make -C ${ROOT_DIR} ergodox_ez:hacker_dvorak`;
|
||||
|
||||
gulp.task('clean', run(CLEAN_CMD));
|
||||
|
||||
gulp.task('watch', ['build'], () => {
|
||||
gulp.watch([
|
||||
'keymap.c',
|
||||
'config.h',
|
||||
'rules.mk',
|
||||
], ['build']);
|
||||
});
|
||||
gulp.task('build', gulp.series('clean', run(BUILD_CMD, {
|
||||
ignoreErrors: true
|
||||
})));
|
||||
|
||||
gulp.task('watch', gulp.series('build', () => {
|
||||
gulp.watch(HACKER_DVORAK_DIR, gulp.series('build'));
|
||||
}));
|
||||
|
||||
gulp.task('default', ['watch']);
|
||||
gulp.task('default', gulp.series('watch'));
|
||||
|
@ -1,5 +1,13 @@
|
||||
// Keycode aliases
|
||||
// Compound keycode aliases
|
||||
#define SCTL(kc) LSFT(LCTL(kc)) // Modifier keys: SHIFT+CTRL+kc combination.
|
||||
#define LGAS_T(kc) MT(MOD_LGUI | MOD_LALT | MOD_LSFT, kc) // Mod tap: kc when tapped, GUI+ALT+SHIFT when held.
|
||||
#define LAS_T(kc) MT(MOD_LALT | MOD_LSFT, kc) // Mod tap: kc when tapped, ALT+SHIFT whin held.
|
||||
|
||||
// Tap
|
||||
#define LASG_T(kc) MT(MOD_LGUI | MOD_LALT | MOD_LSFT, kc) // Mod tap: kc when tapped, GUI+ALT+SHIFT when held.
|
||||
#define LCSG_T(kc) MT(MOD_LGUI | MOD_LSFT | MOD_LCTL, kc) // Mod tap: kc when tapped, GUI+CTL+SHIFT when held.
|
||||
|
||||
#define LCG_T(kc) MT(MOD_LCTL | MOD_LGUI, kc) // Mod tap: kc when tapped, CTL+GUI when held.
|
||||
#define LAS_T(kc) MT(MOD_LALT | MOD_LSFT, kc) // Mod tap: kc when tapped, ALT+SHIFT when held.
|
||||
#define LAG_T(kc) MT(MOD_LALT | MOD_LGUI, kc) // Mod tap: kc when tapped, ALT+GUI when held.
|
||||
|
||||
// Others
|
||||
#define COMPOSE KC_RALT // Compose key (used to input characters like á, ñ, ü).
|
||||
|
@ -0,0 +1,41 @@
|
||||
//instanalize an instance of 'tap' for the Dot - Comma tap dance.
|
||||
static tap dot_comm_state = {
|
||||
.is_press_action = true,
|
||||
.state = 0
|
||||
};
|
||||
|
||||
void dot_comm_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
dot_comm_state.state = current_dance(state);
|
||||
switch (dot_comm_state.state) {
|
||||
case SINGLE_TAP:
|
||||
register_code(KC_DOT);
|
||||
break;
|
||||
|
||||
case SINGLE_HOLD:
|
||||
register_code(KC_LCTL);
|
||||
register_code(KC_LSFT);
|
||||
break;
|
||||
|
||||
case DOUBLE_TAP:
|
||||
register_code(KC_COMM);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void dot_comm_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||
switch (dot_comm_state.state) {
|
||||
case SINGLE_TAP:
|
||||
unregister_code(KC_DOT);
|
||||
break;
|
||||
|
||||
case SINGLE_HOLD:
|
||||
unregister_code(KC_LCTL);
|
||||
unregister_code(KC_LSFT);
|
||||
break;
|
||||
|
||||
case DOUBLE_TAP:
|
||||
unregister_code(KC_COMM);
|
||||
break;
|
||||
}
|
||||
dot_comm_state.state = 0;
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
//instanalize an instance of 'tap' for the H - Mouse - Gui tap dance.
|
||||
static tap h_mouse_gui_state = {
|
||||
.is_press_action = true,
|
||||
.state = 0
|
||||
};
|
||||
|
||||
void h_mouse_gui_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
h_mouse_gui_state.state = current_dance(state);
|
||||
switch (h_mouse_gui_state.state) {
|
||||
case SINGLE_TAP:
|
||||
register_code(KC_H);
|
||||
break;
|
||||
|
||||
case SINGLE_HOLD:
|
||||
layer_on(MOUSE);
|
||||
break;
|
||||
|
||||
case DOUBLE_HOLD:
|
||||
register_code(KC_LGUI);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void h_mouse_gui_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||
switch (h_mouse_gui_state.state) {
|
||||
case SINGLE_TAP:
|
||||
unregister_code(KC_H);
|
||||
break;
|
||||
|
||||
case SINGLE_HOLD:
|
||||
layer_off(MOUSE);
|
||||
break;
|
||||
|
||||
case DOUBLE_HOLD:
|
||||
unregister_code(KC_LGUI);
|
||||
break;
|
||||
}
|
||||
h_mouse_gui_state.state = 0;
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
//instanalize an instance of 'tap' for the J - Media - Meh tap dance.
|
||||
static tap j_media_meh_state = {
|
||||
.is_press_action = true,
|
||||
.state = 0
|
||||
};
|
||||
|
||||
void j_media_meh_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
j_media_meh_state.state = current_dance(state);
|
||||
switch (j_media_meh_state.state) {
|
||||
case SINGLE_TAP:
|
||||
register_code(KC_J);
|
||||
break;
|
||||
|
||||
case SINGLE_HOLD:
|
||||
layer_on(MEDIA_FN);
|
||||
break;
|
||||
|
||||
case DOUBLE_HOLD:
|
||||
register_code(KC_LCTL);
|
||||
register_code(KC_LSFT);
|
||||
register_code(KC_LALT);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void j_media_meh_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||
switch (j_media_meh_state.state) {
|
||||
case SINGLE_TAP:
|
||||
unregister_code(KC_J);
|
||||
break;
|
||||
|
||||
case SINGLE_HOLD:
|
||||
layer_off(MEDIA_FN);
|
||||
break;
|
||||
|
||||
case DOUBLE_HOLD:
|
||||
unregister_code(KC_LCTL);
|
||||
unregister_code(KC_LSFT);
|
||||
unregister_code(KC_LALT);
|
||||
break;
|
||||
}
|
||||
j_media_meh_state.state = 0;
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
//instanalize an instance of 'tap' for the K - Numpad - Hyper tap dance.
|
||||
static tap k_numpad_hyper_state = {
|
||||
.is_press_action = true,
|
||||
.state = 0
|
||||
};
|
||||
|
||||
void k_numpad_hyper_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
k_numpad_hyper_state.state = current_dance(state);
|
||||
switch (k_numpad_hyper_state.state) {
|
||||
case SINGLE_TAP:
|
||||
register_code(KC_K);
|
||||
break;
|
||||
|
||||
case SINGLE_HOLD:
|
||||
layer_on(NUMPAD);
|
||||
break;
|
||||
|
||||
case DOUBLE_HOLD:
|
||||
register_code(KC_LCTL);
|
||||
register_code(KC_LSFT);
|
||||
register_code(KC_LALT);
|
||||
register_code(KC_LGUI);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void k_numpad_hyper_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||
switch (k_numpad_hyper_state.state) {
|
||||
case SINGLE_TAP:
|
||||
unregister_code(KC_K);
|
||||
break;
|
||||
|
||||
case SINGLE_HOLD:
|
||||
layer_off(NUMPAD);
|
||||
break;
|
||||
|
||||
case DOUBLE_HOLD:
|
||||
unregister_code(KC_LCTL);
|
||||
unregister_code(KC_LSFT);
|
||||
unregister_code(KC_LALT);
|
||||
unregister_code(KC_LGUI);
|
||||
break;
|
||||
}
|
||||
k_numpad_hyper_state.state = 0;
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
//instanalize an instance of 'tap' for the M - Chords - Hyper tap dance.
|
||||
static tap m_chords_hyper_state = {
|
||||
.is_press_action = true,
|
||||
.state = 0
|
||||
};
|
||||
|
||||
void m_chords_hyper_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
m_chords_hyper_state.state = current_dance(state);
|
||||
switch (m_chords_hyper_state.state) {
|
||||
case SINGLE_TAP:
|
||||
register_code(KC_M);
|
||||
break;
|
||||
|
||||
case SINGLE_HOLD:
|
||||
layer_on(CHORD);
|
||||
break;
|
||||
|
||||
case DOUBLE_HOLD:
|
||||
register_code(KC_LCTL);
|
||||
register_code(KC_LSFT);
|
||||
register_code(KC_LALT);
|
||||
register_code(KC_LGUI);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void m_chords_hyper_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||
switch (m_chords_hyper_state.state) {
|
||||
case SINGLE_TAP:
|
||||
unregister_code(KC_M);
|
||||
break;
|
||||
|
||||
case SINGLE_HOLD:
|
||||
layer_off(CHORD);
|
||||
break;
|
||||
|
||||
case DOUBLE_HOLD:
|
||||
unregister_code(KC_LCTL);
|
||||
unregister_code(KC_LSFT);
|
||||
unregister_code(KC_LALT);
|
||||
unregister_code(KC_LGUI);
|
||||
break;
|
||||
}
|
||||
m_chords_hyper_state.state = 0;
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
//instanalize an instance of 'tap' for the Quote - Double Quote tap dance.
|
||||
static tap quot_dquot_state = {
|
||||
.is_press_action = true,
|
||||
.state = 0
|
||||
};
|
||||
|
||||
void quot_dquot_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
quot_dquot_state.state = current_dance(state);
|
||||
switch (quot_dquot_state.state) {
|
||||
case SINGLE_TAP:
|
||||
register_code(KC_QUOT);
|
||||
break;
|
||||
|
||||
case SINGLE_HOLD:
|
||||
register_code(KC_LCTL);
|
||||
register_code(KC_LALT);
|
||||
break;
|
||||
|
||||
case DOUBLE_TAP:
|
||||
register_code16(KC_DQUO);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void quot_dquot_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||
switch (quot_dquot_state.state) {
|
||||
case SINGLE_TAP:
|
||||
unregister_code(KC_QUOT);
|
||||
break;
|
||||
|
||||
case SINGLE_HOLD:
|
||||
unregister_code(KC_LCTL);
|
||||
unregister_code(KC_LALT);
|
||||
break;
|
||||
|
||||
case DOUBLE_TAP:
|
||||
unregister_code16(KC_DQUO);
|
||||
break;
|
||||
}
|
||||
quot_dquot_state.state = 0;
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
//instanalize an instance of 'tap' for the Semicolon - Colon tap dance.
|
||||
static tap scln_coln_state = {
|
||||
.is_press_action = true,
|
||||
.state = 0
|
||||
};
|
||||
|
||||
void scln_coln_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
scln_coln_state.state = current_dance(state);
|
||||
switch (scln_coln_state.state) {
|
||||
case SINGLE_TAP:
|
||||
register_code(KC_SCLN);
|
||||
break;
|
||||
|
||||
case SINGLE_HOLD:
|
||||
register_code(KC_LALT);
|
||||
register_code(KC_LSFT);
|
||||
register_code(KC_LGUI);
|
||||
break;
|
||||
|
||||
case DOUBLE_TAP:
|
||||
register_code16(KC_COLN);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void scln_coln_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||
switch (scln_coln_state.state) {
|
||||
case SINGLE_TAP:
|
||||
unregister_code(KC_SCLN);
|
||||
break;
|
||||
|
||||
case SINGLE_HOLD:
|
||||
unregister_code(KC_LALT);
|
||||
unregister_code(KC_LSFT);
|
||||
unregister_code(KC_LGUI);
|
||||
break;
|
||||
|
||||
case DOUBLE_TAP:
|
||||
unregister_code16(KC_COLN);
|
||||
break;
|
||||
}
|
||||
scln_coln_state.state = 0;
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
//instanalize an instance of 'tap' for the U - Arrows - Gui tap dance.
|
||||
static tap u_arrows_gui_state = {
|
||||
.is_press_action = true,
|
||||
.state = 0
|
||||
};
|
||||
|
||||
void u_arrows_gui_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
u_arrows_gui_state.state = current_dance(state);
|
||||
switch (u_arrows_gui_state.state) {
|
||||
case SINGLE_TAP:
|
||||
register_code(KC_U);
|
||||
break;
|
||||
|
||||
case SINGLE_HOLD:
|
||||
layer_on(ARROWS);
|
||||
break;
|
||||
|
||||
case DOUBLE_HOLD:
|
||||
register_code(KC_LGUI);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void u_arrows_gui_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||
switch (u_arrows_gui_state.state) {
|
||||
case SINGLE_TAP:
|
||||
unregister_code(KC_U);
|
||||
break;
|
||||
|
||||
case SINGLE_HOLD:
|
||||
layer_off(ARROWS);
|
||||
break;
|
||||
|
||||
case DOUBLE_HOLD:
|
||||
unregister_code(KC_LGUI);
|
||||
break;
|
||||
}
|
||||
u_arrows_gui_state.state = 0;
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
//instanalize an instance of 'tap' for the W - Media - Meh tap dance.
|
||||
static tap w_media_meh_state = {
|
||||
.is_press_action = true,
|
||||
.state = 0
|
||||
};
|
||||
|
||||
void w_media_meh_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
w_media_meh_state.state = current_dance(state);
|
||||
switch (w_media_meh_state.state) {
|
||||
case SINGLE_TAP:
|
||||
register_code(KC_W);
|
||||
break;
|
||||
|
||||
case SINGLE_HOLD:
|
||||
layer_on(MEDIA_FN);
|
||||
break;
|
||||
|
||||
case DOUBLE_HOLD:
|
||||
register_code(KC_LCTL);
|
||||
register_code(KC_LSFT);
|
||||
register_code(KC_LALT);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void w_media_meh_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||
switch (w_media_meh_state.state) {
|
||||
case SINGLE_TAP:
|
||||
unregister_code(KC_W);
|
||||
break;
|
||||
|
||||
case SINGLE_HOLD:
|
||||
layer_off(MEDIA_FN);
|
||||
break;
|
||||
|
||||
case DOUBLE_HOLD:
|
||||
unregister_code(KC_LCTL);
|
||||
unregister_code(KC_LSFT);
|
||||
unregister_code(KC_LALT);
|
||||
break;
|
||||
}
|
||||
w_media_meh_state.state = 0;
|
||||
}
|
@ -1,20 +1,26 @@
|
||||
// Register the double tap dances:
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
[EQL_PLUS] = ACTION_TAP_DANCE_DOUBLE(KC_EQL, KC_PLUS),
|
||||
[MINS_UNDS] = ACTION_TAP_DANCE_DOUBLE(KC_MINS, KC_UNDS),
|
||||
[SLSH_BSLS] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_BSLS),
|
||||
[GRV_TILD] = ACTION_TAP_DANCE_DOUBLE(KC_GRV, KC_TILD),
|
||||
[QUOT_DQUO] = ACTION_TAP_DANCE_DOUBLE(KC_QUOT, KC_DQUO),
|
||||
[SCLN_COLN] = ACTION_TAP_DANCE_DOUBLE(KC_SCLN, KC_COLN),
|
||||
[ASTR_CIRC] = ACTION_TAP_DANCE_DOUBLE(KC_ASTR, KC_CIRC),
|
||||
[APMR_PIPE] = ACTION_TAP_DANCE_DOUBLE(KC_AMPR, KC_PIPE),
|
||||
[EXLM_QUES] = ACTION_TAP_DANCE_DOUBLE(KC_EXLM, KC_QUES),
|
||||
[HASH_PERC] = ACTION_TAP_DANCE_DOUBLE(KC_HASH, KC_PERC),
|
||||
[AT_DLR] = ACTION_TAP_DANCE_DOUBLE(KC_AT, KC_DLR),
|
||||
[LPRN_LBRC] = ACTION_TAP_DANCE_DOUBLE(KC_LPRN, KC_LBRC),
|
||||
[RPRN_RBRC] = ACTION_TAP_DANCE_DOUBLE(KC_RPRN, KC_RBRC),
|
||||
[LCBR_LABK] = ACTION_TAP_DANCE_DOUBLE(KC_LCBR, KC_LABK),
|
||||
[RCBR_RABK] = ACTION_TAP_DANCE_DOUBLE(KC_RCBR, KC_RABK),
|
||||
[DOT_COMM] = ACTION_TAP_DANCE_DOUBLE(KC_DOT, KC_COMM),
|
||||
[NONE_LEAD] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, none_lead_finished, none_lead_reset, DANCING_TERM)
|
||||
[EQL_PLUS] = ACTION_TAP_DANCE_DOUBLE(KC_EQL, KC_PLUS),
|
||||
[MINS_UNDS] = ACTION_TAP_DANCE_DOUBLE(KC_MINS, KC_UNDS),
|
||||
[SLSH_BSLS] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_BSLS),
|
||||
[GRV_TILD] = ACTION_TAP_DANCE_DOUBLE(KC_GRV, KC_TILD),
|
||||
[ASTR_CIRC] = ACTION_TAP_DANCE_DOUBLE(KC_ASTR, KC_CIRC),
|
||||
[APMR_PIPE] = ACTION_TAP_DANCE_DOUBLE(KC_AMPR, KC_PIPE),
|
||||
[EXLM_QUES] = ACTION_TAP_DANCE_DOUBLE(KC_EXLM, KC_QUES),
|
||||
[HASH_PERC] = ACTION_TAP_DANCE_DOUBLE(KC_HASH, KC_PERC),
|
||||
[AT_DLR] = ACTION_TAP_DANCE_DOUBLE(KC_AT, KC_DLR),
|
||||
[LPRN_LBRC] = ACTION_TAP_DANCE_DOUBLE(KC_LPRN, KC_LBRC),
|
||||
[RPRN_RBRC] = ACTION_TAP_DANCE_DOUBLE(KC_RPRN, KC_RBRC),
|
||||
[LCBR_LABK] = ACTION_TAP_DANCE_DOUBLE(KC_LCBR, KC_LABK),
|
||||
[RCBR_RABK] = ACTION_TAP_DANCE_DOUBLE(KC_RCBR, KC_RABK),
|
||||
[SCLN_COLN] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, scln_coln_finished, scln_coln_reset, DANCING_TERM),
|
||||
[QUOT_DQUO] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, quot_dquot_finished, quot_dquot_reset, DANCING_TERM),
|
||||
[DOT_COMM] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, dot_comm_finished, dot_comm_reset, DANCING_TERM),
|
||||
[NONE_LEAD] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, none_lead_finished, none_lead_reset, DANCING_TERM),
|
||||
[U_ARR_GUI] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, u_arrows_gui_finished, u_arrows_gui_reset, DANCING_TERM),
|
||||
[H_MOU_GUI] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, h_mouse_gui_finished, h_mouse_gui_reset, DANCING_TERM),
|
||||
[J_MED_MEH] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, j_media_meh_finished, j_media_meh_reset, DANCING_TERM),
|
||||
[W_MED_MEH] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, w_media_meh_finished, w_media_meh_reset, DANCING_TERM),
|
||||
[K_NUM_HYP] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, k_numpad_hyper_finished, k_numpad_hyper_reset, DANCING_TERM),
|
||||
[M_CHO_HYP] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, m_chords_hyper_finished, m_chords_hyper_reset, DANCING_TERM),
|
||||
};
|
||||
|
Loading…
Reference in new issue