Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add userspace pdl and a handwired board #14199

Merged
merged 24 commits into from
Apr 13, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
9f00f38
Add user pdl, keymap orthodox:pdl
pdl Jun 29, 2018
7df9ed1
Add keymap lets_split:pdl
pdl Jul 3, 2018
4ac77a2
Add handwired keyboard 'reclined'
pdl Aug 10, 2018
ed448a7
Add layout foostan/cornelius:pdl
pdl Aug 15, 2021
95cfe22
Add combos to userspace pdl
pdl Aug 19, 2021
40e4fe7
Updates to follow code style, depracations
pdl Aug 29, 2021
d90b9be
Add GPL copyright headers per @drashna
pdl Aug 29, 2021
1cf5ae4
Always use LAYOUT_wrapper, not KEYMAP_wrapper, per @drashna
pdl Aug 29, 2021
2469b14
Convert layers into enums per @drashna
pdl Aug 29, 2021
0f902c1
Apply fixes per @zvecr
pdl Aug 30, 2021
5cbb885
Replace KEYMAP with LAYOUT per @zvecr
pdl Aug 30, 2021
2260952
Have handwired/reclined use ortho_4x12 layout
pdl Sep 2, 2021
07b62fd
Fix handwired/reclined:pdl due to changes to using ortho_4x12 layout
pdl Sep 3, 2021
fdf8363
Remove redundant declaration of LAYOUTS per @drashna
pdl Sep 12, 2021
6cd1b55
Invoke userspace with USER_NAME instead of SRC
pdl Sep 24, 2021
5a01724
Style/comment changes per code review
pdl Sep 25, 2021
972cc63
Two more style/comment changes per code review
pdl Sep 26, 2021
953f2b7
Add info.json for handwired/reclined
pdl Sep 26, 2021
ec5c705
Remove or comment out lines which info.json makes redundant in handwi…
pdl Oct 17, 2021
b262200
Apply suggestions from code review per @fauxpark
pdl Oct 29, 2021
7f5cf61
Remove redundant line per @noroadsleft
pdl Mar 26, 2022
410e838
Update keyboards/handwired/reclined/info.json per @noroadsleft
pdl Mar 26, 2022
7a4238a
Apply suggestions from code review per @fauxpark
pdl Mar 27, 2022
24f9066
Add user keymap pdl for keyboard crkbd (corne)
pdl Mar 27, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add combos to userspace pdl
  • Loading branch information
pdl committed Aug 28, 2021
commit 95cfe22c21f08b2acdceb553dccc1e4fa05ab153
5 changes: 5 additions & 0 deletions keyboards/foostan/cornelius/keymaps/pdl/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,10 @@ along with this program. If not, see <http:https://www.gnu.org/licenses/>.

#include "../../config.h"
pdl marked this conversation as resolved.
Show resolved Hide resolved

#define TAPPING_TOGGLE 2
#define TAPPING_TERM 200
#define PREVENT_STUCK_MODIFIERS
pdl marked this conversation as resolved.
Show resolved Hide resolved

