[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', {
|
||||
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('build', gulp.series('clean', run(BUILD_CMD, {
|
||||
ignoreErrors: true
|
||||
}));
|
||||
})));
|
||||
|
||||
gulp.task('watch', ['build'], () => {
|
||||
gulp.watch([
|
||||
'keymap.c',
|
||||
'config.h',
|
||||
'rules.mk',
|
||||
], ['build']);
|
||||
});
|
||||
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;
|
||||
}
|
Loading…
Reference in new issue