Skip to content

Commit

Permalink
Migrate ACTION_MODS_ONESHOT to OSM() (qmk#8957)
Browse files Browse the repository at this point in the history
* Branch point for 2020 May 30 Breaking Change

* Migrate `ACTION_MODS_ONESHOT` to `OSM()`

* Also migrate the single instance of `ACTION_LAYER_ONESHOT` to `OSL()`
  • Loading branch information
fauxpark authored and noroadsleft committed May 28, 2020
1 parent 621a1ae commit 22bb6e0
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 67 deletions.
6 changes: 1 addition & 5 deletions keyboards/atomic/keymaps/pvc/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ enum keyboard_macros {
#define SC_CCLS LCTL(KC_F4)

#define TG_NKRO MAGIC_TOGGLE_NKRO
#define OS_SHFT KC_FN0
#define OS_SHFT OSM(MOD_LSFT)

#define ________________ _______, _______
#define XXXXXXXXXXXXXXXX XXXXXXX, XXXXXXX
Expand Down Expand Up @@ -258,10 +258,6 @@ void persistent_default_layer_set(uint16_t default_layer) {
default_layer_set(default_layer);
}

const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_MODS_ONESHOT(MOD_LSFT),
};

const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {

// MACRODOWN only works in this function
Expand Down
23 changes: 2 additions & 21 deletions keyboards/ergotravel/keymaps/ckofy/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,6 @@ enum custom_keycodes {
ADJUST,
};

/* Fn keys */

enum {

F_SFT = 0,
F_ALT,
F_CTRL,
F_NUMPAD
// F_LOWER,
// F_RAISE,
};

#define KC_ KC_TRNS
#define KC_XXXX KC_NO
Expand Down Expand Up @@ -57,8 +46,8 @@ enum {
#define KC_UDO LCTL(KC_Z)
#define KC_CUT LCTL(KC_X)
#define KC_SVE LCTL(KC_S)
#define KC_OSH F(F_SFT)
#define KC_OCTL F(F_CTRL)
#define KC_OSH OSM(MOD_LSFT)
#define KC_OCTL OSM(MOD_LCTL)
#define KC_NUMP TT(_NUMPAD)
#define KC_SHESC MT(MOD_LSFT,KC_ESC)
#define KC_SHENT MT(MOD_RSFT,KC_ENT)
Expand Down Expand Up @@ -142,14 +131,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

};

const uint16_t PROGMEM fn_actions[] = {
[F_SFT] = ACTION_MODS_ONESHOT (MOD_LSFT)
,[F_ALT] = ACTION_MODS_ONESHOT (MOD_LALT)
,[F_CTRL] = ACTION_MODS_ONESHOT (MOD_LCTL)
};



bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case COLEMAK:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ TRAN
#define TT_SYM MO(_SYM)
#define TT_MOV LT(_MOV,KC_BSPC)
#define TT_NUM MO(_NUM)
#define SSFT ACTION_MODS_ONESHOT(MOD_LSFT)

enum macro_keycodes {
DHPASTE=1,
Expand Down
6 changes: 1 addition & 5 deletions keyboards/planck/keymaps/pvc/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ enum keyboard_macros {
#define SC_CCLS LCTL(KC_F4)

#define TG_NKRO MAGIC_TOGGLE_NKRO
#define OS_SHFT KC_FN0
#define OS_SHFT OSM(MOD_RSFT)

#define ________________ _______, _______
#define XXXXXXXXXXXXXXXX XXXXXXX, XXXXXXX
Expand Down Expand Up @@ -234,10 +234,6 @@ void persistent_default_layer_set(uint16_t default_layer)
default_layer_set(default_layer);
}

const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_MODS_ONESHOT(MOD_RSFT),
};

const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{

Expand Down
6 changes: 1 addition & 5 deletions keyboards/planck/keymaps/zrichard/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ enum {
#define SC_CCLS LCTL(KC_F4)

#define TG_NKRO MAGIC_TOGGLE_NKRO
#define OS_SHFT KC_FN0
#define OS_SHFT OSM(MOD_RSFT)

#define ________________ _______, _______
#define XXXXXXXXXXXXXXXX XXXXXXX, XXXXXXX
Expand Down Expand Up @@ -243,10 +243,6 @@ void persistant_default_layer_set(uint16_t default_layer)
default_layer_set(default_layer);
}

const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_MODS_ONESHOT(MOD_RSFT),
};

const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{

Expand Down
4 changes: 1 addition & 3 deletions keyboards/sentraq/s60_x/keymaps/ansi_qwertz/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
//Function
//Mute microphone
#define KC_SPACEFN LT(2, KC_SPACE)
#define KC_OSLS KC_FN3
#define KC_OSLS OSM(MOD_LSFT)
#define KC_GMLK TG(1)
#define KC_FUNC MO(2)
#define MICMUTE RCTL(KC_LCTL)

enum function_codes {
F_OSLS = 3
};

enum layer_names {
Expand Down Expand Up @@ -149,7 +148,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* Fn action definition
*/
const uint16_t PROGMEM fn_actions[] = {
[F_OSLS] = ACTION_MODS_ONESHOT(MOD_LSFT) // Oneshot Leftshift
};

void matrix_init_user(void) {
Expand Down
18 changes: 6 additions & 12 deletions layouts/community/ergodox/algernon/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ enum {
F_BSE = 0,
F_HUN,
F_GUI,
F_SFT,
F_ALT,
F_CTRL
};

/* Custom keycodes */
Expand Down Expand Up @@ -146,9 +143,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
,KC_MPLY ,KC_SLSH ,KC_Q ,KC_J ,KC_K ,KC_X ,TD(CT_TMUX)
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,TD(CT_CLN)

,F(F_ALT),F(F_GUI)
,F(F_CTRL)
,KC_BSPC,F(F_SFT),KC_ESC
,OSM(MOD_LALT),F(F_GUI)
,OSM(MOD_LCTL)
,KC_BSPC,OSM(MOD_LSFT),KC_ESC

// right hand
,M(Fx) ,M(A_0) ,M(A_2) ,M(A_4) ,M(A_6) ,M(A_8) ,M(A_PLVR)
Expand Down Expand Up @@ -191,9 +188,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
,KC_NO ,KC_Z ,KC_Q ,KC_QUOT ,KC_COMM ,KC_DOT ,TD(CT_TMUX)
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,TD(CT_CLN)

,F(F_ALT),F(F_GUI)
,F(F_CTRL)
,KC_BSPC,F(F_SFT),KC_ESC
,OSM(MOD_LALT),F(F_GUI)
,OSM(MOD_LCTL)
,KC_BSPC,OSM(F_LSFT),KC_ESC

// right hand
,M(Fx) ,M(A_0) ,M(A_2) ,M(A_4) ,M(A_6) ,M(A_8) ,M(A_PLVR)
Expand Down Expand Up @@ -440,9 +437,6 @@ const uint16_t PROGMEM fn_actions[] = {
[F_BSE] = ACTION_LAYER_CLEAR(ON_PRESS)
,[F_HUN] = ACTION_LAYER_INVERT(HUN, ON_PRESS)
,[F_GUI] = ACTION_MACRO_TAP(A_GUI)
,[F_SFT] = ACTION_MODS_ONESHOT (MOD_LSFT)
,[F_ALT] = ACTION_MODS_ONESHOT (MOD_LALT)
,[F_CTRL] = ACTION_MODS_ONESHOT (MOD_LCTL)
};

static void toggle_steno(int pressed)
Expand Down
3 changes: 1 addition & 2 deletions layouts/community/ergodox/colemak_osx_pc_no/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
MO(4), KC_BTN1, KC_BTN2, KC_TAB,GUI_T(KC_COMMA),
NO_AMPR, NO_PIPE,
NO_PLUS,
KC_FN1,CTL_T(KC_DOT),ALT_T(NO_MINS),
OSM(MOD_LSFT),CTL_T(KC_DOT),ALT_T(NO_MINS),
// right hand
KC_FN5, NO_DLR, NO_LPRN, NO_RPRN ,KC_FN3, KC_FN4,NO_AT,
NO_APOS, KC_J, KC_L, KC_U, KC_Y, NO_AA, NO_AE ,
Expand Down Expand Up @@ -222,7 +222,6 @@ enum macro_id {
};

const uint16_t PROGMEM fn_actions[] = {
[1] = ACTION_MODS_ONESHOT(MOD_LSFT), // Sticky shift light. Tap for the next keypress to be shifted. Hold for regular shift.
[2] = ACTION_MACRO(TILDE_NO), // Completed ~ character(pc and mac), no space needed.
[3] = ACTION_MACRO(LESS_NO), // < completed on keypress down, to avoid shifting the next character if it is not released first.
[4] = ACTION_MACRO(GRTR_NO), // > completed on keypress down, to avoid shifting the next character if it is not released first.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
ALT_T(KC_ESC), KC_EXLM , NO_QUES, NO_COLN, KC_TAB,
KC_HASH, KC_FN7,
KC_FN6,
KC_FN1,CTL_T(KC_DOT),GUI_T(KC_COMMA),
OSM(MOD_LSFT),CTL_T(KC_DOT),GUI_T(KC_COMMA),
// right hand
KC_FN5, NO_DLR, NO_LPRN, NO_RPRN ,KC_FN3, KC_FN4,NO_AT,
NO_APOS, KC_Y, KC_U, KC_I, KC_O, KC_P, NO_AA ,
Expand Down Expand Up @@ -138,7 +138,6 @@ enum macro_id {
};

const uint16_t PROGMEM fn_actions[] = {
[1] = ACTION_MODS_ONESHOT(MOD_LSFT), // Sticky shift light. Tap for the next keypress to be shifted. Hold for regular shift.
[2] = ACTION_MACRO(TILDE_NO), // Completed ~ character(pc and mac), no space needed.
[3] = ACTION_MACRO(LESS_NO), // < completed on keypress down, to avoid shifting the next character if it is not released first.
[4] = ACTION_MACRO(GRTR_NO), // > completed on keypress down, to avoid shifting the next character if it is not released first.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
ALT_T(KC_ESC), KC_EXLM , NO_QUES, NO_COLN, KC_TAB,
KC_HASH, KC_FN7,
KC_FN6,
KC_FN1,CTL_T(KC_DOT),GUI_T(KC_COMMA),
OSM(MOD_LSFT),CTL_T(KC_DOT),GUI_T(KC_COMMA),
// right hand
KC_FN5, NO_DLR, NO_LPRN, NO_RPRN ,KC_FN3, KC_FN4,NO_AT,
NO_APOS, KC_J, KC_L, KC_U, KC_Y, NO_AA, NO_AE ,
Expand Down Expand Up @@ -138,7 +138,6 @@ enum macro_id {
};

const uint16_t PROGMEM fn_actions[] = {
[1] = ACTION_MODS_ONESHOT(MOD_LSFT), // Sticky shift light. Tap for the next keypress to be shifted. Hold for regular shift.
[2] = ACTION_MACRO(TILDE_NO), // Completed ~ character(pc and mac), no space needed.
[3] = ACTION_MACRO(LESS_NO), // < completed on keypress down, to avoid shifting the next character if it is not released first.
[4] = ACTION_MACRO(GRTR_NO), // > completed on keypress down, to avoid shifting the next character if it is not released first.
Expand Down
13 changes: 4 additions & 9 deletions layouts/community/ergodox/townk_osx/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, MEH_T(KC_F16),
CTL_T(KC_BSLS), KC_A, KC_S, KC_D, KC_F, KC_G,
KC_FN2, KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_F18),
KC_FN1, TG(KEYPAD), KC_LCTRL, KC_LALT, KC_LGUI,
OSM(MOD_LSFT), KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_F18),
OSL(FN), TG(KEYPAD), KC_LCTRL, KC_LALT, KC_LGUI,
M_TESC, M_TPASTE,
KC_HOME,
KC_BSPC, KC_DEL, KC_END,
//right half
KC_POWER, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
MEH_T(KC_F17), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_EQL,
KC_H, KC_J, KC_K, KC_L, KC_SCLN, CTL_T(KC_QUOT),
ALL_T(KC_F19), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_FN2,
KC_RGUI, KC_RALT, CTL_T(KC_LBRC), LT(KEYPAD, KC_RBRC), KC_FN1,
ALL_T(KC_F19), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, OSM(MOD_LSFT),
KC_RGUI, KC_RALT, CTL_T(KC_LBRC), LT(KEYPAD, KC_RBRC), OSL(FN),
M_OSXCPY, M_OSXPST,
KC_PGUP,
KC_PGDN, KC_ENT, KC_SPC),
Expand Down Expand Up @@ -194,11 +194,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_NO,
KC_NO, KC_NO, KC_NO)};

const uint16_t PROGMEM fn_actions[] = {
[1] = ACTION_LAYER_ONESHOT(FN),
[2] = ACTION_MODS_ONESHOT(MOD_LSFT), // Sticky shift light. Tap for the next keypress to be shifted. Hold for regular shift.
};

const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
// MACRODOWN only works in this function
switch(id) {
Expand Down

0 comments on commit 22bb6e0

Please sign in to comment.