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/miles2go/babl_chromeos.c | |
| 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/miles2go/babl_chromeos.c')
| -rw-r--r-- | users/miles2go/babl_chromeos.c | 103 |
1 files changed, 103 insertions, 0 deletions
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*/ | ||