#define COMBO_PDL
#define COMBO_COUNT 28
#define COMBO_TERM 100
8 changes: 4 additions & 4 deletions keyboards/foostan/cornelius/keymaps/pdl/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = KEYMAP_wrapper( \
pdl marked this conversation as resolved.
Show resolved Hide resolved
MY_FESC, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC, \
KC_TAB, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, MY_SQUO, \
MY_SBSL, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, MY_SENT, \
KC_LCTL, KC_LGUI, KC_LALT, NUMBRS, NAVIGN, KC_SPC, MY_SSPC, NUMBRS, NAVIGN, MY_AMNU, KC_UNDS, MY_CENT \
MY_SBSL, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, KC_RSFT, \
KC_LCTL, KC_LGUI, KC_LALT, NUMBRS, NAVIGN, KC_SPC, MY_SSPC, NUMBRS, NAVIGN, MY_AMNU, FUNCTN, MY_CENT \
),
[_PROXIM] = KEYMAP_wrapper( \
MY_FESC, _________________PROXIM_L1_________________, _________________PROXIM_R1_________________, KC_BSPC, \
KC_TAB, _________________PROXIM_L2_________________, _________________PROXIM_R2_________________, MY_ASCL, \
MY_SBSL, _________________PROXIM_L3_________________, _________________PROXIM_R3_________________, MY_SENT, \
KC_LCTL, KC_LGUI, KC_LALT, NUMBRS, NAVIGN, KC_SPC, MY_SSPC, NUMBRS, NAVIGN, MY_AMNU, KC_UNDS, MY_CENT \
MY_SBSL, _________________PROXIM_L3_________________, _________________PROXIM_R3_________________, KC_RSFT, \
KC_LCTL, KC_LGUI, KC_LALT, NUMBRS, NAVIGN, KC_SPC, MY_SSPC, NUMBRS, NAVIGN, MY_AMNU, FUNCTN, MY_CENT \
),
[_NAVIGN] = KEYMAP_wrapper( \
_______, _________________NAVIGN_L1_________________, _______, _______, _______, _______, _______, _______, \
Expand Down
130 changes: 121 additions & 9 deletions users/pdl/pdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ uint32_t update_punctn_coding_layer_state(uint32_t state) {
uint32_t maskPunctn = 1UL << _PUNCTN;
uint32_t maskCoding = 1UL << _CODING;

#ifdef COMBO_PDL
return (
(state & maskEither)
? (state | maskPunctn) & ~maskCoding // either => punctn
: (state & ~maskCoding) & ~maskPunctn // neither => neither
);
#endif

return (
(state & maskEither)
? (state & maskEither) == maskEither
Expand Down Expand Up @@ -72,16 +80,120 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
return false;
break;
// KC_LBRC, KC_NUHS, KC_GRV, KC_RBRC [&#`]
// KC_LBRC, KC_NUHS, KC_GRV, KC_RBRC [#`]
// These four keys are unshifted in the UK layout and should be sent as such.
case KC_LBRC:
return unshifted(keycode, record);
case KC_NUHS:
return unshifted(keycode, record);
case KC_GRV:
return unshifted(keycode, record);
case KC_RBRC:
return unshifted(keycode, record);
case KU_LBRC:
return unshifted(KC_LBRC, record);
case KU_NUHS:
return unshifted(KC_NUHS, record);
case KU_GRV:
return unshifted(KC_GRV, record);
case KU_RBRC:
return unshifted(KC_RBRC, record);
case KC_ESC:
if (!record->event.pressed) {
layer_off(_NUMBRS);
layer_off(_NAVIGN);
layer_off(_PUNCTN);
layer_off(_CODING);
}
return true;
}
return true;
}

#ifdef COMBO_PDL
enum combos {
VCOMBO_PU,
VCOMBO_NU,
VCOMBO_EU,
VCOMBO_IU,
VCOMBO_LU,
VCOMBO_PD,
VCOMBO_ND,
VCOMBO_ED,
VCOMBO_ID,
VCOMBO_LD,
HCOMBO_JR,
HCOMBO_UR,
HCOMBO_PR,
HCOMBO_MR,
HCOMBO_HR,
XCOMBO_LEFT,
XCOMBO_RIGHT,
XCOMBO_UP,
XCOMBO_DOWN,
XCOMBO_ENTER,
XCOMBO_DEL,
XCOMBO_BKSP,
XCOMBO_MINS,
XCOMBO_TAB,
XCOMBO_UNDO,
XCOMBO_REDO,
XCOMBO_PGUP,
XCOMBO_PGDN
};

const uint16_t PROGMEM vcombo_pu[] = {KC_J, KC_P, COMBO_END};
const uint16_t PROGMEM vcombo_nu[] = {KC_Y, KC_N, COMBO_END};
const uint16_t PROGMEM vcombo_eu[] = {KC_O, KC_E, COMBO_END};
const uint16_t PROGMEM vcombo_iu[] = {KC_U, KC_I, COMBO_END};
const uint16_t PROGMEM vcombo_lu[] = {KC_QUOT, KC_L, COMBO_END};
const uint16_t PROGMEM vcombo_pd[] = {KC_M, KC_P, COMBO_END};
const uint16_t PROGMEM vcombo_nd[] = {KC_H, KC_N, COMBO_END};
const uint16_t PROGMEM vcombo_ed[] = {KC_COMM, KC_E, COMBO_END};
const uint16_t PROGMEM vcombo_id[] = {KC_DOT, KC_I, COMBO_END};
const uint16_t PROGMEM vcombo_ld[] = {KC_SLSH, KC_L, COMBO_END};
const uint16_t PROGMEM hcombo_jr[] = {KC_J, KC_Y, COMBO_END};
const uint16_t PROGMEM hcombo_ur[] = {KC_QUOT, KC_U, COMBO_END};
const uint16_t PROGMEM hcombo_pr[] = {KC_P, KC_N, COMBO_END};
const uint16_t PROGMEM hcombo_mr[] = {KC_M, KC_H, COMBO_END};
const uint16_t PROGMEM hcombo_hr[] = {KC_COMM, KC_H, COMBO_END};

const uint16_t PROGMEM xcombo_left[] = {KC_K, KC_P, COMBO_END};
const uint16_t PROGMEM xcombo_right[] = {KC_M, KC_G, COMBO_END};
const uint16_t PROGMEM xcombo_up[] = {KC_B, KC_J, COMBO_END};
const uint16_t PROGMEM xcombo_down[] = {KC_K, KC_M, COMBO_END};
const uint16_t PROGMEM xcombo_enter[] = {KC_G, KC_P, COMBO_END};
const uint16_t PROGMEM xcombo_del[] = {KC_M, KC_B, COMBO_END};
const uint16_t PROGMEM xcombo_bksp[] = {KC_K, KC_J, COMBO_END};
const uint16_t PROGMEM xcombo_mins[] = {KC_V, KC_H, COMBO_END};
const uint16_t PROGMEM xcombo_tab[] = {KC_V, KC_K, COMBO_END};
const uint16_t PROGMEM xcombo_undo[] = {KC_V, KC_J, COMBO_END};
const uint16_t PROGMEM xcombo_redo[] = {KC_B, KC_H, COMBO_END};
const uint16_t PROGMEM xcombo_pgup[] = {KC_G, KC_B, COMBO_END};
const uint16_t PROGMEM xcombo_pgdn[] = {KC_G, KC_K, COMBO_END};

combo_t key_combos[COMBO_COUNT] = {
[VCOMBO_PU] = COMBO(vcombo_pu, KC_CIRC),
[VCOMBO_NU] = COMBO(vcombo_nu, KC_LBRC),
[VCOMBO_EU] = COMBO(vcombo_eu, LSFT(KC_9)),
[VCOMBO_IU] = COMBO(vcombo_iu, LSFT(KC_0)),
[VCOMBO_LU] = COMBO(vcombo_lu, KC_RBRC),
[VCOMBO_PD] = COMBO(vcombo_pd, LSFT(KC_7)),
[VCOMBO_ND] = COMBO(vcombo_nd, KC_EQL),
[VCOMBO_ED] = COMBO(vcombo_ed, KC_MINS),
[VCOMBO_ID] = COMBO(vcombo_id, LSFT(KC_1)),
[VCOMBO_LD] = COMBO(vcombo_ld, LSFT(KC_5)),
[HCOMBO_JR] = COMBO(hcombo_jr, KC_GRV),
[HCOMBO_UR] = COMBO(hcombo_ur, LSFT(KC_2)),
[HCOMBO_PR] = COMBO(hcombo_pr, LSFT(KC_8)),
[HCOMBO_MR] = COMBO(hcombo_mr, KC_NUHS),
[HCOMBO_HR] = COMBO(hcombo_hr, KC_NUBS),

[XCOMBO_LEFT] = COMBO(xcombo_left, KC_LEFT),
[XCOMBO_RIGHT] = COMBO(xcombo_right, KC_RGHT),
[XCOMBO_UP] = COMBO(xcombo_up, KC_UP),
[XCOMBO_DOWN] = COMBO(xcombo_down, KC_DOWN),
[XCOMBO_ENTER] = COMBO(xcombo_enter, KC_ENT),
[XCOMBO_DEL] = COMBO(xcombo_del, KC_DEL),
[XCOMBO_BKSP] = COMBO(xcombo_bksp, KC_BSPC),
[XCOMBO_MINS] = COMBO(xcombo_mins, KC_MINS),
[XCOMBO_TAB] = COMBO(xcombo_tab, KC_TAB),
[XCOMBO_UNDO] = COMBO(xcombo_undo, LCTL(KC_Y)),
[XCOMBO_REDO] = COMBO(xcombo_redo, LCTL(KC_Z)),
[XCOMBO_PGUP] = COMBO(xcombo_pgup, KC_PGUP),
[XCOMBO_PGDN] = COMBO(xcombo_pgdn, KC_PGDN)
};

#endif
18 changes: 11 additions & 7 deletions users/pdl/pdl.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ enum userspace_layer_codes {
PROXIM,
PUNCTN,
CODING,
KU_LBRC,
KU_NUHS,
KU_GRV,
KU_RBRC,
NEW_SAFE_RANGE
};

Expand Down Expand Up @@ -86,15 +90,15 @@ enum userspace_layer_codes {
#define _________________PROXIM_R2_________________ KC_P, KC_N, KC_E, KC_I, KC_L
#define _________________PROXIM_R3_________________ KC_M, KC_H, KC_COMM, KC_DOT, KC_SLASH

#define _________________PUNCTN_R1_________________ KC_LT, KC_GT, KC_LPRN, KC_RPRN, _______
#define _________________PUNCTN_R2_________________ KC_ASTR, KC_EQL, KC_MINS, KC_PLUS, KC_SLSH
#define _________________PUNCTN_R3_________________ KC_LCBR, KC_RCBR, _______, _______, _______
#define _________________PUNCTN_R1_________________ KC_NUBS, KC_NUHS, KC_LPRN, KC_RPRN, _______
#define _________________PUNCTN_R2_________________ KC_GRV, KC_EQL, KC_MINS, KC_PLUS, KC_SLSH
#define _________________PUNCTN_R3_________________ KC_LBRC, KC_RBRC, _______, _______, _______

#define _________________CODING_R1_________________ KC_GRV, KC_PERC, KC_DLR, KC_AT, _______
#define _________________CODING_R2_________________ KC_CIRC, KC_UNDS, MY_TILD, KC_AMPR, KC_NUHS
#define _________________CODING_R3_________________ KC_LBRC, KC_RBRC, _______, _______, _______
#define _________________CODING_R1_________________ KU_GRV, KC_PERC, KC_DLR, KC_AT, _______
#define _________________CODING_R2_________________ KC_CIRC, KC_UNDS, MY_TILD, KC_AMPR, KU_NUHS
#define _________________CODING_R3_________________ KU_LBRC, KU_RBRC, _______, _______, _______

#define _________________NAVIGN_L1_________________ KC_DEL, KC_PGUP, KC_UP, KC_PGDN, KC_BSPC
#define _________________NAVIGN_L1_________________ KC_DEL, KC_PGUP, KC_UP, KC_PGDN, KC_BSPC
#define _________________NAVIGN_L2_________________ KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END
#define _________________NAVIGN_L3_________________ MY_UNDO, MY_CUT, MY_COPY, MY_PASTE, KC_ENT

Expand Down
1 change: 1 addition & 0 deletions users/pdl/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
COMBO_ENABLE = yes