1 BabblePaste is a library of common macros used to make sure that
2 you can have one "paste" button on one layer, and it will do the
3 right thing on any OS or app. Windows=Ctrl-V. Mac = Command-V and so on.
5 The babblepaste library looks for the current status in a babble_mode global variable.
6 To switch modes, run the switch_babble_mode() function, or a pre defined macro.
7 Currently supported are Windows, OS X, Gnome/kde, Emacs, VI and readline,
8 across 42+ common macro actions.
12 1) Paste the following into your config.h.
15 #define USE_BABLPASTE 1
18 /* define BabblePaste maps. Whatever = 0 will be the default. */
29 // Uncomment these to remove options an free up flash space
31 // This removes everything but cursor movement
33 // and this just removes browser shortcuts
37 2) Add the following to your keymap in the action_get_macro
42 if( id >= BABL_START_NUM && id < (BABL_START_NUM + BABL_NUM_MACROS ) ) {
43 if (record->event.pressed) { // is there a case where this isn't desired?
45 babblePaste ( record, id );
52 3) add Babbelpaste actions to your keymap. See the full list in babblePaste.h, or the
54 B_L1C // go left 1 char
55 B_R1C // go Right 1 char
56 B_L1W //GO_LEFT_1 WORD
57 B_R1W //BABL_GO_RIGHT_1 WORD
58 B_GSOL // BABL_GOTO_START of _LINE
59 B_GEOL // BABL_GOTO_END_LINE
60 B_GTOP //BABL_GOTO_START_DOC
61 B_GEND //BABL_GO_END_DOC
62 B_DOWN //BABL_GO_NEXT_LINE
63 B_UP // BABL_GO_PREV_LINE
66 // B_BKSP //backspace so why bother.
67 B_DEL // DEL_RIGHT_1 Char // usually = Del
68 B_DLW // DEL_LEFT_ 1 WORD)
69 B_DRW //DEL_RIGHT_1 WORD
70 B_DEOL // delete from cursor to end of line
71 B_DSOL // delete from cursor to begining line
80 B_FINDR // FIND_REPLACE)
81 B_RAPP // open application launcher
82 B_NAPP // switch to next app
83 B_PAPP // switch to previous app
86 B_NTAB // BROWSER_NEW_TAB)
87 B_CTAB //BROWSER_CLOSE_TAB)
88 B_ROTB //BROWSER_REOPEN_LAST_TAB)
89 B_NXTB //BROWSER_NEXT_TAB)
90 B_PTAB //BROWSER_PREV_TAB)
91 B_NURL //BROWSER_jump to URL_BAR)
92 B_BFWD // BROWSER_FORWARD (in history)
93 B_BBAK //BROWSER_BACK (in history)
94 B_BFND // BROWSER_FIND)
95 B_BOOK //BROWSER_New BOOKMARK)
96 B_BDEV //BROWSER_ Open DEV_TOOLS) // hard one to remember
97 B_BRLD // BROWSER_RELOAD Page
98 B_BFUlL // BROWSER_FULLSCREEN)
99 B_ZMIN // BROWSER_ZOOM_IN)
100 B_ZMOT //BROWSER_ZOOM_OUT)
103 #### Development notes
104 -Why a new function? Because it would make the keymap too ugly to put it there.
105 -Why not return the macro to action_get_macro? Because I kept running into scope problems
106 and pointers to the wrong type.
107 -Why not an array of arrays as a lookup instead of a function? That would allow you
108 to store the lookup table in PROGMEM. True, but that takes more pre-processor skill
111 -Have you tested this on every platform? No. Submit a patch.
114 ### Next steps for someone.
115 Make it easier to pair macros with modifiers. So key foo will jump to start of line, and
116 Shift(foo) will jump to the first tab in a browser.
120 Thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts
121 and https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/jeebak/keymap.c