diff options
| author | milestogo <milestogo@users.noreply.github.com> | 2020-05-08 23:15:26 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-08 23:15:26 -0700 |
| commit | 803610a284ac886eaeb319b4a8d25ffbd2861152 (patch) | |
| tree | 46c074727b4015bdd345d762e78f89144498ce24 /users | |
| parent | cd0edbb1fba91df97be233e30c145f352eda31c0 (diff) | |
| download | qmk_firmware-803610a284ac886eaeb319b4a8d25ffbd2861152.tar.gz qmk_firmware-803610a284ac886eaeb319b4a8d25ffbd2861152.zip | |
[Keymap] initial user directory for milestogo + babblepaste (#7698)
* initial user directory
* fix missing endif in vi mode
* fix includes per drashna and a few typos. I have not tested the userspace keymap, it is just there to help keep the user space and keymap in sync
* move babblepaste docs to md format
* clean up block quotes
* TIL clang-format - miles2go userspace
Diffstat (limited to 'users')
| -rw-r--r-- | users/miles2go/babblePaste.c | 125 | ||||
| -rw-r--r-- | users/miles2go/babblePaste.h | 349 | ||||
| -rw-r--r-- | users/miles2go/babblePaste.md | 207 | ||||
| -rw-r--r-- | users/miles2go/babl_chromeos.c | 103 | ||||
| -rw-r--r-- | users/miles2go/babl_emacs.c | 85 | ||||
| -rw-r--r-- | users/miles2go/babl_linux.c | 102 | ||||
| -rw-r--r-- | users/miles2go/babl_mac.c | 152 | ||||
| -rw-r--r-- | users/miles2go/babl_readmux.c | 86 | ||||
| -rw-r--r-- | users/miles2go/babl_vi.c | 76 | ||||
| -rw-r--r-- | users/miles2go/babl_windows.c | 151 | ||||
| -rw-r--r-- | users/miles2go/config.h | 53 | ||||
| -rw-r--r-- | users/miles2go/keymaps/handwired/ms_sculpt_mobile/config.h | 41 | ||||
| -rw-r--r-- | users/miles2go/keymaps/handwired/ms_sculpt_mobile/keymap.c | 463 | ||||
| -rw-r--r-- | users/miles2go/keymaps/handwired/ms_sculpt_mobile/readme.md | 10 | ||||
| -rw-r--r-- | users/miles2go/keymaps/handwired/ms_sculpt_mobile/rules.mk | 24 | ||||
| -rw-r--r-- | users/miles2go/milestogo.c | 142 | ||||
| -rw-r--r-- | users/miles2go/milestogo.h | 289 | ||||
| -rw-r--r-- | users/miles2go/readme.md | 10 | ||||
| -rw-r--r-- | users/miles2go/rules.mk | 10 |
19 files changed, 2478 insertions, 0 deletions
diff --git a/users/miles2go/babblePaste.c b/users/miles2go/babblePaste.c new file mode 100644 index 000000000..2a32024cd --- /dev/null +++ b/users/miles2go/babblePaste.c | |||
| @@ -0,0 +1,125 @@ | |||
| 1 | /* A library to output the right key shortcut in any common app. | ||
| 2 | Given a global variable babble_mode to show the environment and a | ||
| 3 | key that calls the paste macro, do the right type of paste. | ||
| 4 | Setting the context is done by another macro, or TBD interaction with the host. | ||
| 5 | |||
| 6 | Huge thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts | ||
| 7 | and https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/jeebak/keymap.c | ||
| 8 | */ | ||
| 9 | |||
| 10 | #include QMK_KEYBOARD_H | ||
| 11 | |||
| 12 | #ifdef USE_BABBLEPASTE | ||
| 13 | # include "babblePaste.h" | ||
| 14 | |||
| 15 | // small function that we might also want to call from a keymap. | ||
| 16 | |||
| 17 | // GLOBAL variable to determine mode. Sets startup default if no eeppom | ||
| 18 | uint8_t babble_mode = 0; | ||
| 19 | |||
| 20 | // function to tell the user that the mode has changed | ||
| 21 | __attribute__((weak)) void babble_led_user(void) {} | ||
| 22 | |||
| 23 | void set_babble_mode(uint8_t id) { babble_mode = id; } | ||
| 24 | |||
| 25 | void babble_mode_increment() { | ||
| 26 | babble_mode += 1; | ||
| 27 | if (babble_mode >= BABL_MODEMAX) { | ||
| 28 | babble_mode = 0; | ||
| 29 | } | ||
| 30 | } | ||
| 31 | |||
| 32 | void babble_mode_decrement() { | ||
| 33 | if (babble_mode >= 1) { | ||
| 34 | babble_mode -= 1; | ||
| 35 | } else { | ||
| 36 | babble_mode = BABL_MODEMAX - 1; | ||
| 37 | } | ||
| 38 | } | ||
| 39 | |||
| 40 | /* this function runs the appropriate babblepaste macro, given | ||
| 41 | the global babble_mode and a keycode defined in the babble_keycodes enum. | ||
| 42 | |||
| 43 | This could be made faster by splitting into two functions sorted by keycode range | ||
| 44 | But that makes for a *lot* of ifdefs. | ||
| 45 | */ | ||
| 46 | bool babblePaste(uint16_t keycode) { | ||
| 47 | // handle the OS/mode switching first | ||
| 48 | |||
| 49 | # ifdef BABL_MAC | ||
| 50 | if (keycode == BABL_DO_MAC) { | ||
| 51 | set_babble_mode(BABL_MAC_MODE); | ||
| 52 | babble_led_user(); | ||
| 53 | return true; | ||
| 54 | } | ||
| 55 | |||
| 56 | if (babble_mode == BABL_MAC_MODE) { | ||
| 57 | babblePaste_mac(keycode); | ||
| 58 | } | ||
| 59 | # endif | ||
| 60 | |||
| 61 | # ifdef BABL_VI | ||
| 62 | if (keycode == BABL_DO_VI) { | ||
| 63 | set_babble_mode(BABL_VI_MODE); | ||
| 64 | babble_led_user(); | ||
| 65 | return true; | ||
| 66 | } | ||
| 67 | if (babble_mode == BABL_VI_MODE) { | ||
| 68 | babblePaste_vi(keycode); | ||
| 69 | } | ||
| 70 | # endif | ||
| 71 | # ifdef BABL_WINDOWS | ||
| 72 | if (keycode == BABL_DO_WINDOWS) { | ||
| 73 | set_babble_mode(BABL_WINDOWS_MODE); | ||
| 74 | babble_led_user(); | ||
| 75 | return true; | ||
| 76 | } | ||
| 77 | if (babble_mode == BABL_WINDOWS_MODE) { | ||
| 78 | babblePaste_win(keycode); | ||
| 79 | } | ||
| 80 | # endif | ||
| 81 | # ifdef BABL_LINUX | ||
| 82 | if (keycode == BABL_DO_LINUX) { | ||
| 83 | set_babble_mode(BABL_LINUX_MODE); | ||
| 84 | babble_led_user(); | ||
| 85 | return true; | ||
| 86 | } | ||
| 87 | if (babble_mode == BABL_LINUX_MODE) { | ||
| 88 | babblePaste_linux(keycode); | ||
| 89 | } | ||
| 90 | # endif | ||
| 91 | # ifdef BABL_EMACS | ||
| 92 | if (keycode == BABL_DO_EMACS) { | ||
| 93 | set_babble_mode(BABL_EMACS_MODE); | ||
| 94 | babble_led_user(); | ||
| 95 | return true; | ||
| 96 | } | ||
| 97 | if (babble_mode == BABL_EMACS_MODE) { | ||
| 98 | babblePaste_emacs(keycode); | ||
| 99 | } | ||
| 100 | # endif | ||
| 101 | # ifdef BABL_CHROME | ||
| 102 | if (keycode == BABL_DO_CHROMEOS) { | ||
| 103 | set_babble_mode(BABL_CHROMEOS_MODE); | ||
| 104 | babble_led_user(); | ||
| 105 | return true; | ||
| 106 | } | ||
| 107 | if (babble_mode == BABL_CHROMEOS_MODE) { | ||
| 108 | babblePaste_readmux(keycode); | ||
| 109 | } | ||
| 110 | # endif | ||
| 111 | # ifdef BABL_READMUX | ||
| 112 | if (keycode == BABL_DO_READMUX) { | ||
| 113 | set_babble_mode(BABL_READMUX_MODE); | ||
| 114 | babble_led_user(); | ||
| 115 | return true; | ||
| 116 | } | ||
| 117 | if (babble_mode == BABL_READMUX_MODE) { | ||
| 118 | babblePaste_readmux(keycode); | ||
| 119 | } | ||
| 120 | # endif | ||
| 121 | |||
| 122 | return false; | ||
| 123 | } | ||
| 124 | |||
| 125 | #endif // USE_BABBLEPASTE | ||
diff --git a/users/miles2go/babblePaste.h b/users/miles2go/babblePaste.h new file mode 100644 index 000000000..606640227 --- /dev/null +++ b/users/miles2go/babblePaste.h | |||
| @@ -0,0 +1,349 @@ | |||
| 1 | /* A library to output the right key shortcut in any common app. | ||
| 2 | Given a global variable babble_mode to show the environment and a | ||
| 3 | key that calls the paste macro, do the right type of paste. | ||
| 4 | |||
| 5 | Setting the bable_mode is done by another macro, or TBD interaction with the host. | ||
| 6 | |||
| 7 | Huge thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts | ||
| 8 | and jeebak & algernon's keymap | ||
| 9 | */ | ||
| 10 | |||
| 11 | #pragma once | ||
| 12 | #include "quantum.h" | ||
| 13 | |||
| 14 | #ifdef USE_BABBLEPASTE | ||
| 15 | |||
| 16 | void set_babble_mode(uint8_t id); | ||
| 17 | void babble_mode_increment(void); | ||
| 18 | void babble_mode_decrement(void); | ||
| 19 | void babble_led_user(void); | ||
| 20 | |||
| 21 | // manually re-order these if you want to set the order or default. | ||
| 22 | enum babble_modes { | ||
| 23 | # ifdef BABL_MAC | ||
| 24 | BABL_MAC_MODE, | ||
| 25 | # endif | ||
| 26 | # ifdef BABL_READMUX | ||
| 27 | BABL_READMUX_MODE, | ||
| 28 | # endif | ||
| 29 | # ifdef BABL_WINDOWS | ||
| 30 | BABL_WINDOWS_MODE, | ||
| 31 | # endif | ||
| 32 | # ifdef BABL_VI | ||
| 33 | BABL_VI_MODE, | ||
| 34 | # endif | ||
| 35 | # ifdef BABL_LINUX | ||
| 36 | BABL_LINUX_MODE, | ||
| 37 | # endif | ||
| 38 | # ifdef BABL_EMACS | ||
| 39 | BABL_EMACS_MODE, | ||
| 40 | # endif | ||
| 41 | # ifdef BABL_CHROMEOS | ||
| 42 | BABL_CHROMEOS_MODE, | ||
| 43 | # endif | ||
| 44 | BABL_MODEMAX | ||
| 45 | }; | ||
| 46 | |||
| 47 | // void babble_led_user( uint8_t id) | ||
| 48 | |||
| 49 | /// Hacks to make it easier to create sendstring macros | ||
| 50 | |||
| 51 | //"outer" versions wrap text | ||
| 52 | # define OMCTL(arg) SS_DOWN(X_LCTRL) arg SS_UP(X_LCTRL) | ||
| 53 | # define OMGUI(arg) SS_DOWN(X_LGUI) arg SS_UP(X_LGUI) | ||
| 54 | # define OMALT(arg) SS_DOWN(X_LALT) arg SS_UP(X_LALT) | ||
| 55 | # define OMSFT(...) SS_DOWN(X_LSHIFT) __VA_ARGS__ SS_UP(X_LSHIFT) | ||
| 56 | //"inner" versions wrap a key tap | ||
| 57 | # define IMCTL(arg) SS_DOWN(X_LCTRL) SS_TAP(arg) SS_UP(X_LCTRL) | ||
| 58 | # define IMGUI(arg) SS_DOWN(X_LGUI) SS_TAP(arg) SS_UP(X_LGUI) | ||
| 59 | # define IMALT(arg) SS_DOWN(X_LALT) SS_TAP(arg) SS_UP(X_LALT) | ||
| 60 | # define IMSFT(arg) SS_DOWN(X_LSHIFT) SS_TAP(arg) SS_UP(X_LSHIFT) | ||
| 61 | |||
| 62 | # define BABLM(ent, ...) \ | ||
| 63 | if (ent == keycode) { \ | ||
| 64 | SEND_STRING(__VA_ARGS__); \ | ||
| 65 | return true; \ | ||
| 66 | } | ||
| 67 | |||
| 68 | // BabblePaste should be loaded first (header in userspace .h file, before all else) | ||
| 69 | // if not,we'll do our best. | ||
| 70 | # if defined(NEW_SAFE_RANGE) | ||
| 71 | # define BABBLE_START NEW_SAFE_RANGE | ||
| 72 | # else | ||
| 73 | # if defined(KEYMAP_SAFE_RANGE) | ||
| 74 | # define BABBLE_START KEYMAP_SAFE_RANGE | ||
| 75 | # else | ||
| 76 | # define BABBLE_START SAFE_RANGE | ||
| 77 | # endif | ||
| 78 | # endif | ||
| 79 | |||
| 80 | enum babble_keycodes { | ||
| 81 | FIRST = BABBLE_START, | ||
| 82 | # ifdef BABL_MOVE | ||
| 83 | // Movement macros | ||
| 84 | // left & right | ||
| 85 | BABL_GO_LEFT_1C, | ||
| 86 | BABL_GO_RIGHT_1C, | ||
| 87 | BABL_GO_LEFT_WORD, | ||
| 88 | BABL_GO_RIGHT_WORD, | ||
| 89 | BABL_GO_START_LINE, | ||
| 90 | BABL_GO_END_LINE, | ||
| 91 | // now up & down | ||
| 92 | BABL_GO_START_DOC, | ||
| 93 | BABL_GO_END_DOC, | ||
| 94 | BABL_GO_NEXT_LINE, | ||
| 95 | BABL_GO_PREV_LINE, | ||
| 96 | BABL_GO_PARA_START, | ||
| 97 | BABL_GO_PARA_END, | ||
| 98 | BABL_PGDN, | ||
| 99 | BABL_PGUP, | ||
| 100 | // And the delete options | ||
| 101 | BABL_DEL_LEFT_1C, // == backspace, so why bother? | ||
| 102 | BABL_DEL_RIGHT_1C, // usually = Del | ||
| 103 | BABL_DEL_LEFT_WORD, | ||
| 104 | BABL_DEL_RIGHT_WORD, | ||
| 105 | BABL_DEL_TO_LINE_END, // delete from cursor to end of line | ||
| 106 | BABL_DEL_TO_LINE_START, // delete from cursor to begining line | ||
| 107 | BABL_MODE, // print out string saying what mode we're in. | ||
| 108 | # endif | ||
| 109 | # ifdef BABL_OSKEYS | ||
| 110 | BABL_UNDO, | ||
| 111 | BABL_REDO, | ||
| 112 | BABL_CUT, | ||
| 113 | BABL_COPY, | ||
| 114 | BABL_PASTE, | ||
| 115 | BABL_SELECT_ALL, | ||
| 116 | /* not yet implemented | ||
| 117 | BABL_SWAP_LAST2C, // swap last characters before the cursor | ||
| 118 | BABL_SWAP_LAST2W, // Swap the last two words before the cursor | ||
| 119 | */ | ||
| 120 | // find & replace | ||
| 121 | BABL_FIND, | ||
| 122 | BABL_FIND_NEXT, | ||
| 123 | BABL_FIND_PREV, | ||
| 124 | BABL_FIND_REPLACE, | ||
| 125 | // GUI or app | ||
| 126 | BABL_RUNAPP, | ||
| 127 | BABL_SWITCH_APP_NEXT, | ||
| 128 | BABL_SWITCH_APP_LAST, // previous | ||
| 129 | BABL_WINDOW_NEXT, | ||
| 130 | BABL_WINDOW_PREV, | ||
| 131 | BABL_WINDOW_NEW, | ||
| 132 | BABL_CLOSE_APP, | ||
| 133 | BABL_HELP, | ||
| 134 | BABL_LOCK, | ||
| 135 | BABL_SCREENCAPTURE, | ||
| 136 | BABL_SWITCH_KEYBOARD_LAYOUT, | ||
| 137 | # endif | ||
| 138 | # ifdef BABL_BROWSER | ||
| 139 | BABL_BROWSER_NEW_TAB, | ||
| 140 | BABL_BROWSER_CLOSE_TAB, | ||
| 141 | BABL_BROWSER_REOPEN_LAST_TAB, | ||
| 142 | BABL_BROWSER_NEXT_TAB, | ||
| 143 | BABL_BROWSER_PREV_TAB, | ||
| 144 | BABL_BROWSER_URL_BAR, | ||
| 145 | BABL_BROWSER_FORWARD, | ||
| 146 | BABL_BROWSER_BACK, | ||
| 147 | BABL_BROWSER_FIND, | ||
| 148 | BABL_BROWSER_BOOKMARK, | ||
| 149 | BABL_BROWSER_DEV_TOOLS, // hard one to remember | ||
| 150 | BABL_BROWSER_RELOAD, | ||
| 151 | BABL_BROWSER_FULLSCREEN, | ||
| 152 | BABL_BROWSER_ZOOM_IN, | ||
| 153 | BABL_BROWSER_ZOOM_OUT, | ||
| 154 | BABL_BROWSER_VIEWSRC, | ||
| 155 | # endif | ||
| 156 | # ifdef BABL_APP | ||
| 157 | BABL_APP_SAVE, // save file blurs app & os. Move? | ||
| 158 | BABL_APP_PASTE_VALUES, // paste only values, or with some special formatting. ctrl shift v chrome, // Ctrl+Alt+V, excel | ||
| 159 | // App hotkeys will be flawed, since you may use different spreadsheets across OSes. | ||
| 160 | # ifdef BABL_APP_CELLS // spreadsheets and tables | ||
| 161 | BABL_APP_CENTER_ALIGN, // Center align contents of a cell in table or spreadsheet. | ||
| 162 | BABL_APP_CLEAR_FORMATTING, // | ||
| 163 | BABL_APP_SCROLL_ACTIVE_CELL, // scroll to active cell. | ||
| 164 | BABL_NEWLINE_IN_CELL, // newline inside cell of table, | ||
| 165 | BABL_INSERT_COMMENT, // insert comment | ||
| 166 | BABL_INSERT_COL_LEFT, // insert columns to the left | ||
| 167 | BABL_INSERT_ROW, // insert row | ||
| 168 | BABL_DELETE_ROW, // delete row // excel ctrl minus // chrome ctrl alt minus | ||
| 169 | BABL_SELECT_COL, // select column - ctrl space //same in both | ||
| 170 | BABL_SELECT_ROW, // select row shift spaced // same in both. | ||
| 171 | # endif // BABL_APP_CELLS | ||
| 172 | # ifdef BABL_APP_EDITOR | ||
| 173 | BABL_APP_MULTI_SELECT, /* www.sublimetext.com/docs/2/multiple_selection_with_the_keyboard.html */ | ||
| 174 | # endif // BABL_APP_EDITOR | ||
| 175 | # ifdef BABL_APP_WINDOWSPLITTING | ||
| 176 | // These aren't useful on most oses. | ||
| 177 | BABL_SPLIT_FRAME_VERT, | ||
| 178 | BABL_UNSPLIT_FRAME_VERT, | ||
| 179 | BABL_SPLIT_FRAME_HORIZONTAL, | ||
| 180 | BABL_UNSPLIT_FRAME_HORIZONTAL, | ||
| 181 | BABL_NEXT_FRAME, | ||
| 182 | BABL_PREV_FRAME, | ||
| 183 | # endif | ||
| 184 | |||
| 185 | # endif | ||
| 186 | |||
| 187 | // Macros for mode switching | ||
| 188 | # ifdef BABL_WINDOWS | ||
| 189 | BABL_DO_WINDOWS, | ||
| 190 | # endif | ||
| 191 | # ifdef BABL_MAC | ||
| 192 | BABL_DO_MAC, | ||
| 193 | # endif | ||
| 194 | # ifdef BABL_LINUX | ||
| 195 | BABL_DO_LINUX, | ||
| 196 | # endif | ||
| 197 | # ifdef BABL_EMACS | ||
| 198 | BABL_DO_EMACS, | ||
| 199 | # endif | ||
| 200 | # ifdef BABL_VI | ||
| 201 | BABL_DO_VI, | ||
| 202 | # endif | ||
| 203 | # ifdef BABL_READMUX | ||
| 204 | BABL_DO_READMUX, | ||
| 205 | # endif | ||
| 206 | # ifdef BABL_CHROMEOS | ||
| 207 | BABL_DO_CHROMEOS, | ||
| 208 | # endif | ||
| 209 | BABBLE_END_RANGE | ||
| 210 | }; | ||
| 211 | |||
| 212 | // primary function. | ||
| 213 | bool babblePaste(uint16_t keycode); | ||
| 214 | |||
| 215 | /****************************************************/ | ||
| 216 | /* All per-os includes and short mode switch macros*/ | ||
| 217 | # ifdef BABL_WINDOWS | ||
| 218 | # define B_WIN BABL_DO_WINDOWS | ||
| 219 | bool babblePaste_win(uint16_t keycode); | ||
| 220 | # endif | ||
| 221 | # ifdef BABL_MAC | ||
| 222 | # define B_MAC BABL_DO_MAC | ||
| 223 | bool babblePaste_mac(uint16_t keycode); | ||
| 224 | # endif | ||
| 225 | # ifdef BABL_LINUX | ||
| 226 | # define B_LINUX BABL_DO_LINUX | ||
| 227 | bool babblePaste_linux(uint16_t keycode); | ||
| 228 | # endif | ||
| 229 | # ifdef BABL_EMACS | ||
| 230 | # define B_EMACS BABL_DO_EMACS | ||
| 231 | bool babblePaste_emacs(uint16_t keycode); | ||
| 232 | # endif | ||
| 233 | # ifdef BABL_VI | ||
| 234 | # define B_VI BABL_DO_VI | ||
| 235 | bool babblePaste_vi(uint16_t keycode); | ||
| 236 | # endif | ||
| 237 | # ifdef BABL_READMUX | ||
| 238 | # define B_READ BABL_DO_READMUX | ||
| 239 | bool babblePaste_readmux(uint16_t keycode); | ||
| 240 | # endif | ||
| 241 | # ifdef BABL_CHROMEOS | ||
| 242 | # define B_CROM BABL_DO_CHROMEOS | ||
| 243 | bool babblePaste_chromeos(uint16_t keycode); | ||
| 244 | # endif | ||
| 245 | |||
| 246 | # define BABL_INC babble_mode_increment(); | ||
| 247 | # define BABL_DEC babble_mode_decrement(); | ||
| 248 | |||
| 249 | /**************************************************** | ||
| 250 | ** All keyboard macros for Babble Actions | ||
| 251 | *****************************************************/ | ||
| 252 | |||
| 253 | # ifdef BABL_MOVE | ||
| 254 | # define B_L1C BABL_GO_LEFT_1C | ||
| 255 | # define B_R1C BABL_GO_RIGHT_1C | ||
| 256 | # define B_L1W BABL_GO_LEFT_WORD | ||
| 257 | # define B_R1W BABL_GO_RIGHT_WORD | ||
| 258 | # define B_GSOL BABL_GO_START_LINE | ||
| 259 | # define B_GEOL BABL_GO_END_LINE | ||
| 260 | # define B_GTOP BABL_GO_START_DOC | ||
| 261 | # define B_GEND BABL_GO_END_DOC | ||
| 262 | # define B_DOWN BABL_GO_NEXT_LINE | ||
| 263 | # define B_UP BABL_GO_PREV_LINE | ||
| 264 | # define B_PTOP BABL_GO_PARA_START | ||
| 265 | # define B_PEND BABL_GO_PARA_END | ||
| 266 | # define B_PGDN BABL_PGDN | ||
| 267 | # define B_PGUP BABL_PGUP | ||
| 268 | //#define B_BKSP BABL_DEL_LEFT_1C == backspace so why bother. | ||
| 269 | # define B_DEL BABL_DEL_RIGHT_1C // usually = Del | ||
| 270 | # define B_DLW BABL_DEL_LEFT_WORD | ||
| 271 | # define B_DRW BABL_DEL_RIGHT_WORD | ||
| 272 | # define B_DEOL BABL_DEL_TO_LINE_END // delete from cursor to end of line | ||
| 273 | # define B_DSOL BABL_DEL_TO_LINE_START // delete from cursor to begining line | ||
| 274 | # define B_MODE BABL_MODE // type out name of current mode. | ||
| 275 | # endif | ||
| 276 | |||
| 277 | # ifdef BABL_OSKEYS | ||
| 278 | # define B_UNDO BABL_UNDO | ||
| 279 | # define B_REDO BABL_REDO | ||
| 280 | # define B_CUT BABL_CUT | ||
| 281 | # define B_COPY BABL_COPY | ||
| 282 | # define B_PASTE BABL_PASTE | ||
| 283 | # define B_SELALL BABL_SELECT_ALL | ||
| 284 | # define B_SELA BABL_SELECT_ALL | ||
| 285 | # define B_FIND BABL_FIND | ||
| 286 | # define B_FINDN BABL_FIND_NEXT | ||
| 287 | # define B_FINDP BABL_FIND_PREV | ||
| 288 | # define B_RPLACE BABL_FIND_REPLACE | ||
| 289 | # define B_RUNAPP BABL_RUNAPP | ||
| 290 | # define B_NAPP BABL_SWITCH_APP_NEXT | ||
| 291 | # define B_PAPP BABL_SWITCH_APP_LAST // previous | ||
| 292 | # define B_NWIN BABL_WINDOW_NEXT | ||
| 293 | # define B_PWIN BABL_WINDOW_PREV | ||
| 294 | # define B_WINN BABL_WINDOW_NEW | ||
| 295 | # define B_CAPP BABL_CLOSE_APP | ||
| 296 | # define B_HELP BABL_HELP | ||
| 297 | # define B_LOCK BABL_LOCK | ||
| 298 | # define B_SCAP BABL_SCREENCAPTURE | ||
| 299 | # define B_KEYB BABL_SWITCH_KEYBOARD_LAYOUT | ||
| 300 | # endif | ||
| 301 | |||
| 302 | # ifdef BABL_BROWSER | ||
| 303 | # define B_NTAB BABL_BROWSER_NEW_TAB | ||
| 304 | # define B_CTAB BABL_BROWSER_CLOSE_TAB | ||
| 305 | # define B_ROTB BABL_BROWSER_REOPEN_LAST_TAB | ||
| 306 | # define B_NXTB BABL_BROWSER_NEXT_TAB | ||
| 307 | # define B_PTAB BABL_BROWSER_PREV_TAB | ||
| 308 | # define B_NURL BABL_BROWSER_URL_BAR | ||
| 309 | # define B_BFWD BABL_BROWSER_FORWARD | ||
| 310 | # define B_BBAK BABL_BROWSER_BACK | ||
| 311 | # define B_BFND BABL_BROWSER_FIND | ||
| 312 | # define B_BOOK BABL_BROWSER_BOOKMARK | ||
| 313 | # define B_BDEV BABL_BROWSER_DEV_TOOLS // hard one to remember | ||
| 314 | # define B_BRLD BABL_BROWSER_RELOAD | ||
| 315 | # define B_BFULL BABL_BROWSER_FULLSCREEN | ||
| 316 | # define B_ZIN BABL_BROWSER_ZOOM_IN | ||
| 317 | # define B_ZOUT BABL_BROWSER_ZOOM_OUT | ||
| 318 | # endif | ||
| 319 | |||
| 320 | # ifdef BABL_APP | ||
| 321 | # define B_SAVE BABL_APP_SAVE | ||
| 322 | # ifdef BABL_APP_CELLS // spreadsheets and tables | ||
| 323 | # define B_PASTV BABL_APP_PASTE_VALUES | ||
| 324 | # define B_CALN BABL_APP_CENTER_ALIGN | ||
| 325 | # define B_CFMT BABL_APP_CLEAR_FORMATTING | ||
| 326 | # define B_SCLA BABL_APP_SCROLL_ACTIVE_CELL | ||
| 327 | # define B_NCEL BABL_NEWLINE_IN_CELL | ||
| 328 | # define B_IPRW BABL_INSERT_ROW_ABOVE | ||
| 329 | # define B_ICOL BABL_INSERT_COL_LEFT | ||
| 330 | # define B_IROW BABL_INSERT_ROW | ||
| 331 | # define B_DROW BABL_DELETE_ROW | ||
| 332 | # define B_SELC BABL_SELECT_COL | ||
| 333 | # define B_SELR BABL_SELECT_ROW | ||
| 334 | # endif // BABL_APP_CELLS | ||
| 335 | # ifdef BABL_APP_EDITOR | ||
| 336 | # define B_MSEL BABL_APP_MULTI_SELECT | ||
| 337 | /* www.sublimetext.com/docs/2/multiple_selection_with_the_keyboard.html */ | ||
| 338 | # endif // BABL_APP_EDITOR | ||
| 339 | # ifdef BABL_APP_WINDOWSPLITTING | ||
| 340 | # define B_VSPLIT BABL_SPLIT_FRAME_VERT | ||
| 341 | # define B_VUNSPT BABL_UNSPLIT_FRAME_VERT | ||
| 342 | # define B_HSPLIT BABL_SPLIT_FRAME_HORIZONTAL | ||
| 343 | # define B_HUNSPT BABL_UNSPLIT_FRAME_HORIZONTAL | ||
| 344 | # define B_NXTFM BABL_NEXT_FRAME | ||
| 345 | # define B_PRVFM BABL_PREV_FRAME | ||
| 346 | # endif // BABL_APP_WINDOWSPLITTING | ||
| 347 | # endif // BABL_APP | ||
| 348 | |||
| 349 | #endif | ||
diff --git a/users/miles2go/babblePaste.md b/users/miles2go/babblePaste.md new file mode 100644 index 000000000..cc1c31bd0 --- /dev/null +++ b/users/miles2go/babblePaste.md | |||
| @@ -0,0 +1,207 @@ | |||
| 1 | ## Babblepaste, a universal translator for keyboard shortcuts | ||
| 2 | |||
| 3 | The idea is to have one "paste" key do the right thing for any operating system. | ||
| 4 | Put the keyboard in Windows mode, and "paste" means Ctrl-v. | ||
| 5 | Switch to Emacs and "Paste" means Ctrl-y. Mac is GUI-v and so on. | ||
| 6 | |||
| 7 | Currently supported modes are Windows, OS X, Gnome/KDE, Emacs, VI , ChromeOS, and Readline, with 70+ common macro actions. | ||
| 8 | |||
| 9 | The babblepaste library looks for the current OS in the babble_mode global variable. | ||
| 10 | To switch modes, run the switch_babble_mode() function, or a pre defined BABL_DO_x macro. | ||
| 11 | |||
| 12 | **BE CAREFUL** | ||
| 13 | * Not all actions are defined for all OSes. The default is to do nothing. | ||
| 14 | * Not all actions are _TESTED_ on all OSes. | ||
| 15 | * Keys can have very different meanings between windows in the same OS. If you switch apps without switching modes, bad things can happen. | ||
| 16 | |||
| 17 | ###To use the library | ||
| 18 | #### Add #defines to your config.h. | ||
| 19 | ``` | ||
| 20 | #define USE_BABBLEPASTE | ||
| 21 | |||
| 22 | //// Uncomment the modes you want to enable | ||
| 23 | #define BABL_WINDOWS | ||
| 24 | #define BABL_READMUX | ||
| 25 | #define BABL_VI | ||
| 26 | #define BABL_MAC | ||
| 27 | #define BABL_LINUX | ||
| 28 | #define BABL_EMACS | ||
| 29 | #define BABL_CHROMEOS | ||
| 30 | |||
| 31 | //// These enable subsets of babble macros. Disable options to save space | ||
| 32 | #define BABL_MOVE // Uncomment to add basic cursor movement | ||
| 33 | #define BABL_OSKEYS // This adds Cut, paste, window movement and common OS shortcuts | ||
| 34 | #define BABL_BROWSER // Browser shortcuts | ||
| 35 | |||
| 36 | //// What Browser shortcuts? | ||
| 37 | #define BABL_BROWSER_CHROME // Chrome browser, Google apps | ||
| 38 | //#define BABL_BROWSER_MS | ||
| 39 | //#define BABL_BROWSER_SAFARI // Safari, Apple defaults. | ||
| 40 | |||
| 41 | //// applications vary even more between OSes. We'll do our best. | ||
| 42 | #define BABL_APP | ||
| 43 | // To enable specific App options. | ||
| 44 | #define BABL_APP_CELLS // spreadsheets and tables | ||
| 45 | #define BABL_APP_EDITOR // Fancy editor commands | ||
| 46 | #define BABL_APP_WINDOWSPLITTING // splitting frames & windows | ||
| 47 | |||
| 48 | //// What App keybinding is assumed? | ||
| 49 | //#define BABL_APP_GOOGLE // Google office | ||
| 50 | #define BABL_APP_MSOFFICE // MS office | ||
| 51 | //#define BABL_APP_APPLE // Apple office | ||
| 52 | #define BABL_APP_SUBLIME | ||
| 53 | ``` | ||
| 54 | |||
| 55 | #### Enable Babblepaste in your Keymap | ||
| 56 | |||
| 57 | Add the following to your keymap in process_record_user, before the main switch statement. | ||
| 58 | ``` | ||
| 59 | #ifdef USE_BABBLEPASTE | ||
| 60 | if( keycode > BABBLE_START && keycode < BABBLE_END_RANGE ) { | ||
| 61 | if (record->event.pressed) { // is there a case where this isn't desired? | ||
| 62 | babblePaste ( keycode ); | ||
| 63 | } else{ | ||
| 64 | return true; | ||
| 65 | } | ||
| 66 | } | ||
| 67 | #endif | ||
| 68 | ``` | ||
| 69 | |||
| 70 | #### Add makefile rules | ||
| 71 | |||
| 72 | Update your rules.mk to include the modes you want. | ||
| 73 | |||
| 74 | `SRC += babblePaste.c babl_windows.c babl_mac.c babl_vi.c babl_readmux.c babl_chromeos.c babl_emacs.c babl_linux.c` | ||
| 75 | |||
| 76 | |||
| 77 | #### Custom Keycodes | ||
| 78 | |||
| 79 | If you are using custom keycodes, update the safe range in your user.h | ||
| 80 | ``` | ||
| 81 | #if defined(BABBLE_END_RANGE) | ||
| 82 | #define USER_START BABBLE_END_RANGE | ||
| 83 | #else | ||
| 84 | #if defined(KEYMAP_SAFE_RANGE) | ||
| 85 | #define USER_START KEYMAP_SAFE_RANGE | ||
| 86 | #else | ||
| 87 | #define USER_START SAFE_RANGE | ||
| 88 | #endif | ||
| 89 | #endif | ||
| 90 | ``` | ||
| 91 | |||
| 92 | #### Add Babblepaste actions to your keymap. | ||
| 93 | See the full list in babblePaste.h, or the list below | ||
| 94 | ``` | ||
| 95 | B_WIN // switch babblepaste to windows mode. | ||
| 96 | B_MAC // Mac Mode | ||
| 97 | B_LNX // switch to linux | ||
| 98 | B_VI // switch to Vi mode | ||
| 99 | B_EMAX // switch mode to emacs | ||
| 100 | B_READ // switch to readline /tmux mode | ||
| 101 | B_CROM // switch to chromeos mode. | ||
| 102 | |||
| 103 | #define B_L1C BABL_GO_LEFT_1C | ||
| 104 | #define B_R1C BABL_GO_RIGHT_1C | ||
| 105 | #define B_L1W BABL_GO_LEFT_WORD | ||
| 106 | #define B_R1W BABL_GO_RIGHT_WORD | ||
| 107 | #define B_GSOL BABL_GO_START_LINE | ||
| 108 | #define B_GEOL BABL_GO_END_LINE | ||
| 109 | #define B_GTOP BABL_GO_START_DOC | ||
| 110 | #define B_GEND BABL_GO_END_DOC | ||
| 111 | #define B_DOWN BABL_GO_NEXT_LINE | ||
| 112 | #define B_UP BABL_GO_PREV_LINE | ||
| 113 | #define B_PTOP BABL_GO_PARA_START | ||
| 114 | #define B_PEND BABL_GO_PARA_END | ||
| 115 | #define B_PGDN BABL_PGDN | ||
| 116 | #define B_PGUP BABL_PGUP | ||
| 117 | #define B_DEL BABL_DEL_RIGHT_1C | ||
| 118 | #define B_DLW BABL_DEL_LEFT_WORD | ||
| 119 | #define B_DRW BABL_DEL_RIGHT_WORD | ||
| 120 | #define B_DEOL BABL_DEL_TO_LINE_END // delete from cursor to end of line | ||
| 121 | #define B_DSOL BABL_DEL_TO_LINE_START // delete from cursor to begining line | ||
| 122 | #define B_MODE BABL_MODE //type out name of current mode. | ||
| 123 | |||
| 124 | #define B_UNDO BABL_UNDO | ||
| 125 | #define B_REDO BABL_REDO | ||
| 126 | #define B_CUT BABL_CUT | ||
| 127 | #define B_COPY BABL_COPY | ||
| 128 | #define B_PASTE BABL_PASTE | ||
| 129 | #define B_SELALL BABL_SELECT_ALL | ||
| 130 | #define B_SELA BABL_SELECT_ALL | ||
| 131 | #define B_FIND BABL_FIND | ||
| 132 | #define B_FINDN BABL_FIND_NEXT | ||
| 133 | #define B_FINDP BABL_FIND_PREV | ||
| 134 | #define B_RPLACE BABL_FIND_REPLACE | ||
| 135 | #define B_RUNAPP BABL_RUNAPP | ||
| 136 | #define B_NAPP BABL_SWITCH_APP_NEXT | ||
| 137 | #define B_PAPP BABL_SWITCH_APP_LAST // previous | ||
| 138 | #define B_CAPP BABL_CLOSE_APP | ||
| 139 | #define B_HELP BABL_HELP | ||
| 140 | |||
| 141 | #define B_NTAB BABL_BROWSER_NEW_TAB | ||
| 142 | #define B_CTAB BABL_BROWSER_CLOSE_TAB | ||
| 143 | #define B_ROTB BABL_BROWSER_REOPEN_LAST_TAB | ||
| 144 | #define B_NXTB BABL_BROWSER_NEXT_TAB | ||
| 145 | #define B_PTAB BABL_BROWSER_PREV_TAB | ||
| 146 | #define B_NURL BABL_BROWSER_URL_BAR | ||
| 147 | #define B_BFWD BABL_BROWSER_FORWARD | ||
| 148 | #define B_BBAK BABL_BROWSER_BACK | ||
| 149 | #define B_BFND BABL_BROWSER_FIND | ||
| 150 | #define B_BOOK BABL_BROWSER_BOOKMARK | ||
| 151 | #define B_BDEV BABL_BROWSER_DEV_TOOLS // hard one to remember | ||
| 152 | #define B_BRLD BABL_BROWSER_RELOAD | ||
| 153 | #define B_BFULL BABL_BROWSER_FULLSCREEN | ||
| 154 | #define B_ZIN BABL_BROWSER_ZOOM_IN | ||
| 155 | #define B_ZOUT BABL_BROWSER_ZOOM_OUT | ||
| 156 | |||
| 157 | #define B_PASTV BABL_APP_PASTE_VALUES | ||
| 158 | #define B_CALN BABL_APP_CENTER_ALIGN | ||
| 159 | #define B_CFMT BABL_APP_CLEAR_FORMATTING | ||
| 160 | #define B_SCLA BABL_APP_SCROLL_ACTIVE_CELL | ||
| 161 | #define B_NCEL BABL_NEWLINE_IN_CELL | ||
| 162 | #define B_IPRW BABL_INSERT_ROW_ABOVE | ||
| 163 | #define B_ICOL BABL_INSERT_COL_LEFT | ||
| 164 | #define B_IROW BABL_INSERT_ROW | ||
| 165 | #define B_DROW BABL_DELETE_ROW | ||
| 166 | #define B_SELC BABL_SELECT_COL | ||
| 167 | #define B_SELR BABL_SELECT_ROW | ||
| 168 | |||
| 169 | #define B_MSEL BABL_APP_MULTI_SELECT | ||
| 170 | #define B_VSPLIT BABL_SPLIT_FRAME_VERT | ||
| 171 | #define B_VUNSPT BABL_UNSPLIT_FRAME_VERT | ||
| 172 | #define B_HSPLIT BABL_SPLIT_FRAME_HORIZONTAL | ||
| 173 | #define B_HUNSPT BABL_UNSPLIT_FRAME_HORIZONTAL | ||
| 174 | #define B_NXTFM BABL_NEXT_FRAME | ||
| 175 | #define B_PRVFM BABL_PREV_FRAME | ||
| 176 | ``` | ||
| 177 | |||
| 178 | |||
| 179 | ## Development FAQs | ||
| 180 | |||
| 181 | **Todos** | ||
| 182 | eeprom store state of babble_mode? or update docs so that people can change the order of the enum in | ||
| 183 | babblespace.h? | ||
| 184 | |||
| 185 | **You have huge ifdef stanzas instead of functions** | ||
| 186 | This fails gracefully if you don't have all options defined. Patch if you can think how to use fewer defines. | ||
| 187 | |||
| 188 | ** Why not an array of arrays as a lookup instead of a function?** | ||
| 189 | This would allow you to store the lookup table in PROGMEM. | ||
| 190 | True, but that takes more pre-processor skill than I have, and may be less portable to ARM or other flash mappings. | ||
| 191 | |||
| 192 | ** Have you tested every key on every platform?** | ||
| 193 | No. Be careful, submit a patch. | ||
| 194 | |||
| 195 | ** Why not update Apps at the same global level as the OS? ** | ||
| 196 | This is only a good thing if it doesn't confuse the user. If you can show state of OS vs App, it's probably a good thing. | ||
| 197 | |||
| 198 | ** Can the OS tell the keyboard what mode to use? ** | ||
| 199 | The keyboard side is easy to do with virtser_recv & a function that updates babble_mode. It still needs a PC side app to track where the keyboard focus is. | ||
| 200 | One could use a keyboard macro to launch an app & switch modes for that app. | ||
| 201 | |||
| 202 | ## Thanks | ||
| 203 | |||
| 204 | Thanks to [wikipedia shortcuts page](https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts) | ||
| 205 | and [Jeebak's keymap](https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/jeebak/keymap.c) | ||
| 206 | this [howtogeek shortcuts page](https://www.howtogeek.com/115664/42-text-editing-keyboard-shortcuts-that-work-almost-everywhere/) | ||
| 207 | And of course QMK... | ||
diff --git a/users/miles2go/babl_chromeos.c b/users/miles2go/babl_chromeos.c new file mode 100644 index 000000000..a0c461f24 --- /dev/null +++ b/users/miles2go/babl_chromeos.c | |||
| @@ -0,0 +1,103 @@ | |||
| 1 | /* A library to output the right key shortcut in any common app. | ||
| 2 | Given a global variable babble_mode to show the environment and a | ||
| 3 | key that calls the paste macro, do the right type of paste. | ||
| 4 | Setting the context is done by another macro, or TBD interaction with the host. | ||
| 5 | |||
| 6 | https://support.google.com/docs/answer/181110?co=GENIE.Platform%3DDesktop&hl=en | ||
| 7 | |||
| 8 | */ | ||
| 9 | |||
| 10 | #include QMK_KEYBOARD_H | ||
| 11 | |||
| 12 | #ifdef USE_BABBLEPASTE | ||
| 13 | # include "babblePaste.h" | ||
| 14 | |||
| 15 | # ifdef BABL_CHROMEOS | ||
| 16 | |||
| 17 | bool babblepaste_chromeos(uint16_t keycode) { | ||
| 18 | # ifdef BABL_MOVE | ||
| 19 | BABLM(BABL_GO_LEFT_1C, SS_TAP(X_LEFT)); | ||
| 20 | BABLM(BABL_GO_RIGHT_1C, SS_TAP(X_RIGHT)); | ||
| 21 | BABLM(BABL_GO_LEFT_WORD, IMCTL(X_LEFT)); | ||
| 22 | BABLM(BABL_GO_RIGHT_WORD, IMCTL(X_RIGHT)); | ||
| 23 | BABLM(BABL_GO_START_LINE, SS_TAP(X_HOME)); | ||
| 24 | BABLM(BABL_GO_END_LINE, SS_TAP(X_END)); | ||
| 25 | BABLM(BABL_GO_START_DOC, IMCTL(X_HOME)); | ||
| 26 | BABLM(BABL_GO_END_DOC, IMCTL(X_END)); | ||
| 27 | BABLM(BABL_GO_NEXT_LINE, SS_TAP(X_DOWN)); | ||
| 28 | BABLM(BABL_GO_PREV_LINE, SS_TAP(X_UP)); | ||
| 29 | BABLM(BABL_GO_PARA_START, IMCTL(X_UP)); // untested | ||
| 30 | BABLM(BABL_GO_PARA_END, IMCTL(X_DOWN)); // untested | ||
| 31 | BABLM(BABL_PGDN, IMGUI(X_DOWN)); | ||
| 32 | BABLM(BABL_PGUP, IMGUI(X_UP)); | ||
| 33 | BABLM(BABL_DEL_RIGHT_1C, IMALT(X_BSPACE)); | ||
| 34 | BABLM(BABL_DEL_LEFT_WORD, IMCTL(X_BSPACE)); | ||
| 35 | BABLM(BABL_DEL_RIGHT_WORD, OMSFT(IMCTL(X_RIGHT)) SS_TAP(X_BSPACE)); | ||
| 36 | BABLM(BABL_DEL_TO_LINE_END, OMSFT(IMGUI(X_LEFT)) SS_TAP(X_BSPACE)); | ||
| 37 | BABLM(BABL_DEL_TO_LINE_START, OMSFT(IMGUI(X_RIGHT)) SS_TAP(X_BSPACE)); | ||
| 38 | BABLM(BABL_MODE, ("ChromeOS ")); | ||
| 39 | # endif | ||
| 40 | # ifdef BABL_OSKEYS | ||
| 41 | BABLM(BABL_UNDO, SS_LCTRL("z")); | ||
| 42 | BABLM(BABL_REDO, OMSFT(IMCTL(X_Z))); | ||
| 43 | BABLM(BABL_CUT, SS_LCTRL("x")); | ||
| 44 | BABLM(BABL_COPY, SS_LCTRL("c")); | ||
| 45 | BABLM(BABL_PASTE, SS_LCTRL("v")); | ||
| 46 | BABLM(BABL_SELECT_ALL, SS_LCTRL("a")); | ||
| 47 | BABLM(BABL_FIND, SS_LCTRL("f")); | ||
| 48 | BABLM(BABL_FIND_NEXT, SS_LCTRL("g")); | ||
| 49 | BABLM(BABL_FIND_PREV, OMSFT(IMCTL(X_G))); | ||
| 50 | BABLM(BABL_WINDOW_NEW, IMCTL(X_N)); | ||
| 51 | // BABLM( BABL_FIND_REPLACE, () ); // not part of Chrome | ||
| 52 | // BABLM( BABL_RUNAPP, SS_TAP(X_LGUI) ); // not sure of this | ||
| 53 | BABLM(BABL_SWITCH_APP_NEXT, IMALT(X_TAB)); | ||
| 54 | BABLM(BABL_SWITCH_APP_LAST, OMSFT(IMALT(X_TAB))); | ||
| 55 | BABLM(BABL_CLOSE_APP, OMSFT(IMCTL(X_W))); | ||
| 56 | // BABLM( BABL_HELP, OMCTL(IMALT(X_SLASH)) ); // general help | ||
| 57 | BABLM(BABL_HELP, IMCTL(X_SLASH)); // this is keyboard accelerator lookup | ||
| 58 | BABLM(BABL_LOCK, SS_LGUI("l")); // should be caps? | ||
| 59 | BABLM(BABL_SCREENCAPTURE, OMSFT(IMCTL(X_F5))); | ||
| 60 | BABLM(BABL_SWITCH_KEYBOARD_LAYOUT, IMCTL(X_SPACE)); | ||
| 61 | # endif | ||
| 62 | # ifdef BABL_BROWSER | ||
| 63 | BABLM(BABL_BROWSER_NEW_TAB, SS_LCTRL("t")); | ||
| 64 | BABLM(BABL_BROWSER_CLOSE_TAB, SS_LCTRL("w")); | ||
| 65 | BABLM(BABL_BROWSER_REOPEN_LAST_TAB, OMSFT(IMCTL(X_T))); | ||
| 66 | BABLM(BABL_BROWSER_NEXT_TAB, IMCTL(X_TAB)); | ||
| 67 | BABLM(BABL_BROWSER_PREV_TAB, OMSFT(IMCTL(X_TAB))); | ||
| 68 | BABLM(BABL_BROWSER_URL_BAR, SS_LCTRL("l")); | ||
| 69 | BABLM(BABL_BROWSER_FORWARD, IMALT(X_RIGHT)); | ||
| 70 | BABLM(BABL_BROWSER_BACK, IMALT(X_LEFT)); | ||
| 71 | ; | ||
| 72 | BABLM(BABL_BROWSER_FIND, SS_LCTRL("f")); | ||
| 73 | BABLM(BABL_BROWSER_BOOKMARK, SS_LCTRL("d")); | ||
| 74 | BABLM(BABL_BROWSER_DEV_TOOLS, OMSFT(IMCTL(X_I))); | ||
| 75 | BABLM(BABL_BROWSER_RELOAD, OMSFT(IMCTL(X_R))); // hard reload w/o cache | ||
| 76 | BABLM(BABL_BROWSER_FULLSCREEN, SS_TAP(X_F4)); // untested | ||
| 77 | BABLM(BABL_BROWSER_ZOOM_IN, OMSFT(IMCTL(X_EQUAL))); // ctr+ + | ||
| 78 | BABLM(BABL_BROWSER_ZOOM_OUT, IMCTL(X_MINUS)); | ||
| 79 | BABLM(BABL_BROWSER_VIEWSRC, SS_LCTRL("u")); // Chrome or firefox | ||
| 80 | # endif | ||
| 81 | |||
| 82 | # ifdef BABL_APP | ||
| 83 | BABLM(BABL_APP_SAVE, SS_LCTL("s")); | ||
| 84 | //#ifdef BABL_APP_GOOGLE -- we're going to make an assumption. | ||
| 85 | BABLM(BABL_APP_CENTER_ALIGN, OMSFT(IMCTL(X_E))); | ||
| 86 | BABLM(BABL_APP_SCROLL_ACTIVE_CELL, IMCTL(X_BSPACE)); | ||
| 87 | BABLM(BABL_NEWLINE_IN_CELL, IMALT(X_ENTER)); | ||
| 88 | BABLM(BABL_INSERT_COMMENT, OMALT(IMCTL(X_M))); | ||
| 89 | BABLM(BABL_APP_CLEAR_FORMATTING, IMCTL(X_BSLASH)); | ||
| 90 | BABLM(BABL_DELETE_ROW, IMALT(X_E) "d"); | ||
| 91 | BABLM(BABL_INSERT_COL_LEFT, IMALT(X_I) "c"); // o for to the right. | ||
| 92 | BABLM(BABL_INSERT_ROW, IMALT(X_I) "w"); // r for above. | ||
| 93 | BABLM(BABL_SELECT_COL, IMCTL(X_SPACE)); | ||
| 94 | BABLM(BABL_SELECT_ROW, IMSFT(X_SPACE)); | ||
| 95 | BABLM(BABL_DELETE_ROW, OMALT(IMCTL(X_KP_MINUS))); // once selected | ||
| 96 | //#endif // BABL_APP_CELLS | ||
| 97 | # endif // BABL_APP | ||
| 98 | |||
| 99 | // Todo, ring bell, flash light, show user this isn't supported | ||
| 100 | return false; | ||
| 101 | } | ||
| 102 | # endif | ||
| 103 | #endif /* chromeos*/ | ||
diff --git a/users/miles2go/babl_emacs.c b/users/miles2go/babl_emacs.c new file mode 100644 index 000000000..201da0d1a --- /dev/null +++ b/users/miles2go/babl_emacs.c | |||
| @@ -0,0 +1,85 @@ | |||
| 1 | /* A library to output the right key shortcut in any common app. | ||
| 2 | Given a global variable babble_mode to show the environment and a | ||
| 3 | key that calls the paste macro, do the right type of paste. | ||
| 4 | Setting the context is done by another macro, or TBD interaction with the host. | ||
| 5 | |||
| 6 | Emacs mode is probably most useful for people who don't usually use emacs | ||
| 7 | |||
| 8 | https://www.ast.cam.ac.uk/~vasily/idl/emacs_commands_list.html | ||
| 9 | */ | ||
| 10 | |||
| 11 | #include QMK_KEYBOARD_H | ||
| 12 | |||
| 13 | #ifdef USE_BABBLEPASTE | ||
| 14 | # include "babblePaste.h" | ||
| 15 | |||
| 16 | # ifdef BABL_EMACS | ||
| 17 | |||
| 18 | // probably should allow meta to not be ALT | ||
| 19 | # define DMETA IMALT | ||
| 20 | |||
| 21 | bool babblePaste_emacs(uint16_t keycode) { | ||
| 22 | # ifdef BABL_MOVE | ||
| 23 | BABLM(BABL_GO_LEFT_1C, SS_TAP(X_LEFT)); | ||
| 24 | BABLM(BABL_GO_RIGHT_1C, SS_TAP(X_RIGHT)); | ||
| 25 | BABLM(BABL_GO_LEFT_WORD, IMALT(X_B)); | ||
| 26 | BABLM(BABL_GO_RIGHT_WORD, IMALT(X_F)); | ||
| 27 | BABLM(BABL_GO_START_LINE, SS_LCTRL("a")); | ||
| 28 | BABLM(BABL_GO_END_LINE, SS_LCTRL("e")); | ||
| 29 | BABLM(BABL_GO_START_DOC, OMALT(IMSFT(X_COMMA))); | ||
| 30 | BABLM(BABL_GO_END_DOC, OMALT(IMSFT(X_DOT))); | ||
| 31 | BABLM(BABL_GO_NEXT_LINE, SS_LCTRL("n")); | ||
| 32 | BABLM(BABL_GO_PREV_LINE, SS_LCTRL("p")); | ||
| 33 | BABLM(BABL_GO_PARA_START, OMALT(IMSFT(X_LBRACKET))); | ||
| 34 | BABLM(BABL_GO_PARA_END, OMALT(IMSFT(X_RBRACKET))); | ||
| 35 | BABLM(BABL_PGDN, SS_LCTRL("v")); | ||
| 36 | BABLM(BABL_PGUP, IMALT(X_V)); | ||
| 37 | BABLM(BABL_DEL_RIGHT_1C, SS_LCTRL("d")); | ||
| 38 | BABLM(BABL_DEL_LEFT_WORD, IMCTL(X_BSPACE)); | ||
| 39 | BABLM(BABL_DEL_RIGHT_WORD, IMALT(X_D)); | ||
| 40 | BABLM(BABL_DEL_TO_LINE_END, SS_LCTRL("k")); | ||
| 41 | BABLM(BABL_DEL_TO_LINE_START, SS_TAP(X_ESCAPE) "0" SS_LCTRL("k")); | ||
| 42 | BABLM(BABL_MODE, "Emacs "); | ||
| 43 | # endif | ||
| 44 | # ifdef BABL_OSKEYS | ||
| 45 | BABLM(BABL_UNDO, SS_LCTRL("x") "c"); | ||
| 46 | BABLM(BABL_REDO, SS_LCTRL("x") "c"); // arguably | ||
| 47 | BABLM(BABL_CUT, SS_LCTRL("w")); | ||
| 48 | BABLM(BABL_COPY, SS_LALT("w")); // really? | ||
| 49 | BABLM(BABL_PASTE, SS_LCTRL("y")); | ||
| 50 | BABLM(BABL_SELECT_ALL, SS_LCTRL("x") "h"); | ||
| 51 | BABLM(BABL_FIND, SS_LCTRL("s")); | ||
| 52 | BABLM(BABL_FIND_NEXT, SS_LCTRL("s")); | ||
| 53 | BABLM(BABL_FIND_PREV, SS_LCTRL("r")); | ||
| 54 | BABLM(BABL_FIND_REPLACE, OMALT(IMSFT(X_5))); | ||
| 55 | // BABLM( BABL_RUNAPP , //(SS_LALT("x") "shell") );// arguably | ||
| 56 | BABLM(BABL_RUNAPP, IMALT(X_X) "split-window" SS_TAP(X_ENTER)); // arguably | ||
| 57 | BABLM(BABL_WINDOW_NEXT, SS_LCTRL("x") "o"); | ||
| 58 | BABLM(BABL_WINDOW_PREV, SS_LCTRL("x") "o"); // arguably | ||
| 59 | // BABLM( BABL_WINDOW_NEW, IMCTL(X_X)"n" ); // | ||
| 60 | BABLM(BABL_CLOSE_APP, SS_LCTRL("x") "c"); | ||
| 61 | BABLM(BABL_HELP, SS_LCTRL("h") "a"); // start search in help | ||
| 62 | // BABLM( BABL_LOCK, () ); // lock buffer? Too many options. | ||
| 63 | // BABLM( BABL_SCREENCAPTURE, () ); // requires plugin? | ||
| 64 | |||
| 65 | # endif | ||
| 66 | # ifdef BABL_BROWSER | ||
| 67 | /* you get to figure w3 out */ | ||
| 68 | # endif | ||
| 69 | |||
| 70 | # ifdef BABL_APP | ||
| 71 | BABLM(BABL_APP_SAVE, SS_LCTL("x") SS_LCTL("s")); | ||
| 72 | /// BABLM( BABL_APP_MULTI_SELECT, SS_LCTRL("x") "rt" ); // arguably | ||
| 73 | BABLM(BABL_SPLIT_FRAME_VERT, SS_LCTRL("x") "3"); | ||
| 74 | BABLM(BABL_UNSPLIT_FRAME_VERT, SS_LCTRL("u") SS_LCTRL("x") "0"); | ||
| 75 | BABLM(BABL_SPLIT_FRAME_HORIZONTAL, SS_LCTRL("x") "2"); | ||
| 76 | BABLM(BABL_UNSPLIT_FRAME_HORIZONTAL, SS_LCTRL("u") SS_LCTRL("x") "0"); | ||
| 77 | BABLM(BABL_NEXT_FRAME, SS_LCTRL("x") "o"); | ||
| 78 | BABLM(BABL_PREV_FRAME, SS_LCTRL("u") "-1" SS_LCTRL("x") "o"); | ||
| 79 | # endif | ||
| 80 | |||
| 81 | // Todo, ring bell, flash light, show user this isn't supported | ||
| 82 | return false; | ||
| 83 | } | ||
| 84 | # endif /* emacs mode*/ | ||
| 85 | #endif | ||
diff --git a/users/miles2go/babl_linux.c b/users/miles2go/babl_linux.c new file mode 100644 index 000000000..aa822d9ba --- /dev/null +++ b/users/miles2go/babl_linux.c | |||
| @@ -0,0 +1,102 @@ | |||
| 1 | /* A library to output the right key shortcut in any common app. | ||
| 2 | Given a global variable babble_mode to show the environment and a | ||
| 3 | key that calls the paste macro, do the right type of paste. | ||
| 4 | Setting the context is done by another macro, or TBD interaction with the host. | ||
| 5 | |||
| 6 | Huge thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts | ||
| 7 | and | ||
| 8 | https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/jeebak/keymap.c | ||
| 9 | */ | ||
| 10 | |||
| 11 | #include QMK_KEYBOARD_H | ||
| 12 | |||
| 13 | #ifdef USE_BABBLEPASTE | ||
| 14 | # include "babblePaste.h" | ||
| 15 | |||
| 16 | # ifdef BABL_LINUX | ||
| 17 | |||
| 18 | bool babblePaste_linux(uint16_t keycode) { | ||
| 19 | # ifdef BABL_MOVE | ||
| 20 | BABLM(BABL_GO_LEFT_1C, SS_TAP(X_LEFT)); | ||
| 21 | BABLM(BABL_GO_RIGHT_1C, SS_TAP(X_RIGHT)); | ||
| 22 | BABLM(BABL_GO_LEFT_WORD, IMCTL(X_LEFT)); | ||
| 23 | BABLM(BABL_GO_RIGHT_WORD, IMCTL(X_RIGHT)); | ||
| 24 | BABLM(BABL_GO_START_LINE, SS_TAP(X_HOME)); | ||
| 25 | BABLM(BABL_GO_END_LINE, SS_TAP(X_END)); | ||
| 26 | BABLM(BABL_GO_START_DOC, IMCTL(X_HOME)); | ||
| 27 | BABLM(BABL_GO_END_DOC, IMCTL(X_END)); | ||
| 28 | BABLM(BABL_GO_NEXT_LINE, SS_TAP(X_DOWN)); | ||
| 29 | BABLM(BABL_GO_PREV_LINE, SS_TAP(X_UP)); | ||
| 30 | BABLM(BABL_GO_PARA_START, IMCTL(X_UP)); | ||
| 31 | BABLM(BABL_GO_PARA_END, IMCTL(X_DOWN)); | ||
| 32 | BABLM(BABL_PGDN, SS_TAP(X_PGDOWN)); | ||
| 33 | BABLM(BABL_PGUP, SS_TAP(X_PGUP)); | ||
| 34 | BABLM(BABL_DEL_RIGHT_1C, SS_TAP(X_DELETE)); | ||
| 35 | BABLM(BABL_DEL_LEFT_WORD, IMCTL(X_BSPACE)); | ||
| 36 | BABLM(BABL_DEL_RIGHT_WORD, IMCTL(X_DELETE)); | ||
| 37 | BABLM(BABL_DEL_TO_LINE_END, IMSFT(X_HOME) SS_TAP(X_DELETE)); | ||
| 38 | BABLM(BABL_DEL_TO_LINE_START, IMSFT(X_END) SS_TAP(X_DELETE)); | ||
| 39 | BABLM(BABL_MODE, "Linux "); | ||
| 40 | # endif | ||
| 41 | # ifdef BABL_OSKEYS | ||
| 42 | BABLM(BABL_UNDO, SS_LCTL("z")); | ||
| 43 | BABLM(BABL_REDO, SS_LCTL("y")); | ||
| 44 | BABLM(BABL_CUT, SS_LCTL("x")); | ||
| 45 | BABLM(BABL_COPY, SS_LCTL("c")); | ||
| 46 | BABLM(BABL_PASTE, SS_LCTL("v")); | ||
| 47 | BABLM(BABL_SELECT_ALL, SS_LCTL("a")); | ||
| 48 | BABLM(BABL_FIND, SS_LCTL("f")); | ||
| 49 | BABLM(BABL_CLOSE_APP, IMALT(X_F4)); | ||
| 50 | BABLM(BABL_HELP, SS_TAP(X_F1)); | ||
| 51 | // BABLM(BABL_FIND_NEXT (SS_LALT(X_F3)) ); //KDE */ | ||
| 52 | BABLM(BABL_FIND_NEXT, SS_LCTL("g")); // Gnome*/ | ||
| 53 | BABLM(BABL_FIND_PREV, OMSFT(IMCTL(X_G))); // Gnome*/ | ||
| 54 | /* BABLM( BABL_FIND_REPLACE , (SS_LCTL("r")) ); // KDE */ | ||
| 55 | BABLM(BABL_FIND_REPLACE, SS_LCTL("h")); // Gnome*/ | ||
| 56 | BABLM(BABL_RUNAPP, IMALT(X_F2)); // Gnome | ||
| 57 | BABLM(BABL_SWITCH_APP_NEXT, IMALT(X_TAB)); | ||
| 58 | BABLM(BABL_SWITCH_APP_LAST, OMSFT(IMALT(X_TAB))); | ||
| 59 | BABLM(BABL_WINDOW_NEXT, OMCTL(IMALT(X_PGUP))); // Gnome, sometimes | ||
| 60 | BABLM(BABL_WINDOW_PREV, OMCTL(IMALT(X_PGDOWN))); | ||
| 61 | BABLM(BABL_WINDOW_NEW, IMCTL(X_N)); | ||
| 62 | // BABLM( BABL_HELP, (SS_TAP(X_F1)) ); // NA? | ||
| 63 | BABLM(BABL_LOCK, OMCTL(IMALT(X_L))); | ||
| 64 | BABLM(BABL_SCREENCAPTURE, IMSFT(X_PSCREEN)); | ||
| 65 | # endif | ||
| 66 | # ifdef BABL_BROWSER | ||
| 67 | BABLM(BABL_BROWSER_NEW_TAB, SS_LCTL("t")); | ||
| 68 | BABLM(BABL_BROWSER_CLOSE_TAB, SS_LCTL("w")); | ||
| 69 | BABLM(BABL_BROWSER_REOPEN_LAST_TAB, OMSFT(IMCTL(X_T))); | ||
| 70 | BABLM(BABL_BROWSER_NEXT_TAB, SS_LCTL(SS_TAP(X_TAB))); | ||
| 71 | BABLM(BABL_BROWSER_PREV_TAB, OMSFT(IMCTL(X_TAB))); | ||
| 72 | BABLM(BABL_BROWSER_URL_BAR, SS_LCTL("l")); | ||
| 73 | BABLM(BABL_BROWSER_FORWARD, IMALT(X_RIGHT)); | ||
| 74 | BABLM(BABL_BROWSER_BACK, IMALT(X_LEFT)); | ||
| 75 | BABLM(BABL_BROWSER_FIND, SS_LCTL("f")); | ||
| 76 | BABLM(BABL_BROWSER_BOOKMARK, SS_LCTL("d")); | ||
| 77 | BABLM(BABL_BROWSER_DEV_TOOLS, SS_LCTL("t")); // Chrome | ||
| 78 | // chrome | ||
| 79 | BABLM(BABL_BROWSER_RELOAD, IMCTL(X_F5)); // hard reload w/o cache | ||
| 80 | BABLM(BABL_BROWSER_FULLSCREEN, SS_TAP(X_F11)); // command shift F | ||
| 81 | BABLM(BABL_BROWSER_ZOOM_IN, OMSFT(IMCTL(X_EQUAL))); // ctr+ + | ||
| 82 | BABLM(BABL_BROWSER_ZOOM_OUT, IMCTL(X_MINUS)); | ||
| 83 | BABLM(BABL_BROWSER_VIEWSRC, SS_LCTL("u")); // Chrome or firefox | ||
| 84 | # endif | ||
| 85 | # ifdef BABL_APP | ||
| 86 | BABLM(BABL_APP_SAVE, SS_LCTL("s")); | ||
| 87 | // on linux we'd probably use tmux or screen. Some terminal software also | ||
| 88 | // allows this. | ||
| 89 | // BABLM( BABL_SPLIT_FRAME_VERT, () ); | ||
| 90 | // BABLM( BABL_UNSPLIT_FRAME_VERT, () ); | ||
| 91 | // BABLM( BABL_SPLIT_FRAME_HORIZONTAL, () ); | ||
| 92 | // BABLM( BABL_UNSPLIT_FRAME_HORIZONTAL, () ); | ||
| 93 | // BABLM( BABL_NEXT_FRAME, () ); | ||
| 94 | // BABLM( BABL_PREV_FRAME, () ); | ||
| 95 | # endif | ||
| 96 | |||
| 97 | // Todo, ring bell, flash light, show user this isn't supported | ||
| 98 | return false; | ||
| 99 | } | ||
| 100 | |||
| 101 | # endif /* linux mode */ | ||
| 102 | #endif | ||
diff --git a/users/miles2go/babl_mac.c b/users/miles2go/babl_mac.c new file mode 100644 index 000000000..9f769c582 --- /dev/null +++ b/users/miles2go/babl_mac.c | |||
| @@ -0,0 +1,152 @@ | |||
| 1 | /* A library to output the right key shortcut in any common app. | ||
| 2 | Given a global variable babble_mode to show the environment and a | ||
| 3 | key that calls the paste macro, do the right type of paste. | ||
| 4 | Setting the context is done by another macro, or TBD interaction with the host. | ||
| 5 | |||
| 6 | Huge thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts | ||
| 7 | and https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/jeebak/keymap.c | ||
| 8 | */ | ||
| 9 | |||
| 10 | #include QMK_KEYBOARD_H | ||
| 11 | |||
| 12 | #ifdef USE_BABBLEPASTE | ||
| 13 | # include "babblePaste.h" | ||
| 14 | |||
| 15 | # ifdef BABL_MAC | ||
| 16 | |||
| 17 | bool babblePaste_mac(uint16_t keycode) { | ||
| 18 | # ifdef BABL_MOVE | ||
| 19 | BABLM(BABL_GO_LEFT_1C, SS_TAP(X_LEFT)); | ||
| 20 | BABLM(BABL_GO_RIGHT_1C, SS_TAP(X_RIGHT)); | ||
| 21 | BABLM(BABL_GO_LEFT_WORD, IMALT(X_LEFT)); | ||
| 22 | BABLM(BABL_GO_RIGHT_WORD, IMALT(X_RIGHT)); | ||
| 23 | BABLM(BABL_GO_START_LINE, IMGUI(X_LEFT)); | ||
| 24 | BABLM(BABL_GO_END_LINE, IMGUI(X_RIGHT)); | ||
| 25 | BABLM(BABL_GO_START_DOC, IMGUI(X_UP)); | ||
| 26 | BABLM(BABL_GO_END_DOC, IMGUI(X_DOWN)); | ||
| 27 | BABLM(BABL_GO_NEXT_LINE, SS_TAP(X_DOWN)); | ||
| 28 | BABLM(BABL_GO_PREV_LINE, SS_TAP(X_UP)); | ||
| 29 | BABLM(BABL_GO_PARA_START, IMALT(X_UP)); | ||
| 30 | BABLM(BABL_DEL_RIGHT_1C, SS_TAP(X_DELETE)); | ||
| 31 | BABLM(BABL_GO_PARA_END, IMALT(X_DOWN)); | ||
| 32 | BABLM(BABL_PGDN, SS_TAP(X_PGDOWN)); | ||
| 33 | BABLM(BABL_PGUP, SS_TAP(X_PGUP)); | ||
| 34 | BABLM(BABL_DEL_LEFT_WORD, IMALT(X_BSPACE)); | ||
| 35 | BABLM(BABL_DEL_RIGHT_WORD, IMALT(X_DELETE)); | ||
| 36 | BABLM(BABL_DEL_TO_LINE_END, OMSFT(IMGUI(X_RIGHT)) SS_TAP(X_BSPACE)); // this is more app agnostic than ctrl-k | ||
| 37 | BABLM(BABL_DEL_TO_LINE_START, OMSFT(IMGUI(X_LEFT)) SS_TAP(X_BSPACE)); | ||
| 38 | BABLM(BABL_MODE, "Mac "); | ||
| 39 | # endif | ||
| 40 | # ifdef BABL_OSKEYS | ||
| 41 | BABLM(BABL_UNDO, SS_LGUI("z")); | ||
| 42 | BABLM(BABL_REDO, SS_LGUI("y")); | ||
| 43 | BABLM(BABL_CUT, SS_LGUI("x")); | ||
| 44 | BABLM(BABL_COPY, SS_LGUI("c")); | ||
| 45 | BABLM(BABL_PASTE, SS_LGUI("v")); | ||
| 46 | BABLM(BABL_SELECT_ALL, SS_LGUI("a")); | ||
| 47 | BABLM(BABL_FIND, SS_LGUI("f")); | ||
| 48 | BABLM(BABL_FIND_NEXT, SS_LGUI("g")); | ||
| 49 | // BABLM( BABL_FIND_NEXT, OMSFT(X_F4)) ); // Mac office | ||
| 50 | BABLM(BABL_FIND_PREV, OMSFT(IMGUI(X_G))); // Sublime, browser | ||
| 51 | BABLM(BABL_FIND_PREV, SS_LGUI("g")); | ||
| 52 | BABLM(BABL_FIND_REPLACE, SS_LGUI("f")); | ||
| 53 | BABLM(BABL_RUNAPP, SS_LGUI(" ")); | ||
| 54 | BABLM(BABL_SWITCH_APP_NEXT, IMGUI(X_TAB)); | ||
| 55 | BABLM(BABL_SWITCH_APP_LAST, OMSFT(IMGUI(X_TAB))); | ||
| 56 | // Apps vary, but this is usually tab movement, same as B_NXTB | ||
| 57 | /* | ||
| 58 | BABLM( BABL_WINDOW_NEXT, OMSFT(IMGUI(X_RBRACKET)) ); // GUI Grav isn't everywhere | ||
| 59 | BABLM( BABL_WINDOW_PREV, OMSFT(IMGUI(X_LBRACKET)) ); | ||
| 60 | */ | ||
| 61 | BABLM(BABL_WINDOW_NEXT, IMGUI(X_GRAVE)); | ||
| 62 | BABLM(BABL_WINDOW_PREV, OMSFT(IMGUI(X_GRAVE))); | ||
| 63 | BABLM(BABL_WINDOW_NEW, IMGUI(X_N)); | ||
| 64 | BABLM(BABL_CLOSE_APP, SS_LGUI("q")); | ||
| 65 | BABLM(BABL_HELP, OMSFT(IMGUI(X_SLASH))); | ||
| 66 | // Locking screen from external keyboard requires automator https://apple.stackexchange.com/questions/73995 | ||
| 67 | BABLM(BABL_LOCK, OMCTL(IMALT(X_L))); | ||
| 68 | BABLM(BABL_SCREENCAPTURE, OMSFT(OMGUI(IMALT(X_4))) IMGUI(X_SPACE) "preview" SS_LGUI("d")); | ||
| 69 | BABLM(BABL_SWITCH_KEYBOARD_LAYOUT, IMCTL(X_SPACE)); | ||
| 70 | # endif | ||
| 71 | # ifdef BABL_BROWSER | ||
| 72 | BABLM(BABL_BROWSER_NEW_TAB, IMGUI(X_T)); | ||
| 73 | BABLM(BABL_BROWSER_CLOSE_TAB, SS_LGUI("w")); | ||
| 74 | BABLM(BABL_BROWSER_REOPEN_LAST_TAB, OMSFT(SS_LGUI("t"))); | ||
| 75 | BABLM(BABL_BROWSER_NEXT_TAB, OMGUI(IMALT(X_RIGHT))); | ||
| 76 | BABLM(BABL_BROWSER_PREV_TAB, OMGUI(IMALT(X_LEFT))); | ||
| 77 | BABLM(BABL_BROWSER_URL_BAR, SS_LGUI("l")); | ||
| 78 | BABLM(BABL_BROWSER_FORWARD, IMGUI(X_RIGHT)); | ||
| 79 | BABLM(BABL_BROWSER_BACK, IMGUI(X_LEFT)); | ||
| 80 | BABLM(BABL_BROWSER_FIND, SS_LGUI("f")); | ||
| 81 | BABLM(BABL_BROWSER_BOOKMARK, SS_LGUI("d")); | ||
| 82 | BABLM(BABL_BROWSER_RELOAD, OMGUI(SS_LSFT("r"))); // hard reload w/o cache | ||
| 83 | BABLM(BABL_BROWSER_FULLSCREEN, OMGUI(SS_LCTRL("p"))); | ||
| 84 | BABLM(BABL_BROWSER_ZOOM_IN, IMGUI(X_KP_PLUS)); // ctr+ + | ||
| 85 | BABLM(BABL_BROWSER_ZOOM_OUT, IMGUI(X_KP_MINUS)); | ||
| 86 | # ifdef BABL_BROWSER_CHROME | ||
| 87 | BABLM(BABL_BROWSER_VIEWSRC, SS_LGUI("u")); // Chrome or firefox | ||
| 88 | BABLM(BABL_BROWSER_DEV_TOOLS, OMGUI(SS_LALT("i"))); // Chrome or Firefox | ||
| 89 | # endif | ||
| 90 | # ifdef BABL_BROWSER_SAFARI | ||
| 91 | BABLM(BABL_BROWSER_VIEWSRC, OMGUI(IMALT(X_U))); // Safari | ||
| 92 | // BABLM( BABL_BROWSER_DEV_TOOLS, // No real equivalent for Safari | ||
| 93 | # endif | ||
| 94 | # endif // BABL_BROWSER | ||
| 95 | |||
| 96 | # ifdef BABL_APP | ||
| 97 | BABLM(BABL_APP_SAVE, SS_LGUI("s")); | ||
| 98 | # ifdef BABL_APP_EDITOR | ||
| 99 | # ifdef BABL_APP_SUBLIME | ||
| 100 | BABLM(BABL_APP_MULTI_SELECT, OMCTL(IMGUI(X_G))); // add all occurences of current word to select. | ||
| 101 | BABLM(BABL_APP_PASTE_VALUES, OMSFT(IMGUI(X_V))); // paste with proper indenting. | ||
| 102 | # endif // sublime | ||
| 103 | # endif // editor | ||
| 104 | |||
| 105 | # ifdef BABL_APP_CELLS | ||
| 106 | # ifdef BABL_APP_MSOFFICE | ||
| 107 | BABLM(BABL_APP_CENTER_ALIGN, IMGUI(X_E)); | ||
| 108 | // BABLM( BABL_APP_CLEAR_FORMATTING, OMCTL(IMGUI(X_G)) ); // this isn't native. https://support.office.com/en-us/article/Clear-all-text-formatting-C094C4DA-7F09-4CEA-9A8D-C166949C9C80#OfficeVersion=macOS | ||
| 109 | BABLM(BABL_APP_SCROLL_ACTIVE_CELL, IMCTL(X_BSPACE)); | ||
| 110 | BABLM(BABL_NEWLINE_IN_CELL, IMALT(X_ENTER)); | ||
| 111 | BABLM(BABL_INSERT_COMMENT, IMSFT(X_F2)); | ||
| 112 | BABLM(BABL_INSERT_COL_LEFT, IMCTL(X_I)); | ||
| 113 | BABLM(BABL_INSERT_ROW, OMCTL(IMSFT(X_KP_PLUS))); | ||
| 114 | BABLM(BABL_DELETE_ROW, IMCTL(X_KP_MINUS)); | ||
| 115 | BABLM(BABL_SELECT_COL, IMCTL(X_SPACE)); | ||
| 116 | BABLM(BABL_SELECT_ROW, IMSFT(X_SPACE)); | ||
| 117 | # endif // BABL_APP_MSOFFICE | ||
| 118 | |||
| 119 | # ifdef BABL_APP_GOOGLE | ||
| 120 | BABLM(BABL_APP_CENTER_ALIGN, OMSFT(IMGUI(X_E))); | ||
| 121 | BABLM(BABL_APP_SCROLL_ACTIVE_CELL, IMCTL(X_BSPACE)); | ||
| 122 | BABLM(BABL_NEWLINE_IN_CELL, IMALT(X_ENTER)); | ||
| 123 | BABLM(BABL_INSERT_COMMENT, IMSFT(X_F2)); | ||
| 124 | BABLM(BABL_APP_CLEAR_FORMATTING, IMGUI(X_BSLASH)); | ||
| 125 | BABLM(BABL_DELETE_ROW, OMCTL(IMGUI(X_G))); | ||
| 126 | BABLM(BABL_INSERT_COL_LEFT, OMALT(IMCTL(X_I)) "c"); // o for to the right. | ||
| 127 | BABLM(BABL_INSERT_ROW, OMALT(IMCTL(X_I)) "b"); // r for above. | ||
| 128 | BABLM(BABL_SELECT_COL, IMCTL(X_SPACE)); | ||
| 129 | BABLM(BABL_SELECT_ROW, IMSFT(X_SPACE)); | ||
| 130 | BABLM(BABL_DELETE_ROW, OMALT(IMCTL(X_KP_MINUS))); // once selected | ||
| 131 | # endif // BABL_APP_GOOGLE | ||
| 132 | /* | ||
| 133 | #ifdef BABL_APP_APPLE | ||
| 134 | // you're on your own. | ||
| 135 | #endif | ||
| 136 | */ | ||
| 137 | # endif // BABL_APP_CELLS | ||
| 138 | |||
| 139 | # ifdef BABL_APP_WINDOWSPLITTING | ||
| 140 | // These are for os X terminal, and are pretty useless. | ||
| 141 | BABLM(BABL_SPLIT_FRAME_HORIZONTAL, SS_LGUI("d")); | ||
| 142 | BABLM(BABL_UNSPLIT_FRAME_HORIZONTAL, OMSFT(IMGUI(X_D))); | ||
| 143 | # endif // BABL_APP_WINDOWSPLITTING | ||
| 144 | |||
| 145 | # endif // BABL_APP | ||
| 146 | |||
| 147 | // Todo, ring bell, flash light, show user this isn't supported | ||
| 148 | return false; | ||
| 149 | } | ||
| 150 | |||
| 151 | # endif /* mac mode*/ | ||
| 152 | #endif // Babblepaste | ||
diff --git a/users/miles2go/babl_readmux.c b/users/miles2go/babl_readmux.c new file mode 100644 index 000000000..8887d523b --- /dev/null +++ b/users/miles2go/babl_readmux.c | |||
| @@ -0,0 +1,86 @@ | |||
| 1 | // Readline command line editing + tmux windowing | ||
| 2 | // I haven't decided how much to do readline and how much tmux | ||
| 3 | // see https://tiswww.case.edu/php/chet/readline/rluserman.html for other possible | ||
| 4 | // keybindings. | ||
| 5 | |||
| 6 | #include QMK_KEYBOARD_H | ||
| 7 | |||
| 8 | #ifdef USE_BABBLEPASTE | ||
| 9 | # include "babblePaste.h" | ||
| 10 | |||
| 11 | # ifdef BABL_READMUX | ||
| 12 | |||
| 13 | // Redefine if you use something other than CTRL-B to activate tmux. | ||
| 14 | # define TMUX SS_LCTL("b") | ||
| 15 | |||
| 16 | bool babblePaste_readmux(uint16_t keycode) { | ||
| 17 | # ifdef BABL_MOVE | ||
| 18 | BABLM(BABL_GO_LEFT_1C, SS_TAP(X_LEFT)); | ||
| 19 | BABLM(BABL_GO_RIGHT_1C, SS_TAP(X_RIGHT)); | ||
| 20 | BABLM(BABL_GO_LEFT_WORD, SS_LALT("b")); | ||
| 21 | BABLM(BABL_GO_RIGHT_WORD, SS_LALT("f")); | ||
| 22 | BABLM(BABL_GO_START_LINE, SS_LCTL("a")); | ||
| 23 | BABLM(BABL_GO_END_LINE, SS_LCTL("e")); | ||
| 24 | // BABLM( BABL_GO_START_DOC ,END );// tmux? | ||
| 25 | // BABLM( BABL_GO_END_DOC ,END ); // tmux? | ||
| 26 | BABLM(BABL_GO_NEXT_LINE, SS_LCTL("n")); | ||
| 27 | BABLM(BABL_GO_PREV_LINE, SS_LCTL("p")); | ||
| 28 | // BABLM( BABL_GO_PARA_START, // undefined | ||
| 29 | // BABLM( BABL_GO_PARA_END, // undefinedBABLM( BABL_PGDN , | ||
| 30 | |||
| 31 | BABLM(BABL_PGUP, SS_TAP(X_PGUP)); | ||
| 32 | BABLM(BABL_PGDN, SS_TAP(X_PGDOWN)); | ||
| 33 | BABLM(BABL_DEL_RIGHT_1C, SS_LCTL("d")); | ||
| 34 | BABLM(BABL_DEL_LEFT_WORD, SS_LCTL("w")); // meta-DEL instead? | ||
| 35 | BABLM(BABL_DEL_RIGHT_WORD, SS_LALT("d")); | ||
| 36 | BABLM(BABL_DEL_TO_LINE_END, SS_LCTL("k")); | ||
| 37 | BABLM(BABL_DEL_TO_LINE_START, SS_LCTL("u")); | ||
| 38 | BABLM(BABL_MODE, "Readline "); | ||
| 39 | # endif | ||
| 40 | # ifdef BABL_OSKEYS | ||
| 41 | BABLM(BABL_UNDO, SS_LALT("r")); | ||
| 42 | BABLM(BABL_REDO, SS_LCTL("x") "c"); // arguably | ||
| 43 | BABLM(BABL_CUT, SS_LCTL("k")); // wrong half the time | ||
| 44 | // BABLM( BABL_COPY ,END ); | ||
| 45 | BABLM(BABL_PASTE, SS_LCTL("y")); | ||
| 46 | BABLM(BABL_SELECT_ALL, SS_LCTL("aky")); | ||
| 47 | BABLM(BABL_FIND, SS_LCTL("r")); // search history | ||
| 48 | BABLM(BABL_FIND_NEXT, SS_LCTL("r")); | ||
| 49 | BABLM(BABL_FIND_PREV, SS_LCTL("s")); | ||
| 50 | // BABLM( BABL_FIND_REPLACE ,END ); // not offered in readline | ||
| 51 | BABLM(BABL_RUNAPP, TMUX "c"); // tmux | ||
| 52 | BABLM(BABL_SWITCH_APP_NEXT, TMUX "n"); // tmux | ||
| 53 | BABLM(BABL_SWITCH_APP_LAST, TMUX "p"); // tmux | ||
| 54 | BABLM(BABL_CLOSE_APP, TMUX "d"); // usually what I want | ||
| 55 | BABLM(BABL_HELP, TMUX IMSFT(X_SLASH)); | ||
| 56 | BABLM(BABL_LOCK, TMUX "L"); // assuming you set up VLOCK yourself | ||
| 57 | BABLM(BABL_SCREENCAPTURE, TMUX ":capture-pane"); | ||
| 58 | # endif | ||
| 59 | # ifdef BABL_BROWSER | ||
| 60 | /* Add lynx shortcuts, brow.sh? | ||
| 61 | */ | ||
| 62 | # ifdef BABL_MAC | ||
| 63 | // this is stock OS X Terminal, alter for windows &etc. | ||
| 64 | BABLM(BABL_BROWSER_NEW_TAB, IMGUI(X_T)); | ||
| 65 | BABLM(BABL_BROWSER_CLOSE_TAB, SS_LGUI("w")); | ||
| 66 | BABLM(BABL_BROWSER_NEXT_TAB, IMCTL(X_TAB)); | ||
| 67 | BABLM(BABL_BROWSER_PREV_TAB, OMSFT(IMCTL(X_TAB))); | ||
| 68 | # endif | ||
| 69 | # endif | ||
| 70 | # ifdef BABL_APP | ||
| 71 | // Save makes no sense here | ||
| 72 | BABLM(BABL_SPLIT_FRAME_VERT, TMUX IMSFT(X_5)); | ||
| 73 | // BUG - misleading. This is currently set to convert frame to a window. | ||
| 74 | BABLM(BABL_UNSPLIT_FRAME_VERT, TMUX IMSFT(X_1)); | ||
| 75 | BABLM(BABL_SPLIT_FRAME_HORIZONTAL, TMUX IMSFT(X_QUOTE)); | ||
| 76 | // This one closes the current pane. | ||
| 77 | BABLM(BABL_UNSPLIT_FRAME_HORIZONTAL, SS_LCTL("b") "x"); | ||
| 78 | BABLM(BABL_NEXT_FRAME, SS_LCTL("b") "o"); | ||
| 79 | BABLM(BABL_PREV_FRAME, SS_LCTL("w") SS_TAP(X_SCOLON)); | ||
| 80 | # endif | ||
| 81 | |||
| 82 | // Todo, ring bell, flash light, show user this isn't supported | ||
| 83 | return false; | ||
| 84 | } | ||
| 85 | # endif /* readmux*/ | ||
| 86 | #endif | ||
diff --git a/users/miles2go/babl_vi.c b/users/miles2go/babl_vi.c new file mode 100644 index 000000000..7eebc0b20 --- /dev/null +++ b/users/miles2go/babl_vi.c | |||
| @@ -0,0 +1,76 @@ | |||
| 1 | /* | ||
| 2 | Vi is stateful, so you have to track the modes yourself. Otherwise motion is awful (bell, bell, bell) | ||
| 3 | |||
| 4 | */ | ||
| 5 | |||
| 6 | #include QMK_KEYBOARD_H | ||
| 7 | |||
| 8 | #ifdef USE_BABBLEPASTE | ||
| 9 | # include "babblePaste.h" | ||
| 10 | |||
| 11 | # ifdef BABL_VI | ||
| 12 | |||
| 13 | bool babblePaste_vi(uint16_t keycode) { | ||
| 14 | # ifdef BABL_MOVE | ||
| 15 | BABLM(BABL_GO_LEFT_1C, "h"); | ||
| 16 | BABLM(BABL_GO_RIGHT_1C, "l"); | ||
| 17 | BABLM(BABL_GO_LEFT_WORD, "b"); | ||
| 18 | BABLM(BABL_GO_RIGHT_WORD, "w"); | ||
| 19 | BABLM(BABL_GO_START_LINE, IMSFT(X_6)); | ||
| 20 | BABLM(BABL_GO_END_LINE, IMSFT(X_4)); | ||
| 21 | BABLM(BABL_GO_START_DOC, "gg"); | ||
| 22 | BABLM(BABL_GO_END_DOC, IMSFT(X_G)); | ||
| 23 | BABLM(BABL_GO_NEXT_LINE, "j"); | ||
| 24 | BABLM(BABL_GO_PREV_LINE, "k"); | ||
| 25 | BABLM(BABL_GO_PARA_START, IMSFT(X_LBRACKET)); | ||
| 26 | BABLM(BABL_GO_PARA_END, IMSFT(X_RBRACKET)); | ||
| 27 | BABLM(BABL_PGDN, SS_LCTRL("f")); | ||
| 28 | BABLM(BABL_PGUP, SS_LCTRL("b")); | ||
| 29 | BABLM(BABL_DEL_RIGHT_1C, "x"); | ||
| 30 | BABLM(BABL_DEL_LEFT_WORD, "dge"); | ||
| 31 | BABLM(BABL_DEL_RIGHT_WORD, "dw"); | ||
| 32 | BABLM(BABL_DEL_TO_LINE_END, "d" IMSFT(X_4)); | ||
| 33 | BABLM(BABL_DEL_TO_LINE_START, "d" IMSFT(X_6)); | ||
| 34 | BABLM(BABL_MODE, "Vi "); | ||
| 35 | # endif | ||
| 36 | # ifdef BABL_OSKEYS | ||
| 37 | BABLM(BABL_UNDO, "h"); | ||
| 38 | BABLM(BABL_REDO, SS_LCTRL("r")); | ||
| 39 | BABLM(BABL_CUT, "x"); | ||
| 40 | BABLM(BABL_COPY, "y"); | ||
| 41 | BABLM(BABL_PASTE, "p"); | ||
| 42 | BABLM(BABL_SELECT_ALL, IMSFT(X_SCOLON) SS_TAP(X_5) "y"); // wrong but helpful? | ||
| 43 | BABLM(BABL_FIND, SS_TAP(X_SLASH)); | ||
| 44 | BABLM(BABL_FIND_NEXT, "n"); | ||
| 45 | BABLM(BABL_FIND_PREV, IMSFT(X_N)); | ||
| 46 | BABLM(BABL_FIND_REPLACE, OMALT(IMSFT(X_5))); | ||
| 47 | BABLM(BABL_RUNAPP, ":split"); // requires VIM, is vsplit better? | ||
| 48 | BABLM(BABL_SWITCH_APP_NEXT, IMCTL(X_DOWN)); // Or Right? | ||
| 49 | BABLM(BABL_SWITCH_APP_NEXT, IMCTL(X_UP)); // or Left? | ||
| 50 | BABLM(BABL_CLOSE_APP, IMCTL(X_SCOLON) "q"); | ||
| 51 | BABLM(BABL_HELP, SS_LSFT(SS_TAP(X_SCOLON)) "h"); // start search in help | ||
| 52 | // BABLM( BABL_LOCK, () ); Perhaps VI is not an OS? | ||
| 53 | // BABLM( BABL_SCREENCAPTURE, () ); // capture a buffer? | ||
| 54 | # endif | ||
| 55 | |||
| 56 | # ifdef BABL_BROWSER | ||
| 57 | /* what _is_ the VI browser now that vimpirator is dead?*/ | ||
| 58 | # endif | ||
| 59 | |||
| 60 | # ifdef BABL_APP | ||
| 61 | BABLM(BABL_APP_SAVE, SS_TAP(X_ESCAPE) ":w"); | ||
| 62 | # ifdef BABL_APP_WINDOWSPLITTING | ||
| 63 | BABLM(BABL_SPLIT_FRAME_VERT, SS_TAP(X_ESCAPE) ":vsplit"); | ||
| 64 | BABLM(BABL_UNSPLIT_FRAME_VERT, SS_TAP(X_ESCAPE) ":hide"); // debatable. | ||
| 65 | BABLM(BABL_SPLIT_FRAME_HORIZONTAL, SS_TAP(X_ESCAPE) ":vsplit"); | ||
| 66 | BABLM(BABL_UNSPLIT_FRAME_HORIZONTAL, SS_TAP(X_ESCAPE) ":hide"); | ||
| 67 | BABLM(BABL_NEXT_FRAME, SS_LCTRL("w") "w"); | ||
| 68 | BABLM(BABL_PREV_FRAME, SS_LCTRL("w") SS_LSFT("w")); | ||
| 69 | # endif | ||
| 70 | # endif // app | ||
| 71 | // Todo, ring bell, flash light, show user this isn't supported | ||
| 72 | return false; | ||
| 73 | } | ||
| 74 | |||
| 75 | # endif // VI | ||
| 76 | #endif // Babblepaste | ||
diff --git a/users/miles2go/babl_windows.c b/users/miles2go/babl_windows.c new file mode 100644 index 000000000..e9d8c23da --- /dev/null +++ b/users/miles2go/babl_windows.c | |||
| @@ -0,0 +1,151 @@ | |||
| 1 | /* A library to output the right key shortcut in any common app. | ||
| 2 | Given a global variable babble_mode to show the environment and a | ||
| 3 | key that calls the paste macro, do the right type of paste. | ||
| 4 | Setting the context is done by another macro, or TBD interaction with the host. | ||
| 5 | |||
| 6 | Huge thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts | ||
| 7 | https://support.microsoft.com/en-gb/help/12445/windows-keyboard-shortcuts | ||
| 8 | |||
| 9 | Remember to check https://github.com/qmk/qmk_firmware/blob/master/quantum/send_string_keycodes.h | ||
| 10 | |||
| 11 | */ | ||
| 12 | |||
| 13 | #include QMK_KEYBOARD_H | ||
| 14 | |||
| 15 | #ifdef USE_BABBLEPASTE | ||
| 16 | # include "babblePaste.h" | ||
| 17 | |||
| 18 | # ifdef BABL_WINDOWS | ||
| 19 | |||
| 20 | bool babblePaste_win(uint16_t keycode) { | ||
| 21 | # ifdef BABL_MOVE | ||
| 22 | BABLM(BABL_GO_LEFT_1C, SS_TAP(X_LEFT)); | ||
| 23 | BABLM(BABL_GO_RIGHT_1C, SS_TAP(X_RIGHT)); | ||
| 24 | BABLM(BABL_GO_LEFT_WORD, IMCTL(X_LEFT)); | ||
| 25 | BABLM(BABL_GO_RIGHT_WORD, IMCTL(X_RIGHT)); | ||
| 26 | BABLM(BABL_GO_START_LINE, IMGUI(X_LEFT)); | ||
| 27 | BABLM(BABL_GO_END_LINE, IMGUI(X_RIGHT)); | ||
| 28 | BABLM(BABL_GO_START_DOC, OMGUI(IMCTL(X_LEFT))); | ||
| 29 | BABLM(BABL_GO_END_DOC, OMGUI(IMCTL(X_RIGHT))); | ||
| 30 | BABLM(BABL_GO_NEXT_LINE, SS_TAP(X_DOWN)); | ||
| 31 | BABLM(BABL_GO_PREV_LINE, SS_TAP(X_UP)); | ||
| 32 | BABLM(BABL_GO_PARA_START, IMCTL(X_UP)); | ||
| 33 | BABLM(BABL_GO_PARA_END, IMCTL(X_DOWN)); | ||
| 34 | BABLM(BABL_PGDN, SS_TAP(X_PGDOWN)); | ||
| 35 | BABLM(BABL_PGUP, SS_TAP(X_PGUP)); | ||
| 36 | BABLM(BABL_DEL_RIGHT_1C, SS_TAP(X_DELETE)); | ||
| 37 | BABLM(BABL_DEL_LEFT_WORD, IMCTL(X_BSPACE)); | ||
| 38 | BABLM(BABL_DEL_RIGHT_WORD, IMCTL(X_DELETE)); | ||
| 39 | BABLM(BABL_DEL_TO_LINE_END, IMSFT(X_HOME) SS_TAP(X_DELETE)); | ||
| 40 | BABLM(BABL_DEL_TO_LINE_START, IMSFT(X_END) SS_TAP(X_DELETE)); | ||
| 41 | BABLM(BABL_MODE, "Windows "); | ||
| 42 | # endif | ||
| 43 | |||
| 44 | # ifdef BABL_OSKEYS | ||
| 45 | BABLM(BABL_UNDO, SS_LCTRL("z")); | ||
| 46 | BABLM(BABL_REDO, SS_LCTRL("y")); | ||
| 47 | BABLM(BABL_CUT, SS_LCTRL("x")); | ||
| 48 | BABLM(BABL_COPY, SS_LCTRL("c")); | ||
| 49 | BABLM(BABL_PASTE, SS_LCTRL("v")); | ||
| 50 | BABLM(BABL_SELECT_ALL, SS_LCTRL("a")); | ||
| 51 | BABLM(BABL_FIND, SS_LCTRL("f")); | ||
| 52 | BABLM(BABL_FIND_NEXT, SS_TAP(X_F3)); | ||
| 53 | // BABLM( BABL_FIND_PREV, SS_TAP(X_F3) ); // doesn't have a standard one? | ||
| 54 | BABLM(BABL_FIND_REPLACE, SS_LCTRL("h")); | ||
| 55 | BABLM(BABL_RUNAPP, SS_LGUI("r")); | ||
| 56 | BABLM(BABL_SWITCH_APP_NEXT, IMALT(X_TAB)); | ||
| 57 | BABLM(BABL_SWITCH_APP_LAST, OMSFT(IMALT(X_TAB))); | ||
| 58 | BABLM(BABL_WINDOW_NEXT, IMCTL(X_TAB)); | ||
| 59 | BABLM(BABL_WINDOW_PREV, OMSFT(IMCTL(X_TAB))); | ||
| 60 | BABLM(BABL_WINDOW_NEW, IMCTL(X_N)); | ||
| 61 | BABLM(BABL_CLOSE_APP, IMALT(X_F4)); | ||
| 62 | BABLM(BABL_HELP, SS_TAP(X_F1)); | ||
| 63 | BABLM(BABL_LOCK, SS_LGUI("l")); | ||
| 64 | BABLM(BABL_SCREENCAPTURE, OMSFT(SS_LGUI("s"))); | ||
| 65 | BABLM(BABL_SWITCH_KEYBOARD_LAYOUT, IMGUI(X_SPACE)); | ||
| 66 | |||
| 67 | # endif | ||
| 68 | |||
| 69 | # ifdef BABL_BROWSER | ||
| 70 | BABLM(BABL_BROWSER_NEW_TAB, SS_LCTRL("t")); | ||
| 71 | BABLM(BABL_BROWSER_CLOSE_TAB, SS_LCTRL("w")); | ||
| 72 | BABLM(BABL_BROWSER_REOPEN_LAST_TAB, OMSFT(IMCTL(X_T))); | ||
| 73 | BABLM(BABL_BROWSER_NEXT_TAB, IMCTL(X_TAB)); | ||
| 74 | BABLM(BABL_BROWSER_PREV_TAB, OMSFT(IMCTL(X_TAB))); | ||
| 75 | BABLM(BABL_BROWSER_URL_BAR, SS_LCTRL("l")); | ||
| 76 | BABLM(BABL_BROWSER_FORWARD, IMALT(X_RIGHT)); | ||
| 77 | BABLM(BABL_BROWSER_BACK, OMSFT(IMALT(X_LEFT))); | ||
| 78 | ; | ||
| 79 | BABLM(BABL_BROWSER_FIND, SS_LCTRL("f")); | ||
| 80 | BABLM(BABL_BROWSER_BOOKMARK, SS_LCTRL("d")); | ||
| 81 | # ifdef BABL_BROWSER_MS | ||
| 82 | BABLM(BABL_BROWSER_DEV_TOOLS, IMCTL(X_F12)); // EDGE | ||
| 83 | # else | ||
| 84 | BABLM(BABL_BROWSER_DEV_TOOLS, SS_LCTRL("t")); // Chrome | ||
| 85 | BABLM(BABL_BROWSER_VIEWSRC, SS_LCTRL("u")); // Chrome or firefox | ||
| 86 | # endif | ||
| 87 | // chrome | ||
| 88 | BABLM(BABL_BROWSER_RELOAD, IMCTL(X_F5)); // hard reload w/o cache | ||
| 89 | BABLM(BABL_BROWSER_FULLSCREEN, SS_TAP(X_F11)); // command shift F | ||
| 90 | BABLM(BABL_BROWSER_ZOOM_IN, OMSFT(IMCTL(X_EQUAL))); // ctr+ + | ||
| 91 | BABLM(BABL_BROWSER_ZOOM_OUT, IMCTL(X_MINUS)); | ||
| 92 | |||
| 93 | # endif | ||
| 94 | |||
| 95 | # ifdef BABL_APP | ||
| 96 | BABLM(BABL_APP_SAVE, SS_LCTL("s")); | ||
| 97 | # ifdef BABL_APP_EDITOR | ||
| 98 | # ifdef BABL_APP_SUBLIME | ||
| 99 | // http://sweetme.at/2013/08/08/sublime-text-keyboard-shortcuts/ | ||
| 100 | BABLM(BABL_APP_MULTI_SELECT, IMALT(X_F3)); // add all occurences of current word to select. | ||
| 101 | BABLM(BABL_APP_PASTE_VALUES, OMSFT(IMCTL(X_V))); // paste with proper indenting. | ||
| 102 | # endif // sublime | ||
| 103 | # endif // editor | ||
| 104 | |||
| 105 | # ifdef BABL_APP_CELLS | ||
| 106 | # ifdef BABL_APP_MSOFFICE | ||
| 107 | # ifndef BABL_APP_SUBLIME | ||
| 108 | BABLM(BABL_APP_PASTE_VALUES, OMCTL(IMALT(X_V)) "v"); | ||
| 109 | # endif | ||
| 110 | BABLM(BABL_APP_CENTER_ALIGN, IMALT(X_H) "ac"); | ||
| 111 | // BABLM( BABL_APP_CLEAR_FORMATTING, OMCTL(IMGUI(X_G)) ); // this isn't native. https://support.office.com/en-us/article/Clear-all-text-formatting-C094C4DA-7F09-4CEA-9A8D-C166949C9C80#OfficeVersion=macOS | ||
| 112 | BABLM(BABL_APP_SCROLL_ACTIVE_CELL, IMCTL(X_BSPACE)); | ||
| 113 | BABLM(BABL_NEWLINE_IN_CELL, IMALT(X_ENTER)); | ||
| 114 | BABLM(BABL_INSERT_COMMENT, IMSFT(X_F2)); | ||
| 115 | BABLM(BABL_INSERT_COL_LEFT, OMCTL(IMSFT(X_KP_PLUS))); | ||
| 116 | BABLM(BABL_INSERT_ROW, OMCTL(IMSFT(X_KP_PLUS))); | ||
| 117 | BABLM(BABL_DELETE_ROW, IMCTL(X_KP_MINUS)); | ||
| 118 | BABLM(BABL_SELECT_COL, IMCTL(X_SPACE)); | ||
| 119 | BABLM(BABL_SELECT_ROW, IMSFT(X_SPACE)); | ||
| 120 | # endif | ||
| 121 | |||
| 122 | # ifdef BABL_APP_GOOGLE | ||
| 123 | BABLM(BABL_APP_CENTER_ALIGN, OMSFT(IMCTL(X_E))); | ||
| 124 | BABLM(BABL_APP_SCROLL_ACTIVE_CELL, IMCTL(X_BSPACE)); | ||
| 125 | BABLM(BABL_NEWLINE_IN_CELL, IMALT(X_ENTER)); | ||
| 126 | BABLM(BABL_INSERT_COMMENT, IMSFT(X_F2)); | ||
| 127 | BABLM(BABL_APP_CLEAR_FORMATTING, IMCTL(X_BSLASH)); | ||
| 128 | BABLM(BABL_DELETE_ROW, IMALT(X_E) "d"); | ||
| 129 | BABLM(BABL_INSERT_COL_LEFT, OMALT(IMCTL(X_I)) "c"); // o for to the right. | ||
| 130 | BABLM(BABL_INSERT_ROW, IMALT(IMCTL(X_I)) "w"); // r for above. | ||
| 131 | BABLM(BABL_SELECT_COL, IMCTL(X_SPACE)); | ||
| 132 | BABLM(BABL_SELECT_ROW, IMSFT(X_SPACE)); | ||
| 133 | BABLM(BABL_DELETE_ROW, OMALT(IMCTL(X_KP_MINUS))); // once selected | ||
| 134 | # endif | ||
| 135 | |||
| 136 | # endif // BABL_APP_CELLS | ||
| 137 | |||
| 138 | // BABLM( BABL_SPLIT_FRAME_VERT, () );// no windows way? | ||
| 139 | // BABLM( BABL_UNSPLIT_FRAME_VERT, () ); | ||
| 140 | BABLM(BABL_SPLIT_FRAME_HORIZONTAL, OMALT(IMCTL(X_S))); // word only | ||
| 141 | BABLM(BABL_UNSPLIT_FRAME_HORIZONTAL, OMSFT(IMALT(X_C))); // word | ||
| 142 | // BABLM( BABL_NEXT_FRAME, () );//no windows way? | ||
| 143 | // BABLM( BABL_PREV_FRAME, () );// no windows way? | ||
| 144 | # endif | ||
| 145 | |||
| 146 | // Todo, ring bell, flash light, show user this isn't supported | ||
| 147 | return false; | ||
| 148 | } | ||
| 149 | |||
| 150 | # endif /* BABL_WINDOWS*/ | ||
| 151 | #endif /* babblepaste */ \ No newline at end of file | ||
diff --git a/users/miles2go/config.h b/users/miles2go/config.h new file mode 100644 index 000000000..3fb52b8a5 --- /dev/null +++ b/users/miles2go/config.h | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | #ifdef RGBLIGHT_ENABLE | ||
| 4 | #define RGBLIGHT_SLEEP | ||
| 5 | #undef RGBLIGHT_ANIMATIONS | ||
| 6 | #define RGBLIGHT_EFFECT_BREATHING | ||
| 7 | #endif // RGBLIGHT_ENABLE | ||
| 8 | |||
| 9 | #ifndef QMK_KEYS_PER_SCAN | ||
| 10 | #define QMK_KEYS_PER_SCAN 4 | ||
| 11 | #endif // !QMK_KEYS_PER_SCAN | ||
| 12 | |||
| 13 | #undef FORCE_NKRO | ||
| 14 | |||
| 15 | #ifndef TAPPING_TOGGLE | ||
| 16 | #define TAPPING_TOGGLE 3 | ||
| 17 | #endif | ||
| 18 | |||
| 19 | #ifdef TAPPING_TERM | ||
| 20 | #undef TAPPING_TERM | ||
| 21 | #endif // TAPPING_TERM | ||
| 22 | #define TAPPING_TERM 200 | ||
| 23 | //if no chord during tapping term, do the keystroke | ||
| 24 | #define RETRO_TAPPING | ||
| 25 | |||
| 26 | // Disable action_get_macro and fn_actions, since we don't use these | ||
| 27 | // and it saves on space in the firmware. | ||
| 28 | // LTO_ENABLE automatically enables these | ||
| 29 | //#define NO_ACTION_MACRO | ||
| 30 | //#define NO_ACTION_FUNCTION | ||
| 31 | #define MACRO_TIMER 5 | ||
| 32 | |||
| 33 | |||
| 34 | |||
| 35 | #define USE_BABBLEPASTE | ||
| 36 | // All options | ||
| 37 | #define BABL_MOVE // Uncomment to add basic cursor movement | ||
| 38 | #define BABL_OSKEYS // This adds Cut, paste, window movement and common OS shortcuts | ||
| 39 | #define BABL_BROWSER // Browser shortcuts, with Chrome/Firefox as the default. | ||
| 40 | // edit the appropriate OS config file to enable Safari, Edge, vimpirator &etc. | ||
| 41 | #define BABL_APP // Application specific settings this has sub-options. | ||
| 42 | #define BABL_APP_CELLS // spreadsheets and tables | ||
| 43 | #define BABL_APP_EDITOR // Fancy editor commands | ||
| 44 | #define BABL_APP_WINDOWSPLITTING // splitting frames & windows | ||
| 45 | |||
| 46 | //All OSes | ||
| 47 | #define BABL_WINDOWS | ||
| 48 | #define BABL_READMUX | ||
| 49 | #define BABL_VI | ||
| 50 | #define BABL_MAC | ||
| 51 | #define BABL_LINUX | ||
| 52 | #define BABL_EMACS | ||
| 53 | #define BABL_CHROMEOS | ||
diff --git a/users/miles2go/keymaps/handwired/ms_sculpt_mobile/config.h b/users/miles2go/keymaps/handwired/ms_sculpt_mobile/config.h new file mode 100644 index 000000000..bedc08fc0 --- /dev/null +++ b/users/miles2go/keymaps/handwired/ms_sculpt_mobile/config.h | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | // Expect to get errors if you comment a feature out and leave it in your keymap. | ||
| 4 | #define USE_BABLPASTE | ||
| 5 | |||
| 6 | #ifdef USE_BABLPASTE | ||
| 7 | |||
| 8 | #ifdef RGBLIGHT_ENABLE | ||
| 9 | #define BABL_LED_INDEX 0 // set to 0 to set all LEDs , or set to # of LED to be used as BABL updaters | ||
| 10 | #define RGBLIGHT_COLOR_MS 0x00,0x27,0x88 // blue screen? | ||
| 11 | #define RGBLIGHT_COLOR_MAC 0xF0,0xF0,0xF0 // grey | ||
| 12 | #define RGBLIGHT_COLOR_LINUX 0xF4,0xAA,0x90 // ubuntu orange? | ||
| 13 | #define RGBLIGHT_COLOR_EMACS 0x00,0x00,0x00 | ||
| 14 | #define RGBLIGHT_COLOR_VI 0x00,0x90,0x00 | ||
| 15 | #define RGBLIGHT_COLOR_READMUX 0x33,0xFF,0x33 // green screen | ||
| 16 | #define RGBLIGHT_COLOR_CHROMEOS 0xf4,0xc2,0xd // google yellows | ||
| 17 | #endif | ||
| 18 | |||
| 19 | #endif // bablpaste | ||
| 20 | |||
| 21 | |||
| 22 | |||
| 23 | // place overrides here | ||
| 24 | #define RGBLED_NUM 2 | ||
| 25 | #define RGBLIGHT_LIMIT_VAL 200 | ||
| 26 | #ifdef RGBLIGHT_ENABLE | ||
| 27 | #define RGBLIGHT_COLOR_LAYER_0 0x00, 0xFF, 0x00 // qwerty | ||
| 28 | #define RGBLIGHT_COLOR_LAYER_1 0x00, 0x99, 0x99 // cdh | ||
| 29 | #define RGBLIGHT_COLOR_LAYER_2 0xFF, 0x00, 0x00 // symbol | ||
| 30 | #define RGBLIGHT_COLOR_LAYER_3 0x00, 0xFF, 0xFF // move | ||
| 31 | #define RGBLIGHT_COLOR_LAYER_4 0xFF, 0x00, 0xFF // delmove | ||
| 32 | #define RGBLIGHT_COLOR_LAYER_5 0x00, 0xFF, 0xFF | ||
| 33 | #define RGBLIGHT_ANIMATIONS | ||
| 34 | #define RGB_LIGHT_EFFECT_BREATHE_MAX 200 | ||
| 35 | #define RGBLIGHT_RAINBOW_SWIRL_RANGE 127 | ||
| 36 | #endif // rgblight | ||
| 37 | |||
| 38 | #define TAPPING_TERM 200 | ||
| 39 | #define TAPPING_TERM_PER_KEY | ||
| 40 | #define RETRO_TAPPING | ||
| 41 | //#define PERMISSIVE_HOLD | ||
diff --git a/users/miles2go/keymaps/handwired/ms_sculpt_mobile/keymap.c b/users/miles2go/keymaps/handwired/ms_sculpt_mobile/keymap.c new file mode 100644 index 000000000..d36bf25b2 --- /dev/null +++ b/users/miles2go/keymaps/handwired/ms_sculpt_mobile/keymap.c | |||
| @@ -0,0 +1,463 @@ | |||
| 1 | //placeholder until the new keymaps tree is built | ||
| 2 | //#include QMK_KEYBOARD_H | ||
| 3 | |||
| 4 | |||
| 5 | #include "virtser.h" | ||
| 6 | #include <print.h> | ||
| 7 | #include "milestogo.h" | ||
| 8 | |||
| 9 | |||
| 10 | #define LAYOUT_local LAYOUT_mobile_XUW | ||
| 11 | #define LAYOUT LAYOUT_mobile_XUW | ||
| 12 | |||
| 13 | |||
| 14 | #ifndef USERSPACE_ACTIVE | ||
| 15 | enum layer_keycodes { | ||
| 16 | QWR = SAFE_RANGE, | ||
| 17 | CDH, | ||
| 18 | SYM, | ||
| 19 | MOV, | ||
| 20 | NUM, | ||
| 21 | TRAN | ||
| 22 | }; | ||
| 23 | |||
| 24 | enum layer_names { | ||
| 25 | _QWR, | ||
| 26 | _CDH, | ||
| 27 | _SYM, | ||
| 28 | _MOV, | ||
| 29 | _TRAN | ||
| 30 | }; | ||
| 31 | |||
| 32 | #endif | ||
| 33 | |||
| 34 | // Shorter spacing | ||
| 35 | #define XXXX KC_NO | ||
| 36 | #define ____ KC_TRNS | ||
| 37 | |||
| 38 | // Custom macros | ||
| 39 | |||
| 40 | /* Fn Keys */ | ||
| 41 | #define TT_SYM MO(_SYM) | ||
| 42 | #define TT_NUM MO(_NUM) | ||
| 43 | #define SSFT ACTION_MODS_ONESHOT(MOD_LSFT) | ||
| 44 | #define SSYM LT(_SYM, KC_SPC) | ||
| 45 | #define MVTAB LT(_MOV,KC_TAB) | ||
| 46 | #define BKMV TT(_MOV) | ||
| 47 | #define MV2 LT(_MOV, KC_2) | ||
| 48 | #define MV3 LT(_MOV, KC_3) | ||
| 49 | #define MV4 LT(_MOV, KC_4) | ||
| 50 | #define MV8 LT(_MOV, KC_8) | ||
| 51 | #define MV9 LT(_MOV, KC_9) | ||
| 52 | #define MV0 LT(_MOV, KC_0) | ||
| 53 | |||
| 54 | |||
| 55 | |||
| 56 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 57 | /* QWERTY | ||
| 58 | * | ||
| 59 | * |ESC | F1 | F2 | F3 | F4 | F5 | F6 | f7 | F8 | F9 | F10| F11| F12|Vol-|Vol+|_CDH| | ||
| 60 | * -------------------------------------------------------------------------------' | ||
| 61 | * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Bakspace| Del| | ||
| 62 | * --------------------------------------------------------------------------- | ||
| 63 | * | tab | q | w | e | r | t | y | u | i | o | p | [ | ] | \ | | | ||
| 64 | * -------------------------------------------------------------------------------' | ||
| 65 | * |Bak/Mov| a | s | d | f | g | h | j | k | l | ; | ' | enter |PgUp| | ||
| 66 | * -------------------------------------------------------------------------------- | ||
| 67 | * |Lsft | z | x | c | v | b | n | m | , | . | / | Rsft| Up| PgDn| | ||
| 68 | * --------------------------------------------------------------------------------- | ||
| 69 | * |Lctl |Lgui |Lalt | Space/Sym | GUI | Sym | Rctl |Left|Down|Rght| | ||
| 70 | * --------------------------------------------------------------------------------- | ||
| 71 | */ | ||
| 72 | |||
| 73 | [_QWERTY] = LAYOUT_local( \ | ||
| 74 | 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_VOLD, KC_VOLU, TG(_CDH),\ | ||
| 75 | KC_GRAVE, 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_DEL,\ | ||
| 76 | 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,\ | ||
| 77 | BKMV, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP,\ | ||
| 78 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT,KC_SLSH,KC_RSFT, KC_UP, KC_PGDN,\ | ||
| 79 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RGUI, TT_SYM,KC_CDH, KC_LEFT, KC_DOWN, KC_RIGHT | ||
| 80 | ), | ||
| 81 | |||
| 82 | |||
| 83 | [_CDH] = LAYOUT_local(\ | ||
| 84 | ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ | ||
| 85 | KC_GRAVE, KC_1, KC_2, KC_3 ,KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQL, KC_BSPC, KC_DEL,\ | ||
| 86 | KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, ____, ____, ____,\ | ||
| 87 | KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_G, KC_M, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, KC_2,\ | ||
| 88 | KC_LSFT, KC_Z, KC_X, KC_C, DHPASTE,KC_V, KC_K, KC_H, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, ____, KC_1,\ | ||
| 89 | TG(_MOV), ____, ____ , ____, ____, ____, KC_QWERTY, ____, ____, ____ | ||
| 90 | ), | ||
| 91 | |||
| 92 | /* SYMBOL layer, several to chose from | ||
| 93 | */ | ||
| 94 | |||
| 95 | [_SYM] = LAYOUT_wrapper(\ | ||
| 96 | ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ | ||
| 97 | ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ | ||
| 98 | ____, _________________EXCEL_L1__________________, _________________EXCEL_R1__________________, ____, ____, ____,\ | ||
| 99 | ____, _________________EXCEL_L2__________________, _________________EXCEL_R2__________________, KC_GRV, ____, ____,\ | ||
| 100 | ____, _________________EXCEL_L3__________________, _________________EXCEL_R3__________________, B_SAVE, ____, ____,\ | ||
| 101 | ____, ____, ____, ____, ____, ____, ____, ____, ____, ____ | ||
| 102 | ), | ||
| 103 | |||
| 104 | #ifndef USE_BABLPASTE | ||
| 105 | |||
| 106 | [_MOV] = LAYOUT_local(\ | ||
| 107 | ____, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, ____ , \ | ||
| 108 | ____, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, \ | ||
| 109 | ____, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, KC_UP, XXXX, XXXX, XXXX, XXXX, XXXX, \ | ||
| 110 | ____, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, KC_LEFT, KC_DOWN, KC_RIGHT,XXXX, XXXX, XXXX, XXXX, \ | ||
| 111 | ____, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, \ | ||
| 112 | ____, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX | ||
| 113 | ) | ||
| 114 | |||
| 115 | #else | ||
| 116 | /* MOVE babble version version | ||
| 117 | |||
| 118 | * |ESC | MAC|Read|Linx| VI | | | | | | | | | | | | | ||
| 119 | * -------------------------------------------------------------------------------' | ||
| 120 | * | | | - | = |Bakspace| Del| | ||
| 121 | * --------------------------------------------------------------------------- | ||
| 122 | * | tab | | [ | ] | \ | | | ||
| 123 | * -------------------------------------------------------------------------------' | ||
| 124 | * |Bak/Mov| | ' |Launch App |PgUp| | ||
| 125 | * --------------------------------------------------------------------------------- | ||
| 126 | * |Lsft | | Rsft| Up| PgDn| | ||
| 127 | * --------------------------------------------------------------------------------- | ||
| 128 | * | |Lgui |Lalt | Exit Move Mode | GUI | Sym | Rctl |Left|Down|Rght| | ||
| 129 | * --------------------------------------------------------------------------------- | ||
| 130 | */ | ||
| 131 | /* ,--------------------------------------------. ,--------------------------------------------. | ||
| 132 | * 01 | ESC |FindPrev| Find |FindNext| \n cell| |ParStart|LineStrt| Up | EOL | ParEnd | | ||
| 133 | * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| | ||
| 134 | * 02 | SelA | Do_DEL | Shift | Undo |Hsplit+ | | WrdLft | Left | Down | Right | WrdRght| | ||
| 135 | * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| | ||
| 136 | * 03 |Vspli+ | Cut | Copy | Paste | Paste | | WinPrv | Tab-- | NewTab | Tab++ | WinNxt | | ||
| 137 | * `--------------------------------------------' `--------------------------------------------' | ||
| 138 | */ | ||
| 139 | |||
| 140 | [_MOV] = LAYOUT_wrapper(\ | ||
| 141 | ____, ____________BABBLE_SWITCH_L________________, ____________BABBLE_SWITCH_R________________, XXXX, XXXX, XXXX, XXXX, ____, \ | ||
| 142 | ____, ____________BABBLE_MOV_LNUM________________, ____________BABBLE_MOV_RNUM________________, XXXX, XXXX, XXXX, XXXX,\ | ||
| 143 | ____, ____________BABBLE_MOV_L1__________________, ____________BABBLE_MOV_R1__________________, XXXX, XXXX, XXXX, \ | ||
| 144 | ____, ____________BABBLE_MOV_L2__________________, ____________BABBLE_MOV_R2__________________, XXXX, B_RUNAPP, XXXX,\ | ||
| 145 | ____, ____________BABBLE_MOV_L3__________________, ____________BABBLE_MOV_R2__________________, XXXX, XXXX, XXXX, \ | ||
| 146 | ____, ____, ____, TG(_MOV), XXXX, XXXX, XXXX, XXXX, XXXX, XXXX | ||
| 147 | ), | ||
| 148 | // Move in a direction, deleting as we go, or do opposite of Mov layer action */ | ||
| 149 | /* ,--------------------------------------------. ,--------------------------------------------. | ||
| 150 | * 01 | Esc | |Replace |MultiSel|PasteVal| | . |LineStrt| . | EOL | . | | ||
| 151 | * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| | ||
| 152 | * 02 | | Do_Mov | Shift | Redo |Hsplit- | | WrdLft | Left | . | Right | WrdRght| | ||
| 153 | * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| | ||
| 154 | * 03 |Vsplit- | Cut | Copy | Paste |Paste | | App-- | ZoomOut| NewWin | ZoomIn | App+ | | ||
| 155 | * `--------------------------------------------' `--------------------------------------------' | ||
| 156 | */ | ||
| 157 | [_DMOV] = LAYOUT_wrapper(\ | ||
| 158 | ____, ____________BABBLE_SWITCH_L________________, ____________BABBLE_SWITCH_R________________, XXXX, XXXX, XXXX, ____, \ | ||
| 159 | ____, ____________BABBLE_MOV_LNUM________________, ____________BABBLE_MOV_RNUM________________, XXXX, XXXX, XXXX, XXXX, \ | ||
| 160 | ____, _________BABBLE_DELMOV_L1__________________ , _________BABBLE_DELMOV_R1__________________ , XXXX, XXXX, XXXX, \ | ||
| 161 | ____, _________BABBLE_DELMOV_L2__________________ , _________BABBLE_DELMOV_R2__________________ , XXXX, XXXX, XXXX,\ | ||
| 162 | ____, _________BABBLE_DELMOV_L3__________________ , _________BABBLE_DELMOV_R3__________________ , XXXX, XXXX, XXXX, \ | ||
| 163 | ____, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX | ||
| 164 | ), | ||
| 165 | |||
| 166 | #endif // Bablepaste | ||
| 167 | /* | ||
| 168 | [_TRAN] = LAYOUT_local(\ | ||
| 169 | ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ | ||
| 170 | ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ | ||
| 171 | ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ | ||
| 172 | ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ | ||
| 173 | ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ | ||
| 174 | ____, ____, ____, ____, ____, ____, ____, ____, ____, ____ | ||
| 175 | ) | ||
| 176 | */ | ||
| 177 | }; | ||
| 178 | |||
| 179 | #ifndef USERSPACE_ACTIVE | ||
| 180 | |||
| 181 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 182 | switch (keycode) { | ||
| 183 | case QWR: | ||
| 184 | if (record->event.pressed) { | ||
| 185 | layer_off(_CDH); | ||
| 186 | } | ||
| 187 | return false; | ||
| 188 | break; | ||
| 189 | |||
| 190 | case CDH: | ||
| 191 | if (record->event.pressed) { | ||
| 192 | layer_on(_CDH); | ||
| 193 | } | ||
| 194 | return false; | ||
| 195 | break; | ||
| 196 | |||
| 197 | case SYM: | ||
| 198 | if (record->event.pressed) { | ||
| 199 | layer_on(_SYM); | ||
| 200 | } else { | ||
| 201 | layer_off(_SYM); | ||
| 202 | } | ||
| 203 | return false; | ||
| 204 | break; | ||
| 205 | |||
| 206 | case SAVE: | ||
| 207 | if (record->event.pressed) { | ||
| 208 | SEND_STRING(SS_LCTL("s")); | ||
| 209 | } | ||
| 210 | return false; | ||
| 211 | break; | ||
| 212 | /* Colemak mod-dh moves the D key to the qwerty V position | ||
| 213 | This hack makes apple-V_position do what I mean */ | ||
| 214 | case DHPASTE: | ||
| 215 | if(get_mods() & MOD_BIT(KC_LGUI) ) { | ||
| 216 | if (record->event.pressed) { | ||
| 217 | clear_keyboard_but_mods(); | ||
| 218 | register_code(KC_V); | ||
| 219 | } else { | ||
| 220 | unregister_code(KC_V); | ||
| 221 | } | ||
| 222 | } else { | ||
| 223 | if (record->event.pressed) { | ||
| 224 | register_code(KC_D); | ||
| 225 | } else { | ||
| 226 | unregister_code(KC_D); | ||
| 227 | } | ||
| 228 | } | ||
| 229 | return false; | ||
| 230 | break; | ||
| 231 | |||
| 232 | return false; | ||
| 233 | break; | ||
| 234 | } | ||
| 235 | |||
| 236 | return true; | ||
| 237 | } | ||
| 238 | #endif | ||
| 239 | |||
| 240 | void keyboard_post_init_user(void) { | ||
| 241 | // Customise these values to desired behaviour | ||
| 242 | // debug_enable=true; | ||
| 243 | //debug_matrix=true; | ||
| 244 | //debug_keyboard=true; | ||
| 245 | //debug_mouse=true; | ||
| 246 | } | ||
| 247 | |||
| 248 | |||
| 249 | void matrix_init_user(void) { | ||
| 250 | #ifdef RGBLIGHT_ENABLE | ||
| 251 | #ifdef RGB_DI_PIN | ||
| 252 | rgblight_setrgb(RGB_GREEN); | ||
| 253 | #endif | ||
| 254 | #endif //RGB_matrix | ||
| 255 | } | ||
| 256 | |||
| 257 | // Runs whenever there is a layer state change. | ||
| 258 | layer_state_t layer_state_set_user(layer_state_t state) { | ||
| 259 | uint8_t layer = get_highest_layer(state); | ||
| 260 | switch (layer) { | ||
| 261 | case 0: | ||
| 262 | #ifdef RGBLIGHT_COLOR_LAYER_0 | ||
| 263 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_0); | ||
| 264 | #else | ||
| 265 | #ifdef RGBLIGHT_ENABLE | ||
| 266 | rgblight_init(); | ||
| 267 | #endif | ||
| 268 | #endif | ||
| 269 | break; | ||
| 270 | |||
| 271 | case 1: | ||
| 272 | #ifdef RGBLIGHT_COLOR_LAYER_1 | ||
| 273 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_1); | ||
| 274 | #endif | ||
| 275 | break; | ||
| 276 | |||
| 277 | case 2: // symbol | ||
| 278 | #ifdef RGBLIGHT_COLOR_LAYER_2 | ||
| 279 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_2); | ||
| 280 | #endif | ||
| 281 | break; | ||
| 282 | |||
| 283 | case 3: // move | ||
| 284 | #ifdef RGBLIGHT_COLOR_LAYER_3 | ||
| 285 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_3); | ||
| 286 | #endif | ||
| 287 | #ifdef USE_BABLPASTE | ||
| 288 | babble_led_user(); // poke led to update | ||
| 289 | #endif // bablepaste | ||
| 290 | break; | ||
| 291 | |||
| 292 | case 4: //delmove ideally we'd turn on a red pixel in addition to the layer indicator. | ||
| 293 | #ifdef RGBLIGHT_COLOR_LAYER_4 | ||
| 294 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_4); | ||
| 295 | #endif | ||
| 296 | break; | ||
| 297 | |||
| 298 | case 5: | ||
| 299 | #ifdef RGBLIGHT_COLOR_LAYER_5 | ||
| 300 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_5); | ||
| 301 | #endif | ||
| 302 | break; | ||
| 303 | |||
| 304 | default: | ||
| 305 | break; | ||
| 306 | } | ||
| 307 | #ifdef VIRTSER_ENABLE | ||
| 308 | //virtser_send(layer + 48); // ascii 0 is 48 | ||
| 309 | #endif | ||
| 310 | return state; | ||
| 311 | }; | ||
| 312 | |||
| 313 | // custom tapping term lengths. | ||
| 314 | uint16_t get_tapping_term(uint16_t keycode) { | ||
| 315 | switch (keycode) { | ||
| 316 | case LT(_MOV, KC_TAB): | ||
| 317 | return TAPPING_TERM ; | ||
| 318 | break; | ||
| 319 | default: | ||
| 320 | return TAPPING_TERM; | ||
| 321 | } | ||
| 322 | } | ||
| 323 | |||
| 324 | |||
| 325 | |||
| 326 | #ifdef VIRTSER_ENABLE | ||
| 327 | /* listen on serial for commands. Either a set of lower case letters mapped to colors, | ||
| 328 | / or upper case letters that change RGB mode. | ||
| 329 | / special command C takes 3 numbers as arguments, terminated with a newline or comma or excess digits. | ||
| 330 | Command C takes 3-5octets of RGB settings. Numbers can be terminated with a comma or period. | ||
| 331 | 3 octets = set all LED, 4th argument specfies specfic LED, 4+5 specify start and stop LEDs. | ||
| 332 | */ | ||
| 333 | |||
| 334 | uint8_t ser_rgbByte[18] ; //ascii string | ||
| 335 | uint8_t ser_cmd_started =0 ; // are we in process | ||
| 336 | uint8_t ser_got_RGBbytes =0 ; // how many bytes we've recived. | ||
| 337 | uint8_t rgb_r[6]; // R, g, b, P1, p2 | ||
| 338 | uint8_t bs=0; // how many bytes into our rgbBytestring. | ||
| 339 | |||
| 340 | void virtser_recv(uint8_t serIn) { | ||
| 341 | #ifdef RGBLIGHT_ENABLE | ||
| 342 | if ((serIn == 10 ) || (serIn == 13) || ser_got_RGBbytes >=5) { //reached newline or max digits | ||
| 343 | |||
| 344 | if (ser_cmd_started) { | ||
| 345 | ser_cmd_started =0 ; // end loop at newline | ||
| 346 | virtser_send('|'); | ||
| 347 | |||
| 348 | if (ser_got_RGBbytes==3) { | ||
| 349 | rgblight_setrgb( rgb_r[0], rgb_r[1], rgb_r[2]); | ||
| 350 | } | ||
| 351 | |||
| 352 | if (ser_got_RGBbytes ==4) { | ||
| 353 | if (( rgb_r[3] >=0) && (rgb_r[3] <= RGBLED_NUM) ) { // is pos1 plausible | ||
| 354 | rgblight_setrgb_at ( rgb_r[0], rgb_r[1], rgb_r[2], rgb_r[3]); | ||
| 355 | } else { | ||
| 356 | rgblight_setrgb( rgb_r[0], rgb_r[1], rgb_r[2]); | ||
| 357 | } | ||
| 358 | } | ||
| 359 | |||
| 360 | if (ser_got_RGBbytes == 5) { // are start and end positions plausible? | ||
| 361 | if ( (rgb_r[4] >0) && (rgb_r[4] <= RGBLED_NUM) && (rgb_r[4] > rgb_r[3]) && | ||
| 362 | (rgb_r[3] >=0) && (rgb_r[3] <= (RGBLED_NUM -1)) ) { | ||
| 363 | rgblight_setrgb_range(rgb_r[0], rgb_r[1], rgb_r[2], rgb_r[3], rgb_r[4]); | ||
| 364 | } else { | ||
| 365 | rgblight_setrgb( rgb_r[0], rgb_r[1], rgb_r[2]); | ||
| 366 | } | ||
| 367 | } | ||
| 368 | } else { // newline outside of command loop, or something that can be ignored. | ||
| 369 | //virtser_send('.'); | ||
| 370 | } | ||
| 371 | } | ||
| 372 | |||
| 373 | if (1 == ser_cmd_started) { // collecting bytes. | ||
| 374 | if ( // it is time to compute a byte | ||
| 375 | ( ( (serIn == ',') || (serIn == '.') ) && (bs > 0) ) || // signal done with the byte. | ||
| 376 | (bs ==2 )){ //or we know this is last. | ||
| 377 | |||
| 378 | if ( (serIn <= '9') && (serIn >='0') ) { //3rd asci digit | ||
| 379 | ser_rgbByte[bs] = serIn; | ||
| 380 | bs++; | ||
| 381 | // virtser_send(serIn); | ||
| 382 | } | ||
| 383 | |||
| 384 | if (bs>3) { | ||
| 385 | rgb_r[ser_got_RGBbytes]=255; | ||
| 386 | ser_got_RGBbytes ++; | ||
| 387 | } | ||
| 388 | if (bs==3) { | ||
| 389 | rgb_r[ser_got_RGBbytes] = (ser_rgbByte[0] -'0')*100 + (ser_rgbByte[1] -'0')*10 + (ser_rgbByte[2] -'0' ); | ||
| 390 | ser_got_RGBbytes ++; | ||
| 391 | } | ||
| 392 | if (bs ==2 ) { | ||
| 393 | rgb_r[ser_got_RGBbytes] = (ser_rgbByte[0] -'0')*10 + (ser_rgbByte[1] -'0' ); | ||
| 394 | ser_got_RGBbytes ++; | ||
| 395 | } | ||
| 396 | if (bs ==1) { | ||
| 397 | rgb_r[ser_got_RGBbytes] = (ser_rgbByte[0] -'0'); | ||
| 398 | ser_got_RGBbytes ++; | ||
| 399 | } // {else wipe & start over} | ||
| 400 | |||
| 401 | bs=0; | ||
| 402 | // virtser_send(ser_got_RGBbytes+'0'); | ||
| 403 | |||
| 404 | } else { // haven't got enough for our byte / no terminal marker | ||
| 405 | if ( (serIn <= '9') && (serIn >='0') ) { //ascii only | ||
| 406 | ser_rgbByte[bs] = serIn; | ||
| 407 | bs++; | ||
| 408 | // virtser_send(serIn); | ||
| 409 | } | ||
| 410 | } | ||
| 411 | } else { //not in command loop - next is command w/o arguments, or start of one. | ||
| 412 | switch (serIn) { | ||
| 413 | case 'C': // color switch | ||
| 414 | ser_cmd_started=1; | ||
| 415 | ser_got_RGBbytes = bs =0; | ||
| 416 | virtser_send('/'); | ||
| 417 | break; | ||
| 418 | |||
| 419 | case 'r': //red | ||
| 420 | rgblight_setrgb(RGB_RED); | ||
| 421 | break; | ||
| 422 | |||
| 423 | case 'g': | ||
| 424 | rgblight_setrgb(RGB_GREEN); | ||
| 425 | break; | ||
| 426 | |||
| 427 | case 'b': // color switch | ||
| 428 | rgblight_setrgb(RGB_BLUE); | ||
| 429 | break; | ||
| 430 | |||
| 431 | case 'w': // color switch | ||
| 432 | rgblight_setrgb(RGB_WHITE); | ||
| 433 | break; | ||
| 434 | |||
| 435 | case 'o': // color black/off | ||
| 436 | rgblight_setrgb(0,0,0); | ||
| 437 | break; | ||
| 438 | |||
| 439 | case 'T': // toggle | ||
| 440 | rgblight_toggle(); | ||
| 441 | break; | ||
| 442 | |||
| 443 | case 'P': // pulse led | ||
| 444 | rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING); | ||
| 445 | break; | ||
| 446 | case 'S': // Static | ||
| 447 | rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT); | ||
| 448 | break; | ||
| 449 | |||
| 450 | case 'U': // Rainbow | ||
| 451 | rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_MOOD); | ||
| 452 | break; | ||
| 453 | |||
| 454 | default: | ||
| 455 | // virtser_send(serIn); | ||
| 456 | break; | ||
| 457 | |||
| 458 | } | ||
| 459 | } | ||
| 460 | #endif // RGBLIGHT_ENABLE | ||
| 461 | } | ||
| 462 | |||
| 463 | #endif // VirtSerial | ||
diff --git a/users/miles2go/keymaps/handwired/ms_sculpt_mobile/readme.md b/users/miles2go/keymaps/handwired/ms_sculpt_mobile/readme.md new file mode 100644 index 000000000..a720d81c1 --- /dev/null +++ b/users/miles2go/keymaps/handwired/ms_sculpt_mobile/readme.md | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | # keymap taking advantage of the STM32 storage & CPU. | ||
| 2 | RGB LED is used to show layers | ||
| 3 | default bluepill LED is capslock. | ||
| 4 | there's a simple serial protocol for the keyboard to listen for color change commands from the PC. | ||
| 5 | Useful for "do stuff && cat "green">/dev/ttyACM0" | ||
| 6 | |||
| 7 | lower case letters set pre-programmed colors | ||
| 8 | Upper case letters change RGB mode | ||
| 9 | Command C takes 3-5 octets of RGB settings. Numbers can be terminated with a comma or period. | ||
| 10 | 3 octets = set all LED, 4th argument specfies specfic LED, 4+5 specify start and stop LEDs. | ||
diff --git a/users/miles2go/keymaps/handwired/ms_sculpt_mobile/rules.mk b/users/miles2go/keymaps/handwired/ms_sculpt_mobile/rules.mk new file mode 100644 index 000000000..7eb39e108 --- /dev/null +++ b/users/miles2go/keymaps/handwired/ms_sculpt_mobile/rules.mk | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | # Build Options | ||
| 2 | # change to "no" to disable the options, or define them in the Makefile in | ||
| 3 | # the appropriate keymap folder that will get included automatically | ||
| 4 | # | ||
| 5 | BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration | ||
| 6 | MOUSEKEY_ENABLE = yes # Mouse keys | ||
| 7 | EXTRAKEY_ENABLE = yes # Audio control and System control | ||
| 8 | CONSOLE_ENABLE = no # Console for debug | ||
| 9 | COMMAND_ENABLE = no # Commands for debug and configuration | ||
| 10 | NKRO_ENABLE = no # Nkey Rollover | ||
| 11 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | ||
| 12 | MIDI_ENABLE = no # MIDI controls | ||
| 13 | AUDIO_ENABLE = no # Audio output on port C6 | ||
| 14 | UNICODE_ENABLE = no # Unicode | ||
| 15 | BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID | ||
| 16 | ifeq ($(strip $(KEYBOARD)), handwired/ms_sculpt_mobile/8x18_arm) | ||
| 17 | RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. | ||
| 18 | endif | ||
| 19 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | ||
| 20 | |||
| 21 | #enable RAW in keymap config, since it can hang machines | ||
| 22 | RAW_ENABLE = no | ||
| 23 | # virtual serial port | ||
| 24 | VIRTSER_ENABLE = yes | ||
diff --git a/users/miles2go/milestogo.c b/users/miles2go/milestogo.c new file mode 100644 index 000000000..f1da2f4d7 --- /dev/null +++ b/users/miles2go/milestogo.c | |||
| @@ -0,0 +1,142 @@ | |||
| 1 | // based on drashna's but I think at this point it's a new axe | ||
| 2 | |||
| 3 | #include QMK_KEYBOARD_H | ||
| 4 | #include "milestogo.h" | ||
| 5 | #include <print.h> | ||
| 6 | |||
| 7 | __attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } | ||
| 8 | |||
| 9 | bool move_is_on = false; // track if we are in _MOV layer | ||
| 10 | bool sym_is_on = false; // track if we are in _SYM layer | ||
| 11 | |||
| 12 | // Defines actions for global custom keycodes | ||
| 13 | // Then runs the _keymap's record handier if not processed here | ||
| 14 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 15 | // static uint16_t spcmov_timer; // timer for spcmov key | ||
| 16 | |||
| 17 | #ifdef USE_BABBLEPASTE | ||
| 18 | if (keycode > BABBLE_START && keycode < BABBLE_END_RANGE) { | ||
| 19 | if (record->event.pressed) { // is there a case where this isn't desired? | ||
| 20 | babblePaste(keycode); | ||
| 21 | } else { | ||
| 22 | return true; | ||
| 23 | } | ||
| 24 | } | ||
| 25 | #endif | ||
| 26 | |||
| 27 | switch (keycode) { | ||
| 28 | case _QWERTY: | ||
| 29 | if (record->event.pressed) { | ||
| 30 | set_single_persistent_default_layer(_QWERTY); | ||
| 31 | } | ||
| 32 | break; | ||
| 33 | |||
| 34 | case _CDH: | ||
| 35 | if (record->event.pressed) { | ||
| 36 | set_single_persistent_default_layer(_CDH); | ||
| 37 | } | ||
| 38 | break; | ||
| 39 | |||
| 40 | case TMUX: // ctl-B | ||
| 41 | if (record->event.pressed) { | ||
| 42 | tap_code16(C(KC_B)); | ||
| 43 | } | ||
| 44 | break; | ||
| 45 | |||
| 46 | /* Colemak mod-dh moves the D key to the qwerty V position | ||
| 47 | This hack makes apple-V_position do what I mean */ | ||
| 48 | case DHPASTE: | ||
| 49 | if (get_mods() & MOD_BIT(KC_LGUI)) { | ||
| 50 | if (record->event.pressed) { | ||
| 51 | clear_keyboard_but_mods(); | ||
| 52 | register_code(KC_V); | ||
| 53 | } else { | ||
| 54 | unregister_code(KC_V); | ||
| 55 | } | ||
| 56 | } else { | ||
| 57 | if (record->event.pressed) { | ||
| 58 | register_code(KC_D); | ||
| 59 | } else { | ||
| 60 | unregister_code(KC_D); | ||
| 61 | } | ||
| 62 | } | ||
| 63 | return false; | ||
| 64 | break; | ||
| 65 | |||
| 66 | default: | ||
| 67 | return true; | ||
| 68 | } | ||
| 69 | |||
| 70 | // normal keycode | ||
| 71 | return process_record_keymap(keycode, record); | ||
| 72 | } | ||
| 73 | |||
| 74 | void babble_led_user(void) { | ||
| 75 | #ifdef USE_BABLPASTE | ||
| 76 | extern uint8_t babble_mode; | ||
| 77 | |||
| 78 | # ifdef BABL_WINDOWS | ||
| 79 | if (babble_mode == BABL_WINDOWS_MODE) { | ||
| 80 | if (BABL_LED_INDEX > 0) { | ||
| 81 | rgblight_setrgb_at(RGBLIGHT_COLOR_MS, BABL_LED_INDEX); | ||
| 82 | } else { | ||
| 83 | rgblight_setrgb(RGBLIGHT_COLOR_MS); | ||
| 84 | } | ||
| 85 | } | ||
| 86 | # endif | ||
| 87 | # ifdef BABL_READMUX | ||
| 88 | if (babble_mode == BABL_READMUX_MODE) { | ||
| 89 | if (BABL_LED_INDEX > 0) { | ||
| 90 | rgblight_setrgb_at(RGBLIGHT_COLOR_READMUX, BABL_LED_INDEX); | ||
| 91 | } else { | ||
| 92 | rgblight_setrgb(RGBLIGHT_COLOR_READMUX); | ||
| 93 | } | ||
| 94 | } | ||
| 95 | # endif | ||
| 96 | # ifdef BABL_MAC | ||
| 97 | if (babble_mode == BABL_MAC_MODE) { | ||
| 98 | if (BABL_LED_INDEX > 0) { | ||
| 99 | rgblight_setrgb_at(RGBLIGHT_COLOR_MAC, BABL_LED_INDEX); | ||
| 100 | } else { | ||
| 101 | rgblight_setrgb(RGBLIGHT_COLOR_MAC); | ||
| 102 | } | ||
| 103 | } | ||
| 104 | # endif | ||
| 105 | # ifdef BABL_VI | ||
| 106 | if (babble_mode == BABL_VI_MODE) { | ||
| 107 | if (BABL_LED_INDEX > 0) { | ||
| 108 | rgblight_setrgb_at(RGBLIGHT_COLOR_VI, BABL_LED_INDEX); | ||
| 109 | } else { | ||
| 110 | rgblight_setrgb(RGBLIGHT_COLOR_VI); | ||
| 111 | } | ||
| 112 | } | ||
| 113 | # endif | ||
| 114 | # ifdef BABL_EMACS | ||
| 115 | if (babble_mode == BABL_EMACS_MODE) { | ||
| 116 | if (BABL_LED_INDEX > 0) { | ||
| 117 | rgblight_setrgb_at(RGBLIGHT_COLOR_EMACS, BABL_LED_INDEX); | ||
| 118 | } else { | ||
| 119 | rgblight_setrgb(RGBLIGHT_COLOR_EMACS); | ||
| 120 | } | ||
| 121 | } | ||
| 122 | # endif | ||
| 123 | # ifdef BABL_CHROMEOS | ||
| 124 | if (babble_mode == BABL_CHROMEOS_MODE) { | ||
| 125 | if (BABL_LED_INDEX > 0) { | ||
| 126 | rgblight_setrgb_at(RGBLIGHT_COLOR_CHROMEOS, BABL_LED_INDEX); | ||
| 127 | } else { | ||
| 128 | rgblight_setrgb(RGBLIGHT_COLOR_CHROMEOS); | ||
| 129 | } | ||
| 130 | } | ||
| 131 | # endif | ||
| 132 | # ifdef BABL_LINUX | ||
| 133 | if (babble_mode == BABL_LINUX_MODE) { | ||
| 134 | if (BABL_LED_INDEX > 0) { | ||
| 135 | rgblight_setrgb_at(RGBLIGHT_COLOR_LINUX, BABL_LED_INDEX); | ||
| 136 | } else { | ||
| 137 | rgblight_setrgb(RGBLIGHT_COLOR_LINUX); | ||
| 138 | } | ||
| 139 | } | ||
| 140 | # endif | ||
| 141 | #endif // bablepaste | ||
| 142 | } | ||
diff --git a/users/miles2go/milestogo.h b/users/miles2go/milestogo.h new file mode 100644 index 000000000..dfb344212 --- /dev/null +++ b/users/miles2go/milestogo.h | |||
| @@ -0,0 +1,289 @@ | |||
| 1 | /* Modified from | ||
| 2 | Copyright 2017 Christopher Courtney <drashna@live.com> @drashna | ||
| 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 | |||
| 19 | #pragma once | ||
| 20 | #include "quantum.h" | ||
| 21 | #include "version.h" | ||
| 22 | #include "eeprom.h" | ||
| 23 | |||
| 24 | |||
| 25 | #ifdef USE_BABBLEPASTE | ||
| 26 | #include "babblePaste.h" | ||
| 27 | #endif | ||
| 28 | |||
| 29 | #ifdef RGB_MATRIX_ENABLE | ||
| 30 | #include "rgb_matrix.h" | ||
| 31 | #endif | ||
| 32 | |||
| 33 | #define USERSPACE_ACTIVE | ||
| 34 | |||
| 35 | /* Define layer names */ | ||
| 36 | enum userspace_layers { | ||
| 37 | _QWERTY=0, | ||
| 38 | _CDH, | ||
| 39 | _SYM, | ||
| 40 | _MOV, | ||
| 41 | _DMOV, | ||
| 42 | _NUM | ||
| 43 | }; | ||
| 44 | |||
| 45 | |||
| 46 | /* | ||
| 47 | define modifiers here, since MOD_* doesn't seem to work for these | ||
| 48 | */ | ||
| 49 | #define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) | ||
| 50 | #define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL)) | ||
| 51 | #define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT)) | ||
| 52 | #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) | ||
| 53 | |||
| 54 | #if defined(BABBLE_END_RANGE) | ||
| 55 | #define USER_START BABBLE_END_RANGE | ||
| 56 | #else | ||
| 57 | #if defined(KEYMAP_SAFE_RANGE) | ||
| 58 | #define USER_START KEYMAP_SAFE_RANGE | ||
| 59 | #else | ||
| 60 | #define USER_START SAFE_RANGE | ||
| 61 | #endif | ||
| 62 | #endif | ||
| 63 | |||
| 64 | enum userspace_custom_keycodes { | ||
| 65 | EPRM = BABBLE_END_RANGE, // Resets EEPROM do defaults (as in eeconfig_init) | ||
| 66 | VRSN, // Prints QMK Firmware and board info | ||
| 67 | KC_QWERTY, // Sets default layer to QWERTY | ||
| 68 | KC_CDH, // Sets default layer to COLEMAK DH | ||
| 69 | KC_MAKE, | ||
| 70 | VIBRK, // escape : | ||
| 71 | DHPASTE, // allow pasting via qwerty V,not colemak V | ||
| 72 | TMUX, // TMUX Ctrl-b | ||
| 73 | ALTSYM, // Alt when held, toggle MOV when tapped | ||
| 74 | GUISYM, | ||
| 75 | SPCMOV, | ||
| 76 | SAVE, // placeholder for CTRL-S while I get babble working again. | ||
| 77 | NEW_SAFE_RANGE //Keymap specific codes come AFTER this | ||
| 78 | }; | ||
| 79 | |||
| 80 | #define QWERTY KC_QWERTY | ||
| 81 | #define COLEMAK KC_CDH | ||
| 82 | #define KC_RESET RESET | ||
| 83 | |||
| 84 | |||
| 85 | |||
| 86 | #if (!defined(LAYOUT) && defined(KEYMAP)) | ||
| 87 | #define LAYOUT KEYMAP | ||
| 88 | #endif | ||
| 89 | |||
| 90 | #define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) | ||
| 91 | |||
| 92 | |||
| 93 | #define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T | ||
| 94 | #define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G | ||
| 95 | #define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B | ||
| 96 | |||
| 97 | #define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P | ||
| 98 | #define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN | ||
| 99 | #define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH | ||
| 100 | |||
| 101 | |||
| 102 | #define ______________COLEMAK_MOD_DH_L1____________ KC_Q, KC_W, KC_F, KC_P, KC_B | ||
| 103 | #define ______________COLEMAK_MOD_DH_L2____________ KC_A, KC_R, KC_S, KC_T, KC_G | ||
| 104 | #define ______________COLEMAK_MOD_DH_L3____________ KC_Z, KC_X, KC_C, KC_D, KC_V | ||
| 105 | |||
| 106 | #define ______________COLEMAK_MOD_DH_R1____________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN | ||
| 107 | #define ______________COLEMAK_MOD_DH_R2____________ KC_M, KC_N, KC_E, KC_I, KC_O | ||
| 108 | #define ______________COLEMAK_MOD_DH_R3____________ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLASH | ||
| 109 | |||
| 110 | |||
| 111 | #define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5 | ||
| 112 | #define ________________NUMBER_RIGHT_______________ KC_6, KC_7, KC_8, KC_9, KC_0 | ||
| 113 | |||
| 114 | #define ________________FKEYS__LEFT________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 | ||
| 115 | #define ________________FKEYS__RIGHT_______________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 | ||
| 116 | #define ________________FKEYS__FAR_RIGHT___________ KC_F11, KC_F12, KC_PSCR, KC_HOME, KC_END | ||
| 117 | |||
| 118 | #define ________________NAV_NUMBER_LEFT____________ KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, XXXXXXX | ||
| 119 | |||
| 120 | #define ___________________BLANK___________________ _______, _______, _______, _______, _______ | ||
| 121 | #define ___________________BLOCK___________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX | ||
| 122 | |||
| 123 | |||
| 124 | |||
| 125 | // BabblePaste | ||
| 126 | #define ____________BABBLE_SWITCH_L________________ B_MAC , B_READ , B_LINUX, B_VI, _______ | ||
| 127 | #define ____________BABBLE_SWITCH_R________________ B_CROM, B_LINUX, B_WIN , QWERTY, COLEMAK | ||
| 128 | |||
| 129 | |||
| 130 | /////////MOVE - Full size keyboard version | ||
| 131 | |||
| 132 | /* ,--------------------------------------------. ,--------------------------------------------. | ||
| 133 | * N |Lock |PrevApp |NextApp |PasteVal| | | | |SwitchKB|Devtools| Lock | | ||
| 134 | * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| | ||
| 135 | * 01 | ESC |FindPrev| Find |FindNext| \n cell| |ParStart|LineStrt| Up | EOL | ParEnd | | ||
| 136 | * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| | ||
| 137 | * 02 | SelA | Do_DEL | Shift | Undo |Hsplit+ | | WrdLft | Left | Down | Right | WrdRght| | ||
| 138 | * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| | ||
| 139 | * 03 |Vspli+ | Cut | Copy | Paste | Paste | | WinPrv | Tab-- | NewTab | Tab++ | WinNxt | | ||
| 140 | * `--------------------------------------------' `--------------------------------------------' | ||
| 141 | */ | ||
| 142 | /* Movement layer similar to Extend, but fully enriched with babblepaste */ | ||
| 143 | #define ____________BABBLE_MOV_LNUM________________ B_LOCK, B_PAPP, B_NAPP, B_PASTV, XXXX | ||
| 144 | |||
| 145 | #define ____________BABBLE_MOV_L1__________________ KC_ESC, B_FINDP, B_FIND, B_FINDN, B_NCEL | ||
| 146 | #define ____________BABBLE_MOV_L2__________________ B_SELA , MO(_DMOV),KC_LSFT,B_UNDO, B_HSPLIT | ||
| 147 | #define ____________BABBLE_MOV_L3__________________ B_VSPLIT, B_CUT, B_COPY, B_PASTE, B_PASTE | ||
| 148 | |||
| 149 | #define ____________BABBLE_MOV_RNUM________________ XXXX, XXXX, B_KEYB, B_BDEV, B_LOCK | ||
| 150 | #define ____________BABBLE_MOV_R1__________________ B_PTOP, B_GSOL, B_UP, B_GEOL, B_PEND | ||
| 151 | #define ____________BABBLE_MOV_R2__________________ B_L1W, B_L1C, B_DOWN, B_R1C, B_R1W | ||
| 152 | #define ____________BABBLE_MOV_R3__________________ B_PWIN, B_PTAB, B_NTAB, B_NXTB, B_NWIN | ||
| 153 | |||
| 154 | |||
| 155 | // Move in a direction, deleting as we go, or do opposite of Mov layer action */ | ||
| 156 | /* ,--------------------------------------------. ,--------------------------------------------. | ||
| 157 | * 01 | Esc | |Replace |MultiSel|PasteVal| | . |LineStrt| . | EOL | . | | ||
| 158 | * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| | ||
| 159 | * 02 | | Do_Mov | Shift | Redo |Hsplit- | | WrdLft | Left | . | Right | WrdRght| | ||
| 160 | * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| | ||
| 161 | * 03 |Vsplit- | Cut | Copy | Paste |Paste | | App-- | ZoomOut| NewWin | ZoomIn | App+ | | ||
| 162 | * `--------------------------------------------' `--------------------------------------------' | ||
| 163 | */ | ||
| 164 | #define _________BABBLE_DELMOV_L1__________________ KC_ESC, _______, B_RPLACE, B_MSEL, B_PASTV | ||
| 165 | #define _________BABBLE_DELMOV_L2__________________ XXXXXXX, _______, _______, B_REDO, B_HUNSPT | ||
| 166 | #define _________BABBLE_DELMOV_L3__________________ B_VUNSPT,B_CUT, B_COPY, B_PASTE, B_PRVFM | ||
| 167 | |||
| 168 | #define _________BABBLE_DELMOV_R1__________________ XXXXXXX, B_DSOL, _______, B_DEOL, XXXXXXX | ||
| 169 | #define _________BABBLE_DELMOV_R2__________________ B_DLW, KC_BSPC, _______, B_DEL, B_DRW | ||
| 170 | #define _________BABBLE_DELMOV_R3__________________ B_NAPP, B_ZOUT, B_WINN, B_ZIN, B_PAPP | ||
| 171 | |||
| 172 | /* SYM / excel / programming logic +=1 optimization*/ | ||
| 173 | /* ,----------------------------------. ,----------------------------------. | ||
| 174 | * 01 | | [ | ] | { | | | | } | ( | ) | | | ||
| 175 | * |------+------+------+------+------| |------+------+------+------+------| | ||
| 176 | * 02 | ^ | ! | = | 0 | $ | | # | 1 | - | + | ` | | ||
| 177 | * |------+------+------+------+------| |------+------+------+------+------| | ||
| 178 | * 03 | \ | % | @ | | | _ | | * | & | ~ | . | / | | ||
| 179 | * `----------------------------------' `----------------------------------' | ||
| 180 | Memnonics | ||
| 181 | ^begining end$ . &&/|| on strong finger. #at start of line. | ||
| 182 | * (multiply) opposite / | ||
| 183 | Minus is left of plus as normal. | ||
| 184 | ` is a shifted '' | ||
| 185 | ~/ is an outwards roll. / .* is a roll. !=0 is a roll , ++1 --1 roll. | ||
| 186 | _ is hard to get to. | ||
| 187 | |||
| 188 | */ | ||
| 189 | #define ___________________SYM_L1__________________ XXXXXXX, KC_LBRC, KC_RBRC, KC_LCBR, XXXXXXX | ||
| 190 | #define ___________________SYM_L2__________________ KC_CIRC, KC_EXLM, KC_EQL, KC_0, KC_DLR | ||
| 191 | #define ___________________SYM_L3__________________ KC_BSLS, KC_PERC, KC_AT, KC_PIPE, KC_UNDS | ||
| 192 | |||
| 193 | #define ___________________SYM_R1__________________ XXXXXXX, KC_RCBR, KC_LPRN, KC_RPRN, XXXXXXX | ||
| 194 | #define ___________________SYM_R2__________________ KC_HASH, KC_KP_1, KC_MINS, KC_PLUS, KC_GRAVE | ||
| 195 | #define ___________________SYM_R3__________________ KC_PERC, KC_TILDE,KC_AMPR, KC_DOT, KC_SLASH | ||
| 196 | |||
| 197 | |||
| 198 | |||
| 199 | /* excel centric symbol layer*/ | ||
| 200 | /* ,--------------------------------------------. ,--------------------------------------------. | ||
| 201 | * 01 | DelRow|InsCol | SelCol |PasteVal| | | . | 1 | 2 | 3 | | | ||
| 202 | * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| | ||
| 203 | * 02 | - |InsRow | SelRow | Undo | + | | * | 4 | 5 | 6 | - | | ||
| 204 | * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| | ||
| 205 | * 03 | Undo | Cut | Copy | Paste |Paste | | / | 7 | 8 | 9 | Paste | | ||
| 206 | * `--------------------------------------------' `--------------------------------------------' | ||
| 207 | |||
| 208 | */ | ||
| 209 | #define _________________EXCEL_L1__________________ B_DROW, B_ICOL, B_SELC, B_PASTV, XXXX | ||
| 210 | #define _________________EXCEL_L2__________________ KC_MINS, B_ICOL, B_SELC, B_UNDO, KC_PLUS | ||
| 211 | #define _________________EXCEL_L3__________________ B_UNDO, B_CUT, B_COPY, B_PASTE, B_PASTE | ||
| 212 | |||
| 213 | #define _________________EXCEL_R1__________________ XXXXXXX, KC_1, KC_2, KC_3, XXXXXXX | ||
| 214 | #define _________________EXCEL_R2__________________ KC_ASTR, KC_4, KC_5, KC_6, KC_MINS | ||
| 215 | #define _________________EXCEL_R3__________________ KC_SLASH, KC_7, KC_8, KC_8, B_PASTE | ||
| 216 | |||
| 217 | |||
| 218 | /* Based on BEKL 15 punctuation | ||
| 219 | * ,----------------------------------. ,----------------------------------. | ||
| 220 | * 01 | | < | $ | > | | | | [ | _ | ] | | | ||
| 221 | * |------+------+------+------+------| |------+------+------+------+------| | ||
| 222 | * 02 | \ | ( | "" | ) | # | | % | { | = | } | "|" | | ||
| 223 | * |------+------+------+------+------| |------+------+------+------+------| | ||
| 224 | * 03 | | : | * | + | | | | & | ^ | ~ | | | ||
| 225 | * `----------------------------------' `----------------------------------' | ||
| 226 | Memnonics | ||
| 227 | |||
| 228 | */ | ||
| 229 | #define ______________BEKL_SYM_L1__________________ XXXXXXX, KC_LBRC, KC_RBRC, KC_LCBR, XXXXXXX | ||
| 230 | #define ______________BEKL_SYM_L2__________________ KC_CIRC, KC_EXLM, KC_EQL, KC_0, KC_DLR | ||
| 231 | #define ______________BEKL_SYM_L3__________________ KC_BSLS, KC_PERC, KC_AT, KC_PIPE, KC_UNDS | ||
| 232 | |||
| 233 | #define ______________BEKL_SYM_R1__________________ XXXXXXX, KC_RCBR, KC_LPRN, KC_RPRN, XXXXXXX | ||
| 234 | #define ______________BEKL_SYM_R2__________________ KC_HASH, KC_KP_1, KC_MINS, KC_PLUS, KC_GRAVE | ||
| 235 | #define ______________BEKL_SYM_R3__________________ KC_PERC, KC_TILDE,KC_AMPR, KC_DOT, KC_SLASH | ||
| 236 | |||
| 237 | // NUM | ||
| 238 | /* ,----------------------------------. ,----------------------------------. | ||
| 239 | * 01 | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | ||
| 240 | * |------+------+------+------+------| |------+------+------+------+------| | ||
| 241 | * 02 | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | | ||
| 242 | * |------+------+------+------+------| |------+------+------+------+------| | ||
| 243 | * 03 | F11 | F12 | | | QWERT| | CDH | | | | | | ||
| 244 | * `----------------------------------' `----------------------------------' | ||
| 245 | */ | ||
| 246 | |||
| 247 | #define ___________________NUM_L1__________________ ________________NUMBER_LEFT________________ | ||
| 248 | #define ___________________NUM_L2__________________ ________________FKEYS__LEFT________________ | ||
| 249 | #define ___________________NUM_L3__________________ KC_F11, KC_F11, XXXXXXX, XXXXXXX, QWERTY | ||
| 250 | |||
| 251 | #define ___________________NUM_R1__________________ ________________NUMBER_RIGHT_______________ | ||
| 252 | #define ___________________NUM_R2__________________ ________________FKEYS__RIGHT_______________ | ||
| 253 | #define ___________________NUM_R3__________________ COLEMAK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX | ||
| 254 | |||
| 255 | |||
| 256 | |||
| 257 | /* NUM / excel / programming logic +=1 optimization*/ | ||
| 258 | /* ,----------------------------------. ,----------------------------------. | ||
| 259 | * 01 | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | ||
| 260 | * |------+------+------+------+------| |------+------+------+------+------| | ||
| 261 | * 02 | ^ | ! | = | 0 | $ | | # | 1 | - | + | ` | | ||
| 262 | * |------+------+------+------+------| |------+------+------+------+------| | ||
| 263 | * 03 | \ | % | @ | | | _ | | * | & | ~ | . | / | | ||
| 264 | * `----------------------------------' `----------------------------------' | ||
| 265 | Memnonics | ||
| 266 | ^begining end$ . &&/|| on strong finger. #at start of line. * missing? | ||
| 267 | Minus is left of plus as normal. ` is a shifted '' | ||
| 268 | ~/ is an outwards roll. / * is a roll. | ||
| 269 | _ is hard to get to. | ||
| 270 | |||
| 271 | */ | ||
| 272 | #define __________40_______NUM_L1__________________ ________________NUMBER_LEFT________________ | ||
| 273 | #define __________40_______NUM_L2__________________ KC_CIRC, KC_EXLM, KC_EQL, KC_0, KC_DLR | ||
| 274 | #define __________40_______NUM_L3__________________ KC_BSLS, KC_PERC, KC_AT, KC_PIPE, KC_UNDS | ||
| 275 | |||
| 276 | #define __________40_______NUM_R1__________________ ________________NUMBER_RIGHT_______________ | ||
| 277 | #define __________40_______NUM_R2__________________ KC_HASH, KC_KP_1, KC_MINS, KC_PLUS, KC_GRAVE | ||
| 278 | #define __________40_______NUM_R3__________________ KC_PERC, KC_TILDE, KC_AMPR,KC_DOT, KC_SLASH | ||
| 279 | |||
| 280 | |||
| 281 | #define _________________ADJUST_L1_________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG | ||
| 282 | #define _________________ADJUST_L2_________________ MU_TOG , CK_TOGG, AU_ON, AU_OFF, AG_NORM | ||
| 283 | #define _________________ADJUST_L3_________________ RGB_RMOD,RGB_HUD,RGB_SAD, RGB_VAD, KC_RGB_T | ||
| 284 | |||
| 285 | #define _________________ADJUST_R1_________________ KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5 | ||
| 286 | #define _________________ADJUST_R2_________________ AG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN | ||
| 287 | #define _________________ADJUST_R3_________________ MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT | ||
| 288 | |||
| 289 | |||
diff --git a/users/miles2go/readme.md b/users/miles2go/readme.md new file mode 100644 index 000000000..b55f51b15 --- /dev/null +++ b/users/miles2go/readme.md | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | # Overview | ||
| 2 | |||
| 3 | This is my personal userspace file. Most of my code exists here, as it's heavily shared. | ||
| 4 | |||
| 5 | ## Custom Keycodes | ||
| 6 | See the babblepaste.txt readme | ||
| 7 | |||
| 8 | ## Layer Indication | ||
| 9 | |||
| 10 | This uses the `layer_state_set_*` command to change the layer color, to indicate which layer it is on. This includes the default keymap, as well. \ No newline at end of file | ||
diff --git a/users/miles2go/rules.mk b/users/miles2go/rules.mk new file mode 100644 index 000000000..7fb771952 --- /dev/null +++ b/users/miles2go/rules.mk | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | SRC += milestogo.c babblePaste.c babl_windows.c babl_mac.c babl_vi.c babl_readmux.c babl_chromeos.c babl_emacs.c babl_linux.c | ||
| 2 | LTO_ENABLE = yes | ||
| 3 | |||
| 4 | ifeq ($(strip $(MACROS_ENABLED)), yes) | ||
| 5 | OPT_DEFS += -DMACROS_ENABLED | ||
| 6 | endif | ||
| 7 | |||
| 8 | ifeq ($(strip $(USE_BABBLEPASTE)), yes) | ||
| 9 | SRC += babblePaste.c | ||
| 10 | endif | ||
