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
Next Next commit
Add user pdl, keymap orthodox:pdl
  • Loading branch information
pdl committed Aug 18, 2021
commit 9f00f38ba77a88bfce78609247df1e08f726259a
36 changes: 36 additions & 0 deletions keyboards/orthodox/keymaps/pdl/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
This is the c configuration file for the keymap

Copyright 2012 Jun Wako <[email protected]>
Copyright 2015 Jack Humbert
Copyright 2017 Art Ortenburger
Copyright 2018 Daniel Perrett

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http:https://www.gnu.org/licenses/>.
*/

#pragma once

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

/* Use I2C or Serial, not both */

#define USE_SERIAL
// #define USE_I2C

/* Select hand configuration */

// #define MASTER_LEFT
// #define MASTER_RIGHT
#define EE_HANDS
68 changes: 68 additions & 0 deletions keyboards/orthodox/keymaps/pdl/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
This is the keymap for the keyboard

Copyright 2012 Jun Wako <[email protected]>
Copyright 2015 Jack Humbert
Copyright 2017 Art Ortenburger

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http:https://www.gnu.org/licenses/>.
*/

#include QMK_KEYBOARD_H
#include "pdl.c"
pdl marked this conversation as resolved.
Show resolved Hide resolved

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = LAYOUT_wrapper( \
KC_TAB, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC, \
MY_SESC, _________________QWERTY_L2_________________, KC_LALT, KC_LGUI, FUNCTN, MY_AMNU, _________________QWERTY_R2_________________, MY_SQUO, \
MY_CBSL, _________________QWERTY_L3_________________, NAVIGN, KC_SPC, NUMBRS, NUMBRS, MY_SSPC, NAVIGN, _________________QWERTY_R3_________________, MY_CENT \
),

[_PROXIM] = LAYOUT_wrapper( \
MY_SESC, _________________PROXIM_L1_________________, _________________PROXIM_R1_________________, KC_BSPC, \
KC_TAB, _________________PROXIM_L2_________________, KC_LALT, KC_LGUI, FUNCTN, MY_AMNU, _________________PROXIM_R2_________________, MY_SSCL, \
MY_CBSL, _________________PROXIM_L3_________________, NAVIGN, KC_SPC, NUMBRS, NUMBRS, MY_SSPC, NAVIGN, _________________PROXIM_R3_________________, MY_CENT \
),

[_NAVIGN] = LAYOUT_wrapper( \
_______, _________________NAVIGN_L1_________________, _______, _______, _______, _______, _______, _______, \
_______, _________________NAVIGN_L2_________________, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _________________NAVIGN_L3_________________, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
),

[_PUNCTN] = LAYOUT_wrapper( \
_______, _______, _______, _______, _______, _______, _________________PUNCTN_R1_________________, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _________________PUNCTN_R2_________________, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _________________PUNCTN_R3_________________, _______ \
),

[_NUMBRS] = LAYOUT_wrapper( \
_______, _________________NUMBRS_L1_________________, _______, _______, _______, _______, _______, _______, \
_______, _________________NUMBRS_L2_________________, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _________________NUMBRS_L3_________________, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
),

[_CODING] = LAYOUT_wrapper( \
_______, _______, _______, _______, _______, _______, _________________CODING_R1_________________, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _________________CODING_R2_________________, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _________________CODING_R3_________________, _______ \
),

[_FUNCTN] = LAYOUT_wrapper( \
_______, _________________FUNCTN_L1_________________, _________________FUNCTN_L1_________________, MY_CAD, \
_______, _________________FUNCTN_L2_________________, _______, _______, _______, _______, _________________FUNCTN_L2_________________, KC_PSCR, \
_______, _________________FUNCTN_L3_________________, _______, _______, _______, _______, _______, _______, _________________FUNCTN_L3_________________, _______ \
pdl marked this conversation as resolved.
Show resolved Hide resolved
)
};

2 changes: 2 additions & 0 deletions keyboards/orthodox/keymaps/pdl/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SRC += pdl.c

pdl marked this conversation as resolved.
Show resolved Hide resolved
87 changes: 87 additions & 0 deletions users/pdl/pdl.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#include "pdl.h"
pdl marked this conversation as resolved.
Show resolved Hide resolved

// unshifted
//
// regardless of current mods, send this character in an unshifted state

__attribute__ ((weak))
bool unshifted (uint16_t keycode, keyrecord_t *record) {
uint8_t mods;

if (record->event.pressed) {
mods = keyboard_report->mods & EITHER_SHIFT;

if (mods) {
unregister_mods(mods);
register_code(keycode);
register_mods(mods);
} else {
register_code(keycode);
}

return false;
} else {
return true;
}
}

/*
* update_punctn_coding_layer_state
*
* Check NAVIGN and NUMBRS layers. If one is activated, also activate PUNCTN. If both are activated, also activate CODING.
*/

__attribute__ ((weak))
uint32_t update_punctn_coding_layer_state(uint32_t state) {
uint32_t maskEither = (1UL << _NAVIGN) | (1UL << _NUMBRS);
uint32_t maskPunctn = 1UL << _PUNCTN;
uint32_t maskCoding = 1UL << _CODING;

return (
(state & maskEither)
? (state & maskEither) == maskEither
? (state & ~maskPunctn) | maskCoding // both => coding
: (state | maskPunctn) & ~maskCoding // either => punctn
: (state & ~maskCoding) & ~maskPunctn // neither => neither
);
}

