diff options
| -rw-r--r-- | keyboards/clueboard/keymaps/magicmonty/Makefile | 2 | ||||
| -rw-r--r-- | keyboards/clueboard/keymaps/magicmonty/keymap.c | 152 | ||||
| -rw-r--r-- | keyboards/clueboard/keymaps/magicmonty/layout.png | bin | 0 -> 165761 bytes | |||
| -rw-r--r-- | keyboards/clueboard/keymaps/magicmonty/readme.md | 32 |
4 files changed, 186 insertions, 0 deletions
diff --git a/keyboards/clueboard/keymaps/magicmonty/Makefile b/keyboards/clueboard/keymaps/magicmonty/Makefile new file mode 100644 index 000000000..1ae727708 --- /dev/null +++ b/keyboards/clueboard/keymaps/magicmonty/Makefile | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | MOUSEKEY_ENABLE = yes | ||
| 2 | EXTRAKEY_ENABLE = yes | ||
diff --git a/keyboards/clueboard/keymaps/magicmonty/keymap.c b/keyboards/clueboard/keymaps/magicmonty/keymap.c new file mode 100644 index 000000000..fdfe2151d --- /dev/null +++ b/keyboards/clueboard/keymaps/magicmonty/keymap.c | |||
| @@ -0,0 +1,152 @@ | |||
| 1 | #include "clueboard.h" | ||
| 2 | |||
| 3 | // Helpful defines | ||
| 4 | #define GRAVE_MODS (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)|MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT)) | ||
| 5 | #define _______ KC_TRNS | ||
| 6 | |||
| 7 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | ||
| 8 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | ||
| 9 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
| 10 | // entirely and just use numbers. | ||
| 11 | #define _BL 0 | ||
| 12 | #define _FL 1 | ||
| 13 | #define _ME 2 | ||
| 14 | #define _CL 3 | ||
| 15 | #define _ML 4 | ||
| 16 | |||
| 17 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 18 | /* Keymap _BL: Base Layer (Default Layer) | ||
| 19 | */ | ||
| 20 | [_BL] = KEYMAP( | ||
| 21 | F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, _______, KC_BSPC, KC_INS, \ | ||
| 22 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, \ | ||
| 23 | MO(_FL), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \ | ||
| 24 | KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, KC_RSFT, KC_UP, \ | ||
| 25 | KC_LCTL, KC_LGUI, KC_LALT, _______, LT(_ML, KC_SPC),LT(_ML, KC_SPC), _______, KC_RALT, MO(_ME), MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT), | ||
| 26 | |||
| 27 | /* Keymap _FL: Function Layer | ||
| 28 | */ | ||
| 29 | [_FL] = KEYMAP( | ||
| 30 | KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, BL_STEP, \ | ||
| 31 | _______, _______, _______,_______,_______,_______,_______,_______,KC_PSCR,_______, _______, _______, _______, _______, _______, \ | ||
| 32 | MO(_FL), _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \ | ||
| 33 | _______, _______, _______,_______,_______,_______,_______,_______,MO(_ME),_______, _______, _______, _______, _______, KC_PGUP, \ | ||
| 34 | _______, _______, _______,_______, _______,_______, _______, _______, _______, MO(_FL), KC_HOME, KC_PGDN, KC_END), | ||
| 35 | |||
| 36 | /* Keymap _ME: Media layer | ||
| 37 | */ | ||
| 38 | [_ME] = KEYMAP( | ||
| 39 | _______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, KC_MUTE, KC_VOLU, \ | ||
| 40 | _______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, KC_VOLD, \ | ||
| 41 | _______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \ | ||
| 42 | MO(_FL), _______, _______,_______,_______,_______,_______,_______,MO(_ME),_______, _______, _______, _______, MO(_FL), _______, \ | ||
| 43 | _______, _______, _______,_______, _______,_______, _______, _______, _______, _______, KC_MPRV, KC_MPLY,KC_MNXT), | ||
| 44 | |||
| 45 | /* Keymap _CL: Control layer | ||
| 46 | */ | ||
| 47 | [_CL] = KEYMAP( | ||
| 48 | _______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, RGB_TOG, RGB_VAI, \ | ||
| 49 | _______, _______, _______,_______,RESET, _______,_______,_______,_______,_______, _______, _______, _______, _______, RGB_VAD, \ | ||
| 50 | _______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \ | ||
| 51 | MO(_FL), _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, MO(_FL), RGB_SAI, \ | ||
| 52 | _______, _______, _______,_______, RGB_MOD,RGB_MOD, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_HUI), | ||
| 53 | |||
| 54 | /* Keymap _ML: Mouse layer | ||
| 55 | */ | ||
| 56 | [_ML] = KEYMAP( | ||
| 57 | _______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, _______, _______, \ | ||
| 58 | _______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, _______, \ | ||
| 59 | _______, _______, KC_BTN3,KC_BTN2,KC_BTN1,_______,KC_MS_L,KC_MS_D,KC_MS_U,KC_MS_R, _______, _______, _______, _______, \ | ||
| 60 | _______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, KC_MS_U, \ | ||
| 61 | _______, _______, _______,_______, LT(_ML, KC_SPC),LT(_ML, KC_SPC), _______, KC_BTN1, KC_BTN2, KC_BTN3, KC_MS_L, KC_MS_D,KC_MS_R), | ||
| 62 | }; | ||
| 63 | |||
| 64 | /* This is a list of user defined functions. F(N) corresponds to item N | ||
| 65 | of this list. | ||
| 66 | */ | ||
| 67 | const uint16_t PROGMEM fn_actions[] = { | ||
| 68 | [0] = ACTION_FUNCTION(0), // Calls action_function() | ||
| 69 | }; | ||
| 70 | |||
| 71 | void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { | ||
| 72 | static uint8_t mods_pressed; | ||
| 73 | static bool mod_flag; | ||
| 74 | |||
| 75 | switch (id) { | ||
| 76 | case 0: | ||
| 77 | /* Handle the combined Grave/Esc key | ||
| 78 | */ | ||
| 79 | mods_pressed = get_mods()&GRAVE_MODS; // Check to see what mods are pressed | ||
| 80 | |||
| 81 | if (record->event.pressed) { | ||
| 82 | /* The key is being pressed. | ||
| 83 | */ | ||
| 84 | if (mods_pressed) { | ||
| 85 | mod_flag = true; | ||
| 86 | add_key(KC_GRV); | ||
| 87 | send_keyboard_report(); | ||
| 88 | } else { | ||
| 89 | add_key(KC_ESC); | ||
| 90 | send_keyboard_report(); | ||
| 91 | } | ||
| 92 | } else { | ||
| 93 | /* The key is being released. | ||
| 94 | */ | ||
| 95 | if (mod_flag) { | ||
| 96 | mod_flag = false; | ||
| 97 | del_key(KC_GRV); | ||
| 98 | send_keyboard_report(); | ||
| 99 | } else { | ||
| 100 | del_key(KC_ESC); | ||
| 101 | send_keyboard_report(); | ||
| 102 | } | ||
| 103 | } | ||
| 104 | break; | ||
| 105 | } | ||
| 106 | } | ||
| 107 | |||
| 108 | enum layer_id { | ||
| 109 | LAYER_BASE, | ||
| 110 | LAYER_FUNCTION, | ||
| 111 | LAYER_MEDIA, | ||
| 112 | LAYER_CONTROL, | ||
| 113 | LAYER_MOUSE | ||
| 114 | }; | ||
| 115 | |||
| 116 | void clueboard_set_led(uint8_t id) { | ||
| 117 | switch (id) { | ||
| 118 | case LAYER_BASE: | ||
| 119 | rgblight_sethsv(346, 0, 255); | ||
| 120 | break; | ||
| 121 | case LAYER_FUNCTION: | ||
| 122 | rgblight_sethsv(46, 255, 255); | ||
| 123 | break; | ||
| 124 | case LAYER_MEDIA: | ||
| 125 | rgblight_sethsv(86, 255, 255); | ||
| 126 | break; | ||
| 127 | case LAYER_CONTROL: | ||
| 128 | rgblight_sethsv(346, 255, 255); | ||
| 129 | break; | ||
| 130 | case LAYER_MOUSE: | ||
| 131 | rgblight_sethsv(206, 255, 255); | ||
| 132 | break; | ||
| 133 | } | ||
| 134 | }; | ||
| 135 | |||
| 136 | void matrix_scan_user(void) { | ||
| 137 | uint32_t layer = layer_state; | ||
| 138 | |||
| 139 | if (layer & (1<<_FL)) { | ||
| 140 | if (layer & (1<<_ME)) { | ||
| 141 | clueboard_set_led(LAYER_MEDIA); | ||
| 142 | } else if (layer & (1<<_CL)) { | ||
| 143 | clueboard_set_led(LAYER_CONTROL); | ||
| 144 | } else { | ||
| 145 | clueboard_set_led(LAYER_FUNCTION); | ||
| 146 | } | ||
| 147 | } else if (layer & (1<<_ML)) { | ||
| 148 | clueboard_set_led(LAYER_MOUSE); | ||
| 149 | } else { | ||
| 150 | clueboard_set_led(LAYER_BASE); | ||
| 151 | } | ||
| 152 | }; | ||
diff --git a/keyboards/clueboard/keymaps/magicmonty/layout.png b/keyboards/clueboard/keymaps/magicmonty/layout.png new file mode 100644 index 000000000..168eec2d6 --- /dev/null +++ b/keyboards/clueboard/keymaps/magicmonty/layout.png | |||
| Binary files differ | |||
diff --git a/keyboards/clueboard/keymaps/magicmonty/readme.md b/keyboards/clueboard/keymaps/magicmonty/readme.md new file mode 100644 index 000000000..728c18822 --- /dev/null +++ b/keyboards/clueboard/keymaps/magicmonty/readme.md | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | ``` | ||
| 2 | ___ _____ _ _ _ __ __ _ __ | ||
| 3 | |__ \ / ____| | | | | | / / / /(_) / / | ||
| 4 | ||) | | | | |_ _ ___| |__ ___ __ _ _ __ __| | / /_ / /_ / / | ||
| 5 | |/ / | | | | | | |/ _ \ '_ \ / _ \ / _` | '__/ _` | | '_ \| '_ \ / / | ||
| 6 | |_| | |____| | |_| | __/ |_) | (_) | (_| | | | (_| | | (_) | (_) / / _ | ||
| 7 | (_) \_____|_|\__,_|\___|_.__/ \___/ \__,_|_| \__,_| \___/ \___/_/ (_) | ||
| 8 | ``` | ||
| 9 | |||
| 10 |  | ||
| 11 | |||
| 12 | # MouseKeys Layout | ||
| 13 | |||
| 14 | This layout is a combination of the `mouse_keys` and the `win_optimized` layouts. | ||
| 15 | This layout is optimized for an ISO layout. | ||
| 16 | |||
| 17 | It adds a mouse layer. When you hold down the spacebar the arrow keys | ||
| 18 | will move your mouse cursor. You can click using the 3 mods to the left of the | ||
| 19 | arrow keys, or the 3 keys under your primary fingers on the home row. | ||
| 20 | The Left, Down, Up and Right for the mouse movement are also VIM-Like on the HJKL keys | ||
| 21 | |||
| 22 | The CapsLock is disabled and works as Function key. | ||
| 23 | |||
| 24 | There is also a separate media layer with Volume/Play controls | ||
| 25 | |||
| 26 | The different layers are signalled throug setting of the underlight: | ||
| 27 | |||
| 28 | - Base layer: White | ||
| 29 | - Function layer: Yellow | ||
| 30 | - Media layer: Green | ||
| 31 | - Mouse layer: Blue | ||
| 32 | - Control layer: Red | ||
