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

Update keymaps to use PDF keycode #24633

Merged
merged 2 commits into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
33 changes: 4 additions & 29 deletions keyboards/25keys/zinc/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ enum layer_number {
};

enum custom_keycodes {
QWERTY = SAFE_RANGE,
COLEMAK,
DVORAK,
LOWER,
LOWER = SAFE_RANGE,
RAISE,
ADJUST,
BACKLIT,
Expand All @@ -35,12 +32,9 @@ enum custom_keycodes {
RGBRST
};

enum macro_keycodes {
KC_SAMPLEMACRO,
};

//Macros
#define M_SAMPLE M(KC_SAMPLEMACRO)
#define QWERTY PDF(_QWERTY)
#define COLEMAK PDF(_COLEMAK)
#define DVORAK PDF(_DVORAK)

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty
Expand Down Expand Up @@ -169,25 +163,6 @@ void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) {

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
set_single_persistent_default_layer(_QWERTY);
}
return false;
break;
case COLEMAK:
if (record->event.pressed) {
set_single_persistent_default_layer(_COLEMAK);
}
return false;
break;
case DVORAK:
if (record->event.pressed) {
set_single_persistent_default_layer(_DVORAK);
}
return false;
break;

case LOWER:
if (record->event.pressed) {
//not sure how to have keyboard check mode and set it to a variable, so my work around
Expand Down
31 changes: 4 additions & 27 deletions keyboards/40percentclub/nori/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,14 @@ enum layer_names {
_ADJUST
};

enum custom_keycodes {
QWERTY = SAFE_RANGE,
COLEMAK,
DVORAK,
};

#define LOWER MO(_LOWER)
#define RAISE MO(_RAISE)
#define ADJUST MO(_ADJUST)

#define QWERTY PDF(_QWERTY)
#define COLEMAK PDF(_COLEMAK)
#define DVORAK PDF(_DVORAK)

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty
* ,-----------------------------------------------------------------------------------.
Expand Down Expand Up @@ -138,24 +136,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
layer_state_t layer_state_set_user(layer_state_t state) {
return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
}

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
set_single_persistent_default_layer(_QWERTY);
}
return false;
case COLEMAK:
if (record->event.pressed) {
set_single_persistent_default_layer(_COLEMAK);
}
return false;
case DVORAK:
if (record->event.pressed) {
set_single_persistent_default_layer(_DVORAK);
}
return false;
}
return true;
}
17 changes: 4 additions & 13 deletions keyboards/aleblazer/zodiark/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ enum sofle_layers {
};

enum custom_keycodes {
KC_QWERTY = SAFE_RANGE,
KC_COLEMAK,
KC_LOWER,
KC_LOWER = SAFE_RANGE,
KC_RAISE,
KC_ADJUST,
KC_PRVWD,
Expand All @@ -35,6 +33,9 @@ enum custom_keycodes {
KC_DLINE
};

#define KC_QWERTY PDF(_QWERTY)
#define KC_COLEMAK PDF(_COLEMAK)

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

[_QWERTY] = LAYOUT(
Expand Down Expand Up @@ -148,16 +149,6 @@ bool oled_task_user(void) {

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KC_QWERTY:
if (record->event.pressed) {
set_single_persistent_default_layer(_QWERTY);
}
return false;
case KC_COLEMAK:
if (record->event.pressed) {
set_single_persistent_default_layer(_COLEMAK);
}
return false;
case KC_LOWER:
if (record->event.pressed) {
layer_on(_LOWER);
Expand Down
43 changes: 3 additions & 40 deletions keyboards/bear_face/v1/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@ enum layers {

#define FN1_CAPS LT(_FN1, KC_CAPS)

//custom keycode enums
enum custom_keycodes {
BASE_QWER = QK_USER,
BASE_COLE,
BASE_DVOR
};
#define BASE_QWER PDF(_QWER)
#define BASE_COLE PDF(_COLE)
#define BASE_DVOR PDF(_DVOR)

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWER] = LAYOUT(
Expand Down Expand Up @@ -67,37 +64,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
*/
};


// macros to allow the user to set whatever default layer they want, even after reboot
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case BASE_QWER:
if (record->event.pressed) {
// when keycode BASE_QWER is pressed
set_single_persistent_default_layer(_QWER);
} else {
// when keycode BASE_QWER is released
}
break;

case BASE_COLE:
if (record->event.pressed) {
// when keycode BASE_COLE is pressed
set_single_persistent_default_layer(_COLE);
} else {
// when keycode BASE_COLE is released
}
break;

case BASE_DVOR:
if (record->event.pressed) {
// when keycode BASE_DVOR is pressed
set_single_persistent_default_layer(_DVOR);
} else {
// when keycode BASE_DVOR is released
}
break;
}
return true;
};
43 changes: 3 additions & 40 deletions keyboards/bear_face/v2/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@ enum layers {

#define FN1_CAPS LT(_FN1, KC_CAPS)

//custom keycode enums
enum custom_keycodes {
BASE_QWER = QK_USER,
BASE_COLE,
BASE_DVOR
};
#define BASE_QWER PDF(_QWER)
#define BASE_COLE PDF(_COLE)
#define BASE_DVOR PDF(_DVOR)

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWER] = LAYOUT_83_ansi(
Expand Down Expand Up @@ -67,37 +64,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
*/
};


// macros to allow the user to set whatever default layer they want, even after reboot
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case BASE_QWER:
if (record->event.pressed) {
// when keycode BASE_QWER is pressed
set_single_persistent_default_layer(_QWER);
} else {
// when keycode BASE_QWER is released
}
break;

case BASE_COLE:
if (record->event.pressed) {
// when keycode BASE_COLE is pressed
set_single_persistent_default_layer(_COLE);
} else {
// when keycode BASE_COLE is released
}
break;

case BASE_DVOR:
if (record->event.pressed) {
// when keycode BASE_DVOR is pressed
set_single_persistent_default_layer(_DVOR);
} else {
// when keycode BASE_DVOR is released
}
break;
}
return true;
};
43 changes: 3 additions & 40 deletions keyboards/bear_face/v2/keymaps/default_iso/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@ enum layers {

#define FN1_CAPS LT(_FN1, KC_CAPS)

//custom keycode enums
enum custom_keycodes {
BASE_QWER = QK_USER,
BASE_COLE,
BASE_DVOR
};
#define BASE_QWER PDF(_QWER)
#define BASE_COLE PDF(_COLE)
#define BASE_DVOR PDF(_DVOR)

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWER] = LAYOUT_84_iso(
Expand Down Expand Up @@ -67,37 +64,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
*/
};