__attribute__ ((weak))
uint32_t layer_state_set_user(uint32_t state) {
return update_punctn_coding_layer_state(state);
}

__attribute__ ((weak))
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QK_LAYER_TAP_TOGGLE ... QK_LAYER_TAP_TOGGLE_MAX:
if (record->event.pressed) {
// ensure that the toggled layer is switched off by a single tap
layer_off(keycode & 0xFF);
}
break;
case QWERTY:
if (record->event.pressed) {
set_single_persistent_default_layer(_QWERTY);
}
return false;
break;
case PROXIM:
if (record->event.pressed) {
set_single_persistent_default_layer(_PROXIM);
}
return false;
break;
// 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);
}
return true;
}
107 changes: 107 additions & 0 deletions users/pdl/pdl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
#pragma once
pdl marked this conversation as resolved.
Show resolved Hide resolved

#include "quantum.h"

enum userspace_layer_codes {
QWERTY = SAFE_RANGE,
PROXIM,
PUNCTN,
CODING,
NEW_SAFE_RANGE
};

#define _QWERTY 2
#define _PROXIM 0
#define _NUMBRS 4
#define _NAVIGN 5
#define _PUNCTN 6
#define _CODING 7
#define _FUNCTN 8
pdl marked this conversation as resolved.
Show resolved Hide resolved

// Fillers to make layering more clear
#define _______ KC_TRNS
#define XXXXXXX KC_NO
pdl marked this conversation as resolved.
Show resolved Hide resolved

#define MY_SSPC MT(MOD_RSFT, KC_SPC)
#define MY_SESC MT(MOD_LSFT, KC_ESC)
#define MY_CBSL MT(MOD_LCTL, KC_NUBS)
#define MY_SSCL MT(MOD_RSFT, KC_SCLN)
#define MY_SQUO MT(MOD_RSFT, KC_QUOT)
#define MY_CENT MT(MOD_RCTL, KC_ENT)
#define MY_AMNU MT(MOD_RALT, KC_APP)

#define MY_TILD S(KC_NUHS)
#define MY_SEQL MT(MOD_RALT, KC_PEQL)
#define MY_CMIN MT(MOD_RALT, KC_MINS)
#define MY_ASLS MT(MOD_RALT, KC_SLSH)

#define MY_UNDO LCTL(KC_Z)
#define MY_CUT LCTL(KC_X)
#define MY_COPY LCTL(KC_C)
#define MY_PASTE LCTL(KC_V)

#define MY_AF4 LALT(KC_F4)
#define MY_CF4 LCTL(KC_F4)
#define MY_CF5 LCTL(KC_F5)
#define MY_CAD LCTL(LALT(KC_DEL))

#define NUMBRS TT(_NUMBRS)
#define NAVIGN TT(_NAVIGN)
#define FUNCTN TT(_FUNCTN)

#define EITHER_SHIFT (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT))

// Cannot redefine this here
// #define TAPPING_TOGGLE 2

// Taken from drashna:
// Since our quirky block definitions are basically a list of comma separated
// arguments, we need a wrapper in order for these definitions to be
// expanded before being used as arguments to the LAYOUT_xxx macro.
#if (!defined(LAYOUT) && defined(KEYMAP))
#define LAYOUT KEYMAP
#endif
#define KEYMAP_wrapper(...) LAYOUT(__VA_ARGS__)
#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__)

#define ___________________________________________ _______, _______, _______, _______, _______

#define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T
#define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G
#define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B

#define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P
#define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN
#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH

#define _________________PROXIM_L1_________________ KC_Q, KC_W, KC_F, KC_R, KC_B
#define _________________PROXIM_L2_________________ KC_A, KC_S, KC_D, KC_T, KC_G
#define _________________PROXIM_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_K

#define _________________PROXIM_R1_________________ KC_J, KC_Y, KC_O, KC_U, KC_QUOT
#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 _________________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 _________________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

#define _________________NUMBRS_L1_________________ KC_1, KC_2, KC_3, KC_4, KC_5
#define _________________NUMBRS_L2_________________ KC_6, KC_7, KC_8, KC_9, KC_0
#define _________________NUMBRS_L3_________________ KC_UNDO, KC_MINS, KC_EQL, KC_PDOT, KC_ENT

#define _________________FUNCTN_L1_________________ KC_ESC, KC_F1, KC_F2, KC_F3, MY_AF4
#define _________________FUNCTN_L2_________________ KC_APP, KC_F4, KC_F5, KC_F6, MY_CF5
#define _________________FUNCTN_L3_________________ RESET, KC_F7, KC_F8, KC_F9, MY_CF4

#define _________________FUNCTN_R1_________________ KC_VOLU, KC_F10, KC_F11, KC_F12, KC_INS
#define _________________FUNCTN_R2_________________ KC_VOLD, KC_MPRV, KC_MSTP, KC_MPLY, KC_MNXT
#define _________________FUNCTN_R3_________________ KC_MUTE, KC_PAUS, QWERTY, PROXIM, DEBUG
Empty file added users/pdl/rules.mk
Empty file.