Skip to content

Commit

Permalink
Merge pull request qmk#2 from schmidt-x/for_moran
Browse files Browse the repository at this point in the history
add key-override colemak
  • Loading branch information
Chukozor authored Feb 18, 2024
2 parents a536789 + 3a42cd0 commit f029a82
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 63 deletions.
108 changes: 53 additions & 55 deletions keyboards/crkbd/keymaps/my_keymap/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ bool oled_task_user() {

// This globally defines all key overrides to be used
const key_override_t **key_overrides = (const key_override_t *[]){
&ko_make_with_layers(MOD_MASK_SHIFT, FR_COMM, FR_SCLN, 1 << 0),
&ko_make_with_layers(MOD_MASK_SHIFT, FR_DOT, FR_COLN, 1 << 0),
&ko_make_with_layers(MOD_MASK_SHIFT, FR_QUES, FR_EXLM, 1 << 0),
&ko_make_with_layers(MOD_MASK_SHIFT, FR_QUOT, FR_DQUO, 1 << 0),
&ko_make_with_layers(MOD_MASK_SHIFT, FR_COMM, FR_SCLN, 1 << _SFT_COLEMAK_FR), // check if it works
&ko_make_with_layers(MOD_MASK_SHIFT, FR_DOT, FR_COLN, 1 << _COLEMAK_FR),
&ko_make_with_layers(MOD_MASK_SHIFT, FR_QUES, FR_EXLM, 1 << _COLEMAK_FR),
&ko_make_with_layers(MOD_MASK_SHIFT, FR_QUOT, FR_DQUO, 1 << _COLEMAK_FR),
// &ko_make_with_layers(MOD_MASK_SHIFT, FR_AT, FR_AGRV, 1 << 2);

NULL // Null terminate the array of overrides!
Expand Down Expand Up @@ -287,59 +287,57 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return false;

case ESC_TAB:
if (record->tap.count) { // tapped
if (!record->event.pressed) {
return false;
}
tap_code(KC_ESC);
} else { // held
if (!record->event.pressed) {
return false;
}
tap_code(KC_TAB);
}

return false;

case MY_NAV: // I am an alias for MO(_NAV)
static uint8_t pressed_count = 0;

if (record->event.pressed) {
pressed_count++;
} else {
pressed_count--;
if (pressed_count) {
return false;
}
}

return true;

case MY_PVIRG:
if (!record->event.pressed) {
if (record->tap.count) { // tapped
if (record->event.pressed) {
tap_code(KC_ESC);
}
} else { // held
if (record->event.pressed) {
tap_code(KC_TAB);
}
}

return false;
}
if (is_shift_layer()) {
tap_point_virgule();
} else {
tap_point_virgule(); // TPDP nothing better to put atm here, maybe later
}
return false;

case MY_NAV: { // I am an alias for MO(_NAV)
static uint8_t pressed_count = 0;

if (record->event.pressed) {
pressed_count++;
} else {
pressed_count--;
if (pressed_count) {
return false;
}
}
return true;
}

// case MY_PVIRG:
// if (!record->event.pressed) {
// return false;
// }
// if (is_shift_layer()) {
// tap_point_virgule();
// } else {
// tap_point_virgule(); // TPDP nothing better to put atm here, maybe later
// }
// return false;

// case HT_SPC:
// if (record->tap.count) { // tapped
// if (!record->event.pressed) {
// return false;
// }
// tap_code(KC_SCP);
// } else { // held
// if (!record->event.pressed) {
// return false;
// }
// tap_code(KC_LGUI);
// }
// return false;
// if (record->tap.count) { // tapped
// if (!record->event.pressed) {
// return false;
// }
// tap_code(KC_SCP);
// } else { // held
// if (!record->event.pressed) {
// return false;
// }
// tap_code(KC_LGUI);
// }
// return false;

}

Expand Down Expand Up @@ -380,7 +378,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,MY_QUOTE,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
_______, _______, _______, _______, _______, _______, _______, _______,MY_PVIRG, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
_______, _______, _______, _______, _______, _______
//`--------------------------' `--------------------------'
Expand Down
22 changes: 14 additions & 8 deletions keyboards/crkbd/keymaps/my_keymap/keymap.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
#pragma once

#define HT_E TT(16) // aliases
#define HT_C TT(17)
#define HT_A TT(18)
#define HT_U TT(19)
#define HT_I TT(20)
#define HT_O TT(21)
// #define LEAST TT(0)

#define HT_E TT(16)
#define HT_C TT(17)
#define HT_A TT(18)
#define HT_U TT(19)
#define HT_I TT(20)
#define HT_O TT(21)
#define ESC_TAB TT(22)

// #define MOST TT(31)

#define MO_ACC MO(_ACCENTS)
#define MO_NUM MO(_NUMPAD)
#define MO_RGB MO(_RGB)
Expand Down Expand Up @@ -42,6 +48,6 @@ enum layers{

enum custom_keycodes {
MY_QUOTE = SAFE_RANGE,
ESC_TAB,
MY_PVIRG,
// ESC_TAB,
// MY_PVIRG,
};

0 comments on commit f029a82

Please sign in to comment.