From 7b7689d30796c977b95197091c16e8bb97000101 Mon Sep 17 00:00:00 2001 From: milestogo Date: Sun, 14 Mar 2021 12:23:30 -0700 Subject: [Keymap] miles2go userspace update, add functions for babblepaste library, add prime_e keybard keymap (#9196) Co-authored-by: Drashna Jaelre --- users/miles2go/babblePaste.c | 130 ++++++++++++++-- users/miles2go/babblePaste.h | 50 +++++- users/miles2go/babblePaste.md | 71 +++++++-- users/miles2go/babl_chromeos.c | 2 +- users/miles2go/babl_emacs.c | 1 + users/miles2go/babl_kitty.c | 153 ++++++++++++++++++ users/miles2go/babl_nano.c | 77 +++++++++ users/miles2go/babl_vi.c | 1 + users/miles2go/config.h | 8 +- users/miles2go/milestogo.c | 29 ++-- users/miles2go/milestogo.h | 343 +++++++++++++++++++++-------------------- users/miles2go/readme.md | 2 +- users/miles2go/rules.mk | 2 +- 13 files changed, 648 insertions(+), 221 deletions(-) create mode 100644 users/miles2go/babl_kitty.c create mode 100644 users/miles2go/babl_nano.c (limited to 'users') diff --git a/users/miles2go/babblePaste.c b/users/miles2go/babblePaste.c index 2a32024cd2..cd032882bf 100644 --- a/users/miles2go/babblePaste.c +++ b/users/miles2go/babblePaste.c @@ -12,13 +12,14 @@ and https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/jee #ifdef USE_BABBLEPASTE # include "babblePaste.h" -// small function that we might also want to call from a keymap. - // GLOBAL variable to determine mode. Sets startup default if no eeppom uint8_t babble_mode = 0; -// function to tell the user that the mode has changed -__attribute__((weak)) void babble_led_user(void) {} +// functions to tell the user that the mode has changed +__attribute__((weak)) void babble_modeswitch_user(uint8_t mode) {} +__attribute__((weak)) void babble_modeswitch_kb(uint8_t mode) { babble_modeswitch_user( mode); } + + void set_babble_mode(uint8_t id) { babble_mode = id; } @@ -27,6 +28,7 @@ void babble_mode_increment() { if (babble_mode >= BABL_MODEMAX) { babble_mode = 0; } + babble_modeswitch_kb(babble_mode); } void babble_mode_decrement() { @@ -35,21 +37,97 @@ void babble_mode_decrement() { } else { babble_mode = BABL_MODEMAX - 1; } + babble_modeswitch_kb(babble_mode); } /* this function runs the appropriate babblepaste macro, given the global babble_mode and a keycode defined in the babble_keycodes enum. -This could be made faster by splitting into two functions sorted by keycode range +This could be made faster by splitting into functions sorted by keycode range But that makes for a *lot* of ifdefs. */ -bool babblePaste(uint16_t keycode) { - // handle the OS/mode switching first +bool babblePaste(uint16_t keycode, bool is_pressed ) { + // handle keys that have up & down behavior first, then OS/mode switching, then macros + +// This is the key used for cut & paste (Propeller on Mac, Control elsewhere) +# ifdef BABL_MODSWAP + // WARNING, this assumes you have BABL_MAC_MODE defined. + if (keycode == BABL_PRIMARY_OS_MOD ) { + if (babble_mode == BABL_MAC_MODE) { + if (is_pressed) { + register_code(KC_LGUI); + } else { + unregister_code(KC_LGUI); + } + } else { // everybody else + + if (is_pressed) { + register_code(KC_LCTL); + } else { + unregister_code(KC_LCTL); + } + } + } + +// This is the os key not used in cut & paste. (CTRL on mac, GUI elsewhere) + if (keycode == BABL_SECONDARY_OS_MOD ) { + if (babble_mode == BABL_MAC_MODE) { + if (is_pressed) { + register_code(KC_LCTL); + } else { + unregister_code(KC_LCTL); + } + + } else { // everybody else + if (is_pressed) { + register_code(KC_LGUI); + } else { + unregister_code(KC_LGUI); + } + } + } + +// This is the alt key in most OSes. Mostly useful if you want to do hyper on one OS, Meh on another. + if (keycode == BABL_TERTIARY_OS_MOD ) { + if (babble_mode == BABL_MAC_MODE) { + if (is_pressed) { + register_code(KC_LALT); + } else { + unregister_code(KC_LALT); + } + } else { // everybody else + + if (is_pressed) { + register_code(KC_LALT); + } else { + unregister_code(KC_LALT); + } + } + } + +# endif + +// below here we are only running macros - don't serve any key up events. + if (is_pressed == 0 ) { + return true; + } + +// handle increment functions. + +if (keycode == BABL_MODE_INCREMENT) { + babble_mode_increment(); + return true; +} + +if (keycode == BABL_MODE_DECREMENT) { + babble_mode_decrement(); + return true; +} # ifdef BABL_MAC if (keycode == BABL_DO_MAC) { set_babble_mode(BABL_MAC_MODE); - babble_led_user(); + babble_modeswitch_kb(babble_mode); return true; } @@ -61,7 +139,7 @@ bool babblePaste(uint16_t keycode) { # ifdef BABL_VI if (keycode == BABL_DO_VI) { set_babble_mode(BABL_VI_MODE); - babble_led_user(); + babble_modeswitch_kb(babble_mode); return true; } if (babble_mode == BABL_VI_MODE) { @@ -71,7 +149,7 @@ bool babblePaste(uint16_t keycode) { # ifdef BABL_WINDOWS if (keycode == BABL_DO_WINDOWS) { set_babble_mode(BABL_WINDOWS_MODE); - babble_led_user(); + babble_modeswitch_kb(babble_mode); return true; } if (babble_mode == BABL_WINDOWS_MODE) { @@ -81,7 +159,7 @@ bool babblePaste(uint16_t keycode) { # ifdef BABL_LINUX if (keycode == BABL_DO_LINUX) { set_babble_mode(BABL_LINUX_MODE); - babble_led_user(); + babble_modeswitch_kb(babble_mode); return true; } if (babble_mode == BABL_LINUX_MODE) { @@ -91,27 +169,47 @@ bool babblePaste(uint16_t keycode) { # ifdef BABL_EMACS if (keycode == BABL_DO_EMACS) { set_babble_mode(BABL_EMACS_MODE); - babble_led_user(); + babble_modeswitch_kb(babble_mode); return true; } if (babble_mode == BABL_EMACS_MODE) { babblePaste_emacs(keycode); } # endif -# ifdef BABL_CHROME +# ifdef BABL_NANO + if (keycode == BABL_DO_NANO) { + set_babble_mode(BABL_NANO_MODE); + babble_modeswitch_kb(babble_mode); + return true; + } + if (babble_mode == BABL_NANO_MODE) { + babblePaste_nano(keycode); + } +# endif +# ifdef BABL_KITTY + if (keycode == BABL_DO_KITTY) { + set_babble_mode(BABL_KITTY_MODE); + babble_modeswitch_kb(babble_mode); + return true; + } + if (babble_mode == BABL_KITTY_MODE) { + babblePaste_kitty(keycode); + } +# endif +# ifdef BABL_CHROMEOS if (keycode == BABL_DO_CHROMEOS) { set_babble_mode(BABL_CHROMEOS_MODE); - babble_led_user(); + babble_modeswitch_kb(babble_mode); return true; } if (babble_mode == BABL_CHROMEOS_MODE) { - babblePaste_readmux(keycode); + babblePaste_chromeos(keycode); } # endif # ifdef BABL_READMUX if (keycode == BABL_DO_READMUX) { set_babble_mode(BABL_READMUX_MODE); - babble_led_user(); + babble_modeswitch_kb(babble_mode); return true; } if (babble_mode == BABL_READMUX_MODE) { diff --git a/users/miles2go/babblePaste.h b/users/miles2go/babblePaste.h index 606640227c..8fc233e8d4 100644 --- a/users/miles2go/babblePaste.h +++ b/users/miles2go/babblePaste.h @@ -16,7 +16,8 @@ and jeebak & algernon's keymap void set_babble_mode(uint8_t id); void babble_mode_increment(void); void babble_mode_decrement(void); -void babble_led_user(void); +void babble_modeswitch_user(uint8_t mode); +void babble_modeswitch_kb(uint8_t mode); // manually re-order these if you want to set the order or default. enum babble_modes { @@ -32,19 +33,24 @@ enum babble_modes { # ifdef BABL_VI BABL_VI_MODE, # endif -# ifdef BABL_LINUX - BABL_LINUX_MODE, -# endif # ifdef BABL_EMACS BABL_EMACS_MODE, # endif +# ifdef BABL_NANO + BABL_NANO_MODE, +# endif +# ifdef BABL_KITTY + BABL_KITTY_MODE, +# endif # ifdef BABL_CHROMEOS BABL_CHROMEOS_MODE, +# endif +# ifdef BABL_LINUX + BABL_LINUX_MODE, # endif BABL_MODEMAX }; -// void babble_led_user( uint8_t id) /// Hacks to make it easier to create sendstring macros @@ -79,6 +85,13 @@ enum babble_modes { enum babble_keycodes { FIRST = BABBLE_START, + BABL_MODE_INCREMENT, + BABL_MODE_DECREMENT, +# ifdef BABL_MODSWAP + BABL_PRIMARY_OS_MOD, + BABL_SECONDARY_OS_MOD, + BABL_TERTIARY_OS_MOD, +# endif # ifdef BABL_MOVE // Movement macros // left & right @@ -171,6 +184,7 @@ enum babble_keycodes { # endif // BABL_APP_CELLS # ifdef BABL_APP_EDITOR BABL_APP_MULTI_SELECT, /* www.sublimetext.com/docs/2/multiple_selection_with_the_keyboard.html */ + BABL_APP_SET_MARK, // set editor mark # endif // BABL_APP_EDITOR # ifdef BABL_APP_WINDOWSPLITTING // These aren't useful on most oses. @@ -197,6 +211,12 @@ enum babble_keycodes { # ifdef BABL_EMACS BABL_DO_EMACS, # endif +# ifdef BABL_NANO + BABL_DO_NANO, +# endif +# ifdef BABL_KITTY + BABL_DO_KITTY, +# endif # ifdef BABL_VI BABL_DO_VI, # endif @@ -210,7 +230,7 @@ enum babble_keycodes { }; // primary function. -bool babblePaste(uint16_t keycode); +bool babblePaste(uint16_t keycode, bool is_pressed); /****************************************************/ /* All per-os includes and short mode switch macros*/ @@ -230,6 +250,14 @@ bool babblePaste_linux(uint16_t keycode); # define B_EMACS BABL_DO_EMACS bool babblePaste_emacs(uint16_t keycode); # endif +# ifdef BABL_NANO +# define B_NANO BABL_DO_NANO +bool babblePaste_nano(uint16_t keycode); +# endif +# ifdef BABL_KITTY +# define B_KITTY BABL_DO_KITTY +bool babblePaste_kitty(uint16_t keycode); +# endif # ifdef BABL_VI # define B_VI BABL_DO_VI bool babblePaste_vi(uint16_t keycode); @@ -243,12 +271,17 @@ bool babblePaste_readmux(uint16_t keycode); bool babblePaste_chromeos(uint16_t keycode); # endif -# define BABL_INC babble_mode_increment(); -# define BABL_DEC babble_mode_decrement(); /**************************************************** ** All keyboard macros for Babble Actions *****************************************************/ +# define B_INC BABL_MODE_INCREMENT +# define B_DEC BABL_MODE_DECREMENT +# ifdef BABL_MODSWAP +# define B_1ME BABL_PRIMARY_OS_MOD +# define B_2ME BABL_SECONDARY_OS_MOD +# define B_3ME BABL_TERTIARY_OS_MOD +# endif # ifdef BABL_MOVE # define B_L1C BABL_GO_LEFT_1C @@ -334,6 +367,7 @@ bool babblePaste_chromeos(uint16_t keycode); # endif // BABL_APP_CELLS # ifdef BABL_APP_EDITOR # define B_MSEL BABL_APP_MULTI_SELECT +# define B_MARK BABL_APP_SET_MARK /* www.sublimetext.com/docs/2/multiple_selection_with_the_keyboard.html */ # endif // BABL_APP_EDITOR # ifdef BABL_APP_WINDOWSPLITTING diff --git a/users/miles2go/babblePaste.md b/users/miles2go/babblePaste.md index cc1c31bd0d..4f68cc4ae8 100644 --- a/users/miles2go/babblePaste.md +++ b/users/miles2go/babblePaste.md @@ -26,6 +26,7 @@ To switch modes, run the switch_babble_mode() function, or a pre defined BABL_DO #define BABL_MAC #define BABL_LINUX #define BABL_EMACS + #define BABL_NANO #define BABL_CHROMEOS //// These enable subsets of babble macros. Disable options to save space @@ -56,22 +57,22 @@ To switch modes, run the switch_babble_mode() function, or a pre defined BABL_DO Add the following to your keymap in process_record_user, before the main switch statement. ``` - #ifdef USE_BABBLEPASTE - if( keycode > BABBLE_START && keycode < BABBLE_END_RANGE ) { - if (record->event.pressed) { // is there a case where this isn't desired? - babblePaste ( keycode ); - } else{ - return true; - } +#ifdef USE_BABBLEPASTE + if (keycode > BABBLE_START && keycode < BABBLE_END_RANGE) { + if (record->event.pressed) { + babblePaste(keycode, 1); + } else { + babblePaste(keycode, 0); } - #endif + } +#endif ``` #### Add makefile rules Update your rules.mk to include the modes you want. - `SRC += babblePaste.c babl_windows.c babl_mac.c babl_vi.c babl_readmux.c babl_chromeos.c babl_emacs.c babl_linux.c` + `SRC += babblePaste.c babl_windows.c babl_mac.c babl_nano babl_vi.c babl_readmux.c babl_chromeos.c babl_emacs.c babl_linux.c` #### Custom Keycodes @@ -97,9 +98,18 @@ See the full list in babblePaste.h, or the list below B_LNX // switch to linux B_VI // switch to Vi mode B_EMAX // switch mode to emacs + B_NANO // switch mode to emacs B_READ // switch to readline /tmux mode B_CROM // switch to chromeos mode. - + + // Swap meaning of modifier key in most ergonomic location based on babble + // mode. Eg Thumb gets CTL on Win/Linux, pinky gets Windows key. Reverse for + // OS X. See first line in babblepaste function. + #define B_1ME BABL_PRIMARY_OS_MOD + #define B_2ME BABL_SECONDARY_OS_MOD + #define B_3ME BABL_TERTIARY_OS_MOD + +// Macros #define B_L1C BABL_GO_LEFT_1C #define B_R1C BABL_GO_RIGHT_1C #define B_L1W BABL_GO_LEFT_WORD @@ -137,6 +147,10 @@ See the full list in babblePaste.h, or the list below #define B_PAPP BABL_SWITCH_APP_LAST // previous #define B_CAPP BABL_CLOSE_APP #define B_HELP BABL_HELP + #define B_HELP BABL_HELP + #define B_LOCK BABL_LOCK + #define B_SCAP BABL_SCREENCAPTURE + #define B_KEYB BABL_SWITCH_KEYBOARD_LAYOUT #define B_NTAB BABL_BROWSER_NEW_TAB #define B_CTAB BABL_BROWSER_CLOSE_TAB @@ -151,9 +165,10 @@ See the full list in babblePaste.h, or the list below #define B_BDEV BABL_BROWSER_DEV_TOOLS // hard one to remember #define B_BRLD BABL_BROWSER_RELOAD #define B_BFULL BABL_BROWSER_FULLSCREEN - #define B_ZIN BABL_BROWSER_ZOOM_IN + #define B_ZIN BABL_BROWSER_ZOOM_IN #define B_ZOUT BABL_BROWSER_ZOOM_OUT + #define B_SAVE BABL_APP_SAVE #define B_PASTV BABL_APP_PASTE_VALUES #define B_CALN BABL_APP_CENTER_ALIGN #define B_CFMT BABL_APP_CLEAR_FORMATTING @@ -167,6 +182,7 @@ See the full list in babblePaste.h, or the list below #define B_SELR BABL_SELECT_ROW #define B_MSEL BABL_APP_MULTI_SELECT + #define B_MARK BABL_APP_SET_MARK #define B_VSPLIT BABL_SPLIT_FRAME_VERT #define B_VUNSPT BABL_UNSPLIT_FRAME_VERT #define B_HSPLIT BABL_SPLIT_FRAME_HORIZONTAL @@ -175,27 +191,48 @@ See the full list in babblePaste.h, or the list below #define B_PRVFM BABL_PREV_FRAME ``` +####Add babblepaste functions to your keyboard or userspace +Functions babble_led_user() and babble_led_kb() are called when babble mode is changed. +``` +void babble_modeswitch_kb(uint8_t mode){ + #ifdef USE_BABBLEPASTE + writePinLow(B3); writePinLow(B2); + switch(mode) { + case(BABL_LINUX_MODE): + writePinHigh(B2); + backlight_level(1); + break; + case(BABL_MAC_MODE): + writePinHigh(B3); + backlight_level(4); + break; + } + // call the user function + babble_modeswitch_user(mode); + #endif +``` + + ## Development FAQs **Todos** -eeprom store state of babble_mode? or update docs so that people can change the order of the enum in -babblespace.h? +eeprom store state of babble_mode? or update docs so that people can change the order of the enum in babblespace.h? **You have huge ifdef stanzas instead of functions** This fails gracefully if you don't have all options defined. Patch if you can think how to use fewer defines. -** Why not an array of arrays as a lookup instead of a function?** +**Why not an array of arrays as a lookup instead of a function?** This would allow you to store the lookup table in PROGMEM. True, but that takes more pre-processor skill than I have, and may be less portable to ARM or other flash mappings. -** Have you tested every key on every platform?** +**Have you tested every key on every platform?** No. Be careful, submit a patch. -** Why not update Apps at the same global level as the OS? ** +**Why not change apps App babble modes at the same global level as the OS?** 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. -** Can the OS tell the keyboard what mode to use? ** +**Can the OS tell the keyboard what mode to use?** 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. One could use a keyboard macro to launch an app & switch modes for that app. diff --git a/users/miles2go/babl_chromeos.c b/users/miles2go/babl_chromeos.c index a0c461f24e..fd644fc5c5 100644 --- a/users/miles2go/babl_chromeos.c +++ b/users/miles2go/babl_chromeos.c @@ -14,7 +14,7 @@ https://support.google.com/docs/answer/181110?co=GENIE.Platform%3DDesktop&hl=en # ifdef BABL_CHROMEOS -bool babblepaste_chromeos(uint16_t keycode) { +bool babblePaste_chromeos(uint16_t keycode) { # ifdef BABL_MOVE BABLM(BABL_GO_LEFT_1C, SS_TAP(X_LEFT)); BABLM(BABL_GO_RIGHT_1C, SS_TAP(X_RIGHT)); diff --git a/users/miles2go/babl_emacs.c b/users/miles2go/babl_emacs.c index 201da0d1a3..87560b6eb8 100644 --- a/users/miles2go/babl_emacs.c +++ b/users/miles2go/babl_emacs.c @@ -69,6 +69,7 @@ bool babblePaste_emacs(uint16_t keycode) { # ifdef BABL_APP BABLM(BABL_APP_SAVE, SS_LCTL("x") SS_LCTL("s")); + BABLM(BABL_APP_SET_MARK, IMCTL(X_SPACE)); /// BABLM( BABL_APP_MULTI_SELECT, SS_LCTRL("x") "rt" ); // arguably BABLM(BABL_SPLIT_FRAME_VERT, SS_LCTRL("x") "3"); BABLM(BABL_UNSPLIT_FRAME_VERT, SS_LCTRL("u") SS_LCTRL("x") "0"); diff --git a/users/miles2go/babl_kitty.c b/users/miles2go/babl_kitty.c new file mode 100644 index 0000000000..44fd87e5ed --- /dev/null +++ b/users/miles2go/babl_kitty.c @@ -0,0 +1,153 @@ +/* Keyboard mappings for Kitty terminal +https://sw.kovidgoyal.net/kitty/index.html# + + A library to output the right key shortcut in any common app. +Given a global variable babble_mode to show the environment and a +key that calls the paste macro, do the right type of paste. +Setting the context is done by another macro, or TBD interaction with the host. + +Huge thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts +and +https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/jeebak/keymap.c +*/ + +#include QMK_KEYBOARD_H + +// #define TAB_MEANS TAB +/* #define TAB_MEANS_TAB to keep the meaning of "tab" and "window" used in kitty documentation. . + * Leaving tab undefined will mean that each babble window command applies to a tab, + * and each babble tab command applies to a window inside the kitty OS window. + */ +//#define TAB_MEANS_TAB + +#ifdef USE_BABBLEPASTE +# include "babblePaste.h" + +# ifdef BABL_KITTY + +bool babblePaste_kitty(uint16_t keycode) { +# ifdef BABL_MOVE + BABLM(BABL_GO_LEFT_1C, SS_TAP(X_LEFT)); + BABLM(BABL_GO_RIGHT_1C, SS_TAP(X_RIGHT)); + BABLM(BABL_GO_LEFT_WORD, IMCTL(X_LEFT)); + BABLM(BABL_GO_RIGHT_WORD, IMCTL(X_RIGHT)); + BABLM(BABL_GO_START_LINE, SS_TAP(X_HOME)); + BABLM(BABL_GO_END_LINE, SS_TAP(X_END)); + BABLM(BABL_GO_START_DOC, OMSFT(IMCTL(X_HOME))); + BABLM(BABL_GO_END_DOC, OMSFT(IMCTL(X_END))); + // leaving these for command line editing. + BABLM(BABL_GO_NEXT_LINE, SS_TAP(X_DOWN)); + BABLM(BABL_GO_PREV_LINE, SS_TAP(X_UP)); + // These are for kitty scrolling by one line + // BABLM(BABL_GO_NEXT_LINE, OMSFT(IMCTL(X_DOWN))); + // BABLM(BABL_GO_PREV_LINE, OMSFT(IMCTL(X_UP))); + // passthrough + BABLM(BABL_PGDN, OMSFT(IMCTL(X_PGDOWN))); // kitty pagedown + BABLM(BABL_PGUP, OMSFT(IMCTL(X_PGUP))); // kitty pageup + // passthrough to commanrd line/shell. + BABLM(BABL_DEL_RIGHT_1C, SS_LCTL("d")); + BABLM(BABL_DEL_LEFT_WORD, SS_LCTL("w")); // meta-DEL instead? + BABLM(BABL_DEL_RIGHT_WORD, SS_LALT("d")); + BABLM(BABL_DEL_TO_LINE_END, SS_LCTL("k")); + BABLM(BABL_DEL_TO_LINE_START, SS_LCTL("u")); + BABLM(BABL_GO_PARA_START, IMCTL(X_UP)); + BABLM(BABL_GO_PARA_END, IMCTL(X_DOWN)); + BABLM(BABL_MODE, "Kitty! "); +# endif +# ifdef BABL_OSKEYS + // cut isn't real, undo/redo are passthrough. + BABLM(BABL_UNDO, SS_LCTL("z")); + BABLM(BABL_REDO, SS_LCTL("y")); + BABLM(BABL_CUT, OMSFT(IMCTL(X_X))); + BABLM(BABL_COPY, OMSFT(IMCTL(X_C))); + BABLM(BABL_PASTE, OMSFT(IMCTL(X_V))); + BABLM(BABL_SELECT_ALL, SS_LCTL("a")); + BABLM(BABL_FIND, SS_LCTL("f")); // passthrough. + // BABLM(BABL_CLOSE_APP, IMALT(X_F4)); // gnome. + // BABLM(BABL_HELP, SS_TAP(X_F1)); // script to pop open kitty web page? + // 2 passthrough. + BABLM(BABL_FIND_NEXT, SS_LCTL("g")); // Gnome*/ + BABLM(BABL_FIND_PREV, OMSFT(IMCTL(X_G))); // Gnome*/ + // BABLM(BABL_FIND_NEXT (SS_LALT(X_F3)) ); //KDE */ + /* BABLM( BABL_FIND_REPLACE , (SS_LCTL("r")) ); // KDE */ + // BABLM(BABL_FIND_REPLACE, SS_LCTL("h")); // Gnome*/ + BABLM(BABL_RUNAPP, OMSFT(IMCTL(X_O))); // pass current selection to program. + BABLM(BABL_SWITCH_APP_NEXT, IMGUI(X_TAB)); + // BABLM(BABL_SWITCH_APP_LAST, OMSFT(IMALT(X_TAB))); + BABLM(BABL_WINDOW_NEXT, IMGUI(X_GRAVE)); // next OS window of kitty. + BABLM(BABL_WINDOW_PREV, OMSFT(IMGUI(X_GRAVE))); // NA? +# ifdef TAB_MEANS_TAB + BABLM(BABL_WINDOW_NEW, OMSFT(IMCTL(X_ENTER))); // a window is a window +# else + BABLM(BABL_WINDOW_NEW, OMSFT(IMCTL(X_T))); // a window is a tab +# endif + // KITTY - missing close window. + // BABLM( BABL_HELP, (SS_TAP(X_F1)) ); // NA? + // BABLM(BABL_LOCK, OMCTL(IMALT(X_L))); // NA passthrough + // BABLM(BABL_SCREENCAPTURE, IMSFT(X_PSCREEN)); // NA passthrough +# endif +# ifdef BABL_BROWSER + +# ifdef TAB_MEANS_TAB + // option A - do tab when I say tab. + BABLM(BABL_BROWSER_NEW_TAB, OMSFT(IMCTL(X_T))); + BABLM(BABL_BROWSER_CLOSE_TAB, OMSFT(IMCTL(X_Q))); + BABLM(BABL_BROWSER_NEXT_TAB, OMSFT(IMCTL(X_RIGHT))); + BABLM(BABL_BROWSER_PREV_TAB, OMSFT(IMCTL(X_LEFT))); + // ok, this is a bit of a stretch, overloading meaning of forwards/backwards + BABLM(BABL_BROWSER_FORWARD, OMSFT(IMCTL(X_DOT))); // move current kitty tab forwards + BABLM(BABL_BROWSER_BACK, OMSFT(IMCTL(X_COMMA))); // move current kitty tab back + // requires kitty config of "map ctrl+shift+f7 detach_window" + BABLM(BABL_BROWSER_REOPEN_LAST_TAB, IMCTL(X_F7)); // pop current frame into a window +# else // tab means window/frame. + // option B - do Kitty window (frame) when I say tab + BABLM(BABL_BROWSER_NEW_TAB, OMSFT(IMCTL(X_ENTER))); + BABLM(BABL_BROWSER_NEXT_TAB, OMSFT(IMCTL(X_LBRC))); + BABLM(BABL_BROWSER_PREV_TAB, OMSFT(IMCTL(X_RBRC))); + // ok, this is a bit of a stretch, overloading meaning of forwards/backwards + BABLM(BABL_BROWSER_FORWARD, OMSFT(IMCTL(X_F))); + BABLM(BABL_BROWSER_BACK, OMSFT(IMCTL(X_B))); + // kitty - questionable mental model - reopen current frame as a window + // requires kitty config of "map ctrl+shift+f6 detach_frame" + BABLM(BABL_BROWSER_REOPEN_LAST_TAB, IMCTL(X_F6)); // pop current frame into a window +# endif // tab means tab + + // BABLM(BABL_BROWSER_FIND, SS_LCTL("f")); + BABLM(BABL_BROWSER_BOOKMARK, SS_LCTL(SS_LSFT(SS_LALT("t")))); // bookmark == set tab title. + BABLM(BABL_BROWSER_DEV_TOOLS, OMSFT(IMCTL(X_F2))); // edit kitty config. + BABLM(BABL_BROWSER_RELOAD, OMSFT(IMCTL(X_DEL))); // reset terminal + BABLM(BABL_BROWSER_FULLSCREEN, OMSFT(IMCTL(X_F11))); + BABLM(BABL_BROWSER_ZOOM_IN, OMSFT(IMCTL(X_EQUAL))); + BABLM(BABL_BROWSER_ZOOM_OUT, OMSFT(IMCTL(X_MINUS))); + // Again, breaking model to overload "view source" + BABLM(BABL_BROWSER_VIEWSRC, OMSFT(IMCTL(X_O))); // open URL in browser + +# endif +# ifdef BABL_APP + BABLM(BABL_APP_SAVE, SS_LCTL("s")); // passthrough. +# ifdef TAB_MEANS_TAB // frames are called windows. + BABLM(BABL_SPLIT_FRAME_VERT, OMSFT(IMCTL(X_ENTER))); // add new frame in kitty window + BABLM(BABL_UNSPLIT_FRAME_VERT, OMSFT(IMCTL(X_W))); // close window + // BUG, this breaks the mental model. move the current frame forward/back in rotation + BABLM(BABL_SPLIT_FRAME_HORIZONTAL, OMSFT(IMCTL(X_F))); + BABLM(BABL_UNSPLIT_FRAME_HORIZONTAL, OMSFT(IMCTL(X_B))); + // KITTY - missing ctrl shift ` = move frame to top. + BABLM(BABL_NEXT_FRAME, OMSFT(IMCTL(X_RBRC))); + BABLM(BABL_PREV_FRAME, OMSFT(IMCTL(X_LBRC))); +# else // splits are tabs + BABLM(BABL_SPLIT_FRAME_VERT, OMSFT(IMCTL(X_T))); + BABLM(BABL_UNSPLIT_FRAME_VERT, OMSFT(IMCTL(X_Q))); // close Tab + BABLM(BABL_NEXT_FRAME, OMSFT(IMCTL(X_RIGHT))); + BABLM(BABL_PREV_FRAME, OMSFT(IMCTL(X_LEFT))); + // ok, this is a bit of a stretch, overloading meaning of forwards/backwards + BABLM(BABL_SPLIT_FRAME_HORIZONTAL, OMSFT(IMCTL(X_DOT))); // move current kitty tab forwards + BABLM(BABL_UNSPLIT_FRAME_HORIZONTAL, OMSFT(IMCTL(X_COMMA))); // move current kitty tab back +# endif // tab means tab +# endif + + // Todo, ring bell, flash light, show user this isn't supported + return false; +} + +# endif /* kitty mode */ +#endif diff --git a/users/miles2go/babl_nano.c b/users/miles2go/babl_nano.c new file mode 100644 index 0000000000..ebbe9b2bc5 --- /dev/null +++ b/users/miles2go/babl_nano.c @@ -0,0 +1,77 @@ +/* A library to output the right key shortcut in any common app. +Given a global variable babble_mode to show the environment and a +key that calls the paste macro, do the right type of paste. +Setting the context is done by another macro, or TBD interaction with the host. + +Nano mode is probably most useful for people who don't usually use Nano, but +sometimes find themselves using it. + +https://www.nano-editor.org/dist/latest/cheatsheet.html +*/ + +#include QMK_KEYBOARD_H + +#ifdef USE_BABBLEPASTE +# include "babblePaste.h" + +# ifdef BABL_NANO + +// probably should allow meta to not be ALT +# define DMETA IMALT + +bool babblePaste_nano(uint16_t keycode) { +# ifdef BABL_MOVE + BABLM(BABL_GO_LEFT_1C, SS_LCTRL("b")); + BABLM(BABL_GO_RIGHT_1C, SS_LCTL("f")); + BABLM(BABL_GO_LEFT_WORD, IMCTL(X_LEFT)); + BABLM(BABL_GO_RIGHT_WORD, IMCTL(X_RIGHT)); + BABLM(BABL_GO_START_LINE, SS_LCTRL("a")); + BABLM(BABL_GO_END_LINE, SS_LCTRL("e")); + BABLM(BABL_GO_START_DOC, IMALT(X_BSLS)); + BABLM(BABL_GO_END_DOC, IMALT(X_SLASH)); + BABLM(BABL_GO_NEXT_LINE, SS_LCTRL("n")); + BABLM(BABL_GO_PREV_LINE, SS_LCTRL("p")); + BABLM(BABL_GO_PARA_START, IMCTL(X_UP)); + BABLM(BABL_GO_PARA_END, IMCTL(X_DOWN)); + BABLM(BABL_PGDN, SS_LCTRL("v")); + BABLM(BABL_PGUP, SS_LCTRL("y")); + BABLM(BABL_DEL_RIGHT_1C, SS_LCTRL("d")); + BABLM(BABL_DEL_LEFT_WORD, IMCTL(X_BSPC)); + BABLM(BABL_DEL_RIGHT_WORD, IMCTL(X_DEL)); + // BABLM(BABL_DEL_TO_LINE_END, SS_LCTRL("k")); + // BABLM(BABL_DEL_TO_LINE_START, SS_TAP(X_ESCAPE) "0" SS_LCTRL("k")); + BABLM(BABL_MODE, "Nano "); +# endif +# ifdef BABL_OSKEYS + BABLM(BABL_UNDO, SS_LALT("u")); + BABLM(BABL_REDO, SS_LALT("e")); + BABLM(BABL_CUT, SS_LCTRL("k")); // arguably b/c line based, not selection + BABLM(BABL_COPY, SS_LALT("6")); // arguably + BABLM(BABL_PASTE, SS_LCTRL("u")); + // BABLM(BABL_SELECT_ALL, SS_LCTRL("x") "h"); + BABLM(BABL_FIND, SS_LCTRL("w")); + BABLM(BABL_FIND_NEXT, SS_LALT("w")); + BABLM(BABL_FIND_PREV, SS_LALT("q")); + BABLM(BABL_FIND_REPLACE, SS_LALT("r")); + BABLM(BABL_RUNAPP, SS_LCTL("t")); + BABLM(BABL_WINDOW_NEXT, OMALT(IMSFT(X_DOT))); + BABLM(BABL_WINDOW_PREV, OMALT(IMSFT(X_COMMA))); + BABLM(BABL_WINDOW_NEW, IMCTL(X_R) IMALT(X_F)); // + BABLM(BABL_CLOSE_APP, SS_LCTRL("x")); + BABLM(BABL_HELP, SS_LCTRL("g")); + + // BABLM( BABL_LOCK, () ); // lock buffer? Too many options. + // BABLM( BABL_SCREENCAPTURE, () ); // requires plugin? + +# endif + +# ifdef BABL_APP + BABLM(BABL_APP_SAVE, SS_LCTRL("s")); // save file blurs app & os. Move? + BABLM(BABL_APP_SET_MARK, SS_LALT("a")); +# endif + + // Todo, ring bell, flash light, show user this isn't supported + return false; +} +# endif /* nano mode*/ +#endif diff --git a/users/miles2go/babl_vi.c b/users/miles2go/babl_vi.c index 7eebc0b208..f4b1d39d99 100644 --- a/users/miles2go/babl_vi.c +++ b/users/miles2go/babl_vi.c @@ -59,6 +59,7 @@ bool babblePaste_vi(uint16_t keycode) { # ifdef BABL_APP BABLM(BABL_APP_SAVE, SS_TAP(X_ESCAPE) ":w"); + BABLM(BABL_APP_SET_MARK, SS_TAP(X_ESCAPE) "ma"); // real vi people probably want multiple marks,not just a # ifdef BABL_APP_WINDOWSPLITTING BABLM(BABL_SPLIT_FRAME_VERT, SS_TAP(X_ESCAPE) ":vsplit"); BABLM(BABL_UNSPLIT_FRAME_VERT, SS_TAP(X_ESCAPE) ":hide"); // debatable. diff --git a/users/miles2go/config.h b/users/miles2go/config.h index 3fb52b8a59..a704df4b55 100644 --- a/users/miles2go/config.h +++ b/users/miles2go/config.h @@ -34,6 +34,7 @@ #define USE_BABBLEPASTE // All options +#define BABL_MODSWAP #define BABL_MOVE // Uncomment to add basic cursor movement #define BABL_OSKEYS // This adds Cut, paste, window movement and common OS shortcuts #define BABL_BROWSER // Browser shortcuts, with Chrome/Firefox as the default. @@ -44,10 +45,11 @@ #define BABL_APP_WINDOWSPLITTING // splitting frames & windows //All OSes -#define BABL_WINDOWS + +//#define BABL_WINDOWS #define BABL_READMUX -#define BABL_VI +//#define BABL_VI #define BABL_MAC #define BABL_LINUX -#define BABL_EMACS +//#define BABL_EMACS #define BABL_CHROMEOS diff --git a/users/miles2go/milestogo.c b/users/miles2go/milestogo.c index f1da2f4d7a..1c7f174e4a 100644 --- a/users/miles2go/milestogo.c +++ b/users/miles2go/milestogo.c @@ -9,6 +9,8 @@ __attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t * bool move_is_on = false; // track if we are in _MOV layer bool sym_is_on = false; // track if we are in _SYM layer + + // Defines actions for global custom keycodes // Then runs the _keymap's record handier if not processed here bool process_record_user(uint16_t keycode, keyrecord_t *record) { @@ -16,24 +18,26 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #ifdef USE_BABBLEPASTE if (keycode > BABBLE_START && keycode < BABBLE_END_RANGE) { - if (record->event.pressed) { // is there a case where this isn't desired? - babblePaste(keycode); + if (record->event.pressed) { + babblePaste(keycode, 1); } else { - return true; + babblePaste(keycode, 0); } } #endif switch (keycode) { - case _QWERTY: + case KC_QWERTY: if (record->event.pressed) { - set_single_persistent_default_layer(_QWERTY); + layer_off(_CDH); + default_layer_set(_QWERTY); } break; - case _CDH: + case KC_CDH: if (record->event.pressed) { - set_single_persistent_default_layer(_CDH); + layer_on(_CDH); + default_layer_set(_CDH); } break; @@ -71,9 +75,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return process_record_keymap(keycode, record); } -void babble_led_user(void) { +void babble_modeswitch_user(uint8_t mode) { #ifdef USE_BABLPASTE - extern uint8_t babble_mode; + extern uint8_t babble_mode; // still using global. why? # ifdef BABL_WINDOWS if (babble_mode == BABL_WINDOWS_MODE) { @@ -140,3 +144,10 @@ void babble_led_user(void) { # endif #endif // bablepaste } + + +// we always return true here, so that each keyboard can use it's own +// led_update_kb() function +bool led_update_user(led_t led_state ) { + return true; +} \ No newline at end of file diff --git a/users/miles2go/milestogo.h b/users/miles2go/milestogo.h index dfb344212e..3a99f6d2a8 100644 --- a/users/miles2go/milestogo.h +++ b/users/miles2go/milestogo.h @@ -1,4 +1,4 @@ -/* Modified from +/* Modified from Copyright 2017 Christopher Courtney @drashna This program is free software: you can redistribute it and/or modify @@ -15,117 +15,99 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ - #pragma once #include "quantum.h" #include "version.h" #include "eeprom.h" - #ifdef USE_BABBLEPASTE -#include "babblePaste.h" -#endif +# include "babblePaste.h" +#endif #ifdef RGB_MATRIX_ENABLE -#include "rgb_matrix.h" +# include "rgb_matrix.h" #endif #define USERSPACE_ACTIVE /* Define layer names */ -enum userspace_layers { - _QWERTY=0, - _CDH, - _SYM, - _MOV, - _DMOV, - _NUM -}; - +enum userspace_layers { _QWERTY = 0, _CDH, _SYM, _MOV, _DMOV, _NUM }; /* define modifiers here, since MOD_* doesn't seem to work for these */ -#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) -#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL)) -#define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT)) -#define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) +#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTRL)) +#define MODS_ALT_MASK (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT)) +#define MODS_GUI_MASK (MOD_BIT(KC_LGUI) | MOD_BIT(KC_RGUI)) #if defined(BABBLE_END_RANGE) - #define USER_START BABBLE_END_RANGE +# define USER_START BABBLE_END_RANGE #else - #if defined(KEYMAP_SAFE_RANGE) - #define USER_START KEYMAP_SAFE_RANGE - #else - #define USER_START SAFE_RANGE - #endif +# if defined(KEYMAP_SAFE_RANGE) +# define USER_START KEYMAP_SAFE_RANGE +# else +# define USER_START SAFE_RANGE +# endif #endif enum userspace_custom_keycodes { - EPRM = BABBLE_END_RANGE, // Resets EEPROM do defaults (as in eeconfig_init) - VRSN, // Prints QMK Firmware and board info - KC_QWERTY, // Sets default layer to QWERTY - KC_CDH, // Sets default layer to COLEMAK DH + EPRM = BABBLE_END_RANGE, // Resets EEPROM do defaults (as in eeconfig_init) + VRSN, // Prints QMK Firmware and board info + KC_QWERTY, // Sets default layer to QWERTY + KC_CDH, // Sets default layer to COLEMAK DH KC_MAKE, - VIBRK, // escape : - DHPASTE, // allow pasting via qwerty V,not colemak V - TMUX, // TMUX Ctrl-b - ALTSYM, // Alt when held, toggle MOV when tapped + VIBRK, // escape : + DHPASTE, // allow pasting via qwerty V,not colemak V + TMUX, // TMUX Ctrl-b + ALTSYM, // Alt when held, toggle MOV when tapped GUISYM, SPCMOV, - SAVE, // placeholder for CTRL-S while I get babble working again. - NEW_SAFE_RANGE //Keymap specific codes come AFTER this + SAVE, // placeholder for CTRL-S while I get babble working again. + NEW_SAFE_RANGE // Keymap specific codes come AFTER this }; - + #define QWERTY KC_QWERTY #define COLEMAK KC_CDH #define KC_RESET RESET - - #if (!defined(LAYOUT) && defined(KEYMAP)) -#define LAYOUT KEYMAP +# define LAYOUT KEYMAP #endif -#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) +#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) +#define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T +#define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G +#define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B -#define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T -#define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G -#define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B +#define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P +#define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN +#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH -#define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P -#define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN -#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH +#define ______________COLEMAK_MOD_DH_L1____________ KC_Q, KC_W, KC_F, KC_P, KC_B +#define ______________COLEMAK_MOD_DH_L2____________ KC_A, KC_R, KC_S, KC_T, KC_G +#define ______________COLEMAK_MOD_DH_L3____________ KC_Z, KC_X, KC_C, KC_D, KC_V +#define ______________COLEMAK_MOD_DH_R1____________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN +#define ______________COLEMAK_MOD_DH_R2____________ KC_M, KC_N, KC_E, KC_I, KC_O +#define ______________COLEMAK_MOD_DH_R3____________ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLASH -#define ______________COLEMAK_MOD_DH_L1____________ KC_Q, KC_W, KC_F, KC_P, KC_B -#define ______________COLEMAK_MOD_DH_L2____________ KC_A, KC_R, KC_S, KC_T, KC_G -#define ______________COLEMAK_MOD_DH_L3____________ KC_Z, KC_X, KC_C, KC_D, KC_V +#define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5 +#define ________________NUMBER_RIGHT_______________ KC_6, KC_7, KC_8, KC_9, KC_0 -#define ______________COLEMAK_MOD_DH_R1____________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN -#define ______________COLEMAK_MOD_DH_R2____________ KC_M, KC_N, KC_E, KC_I, KC_O -#define ______________COLEMAK_MOD_DH_R3____________ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLASH +#define ________________FKEYS__LEFT________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 +#define ________________FKEYS__RIGHT_______________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 +#define ________________FKEYS__FAR_RIGHT___________ KC_F11, KC_F12, KC_PSCR, KC_HOME, KC_END +#define ________________NAV_NUMBER_LEFT____________ KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, XXXXXXX -#define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5 -#define ________________NUMBER_RIGHT_______________ KC_6, KC_7, KC_8, KC_9, KC_0 - -#define ________________FKEYS__LEFT________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 -#define ________________FKEYS__RIGHT_______________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 -#define ________________FKEYS__FAR_RIGHT___________ KC_F11, KC_F12, KC_PSCR, KC_HOME, KC_END - -#define ________________NAV_NUMBER_LEFT____________ KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, XXXXXXX - -#define ___________________BLANK___________________ _______, _______, _______, _______, _______ -#define ___________________BLOCK___________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX - - - -// BabblePaste -#define ____________BABBLE_SWITCH_L________________ B_MAC , B_READ , B_LINUX, B_VI, _______ -#define ____________BABBLE_SWITCH_R________________ B_CROM, B_LINUX, B_WIN , QWERTY, COLEMAK +#define ___________________BLANK___________________ _______, _______, _______, _______, _______ +#define ___________________BLOCK___________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX +// BabblePaste +#define ____________BABBLE_SWITCH_L________________ B_MAC, B_READ, B_LINUX, B_VI, _______ +#define ____________BABBLE_SWITCH_R________________ B_CROM, B_LINUX, B_WIN, QWERTY, COLEMAK /////////MOVE - Full size keyboard version @@ -140,17 +122,16 @@ enum userspace_custom_keycodes { * `--------------------------------------------' `--------------------------------------------' */ /* Movement layer similar to Extend, but fully enriched with babblepaste */ -#define ____________BABBLE_MOV_LNUM________________ B_LOCK, B_PAPP, B_NAPP, B_PASTV, XXXX +#define ____________BABBLE_MOV_LNUM________________ B_LOCK, B_PAPP, B_NAPP, B_PASTV, XXXX -#define ____________BABBLE_MOV_L1__________________ KC_ESC, B_FINDP, B_FIND, B_FINDN, B_NCEL -#define ____________BABBLE_MOV_L2__________________ B_SELA , MO(_DMOV),KC_LSFT,B_UNDO, B_HSPLIT -#define ____________BABBLE_MOV_L3__________________ B_VSPLIT, B_CUT, B_COPY, B_PASTE, B_PASTE - -#define ____________BABBLE_MOV_RNUM________________ XXXX, XXXX, B_KEYB, B_BDEV, B_LOCK -#define ____________BABBLE_MOV_R1__________________ B_PTOP, B_GSOL, B_UP, B_GEOL, B_PEND -#define ____________BABBLE_MOV_R2__________________ B_L1W, B_L1C, B_DOWN, B_R1C, B_R1W -#define ____________BABBLE_MOV_R3__________________ B_PWIN, B_PTAB, B_NTAB, B_NXTB, B_NWIN +#define ____________BABBLE_MOV_L1__________________ KC_ESC, B_FINDP, B_FIND, B_FINDN, B_NCEL +#define ____________BABBLE_MOV_L2__________________ B_SELA, MO(_DMOV), KC_LSFT, B_UNDO, B_HSPLIT +#define ____________BABBLE_MOV_L3__________________ B_VSPLIT, B_CUT, B_COPY, B_PASTE, B_PASTE +#define ____________BABBLE_MOV_RNUM________________ XXXX, XXXX, B_KEYB, B_BDEV, B_LOCK +#define ____________BABBLE_MOV_R1__________________ B_PTOP, B_GSOL, B_UP, B_GEOL, B_PEND +#define ____________BABBLE_MOV_R2__________________ B_L1W, B_L1C, B_DOWN, B_R1C, B_R1W +#define ____________BABBLE_MOV_R3__________________ B_PWIN, B_PTAB, B_NTAB, B_NXTB, B_NWIN // Move in a direction, deleting as we go, or do opposite of Mov layer action */ /* ,--------------------------------------------. ,--------------------------------------------. @@ -160,130 +141,162 @@ enum userspace_custom_keycodes { * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| * 03 |Vsplit- | Cut | Copy | Paste |Paste | | App-- | ZoomOut| NewWin | ZoomIn | App+ | * `--------------------------------------------' `--------------------------------------------' - */ -#define _________BABBLE_DELMOV_L1__________________ KC_ESC, _______, B_RPLACE, B_MSEL, B_PASTV -#define _________BABBLE_DELMOV_L2__________________ XXXXXXX, _______, _______, B_REDO, B_HUNSPT -#define _________BABBLE_DELMOV_L3__________________ B_VUNSPT,B_CUT, B_COPY, B_PASTE, B_PRVFM + */ +#define _________BABBLE_DELMOV_L1__________________ KC_ESC, _______, B_RPLACE, B_MSEL, B_PASTV +#define _________BABBLE_DELMOV_L2__________________ XXXXXXX, _______, _______, B_REDO, B_HUNSPT +#define _________BABBLE_DELMOV_L3__________________ B_VUNSPT, B_CUT, B_COPY, B_PASTE, B_PRVFM -#define _________BABBLE_DELMOV_R1__________________ XXXXXXX, B_DSOL, _______, B_DEOL, XXXXXXX -#define _________BABBLE_DELMOV_R2__________________ B_DLW, KC_BSPC, _______, B_DEL, B_DRW -#define _________BABBLE_DELMOV_R3__________________ B_NAPP, B_ZOUT, B_WINN, B_ZIN, B_PAPP +#define _________BABBLE_DELMOV_R1__________________ XXXXXXX, B_DSOL, _______, B_DEOL, XXXXXXX +#define _________BABBLE_DELMOV_R2__________________ B_DLW, KC_BSPC, _______, B_DEL, B_DRW +#define _________BABBLE_DELMOV_R3__________________ B_NAPP, B_ZOUT, B_WINN, B_ZIN, B_PAPP /* SYM / excel / programming logic +=1 optimization*/ /* ,----------------------------------. ,----------------------------------. - * 01 | | [ | ] | { | | | | } | ( | ) | | + * 01 | | [ | ] | { | } | | { | } | ( | ) | | * |------+------+------+------+------| |------+------+------+------+------| * 02 | ^ | ! | = | 0 | $ | | # | 1 | - | + | ` | * |------+------+------+------+------| |------+------+------+------+------| * 03 | \ | % | @ | | | _ | | * | & | ~ | . | / | * `----------------------------------' `----------------------------------' Memnonics - ^begining end$ . &&/|| on strong finger. #at start of line. - * (multiply) opposite / - Minus is left of plus as normal. + ^begining end$ . &&/|| on strong finger. #at start of line. + * (multiply) opposite / + Minus is left of plus as normal. ` is a shifted '' - ~/ is an outwards roll. / .* is a roll. !=0 is a roll , ++1 --1 roll. - _ is hard to get to. + ~/ is an outwards roll. / .* is a roll. !=0 is a roll , ++1 --1 roll. + _ is hard to get to. + */ +#define ___________________SYM_L1__________________ XXXXXXX, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR +#define ___________________SYM_L2__________________ KC_CIRC, KC_EXLM, KC_EQL, KC_0, KC_DLR +#define ___________________SYM_L3__________________ KC_BSLS, KC_PERC, KC_AT, KC_PIPE, KC_UNDS + +#define ___________________SYM_R1__________________ KC_LCBR, KC_RCBR, KC_LPRN, KC_RPRN, XXXXXXX +#define ___________________SYM_R2__________________ KC_HASH, KC_1, KC_MINS, KC_PLUS, KC_GRAVE +#define ___________________SYM_R3__________________ KC_ASTR, KC_AMPR, KC_TILDE, KC_DOT, KC_SLASH +// Move and brackets - 40% optimization. +/* ,--------------------------------------------. ,--------------------------------------------. + * 01 | ESC | ( | ) | { | } | | PgDn |LineStrt| Up | EOL | PGUp | + * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| + * 02 | [ |DelMove | Shift | Undo | ] | | WrdLft | Left | Down | Right | WrdRght| + * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| + * 03 | CDH | Cut | Copy | Paste | Paste | | Babl-- | Tab-- | NewTab | Tab++ | Babl++ | + * `--------------------------------------------' `--------------------------------------------' */ -#define ___________________SYM_L1__________________ XXXXXXX, KC_LBRC, KC_RBRC, KC_LCBR, XXXXXXX -#define ___________________SYM_L2__________________ KC_CIRC, KC_EXLM, KC_EQL, KC_0, KC_DLR -#define ___________________SYM_L3__________________ KC_BSLS, KC_PERC, KC_AT, KC_PIPE, KC_UNDS - -#define ___________________SYM_R1__________________ XXXXXXX, KC_RCBR, KC_LPRN, KC_RPRN, XXXXXXX -#define ___________________SYM_R2__________________ KC_HASH, KC_KP_1, KC_MINS, KC_PLUS, KC_GRAVE -#define ___________________SYM_R3__________________ KC_PERC, KC_TILDE,KC_AMPR, KC_DOT, KC_SLASH +#define __________40_______MOV_L1__________________ KC_ESC, KC_LPRN, KC_RPRN, KC_LCBR, KC_RCBR +#define __________40_______MOV_L2__________________ KC_LBRC, MO(_DMOV), KC_LSFT, KC_UNDO, KC_RBRC +#define __________40_______MOV_L3__________________ KC_CDH, B_CUT, B_COPY, B_PASTE, B_PASTE +#define __________40_______MOV_R1__________________ B_PGDN, B_GSOL, B_UP, B_GEOL, B_PGUP +#define __________40_______MOV_R2__________________ B_L1W, B_L1C, B_DOWN, B_R1C, B_R1W +#define __________40_______MOV_R3__________________ B_DEC, B_PTAB, B_NTAB, B_NXTB, B_INC -/* excel centric symbol layer*/ - /* ,--------------------------------------------. ,--------------------------------------------. - * 01 | DelRow|InsCol | SelCol |PasteVal| | | . | 1 | 2 | 3 | | +// Move in a direction, deleting as we go, or do opposite of Mov layer action +/* ,--------------------------------------------. ,--------------------------------------------. + * 01 | Esc | | B_print| | | | Zoom-- |LineStrt| . | EOL | Zoom++| * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| - * 02 | - |InsRow | SelRow | Undo | + | | * | 4 | 5 | 6 | - | + * 02 | | Do_DEL | Shift | Redo | | | WrdLft | Left | . | Right | WrdRght| * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| - * 03 | Undo | Cut | Copy | Paste |Paste | | / | 7 | 8 | 9 | Paste | + * 03 | Qwerty | Cut | Copy | Paste |Paste | | WIN-- |PrvFrame| Split |nxtFrame| Win++ | * `--------------------------------------------' `--------------------------------------------' - */ -#define _________________EXCEL_L1__________________ B_DROW, B_ICOL, B_SELC, B_PASTV, XXXX -#define _________________EXCEL_L2__________________ KC_MINS, B_ICOL, B_SELC, B_UNDO, KC_PLUS -#define _________________EXCEL_L3__________________ B_UNDO, B_CUT, B_COPY, B_PASTE, B_PASTE - -#define _________________EXCEL_R1__________________ XXXXXXX, KC_1, KC_2, KC_3, XXXXXXX -#define _________________EXCEL_R2__________________ KC_ASTR, KC_4, KC_5, KC_6, KC_MINS -#define _________________EXCEL_R3__________________ KC_SLASH, KC_7, KC_8, KC_8, B_PASTE +#define ____________40__DELMOV_L1__________________ KC_ESC, XXXXXXX, B_MODE, XXXXXXX, XXXXXXX +#define ____________40__DELMOV_L2__________________ XXXXXXX, _______, _______, B_REDO, XXXXXXX +#define ____________40__DELMOV_L3__________________ KC_QWERTY, _______, _______, _______, _______ +#define ____________40__DELMOV_R1__________________ B_ZOUT, B_DSOL, _______, B_DEOL, B_ZIN +#define ____________40__DELMOV_R2__________________ B_DLW, KC_BSPC, _______, B_DEL, B_DRW +#define ____________40__DELMOV_R3__________________ B_PWIN, B_PRVFM, B_VSPLIT, B_NXTFM, B_NWIN -/* Based on BEKL 15 punctuation -* ,----------------------------------. ,----------------------------------. - * 01 | | < | $ | > | | | | [ | _ | ] | | +/* NUM + symbol / programming logic +=1 optimization*/ +/* ,----------------------------------. ,----------------------------------. + * 01 | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | * |------+------+------+------+------| |------+------+------+------+------| - * 02 | \ | ( | "" | ) | # | | % | { | = | } | "|" | + * 02 | ^ | ! | = | 0 | $ | | # | 1 | - | + | ` | * |------+------+------+------+------| |------+------+------+------+------| - * 03 | | : | * | + | | | | & | ^ | ~ | | + * 03 | \ | % | @ | | | _ | | * | & | ~ | . | / | * `----------------------------------' `----------------------------------' Memnonics - + ^begining end$ . &&/|| on strong finger. #at start of line. + Minus is left of plus as normal. ` is a shifted '' + ~/ and is an outwards roll. / * is a roll. + _ is hard to get to. */ -#define ______________BEKL_SYM_L1__________________ XXXXXXX, KC_LBRC, KC_RBRC, KC_LCBR, XXXXXXX -#define ______________BEKL_SYM_L2__________________ KC_CIRC, KC_EXLM, KC_EQL, KC_0, KC_DLR -#define ______________BEKL_SYM_L3__________________ KC_BSLS, KC_PERC, KC_AT, KC_PIPE, KC_UNDS - -#define ______________BEKL_SYM_R1__________________ XXXXXXX, KC_RCBR, KC_LPRN, KC_RPRN, XXXXXXX -#define ______________BEKL_SYM_R2__________________ KC_HASH, KC_KP_1, KC_MINS, KC_PLUS, KC_GRAVE -#define ______________BEKL_SYM_R3__________________ KC_PERC, KC_TILDE,KC_AMPR, KC_DOT, KC_SLASH - -// NUM + +#define __________40_______NUM_L1__________________ ________________NUMBER_LEFT________________ +#define __________40_______NUM_L2__________________ KC_CIRC, KC_EXLM, KC_EQL, KC_0, KC_DLR +#define __________40_______NUM_L3__________________ KC_BSLS, KC_PERC, KC_AT, KC_PIPE, KC_UNDS + +#define __________40_______NUM_R1__________________ ________________NUMBER_RIGHT_______________ +#define __________40_______NUM_R2__________________ KC_HASH, KC_1, KC_MINS, KC_PLUS, KC_GRAVE +#define __________40_______NUM_R3__________________ KC_ASTR, KC_AMPR, KC_TILDE, KC_DOT, KC_SLASH + +// NUM /* ,----------------------------------. ,----------------------------------. * 01 | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | * |------+------+------+------+------| |------+------+------+------+------| - * 02 | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | + * 02 | F1 | F2 | F3 | F4 | F5 | | + | 4 | 5 | 6 | - | * |------+------+------+------+------| |------+------+------+------+------| - * 03 | F11 | F12 | | | QWERT| | CDH | | | | | + * 03 | F11 | F12 | | CDH| QWERT| | 0 | 1 | 2 | 3 | . | * `----------------------------------' `----------------------------------' */ - -#define ___________________NUM_L1__________________ ________________NUMBER_LEFT________________ -#define ___________________NUM_L2__________________ ________________FKEYS__LEFT________________ -#define ___________________NUM_L3__________________ KC_F11, KC_F11, XXXXXXX, XXXXXXX, QWERTY - -#define ___________________NUM_R1__________________ ________________NUMBER_RIGHT_______________ -#define ___________________NUM_R2__________________ ________________FKEYS__RIGHT_______________ -#define ___________________NUM_R3__________________ COLEMAK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX - - - -/* NUM / excel / programming logic +=1 optimization*/ + +#define ___________________NUM_L1__________________ ________________NUMBER_LEFT________________ +#define ___________________NUM_L2__________________ ________________FKEYS__LEFT________________ +#define ___________________NUM_L3__________________ KC_F11, KC_F11, XXXXXXX, XXXXXXX, QWERTY + +#define ___________________NUM_R1__________________ ________________NUMBER_RIGHT_______________ +#define ___________________NUM_R2__________________ KC_PLUS, KC_4, KC_5, KC_6, KC_MINS +#define ___________________NUM_R3__________________ KC_0, KC_1, KC_2, KC_3, KC_DOT + +// Standard Sym /* ,----------------------------------. ,----------------------------------. - * 01 | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - * |------+------+------+------+------| |------+------+------+------+------| - * 02 | ^ | ! | = | 0 | $ | | # | 1 | - | + | ` | + * 01 | ! | @ | # | $ | % | | ^ | & | * | ( | ) | * |------+------+------+------+------| |------+------+------+------+------| - * 03 | \ | % | @ | | | _ | | * | & | ~ | . | / | - * `----------------------------------' `----------------------------------' - Memnonics - ^begining end$ . &&/|| on strong finger. #at start of line. * missing? - Minus is left of plus as normal. ` is a shifted '' - ~/ is an outwards roll. / * is a roll. - _ is hard to get to. - */ -#define __________40_______NUM_L1__________________ ________________NUMBER_LEFT________________ -#define __________40_______NUM_L2__________________ KC_CIRC, KC_EXLM, KC_EQL, KC_0, KC_DLR -#define __________40_______NUM_L3__________________ KC_BSLS, KC_PERC, KC_AT, KC_PIPE, KC_UNDS - -#define __________40_______NUM_R1__________________ ________________NUMBER_RIGHT_______________ -#define __________40_______NUM_R2__________________ KC_HASH, KC_KP_1, KC_MINS, KC_PLUS, KC_GRAVE -#define __________40_______NUM_R3__________________ KC_PERC, KC_TILDE, KC_AMPR,KC_DOT, KC_SLASH - +#define __________________SSYM_L1__________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC +#define __________________SSYM_R1__________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN + +#define _________________ADJUST_L1_________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG +#define _________________ADJUST_L2_________________ MU_TOG, CK_TOGG, AU_ON, AU_OFF, AG_NORM +#define _________________ADJUST_L3_________________ RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, KC_RGB_T + +#define _________________ADJUST_R1_________________ KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5 +#define _________________ADJUST_R2_________________ AG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN +#define _________________ADJUST_R3_________________ MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT + +/* excel centric symbol layer*/ +/* ,--------------------------------------------. ,--------------------------------------------. +* 01 | DelRow|InsCol | SelCol |PasteVal| | | . | 1 | 2 | 3 | | +* |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| +* 02 | - |InsRow | SelRow | Undo | + | | * | 4 | 5 | 6 | - | +* |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| +* 03 | Undo | Cut | Copy | Paste |Paste | | / | 7 | 8 | 9 | Paste | +* `--------------------------------------------' `--------------------------------------------' -#define _________________ADJUST_L1_________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG -#define _________________ADJUST_L2_________________ MU_TOG , CK_TOGG, AU_ON, AU_OFF, AG_NORM -#define _________________ADJUST_L3_________________ RGB_RMOD,RGB_HUD,RGB_SAD, RGB_VAD, KC_RGB_T +*/ +#define _________________EXCEL_L1__________________ B_DROW, B_ICOL, B_SELC, B_PASTV, XXXX +#define _________________EXCEL_L2__________________ KC_MINS, B_ICOL, B_SELC, B_UNDO, KC_PLUS +#define _________________EXCEL_L3__________________ B_UNDO, B_CUT, B_COPY, B_PASTE, B_PASTE -#define _________________ADJUST_R1_________________ KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5 -#define _________________ADJUST_R2_________________ AG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN -#define _________________ADJUST_R3_________________ MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT +#define _________________EXCEL_R1__________________ XXXXXXX, KC_1, KC_2, KC_3, XXXXXXX +#define _________________EXCEL_R2__________________ KC_ASTR, KC_4, KC_5, KC_6, KC_MINS +#define _________________EXCEL_R3__________________ KC_SLASH, KC_7, KC_8, KC_8, B_PASTE +/* Based on BEKL 15 punctuation + * ,----------------------------------. ,----------------------------------. + * 01 | | < | $ | > | | | | [ | _ | ] | | + * |------+------+------+------+------| |------+------+------+------+------| + * 02 | \ | ( | "" | ) | # | | % | { | = | } | "|" | + * |------+------+------+------+------| |------+------+------+------+------| + * 03 | | : | * | + | | | | & | ^ | ~ | | + * `----------------------------------' `----------------------------------' + */ +#define ______________BEKL_SYM_L1__________________ XXXXXXX, KC_LBRC, KC_RBRC, KC_LCBR, XXXXXXX +#define ______________BEKL_SYM_L2__________________ KC_CIRC, KC_EXLM, KC_EQL, KC_0, KC_DLR +#define ______________BEKL_SYM_L3__________________ KC_BSLS, KC_PERC, KC_AT, KC_PIPE, KC_UNDS +#define ______________BEKL_SYM_R1__________________ XXXXXXX, KC_RCBR, KC_LPRN, KC_RPRN, XXXXXXX +#define ______________BEKL_SYM_R2__________________ KC_HASH, KC_KP_1, KC_MINS, KC_PLUS, KC_GRAVE +#define ______________BEKL_SYM_R3__________________ KC_PERC, KC_TILDE, KC_AMPR, KC_DOT, KC_SLASH diff --git a/users/miles2go/readme.md b/users/miles2go/readme.md index b55f51b15f..57983660be 100644 --- a/users/miles2go/readme.md +++ b/users/miles2go/readme.md @@ -3,7 +3,7 @@ This is my personal userspace file. Most of my code exists here, as it's heavily shared. ## Custom Keycodes -See the babblepaste.txt readme +See the babblepaste.md readme ## Layer Indication diff --git a/users/miles2go/rules.mk b/users/miles2go/rules.mk index 7fb7719527..b7a7dcdba8 100644 --- a/users/miles2go/rules.mk +++ b/users/miles2go/rules.mk @@ -1,4 +1,4 @@ -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 +SRC += milestogo.c babblePaste.c babl_windows.c babl_mac.c babl_vi.c babl_readmux.c babl_chromeos.c babl_kitty.c babl_linux.c LTO_ENABLE = yes ifeq ($(strip $(MACROS_ENABLED)), yes) -- cgit v1.2.3