//macros to allow the user to set whatever default layer they want, even after reboot
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case BASE_QWER:
if (record->event.pressed) {
// when keycode BASE_QWER is pressed
set_single_persistent_default_layer(_QWER);
} else {
// when keycode BASE_QWER is released
}
break;

case BASE_COLE:
if (record->event.pressed) {
// when keycode BASE_COLE is pressed
set_single_persistent_default_layer(_COLE);
} else {
// when keycode BASE_COLE is released
}
break;

case BASE_DVOR:
if (record->event.pressed) {
// when keycode BASE_DVOR is pressed
set_single_persistent_default_layer(_DVOR);
} else {
// when keycode BASE_DVOR is released
}
break;
}
return true;
};
32 changes: 3 additions & 29 deletions keyboards/bear_face/v3/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@ enum layers {

#define FN1_CAPS LT(_FN1, KC_CAPS)

//custom keycode enums
enum custom_keycodes {
BASE_QWER = QK_USER,
BASE_COLE,
BASE_DVOR
};
#define BASE_QWER PDF(_QWER)
#define BASE_COLE PDF(_COLE)
#define BASE_DVOR PDF(_DVOR)

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWER] = LAYOUT_83_ansi(
Expand Down Expand Up @@ -67,26 +64,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
*/
};


// Macros to allow the user to set whatever default layer they want, even after reboot
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case BASE_QWER:
if (record->event.pressed) {
set_single_persistent_default_layer(_QWER);
}
break;
case BASE_COLE:
if (record->event.pressed) {
set_single_persistent_default_layer(_COLE);
}
break;
case BASE_DVOR:
if (record->event.pressed) {
set_single_persistent_default_layer(_DVOR);
}
break;
}
return true;
};
32 changes: 3 additions & 29 deletions keyboards/bear_face/v3/keymaps/default_iso/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@ enum layers {

#define FN1_CAPS LT(_FN1, KC_CAPS)

//custom keycode enums
enum custom_keycodes {
BASE_QWER = QK_USER,
BASE_COLE,
BASE_DVOR
};
#define BASE_QWER PDF(_QWER)
#define BASE_COLE PDF(_COLE)
#define BASE_DVOR PDF(_DVOR)

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWER] = LAYOUT_84_iso(
Expand Down Expand Up @@ -67,26 +64,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
*/
};


// Macros to allow the user to set whatever default layer they want, even after reboot
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case BASE_QWER:
if (record->event.pressed) {
set_single_persistent_default_layer(_QWER);
}
break;
case BASE_COLE:
if (record->event.pressed) {
set_single_persistent_default_layer(_COLE);
}
break;
case BASE_DVOR:
if (record->event.pressed) {
set_single_persistent_default_layer(_DVOR);
}
break;
}
return true;
};
Loading