Skip to content

Commit

Permalink
Fix ergodash keymap
Browse files Browse the repository at this point in the history
  • Loading branch information
fuadsaud committed Oct 8, 2023
1 parent da4f238 commit b876ea5
Showing 1 changed file with 105 additions and 73 deletions.
178 changes: 105 additions & 73 deletions keyboards/omkbd/ergodash/rev1/keymaps/fuad/keymap.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
#include QMK_KEYBOARD_H
/* Copyright 2023 Fuad
*
* 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://www.gnu.org/licenses/>.
*/

enum custom_keycodes {
M_WSS = SAFE_RANGE,
X_DENUS,
X_PMAIL,
X_WMAIL,
D_I3,
D_GNOME,
D_MACOS,
};
#include QMK_KEYBOARD_H

enum user_layers {
LAYER_QWERTY_I3,
Expand All @@ -23,6 +29,15 @@ enum user_layers {
LAYER_META
};

enum user_keycodes {
M_WSS = SAFE_RANGE,
X_PMAIL,
X_WMAIL,
D_I3,
D_GNOME,
D_MACOS,
};

// aliases
#define ___x___ KC_NO

Expand All @@ -37,37 +52,37 @@ enum user_layers {

// mod-tap
#define LCTL_ESC LCTL_T(KC_ESC)
#define G_ENTER LGUI_T(KC_ENT)
#define M_ENTER LCMD_T(KC_ENT)
#define G_ENTER LGUI_T(KC_ENTER)
#define M_ENTER LCMD_T(KC_ENTER)

#define G_C_BRO LCTL_T(KC_LBRC)
#define I_C_BRO LGUI_T(KC_LBRC)
#define M_C_BRO LCMD_T(KC_LBRC)
#define MEH_LEA MEH(KC_LEAD)
#define HYP_BRC HYPR_T(KC_RBRC)
#define GUI_BRC LGUI_T(KC_RBRC)
#define G_C_BRO LCTL_T(KC_LEFT_BRACKET)
#define I_C_BRO LGUI_T(KC_LEFT_BRACKET)
#define M_C_BRO LCMD_T(KC_LEFT_BRACKET)
#define MEH_LEA MEH(QK_LEAD)
#define HYP_BRC HYPR_T(KC_RIGHT_BRACKET)
#define GUI_BRC LGUI_T(KC_RIGHT_BRACKET)

// app launcher
#define G_LNCHR KC_LGUI
#define G_LNCHR KC_LEFT_GUI
#define I_LNCHR LGUI(KC_D)
#define M_LNCHR LCMD(KC_SPC)
#define M_LNCHR LCMD(KC_SPACE)

// misc
#define G_SS KC_PSCREEN
#define G_WSS LALT(KC_PSCREEN)
#define G_SSS LSFT(KC_PSCREEN)
#define I_SS KC_PSCREEN
#define I_WSS LALT(KC_PSCREEN)
#define I_SSS LSFT(KC_PSCREEN)
#define G_SS KC_PRINT_SCREEN
#define G_WSS LALT(KC_PRINT_SCREEN)
#define G_SSS LSFT(KC_PRINT_SCREEN)
#define I_SS KC_PRINT_SCREEN
#define I_WSS LALT(KC_PRINT_SCREEN)
#define I_SSS LSFT(KC_PRINT_SCREEN)
#define M_SS LCMD(LSFT(KC_3))
#define M_SSS LCMD(LSFT(KC_4))

#define G_SPC KC_SPC
#define G_BSP KC_BSPC
#define I_SPC KC_SPC
#define I_BSP KC_BSPC
#define M_SPC KC_SPC
#define M_BSP KC_BSPC
#define G_SPC KC_SPACE
#define G_BSP KC_BACKSPACE
#define I_SPC KC_SPACE
#define I_BSP KC_BACKSPACE
#define M_SPC KC_SPACE
#define M_BSP KC_BACKSPACE

#define G_BACK LALT(KC_LEFT)
#define G_FRWD LALT(KC_RIGHT)
Expand All @@ -76,41 +91,41 @@ enum user_layers {

#define G_GLEFT LCTL(LSFT(KC_TAB))
#define G_GRIGH LCTL(KC_TAB)
#define M_GLEFT LCMD(LSFT(KC_LBRC))
#define M_GRIGH LCMD(LSFT(KC_RBRC))
#define M_GLEFT LCMD(LSFT(KC_LEFT_BRACKET))
#define M_GRIGH LCMD(LSFT(KC_LEFT_BRACKET))

#define G_LOCK LGUI(KC_L)
#define I_LOCK LGUI(KC_BSLS)
#define M_LOCK LCTL(LSFT(KC_POWER))

#define G_VOLD KC_VOLD
#define G_VOLU KC_VOLU
#define G_MUTE KC_MUTE
#define M_VOLD KC__VOLDOWN
#define M_VOLU KC__VOLUP
#define M_MUTE KC__MUTE

#define G_MPLY LALT(KC_MPLY)
#define G_MNXT LALT(KC_MNXT)
#define G_MPRV LALT(KC_MPRV)
#define I_MPLY KC_MPLY
#define I_MNXT KC_MNXT
#define I_MPRV KC_MPRV
#define M_MPLY KC_MPLY
#define M_MNXT KC_MFFD
#define M_MPRV KC_MRWD

#define G_PTT KC_F20
#define I_LOCK LGUI(KC_BACKSLASH)
#define M_LOCK LCTL(LSFT(KC_SYSTEM_POWER))

#define G_VOLD KC_AUDIO_VOL_DOWN
#define G_VOLU KC_AUDIO_VOL_UP
#define G_MUTE KC_AUDIO_MUTE
#define M_VOLD KC_AUDIO_VOL_DOWN
#define M_VOLU KC_AUDIO_VOL_UP
#define M_MUTE KC_AUDIO_MUTE

#define G_MPLY LALT(KC_MEDIA_PLAY_PAUSE)
#define G_MNXT LALT(KC_MEDIA_NEXT_TRACK)
#define G_MPRV LALT(KC_MEDIA_PREV_TRACK)
#define I_MPLY KC_MEDIA_PLAY_PAUSE
#define I_MNXT KC_MEDIA_NEXT_TRACK
#define I_MPRV KC_MEDIA_PREV_TRACK
#define M_MPLY KC_MEDIA_PLAY_PAUSE
#define M_MNXT KC_MEDIA_FAST_FORWARD
#define M_MPRV KC_MEDIA_REWIND

#define G_PTT LGUI(KC_BACKSLASH)
#define I_PTT KC_F20
#define M_PTT ___x___

// diacritics
#define G_GRAVE RALT(KC_GRV)
#define G_ACUTE RALT(KC_QUOT)
#define G_GRAVE RALT(KC_GRAVE)
#define G_ACUTE RALT(KC_QUOTE)
#define G_TILDE RALT(KC_TILDE)
#define G_CIRCU RALT(KC_CIRCUMFLEX)
#define G_CEDIL RALT(KC_COMM)
#define M_GRAVE LALT(KC_GRV)
#define G_CEDIL RALT(KC_COMMA)
#define M_GRAVE LALT(KC_GRAVE)
#define M_ACUTE LALT(KC_E)
#define M_TILDE LALT(KC_N)
#define M_CIRCU LALT(KC_I)
Expand All @@ -126,8 +141,8 @@ enum user_layers {
#define G_WIN_RST LGUI(KC_DOWN)
#define I_WIN_MAX LGUI(KC_F)
#define I_WIN_RST LGUI(KC_F)
#define M_WIN_MAX LCMD(LALT(KC_F))
#define M_WIN_RST LCTL(LALT(KC_BSPC))
#define M_WIN_MAX LGUI(LALT(KC_F))
#define M_WIN_RST LCTL(LALT(KC_BACKSPACE))

#define G_WMV_L LGUI(KC_LEFT)
#define G_WMV_R LGUI(KC_RIGHT)
Expand Down Expand Up @@ -177,16 +192,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , I_MPLY , I_LOCK , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_BSLS,
KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_HOME , KC_PGUP , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_QUOT,
LCTL_ESC , KC_A , KC_S , KC_D , KC_F , KC_G , KC_END , KC_PGDN , KC_H , KC_J , KC_K , KC_L , KC_SCLN , G_ENTER,
KC_LSPO , KC_Z , KC_X , KC_C , KC_V , KC_B , G_VOLD , G_VOLU , KC_N , KC_M , KC_COMM , KC_DOT , KC_SLSH , KC_RSPC,
KC_LEAD , KC_LGUI , KC_LALT , I_C_BRO , I_C_BRO , I_LOWER , KC_SPC , KC_BSPC , I_RAISE , HYP_BRC , HYP_BRC , MEH_LEA , I_PTT , META
SC_LSPO , KC_Z , KC_X , KC_C , KC_V , KC_B , G_VOLD , G_VOLU , KC_N , KC_M , KC_COMM , KC_DOT , KC_SLSH , SC_RSPC,
QK_LEAD , KC_LGUI , KC_LALT , I_C_BRO , I_C_BRO , I_LOWER , KC_SPC , KC_BSPC , I_RAISE , HYP_BRC , HYP_BRC , MEH_LEA , I_PTT , META
),

[LAYER_QWERTY_MACOS] = LAYOUT(
KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , M_MPLY , M_LOCK , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_BSLS,
KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_HOME , KC_PGUP , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_QUOT,
LCTL_ESC , KC_A , KC_S , KC_D , KC_F , KC_G , KC_END , KC_PGDN , KC_H , KC_J , KC_K , KC_L , KC_SCLN , M_ENTER,
KC_LSPO , KC_Z , KC_X , KC_C , KC_V , KC_B , M_VOLD , M_VOLU , KC_N , KC_M , KC_COMM , KC_DOT , KC_SLSH , KC_RSPC,
KC_LEAD , KC_LGUI , KC_LALT , M_C_BRO , M_C_BRO , M_LOWER , KC_SPC , KC_BSPC , M_RAISE , HYP_BRC , HYP_BRC , MEH_LEA , M_PTT , META
SC_LSPO , KC_Z , KC_X , KC_C , KC_V , KC_B , M_VOLD , M_VOLU , KC_N , KC_M , KC_COMM , KC_DOT , KC_SLSH , SC_RSPC,
QK_LEAD , KC_LGUI , KC_LALT , M_C_BRO , M_C_BRO , M_LOWER , KC_SPC , KC_BSPC , M_RAISE , HYP_BRC , HYP_BRC , MEH_LEA , M_PTT , META
),

/* LOWER LAYER
Expand Down Expand Up @@ -238,7 +253,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* META LAYER
*
* ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┐
* │RESET│ │ │RGBPM│RGBPM│ │ │ │ │ │ │ │ │ │ │
* │BOOT │ │ │RGBPM│RGBPM│ │ │ │ │ │ │ │ │ │ │
* ├─────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┤
* │ │ │RGBTG│VAL -│VAL +│ │ │ │ │ │BLINC│BLDEC│BL TG│ │ ' │
* ├─────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┤
Expand All @@ -250,8 +265,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* └─────┴─────┴─────┴───────────┴─────┴─────┴─────┘ └─────┴─────┴─────┴───────────┴─────┴─────┴─────┘
*/
[LAYER_META] = LAYOUT(
RESET , _______ , _______ , RGB_RMOD, RGB_MOD , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ ,
_______ , _______ , RGB_TOG , RGB_VAD , RGB_VAI , _______ , _______ , _______ , _______ , BL_DEC , BL_INC , BL_TOGG , _______ , _______ ,
QK_BOOT , _______ , _______ , RGB_RMOD, RGB_MOD , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ ,
_______ , _______ , RGB_TOG , RGB_VAD , RGB_VAI , _______ , _______ , _______ , _______ , BL_DOWN , BL_UP , BL_TOGG , _______ , _______ ,
_______ , _______ , _______ , RGB_HUD , RGB_HUI , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ ,
_______ , _______ , _______ , RGB_SAD , RGB_SAI , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ ,
_______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______
Expand Down Expand Up @@ -304,12 +319,10 @@ void persistent_default_layer_set(uint16_t default_layer) {
}

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
switch(keycode) {
case M_WSS:
if (record->event.pressed) {
SEND_STRING(SS_DOWN(X_LGUI) SS_DOWN(X_LSHIFT) SS_TAP(X_4) SS_UP(X_LGUI) SS_UP(X_LSHIFT));
_delay_ms(100);
SEND_STRING(SS_TAP(X_SPACE));
SEND_STRING(SS_DOWN(X_LEFT_GUI) SS_DOWN(X_LEFT_SHIFT) SS_TAP(X_4) SS_UP(X_LEFT_GUI) SS_UP(X_LEFT_SHIFT) SS_DELAY(100) SS_TAP(X_SPACE));
}
return false;

Expand All @@ -321,9 +334,28 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {

case X_WMAIL:
if (record->event.pressed) {
SEND_STRING("fuad.saud@nubank.com.br");
SEND_STRING("fuad@ellipsus.com");
}
return false;

case D_GNOME:
if (record->event.pressed) {
set_single_persistent_default_layer(LAYER_QWERTY_GNOME);
}
return false;

case D_I3:
if (record->event.pressed) {
set_single_persistent_default_layer(LAYER_QWERTY_I3);
}
return false;

case D_MACOS:
if (record->event.pressed) {
set_single_persistent_default_layer(LAYER_QWERTY_MACOS);
}
return false;
}

return true;
}

0 comments on commit b876ea5

Please sign in to comment.