diff options
Diffstat (limited to 'keyboards/pegasushoof/keymaps/blowrak/keymap.c')
| -rw-r--r-- | keyboards/pegasushoof/keymaps/blowrak/keymap.c | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/keyboards/pegasushoof/keymaps/blowrak/keymap.c b/keyboards/pegasushoof/keymaps/blowrak/keymap.c new file mode 100644 index 000000000..6faf4db6f --- /dev/null +++ b/keyboards/pegasushoof/keymaps/blowrak/keymap.c | |||
| @@ -0,0 +1,112 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2016 Daniel Svensson <dsvensson@gmail.com> | ||
| 3 | |||
| 4 | This program is free software: you can redistribute it and/or modify | ||
| 5 | it under the terms of the GNU General Public License as published by | ||
| 6 | the Free Software Foundation, either version 2 of the License, or | ||
| 7 | (at your option) any later version. | ||
| 8 | |||
| 9 | This program is distributed in the hope that it will be useful, | ||
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | GNU General Public License for more details. | ||
| 13 | |||
| 14 | You should have received a copy of the GNU General Public License | ||
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 16 | */ | ||
| 17 | |||
| 18 | #include "pegasushoof.h" | ||
| 19 | |||
| 20 | #define _______ KC_TRNS | ||
| 21 | |||
| 22 | /* Swedish keys */ | ||
| 23 | #define SE_HALF KC_GRV | ||
| 24 | #define SE_PLUS KC_MINS | ||
| 25 | #define SE_ACUT KC_EQL | ||
| 26 | #define SE_AO KC_LBRC | ||
| 27 | #define SE_CIRC KC_RBRC | ||
| 28 | #define SE_QUOT KC_BSLS | ||
| 29 | #define SE_OE KC_SCLN | ||
| 30 | #define SE_AE KC_QUOT | ||
| 31 | #define SE_MINS KC_SLSH | ||
| 32 | #define SE_LTGT KC_NUBS | ||
| 33 | #define SE_LCBR RALT(KC_7) | ||
| 34 | #define SE_LBRC RALT(KC_8) | ||
| 35 | #define SE_RBRC RALT(KC_9) | ||
| 36 | #define SE_RCBR RALT(KC_0) | ||
| 37 | #define SE_PIPE RALT(SE_LTGT) | ||
| 38 | #define SE_BSLS RALT(SE_PLUS) | ||
| 39 | |||
| 40 | #define KM_BLOWRAK 0 | ||
| 41 | #define KM_QWERTY 1 | ||
| 42 | #define KM_MEDIA 2 | ||
| 43 | #define KM_HAXHAX 3 | ||
| 44 | |||
| 45 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 46 | /* Layer 0: Blowrak ISO layer, a Swedish take on Dvorak */ | ||
| 47 | [KM_BLOWRAK] = KEYMAP( \ | ||
| 48 | KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR,KC_SLCK,KC_PAUS, \ | ||
| 49 | SE_HALF, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, SE_PLUS,SE_ACUT,KC_BSPC, KC_INS, KC_HOME,KC_PGUP, \ | ||
| 50 | KC_TAB, SE_AO, SE_AE, SE_OE, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_COMM,SE_CIRC,SE_QUOT, KC_DEL, KC_END, KC_PGDN, \ | ||
| 51 | KC_LCTRL,KC_A, KC_O, KC_E, KC_U, KC_I, KC_H, KC_D, KC_T, KC_N, KC_S, SE_MINS, KC_ENT, \ | ||
| 52 | KC_LSFT, SE_LTGT,KC_DOT, KC_Q, KC_J, KC_K, KC_B, KC_X, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_UP, \ | ||
| 53 | KC_FN0, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,KC_MENU,KC_FN1, KC_LEFT,KC_DOWN,KC_RGHT), | ||
| 54 | /* Layer 1: Standard ISO layer */ | ||
| 55 | [KM_QWERTY] = KEYMAP( \ | ||
| 56 | KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR,KC_SLCK,KC_PAUS, \ | ||
| 57 | SE_HALF, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, SE_PLUS,SE_ACUT,KC_BSPC, KC_INS, KC_HOME,KC_PGUP, \ | ||
| 58 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, SE_AO, SE_CIRC,SE_QUOT, KC_DEL, KC_END, KC_PGDN, \ | ||
| 59 | KC_LCTRL,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, SE_OE, SE_AE, KC_ENT, \ | ||
| 60 | KC_LSFT, SE_LTGT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, SE_MINS, KC_RSFT, KC_UP, \ | ||
| 61 | KC_FN0, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,KC_MENU,KC_FN1, KC_LEFT,KC_DOWN,KC_RGHT), | ||
| 62 | /* Layer 2: Media layer */ | ||
| 63 | [KM_MEDIA] = KEYMAP( \ | ||
| 64 | _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, KC_WAKE,KC_PWR, KC_SLEP, \ | ||
| 65 | _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,KC_VOLU, \ | ||
| 66 | _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, KC_MUTE,_______,KC_VOLD, \ | ||
| 67 | _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ | ||
| 68 | _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, KC_MPLY, \ | ||
| 69 | _______,_______,_______, _______, _______,_______,RESET ,_______, KC_MPRV,KC_MSTP,KC_MNXT), | ||
| 70 | /* Layer 3: Programming layer */ | ||
| 71 | [KM_HAXHAX] = KEYMAP( \ | ||
| 72 | _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ | ||
| 73 | _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ | ||
| 74 | _______,SE_LCBR,SE_PIPE,SE_RCBR,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ | ||
| 75 | _______,SE_LBRC,SE_BSLS,SE_RBRC,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ | ||
| 76 | _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______, \ | ||
| 77 | _______,_______,_______, _______, _______,_______,_______,_______, _______,_______,_______), | ||
| 78 | }; | ||
| 79 | |||
| 80 | const uint16_t PROGMEM fn_actions[] = { | ||
| 81 | [0] = ACTION_LAYER_MOMENTARY(KM_MEDIA), | ||
| 82 | [1] = ACTION_LAYER_TOGGLE(KM_QWERTY) | ||
| 83 | }; | ||
| 84 | |||
| 85 | void matrix_scan_user(void) | ||
| 86 | { | ||
| 87 | uint8_t layer = biton32(layer_state); | ||
| 88 | switch (layer) { | ||
| 89 | case KM_BLOWRAK: | ||
| 90 | ph_caps_led_on(); | ||
| 91 | ph_sclk_led_off(); | ||
| 92 | break; | ||
| 93 | case KM_QWERTY: | ||
| 94 | ph_sclk_led_on(); | ||
| 95 | ph_caps_led_off(); | ||
| 96 | break; | ||
| 97 | } | ||
| 98 | } | ||
| 99 | |||
| 100 | /* Mixes in KM_HAXHAX via RALT modifier without shadowing the RALT key combinations. */ | ||
| 101 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 102 | uint8_t modifiers = get_mods(); | ||
| 103 | if (modifiers & MOD_BIT(KC_RALT) && record->event.pressed) { | ||
| 104 | uint16_t kc = keymap_key_to_keycode(KM_HAXHAX, record->event.key); | ||
| 105 | if (kc != KC_TRNS) { | ||
| 106 | register_code(kc); | ||
| 107 | unregister_code(kc); | ||
| 108 | return false; | ||
| 109 | } | ||
| 110 | } | ||
| 111 | return true; | ||
| 112 | } | ||
