Skip to content

Commit

Permalink
Replace AST with PAST keycode so that it works with layer tap
Browse files Browse the repository at this point in the history
  • Loading branch information
skewwhiffy authored and Kenny Hung committed Aug 2, 2018
1 parent f575fe6 commit 4800f17
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 38 deletions.
48 changes: 10 additions & 38 deletions keyboards/xd75/keymaps/skewwhiffy/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@
#define _DV 1 // Dvorak
#define _QW 2 // QWERTY
#define _NB 3 // Numbers
#define _SYL 4 // Symbols left
#define _SYR 5 // Symbols right
#define _NAV 6 // Navigation
#define _SY 4 // Symbols
#define _NAV 5 // Navigation

// Layer buttons
#define _Z_SFT SFT_T(UK_Z)
Expand All @@ -35,10 +34,11 @@
#define _Q_NB LT(_NB, UK_Q)
#define _DOT_NB LT(_NB, UK_DOT)
#define _V_NB LT(_NB, UK_V)
#define _C_SY LT(_SYL, UK_C)
#define _J_SY LT(_SYL, UK_J)
#define _W_SY LT(_SYL, UK_W)
#define _COM_SY LT(_SYR, UK_COMM)
#define _C_SY LT(_SY, UK_C)
#define _J_SY LT(_SY, UK_J)
#define _W_SY LT(_SY, UK_W)
#define _COM_SY LT(_SY, UK_COMM)
#define _AST_SY LT(_SY, UK_PAST)
#define _B_NAV LT(_NAV, UK_B)
#define _X_NAV LT(_NAV, UK_X)
#define _K_NAV LT(_NAV, UK_K)
Expand Down Expand Up @@ -150,7 +150,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }
},

/* Symbols _SYL and _SYR - For some reason, combining this into the same layer causes problems. See issue 3265 for more details
/* Symbols _SY
* .--------------------------------------------------------------------------------------------------------------------------------------.
* | | | | | | | | | | | | | | | |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
Expand All @@ -163,18 +163,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | | | | | | | | |
* '--------------------------------------------------------------------------------------------------------------------------------------'
*/
[_SYL] = {
[_SY] = {
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
{ UK_EXLM, UK_PND, UK_UNDS, UK_MINS, UK_TILD, _______, _______, _______, _______, _______, UK_BSLS, UK_LCBR, UK_RCBR, UK_SLSH, UK_HASH },
{ UK_DLR, UK_PERC, UK_PLUS, UK_EQL, _______, _______, _______, _______, _______, _______, UK_DQUO, UK_LPRN, UK_RPRN, UK_QUOT, UK_AT },
{ UK_CIRC, UK_AMPR, _C_SY, UK_PIPE, _______, _______, _______, _______, _______, _______, UK_LABK, UK_LBRC, UK_RBRC, UK_RABK, UK_GRV },
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }
},
[_SYR] = {
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
{ UK_EXLM, UK_PND, UK_UNDS, UK_MINS, UK_TILD, _______, _______, _______, _______, _______, UK_BSLS, UK_LCBR, UK_RCBR, UK_SLSH, UK_HASH },
{ UK_DLR, UK_PERC, UK_PLUS, UK_EQL, _______, _______, _______, _______, _______, _______, UK_DQUO, UK_LPRN, UK_RPRN, UK_QUOT, UK_AT },
{ UK_CIRC, UK_AMPR, UK_ASTR, UK_PIPE, _______, _______, _______, _______, _______, _______, UK_LABK, UK_LBRC, _COM_SY, UK_RABK, UK_GRV },
{ UK_CIRC, UK_AMPR, _AST_SY, UK_PIPE, _______, _______, _______, _______, _______, _______, UK_LABK, UK_LBRC, _COM_SY, UK_RABK, UK_GRV },
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }
},
/*
Expand Down Expand Up @@ -272,27 +265,6 @@ void matrix_scan_user(void) {
}
}

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (!record->event.pressed) return true;
if (keycode == L_SB) {
lightsOn = !lightsOn;
if (!lightsOn) {
keyPresses = 0;
} else {
resetCounts();
}
return true;
}
if (keycode == L_NEXT) {
resetCounts();
return true;
}
keyPresses++;
if (keyPresses > 100) {
resetCounts();
}
}

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (!record->event.pressed) return true;
if (keycode == L_SB) {
Expand Down
19 changes: 19 additions & 0 deletions quantum/keymap_extras/keymap_uk.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,25 @@
#define UK_ASTR KC_ASTR
#define UK_QUOT KC_QUOT

#define UK_P1 KC_P1
#define UK_P2 KC_P2
#define UK_P3 KC_P3
#define UK_P4 KC_P4
#define UK_P5 KC_P5
#define UK_P6 KC_P6
#define UK_P7 KC_P7
#define UK_P8 KC_P8
#define UK_P9 KC_P9
#define UK_P0 KC_P0
#define UK_PDOT KC_PDOT
#define UK_PCMM KC_PCMM
#define UK_PSLS KC_PSLS
#define UK_PAST KC_PAST
#define UK_PMNS KC_PMNS
#define UK_PPLS KC_PPLS
#define UK_PEQL KC_PEQL
#define UK_PENT KC_PENT

#define UK_TAB KC_TAB
#define UK_ENT KC_ENT
#define UK_LSFT KC_LSFT
Expand Down

0 comments on commit 4800f17

Please sign in to comment.