From 738b8d2b9c458839d23f584843b251b1c8f29880 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 9 Apr 2017 22:48:35 +0300 Subject: Add SKIP_VERSION option to speed up compilation --- .../handwired/MS-sculpt-mobile/MS-sculpt-mobile.c | 1 - .../handwired/MS-sculpt-mobile/MS-sculpt-mobile.h | 48 --- keyboards/handwired/MS-sculpt-mobile/Makefile | 3 - keyboards/handwired/MS-sculpt-mobile/babblePaste.c | 459 --------------------- keyboards/handwired/MS-sculpt-mobile/babblePaste.h | 238 ----------- .../handwired/MS-sculpt-mobile/babblePaste.txt | 123 ------ keyboards/handwired/MS-sculpt-mobile/config.h | 100 ----- .../MS-sculpt-mobile/keymaps/default/Makefile | 21 - .../MS-sculpt-mobile/keymaps/default/config.h | 8 - .../MS-sculpt-mobile/keymaps/default/keymap.c | 64 --- .../MS-sculpt-mobile/keymaps/default/readme.md | 1 - .../MS-sculpt-mobile/keymaps/milestogo/Makefile | 21 - .../MS-sculpt-mobile/keymaps/milestogo/config.h | 32 -- .../MS-sculpt-mobile/keymaps/milestogo/keymap.c | 272 ------------ .../MS-sculpt-mobile/keymaps/milestogo/readme.md | 1 - keyboards/handwired/MS-sculpt-mobile/readme.md | 58 --- keyboards/handwired/MS-sculpt-mobile/rules.mk | 48 --- .../handwired/MS_sculpt_mobile/MS_sculpt_mobile.c | 1 + .../handwired/MS_sculpt_mobile/MS_sculpt_mobile.h | 48 +++ keyboards/handwired/MS_sculpt_mobile/Makefile | 3 + keyboards/handwired/MS_sculpt_mobile/babblePaste.c | 459 +++++++++++++++++++++ keyboards/handwired/MS_sculpt_mobile/babblePaste.h | 238 +++++++++++ .../handwired/MS_sculpt_mobile/babblePaste.txt | 123 ++++++ keyboards/handwired/MS_sculpt_mobile/config.h | 100 +++++ .../MS_sculpt_mobile/keymaps/default/Makefile | 21 + .../MS_sculpt_mobile/keymaps/default/config.h | 8 + .../MS_sculpt_mobile/keymaps/default/keymap.c | 64 +++ .../MS_sculpt_mobile/keymaps/default/readme.md | 1 + .../MS_sculpt_mobile/keymaps/milestogo/Makefile | 21 + .../MS_sculpt_mobile/keymaps/milestogo/config.h | 32 ++ .../MS_sculpt_mobile/keymaps/milestogo/keymap.c | 272 ++++++++++++ .../MS_sculpt_mobile/keymaps/milestogo/readme.md | 1 + keyboards/handwired/MS_sculpt_mobile/readme.md | 58 +++ keyboards/handwired/MS_sculpt_mobile/rules.mk | 48 +++ 34 files changed, 1498 insertions(+), 1498 deletions(-) delete mode 100644 keyboards/handwired/MS-sculpt-mobile/MS-sculpt-mobile.c delete mode 100644 keyboards/handwired/MS-sculpt-mobile/MS-sculpt-mobile.h delete mode 100644 keyboards/handwired/MS-sculpt-mobile/Makefile delete mode 100644 keyboards/handwired/MS-sculpt-mobile/babblePaste.c delete mode 100644 keyboards/handwired/MS-sculpt-mobile/babblePaste.h delete mode 100644 keyboards/handwired/MS-sculpt-mobile/babblePaste.txt delete mode 100644 keyboards/handwired/MS-sculpt-mobile/config.h delete mode 100644 keyboards/handwired/MS-sculpt-mobile/keymaps/default/Makefile delete mode 100644 keyboards/handwired/MS-sculpt-mobile/keymaps/default/config.h delete mode 100644 keyboards/handwired/MS-sculpt-mobile/keymaps/default/keymap.c delete mode 100644 keyboards/handwired/MS-sculpt-mobile/keymaps/default/readme.md delete mode 100644 keyboards/handwired/MS-sculpt-mobile/keymaps/milestogo/Makefile delete mode 100644 keyboards/handwired/MS-sculpt-mobile/keymaps/milestogo/config.h delete mode 100644 keyboards/handwired/MS-sculpt-mobile/keymaps/milestogo/keymap.c delete mode 100644 keyboards/handwired/MS-sculpt-mobile/keymaps/milestogo/readme.md delete mode 100644 keyboards/handwired/MS-sculpt-mobile/readme.md delete mode 100644 keyboards/handwired/MS-sculpt-mobile/rules.mk create mode 100644 keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.c create mode 100644 keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.h create mode 100644 keyboards/handwired/MS_sculpt_mobile/Makefile create mode 100644 keyboards/handwired/MS_sculpt_mobile/babblePaste.c create mode 100644 keyboards/handwired/MS_sculpt_mobile/babblePaste.h create mode 100644 keyboards/handwired/MS_sculpt_mobile/babblePaste.txt create mode 100644 keyboards/handwired/MS_sculpt_mobile/config.h create mode 100644 keyboards/handwired/MS_sculpt_mobile/keymaps/default/Makefile create mode 100644 keyboards/handwired/MS_sculpt_mobile/keymaps/default/config.h create mode 100644 keyboards/handwired/MS_sculpt_mobile/keymaps/default/keymap.c create mode 100644 keyboards/handwired/MS_sculpt_mobile/keymaps/default/readme.md create mode 100644 keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/Makefile create mode 100644 keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/config.h create mode 100644 keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/keymap.c create mode 100644 keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/readme.md create mode 100644 keyboards/handwired/MS_sculpt_mobile/readme.md create mode 100644 keyboards/handwired/MS_sculpt_mobile/rules.mk (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/MS-sculpt-mobile/MS-sculpt-mobile.c b/keyboards/handwired/MS-sculpt-mobile/MS-sculpt-mobile.c deleted file mode 100644 index 4c735a6c2..000000000 --- a/keyboards/handwired/MS-sculpt-mobile/MS-sculpt-mobile.c +++ /dev/null @@ -1 +0,0 @@ -#include "MS-sculpt-mobile.h" diff --git a/keyboards/handwired/MS-sculpt-mobile/MS-sculpt-mobile.h b/keyboards/handwired/MS-sculpt-mobile/MS-sculpt-mobile.h deleted file mode 100644 index 1583dea6e..000000000 --- a/keyboards/handwired/MS-sculpt-mobile/MS-sculpt-mobile.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef MICROSOFT_SCULPT_MOBILE_H -#define MICROSOFT_SCULPT_MOBILE_H - -#include "quantum.h" - - -#define KEYMAP( \ - k7Q, k6O, k6P, k6Q, k5O, k5P, k5Q, k7A, k7B, k7C, k7D, k7E, k7F, k1O, k1K, k1L, \ - k5A, k5K, k5L, k5M, k5N, k5H, k5I, k2A, k2B, k2C, k2D, k5B, k5C, k5J, k2E, \ - k6R, k6D, k6E, k6F, k7I, k7J, k4A, k4B, k4C, k4D, k3A, k3B, k3C, k3D, \ - k0J, k6A, k6B, k6C, k7H, k1A, k1B, k5D, k5E, k5F, k5G, k1C, k7P, k2G, \ - k2P, k7K, k7L, k7M, k7O, k0A, k0B, k0C, k0D, k0E, k0F, k2L, k6G, k1P,\ - k1Q, k4N, k3O,k6N, k3K, k0R, k1M, k6H, k6I, k6J \ -) \ -{ \ - {k0A, k0B, k0C, k0D, k0E, k0F, KC_NO, KC_NO, KC_NO, k0J, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,KC_NO, KC_NO, k0R},\ - {k1A, k1B, k1C, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k1K, k1L, k1M, KC_NO, k1O, k1P, k1Q, KC_NO},\ - {k2A, k2B, k2C, k2D, k2E, KC_NO, k2G, KC_NO, KC_NO, KC_NO, KC_NO, k2L, KC_NO, KC_NO, KC_NO, k2P, KC_NO, KC_NO},\ - {k3A, k3B, k3C, k3D, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k3K, KC_NO, KC_NO, KC_NO, k3O, KC_NO, KC_NO, KC_NO},\ - {k4A, k4B, k4C, k4D, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k4N, KC_NO,KC_NO, KC_NO, KC_NO},\ - {k5A, k5B, k5C, k5D, k5E, k5F, k5G, k5H, k5I, k5J, k5K, k5L, k5M, k5N, k5O, k5P, k5Q, KC_NO },\ - {k6A, k6B, k6C, k6D, k6E, k6F, k6G, k6H, k6I, k6J, KC_NO, KC_NO, KC_NO, k6N, k6O, k6P, k6Q, k6R},\ - {k7A, k7B, k7C, k7D, k7E, k7F, KC_NO, k7H, k7I, k7J, k7K, k7L, k7M, KC_NO, k7O, k7P, k7Q, KC_NO},\ -} - - -#define MATRIX_TESTING_KEYMAP( \ - k0A, k0B, k0C, k0D, k0E, k0F, k0G, k0H, k0I, k0, k0J, k0K, k0L, k0M, k0N, k0O, k0P, k0Q,\ - k1A, k1B, k1C, k1D, k1E, k1F, k1G, k1H, k1I, k1, k1J, k1K, k1L, k1M, k1N, k1O, k1P, k1Q,\ - k2A, k2B, k2C, k2D, k2E, k2F, k2G, k2H, k2I, k2, k2J, k2K, k2L, k2M, k2N, k2O, k2P, k2Q,\ - k3A, k3B, k3C, k3D, k3E, k3F, k3G, k3H, k3I, k3, k3J, k3K, k3L, k3M, k3N, k3O, k3P, k3Q,\ - k4A, k4B, k4C, k4D, k4E, k4F, k4G, k4H, k4I, k4, k4J, k4K, k4L, k4M, k4N, k4O, k4P, k4Q,\ - k5A, k5B, k5C, k5D, k5E, k5F, k5G, k5H, k5I, k5, k5J, k5K, k5L, k5M, k5N, k5O, k5P, k5Q,\ - k6A, k6B, k6C, k6D, k6E, k6F, k6G, k6H, k6I, k6, k6J, k6K, k6L, k6M, k6N, k6O, k6P, k6Q,\ - k7A, k7B, k7C, k7D, k7E, k7F, k7G, k7H, k7I, k7, k7J, k7K, k7L, k7M, k7N, k7O, k7P, k7Q\ -) \ -{ \ - {k0A, k0B, k0C, k0D, k0E, k0F, k0G, k0H, k0I, k0, k0J, k0K, k0L, k0M, k0N, k0O, k0P, k0Q},\ - {k1A, k1B, k1C, k1D, k1E, k1F, k1G, k1H, k1I, k1, k1J, k1K, k1L, k1M, k1N, k1O, k1P, k1Q},\ - {k2A, k2B, k2C, k2D, k2E, k2F, k2G, k2H, k2I, k2, k2J, k2K, k2L, k2M, k2N, k2O, k2P, k2Q},\ - {k3A, k3B, k3C, k3D, k3E, k3F, k3G, k3H, k3I, k3, k3J, k3K, k3L, k3M, k3N, k3O, k3P, k3Q},\ - {k4A, k4B, k4C, k4D, k4E, k4F, k4G, k4H, k4I, k4, k4J, k4K, k4L, k4M, k4N, k4O, k4P, k4Q},\ - {k5A, k5B, k5C, k5D, k5E, k5F, k5G, k5H, k5I, k5, k5J, k5K, k5L, k5M, k5N, k5O, k5P, k5Q},\ - {k6A, k6B, k6C, k6D, k6E, k6F, k6G, k6H, k6I, k6, k6J, k6K, k6L, k6M, k6N, k6O, k6P, k6Q},\ - {k7A, k7B, k7C, k7D, k7E, k7F, k7G, k7H, k7I, k7, k7J, k7K, k7L, k7M, k7N, k7O, k7P, k7Q},\ -} - -#endif diff --git a/keyboards/handwired/MS-sculpt-mobile/Makefile b/keyboards/handwired/MS-sculpt-mobile/Makefile deleted file mode 100644 index bd09e5885..000000000 --- a/keyboards/handwired/MS-sculpt-mobile/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -ifndef MAKEFILE_INCLUDED - include ../../../Makefile -endif diff --git a/keyboards/handwired/MS-sculpt-mobile/babblePaste.c b/keyboards/handwired/MS-sculpt-mobile/babblePaste.c deleted file mode 100644 index 3a9b86997..000000000 --- a/keyboards/handwired/MS-sculpt-mobile/babblePaste.c +++ /dev/null @@ -1,459 +0,0 @@ -/* 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 "babblePaste.h" -#include "action_macro.h" - -#ifdef USE_BABLPASTE - -// GLOBAL variable to determine mode. Sets startup default if no eeppom -uint8_t babble_mode =0 ; - -// small function that we might also want to call from a keymap. - -macro_t* switch_babble_mode( uint8_t id) { - babble_mode= id; - return MACRO_NONE; //less typing where called -} - - -// Today I learned that the preprocessor can not create a switch statement label from an argument -// And else statements have problems, see https://gcc.gnu.org/onlinedocs/gcc-3.0.1/cpp_3.html#SEC15 -#define BABLM(ent, macro...) \ - if ( ent == shortcut ) \ - { action_macro_play( MACRO(macro)); return MACRO_NONE; } - - -/* this function runs the appropriate babblepaste macro, given -the global babble_mode, and a shortcut from the ENUM in babblePaste.h -TODO, the pointers in this function should be stored in a PROGMEM array, not ram. -But that requires even more clever preprocessor foo. -*/ -const macro_t *babblePaste (keyrecord_t *record, uint8_t shortcut) { -/* - if ( shortcut < BABL_START_NUM || \ - shortcut >= (BABL_START_NUM + BABL_NUM_MACROS ) ) { - return MACRO_NONE; - } -*/ - - -#ifdef MS_MODE - if ( BABL_WINDOWS == shortcut ) { return switch_babble_mode(MS_MODE); } -#endif -#ifdef MAC_MODE - if ( BABL_MAC == shortcut) { return switch_babble_mode(MAC_MODE); } -#endif -#ifdef LINUX_MODE - if ( BABL_LINUX == shortcut ) { return switch_babble_mode(LINUX_MODE); } -#endif - #ifdef READMUX_MODE - if ( BABL_READLINE == shortcut ) { switch_babble_mode(READMUX_MODE); return MACRO_NONE; } -#endif -#ifdef VI_MODE - if ( BABL_VI == shortcut ) { return switch_babble_mode(VI_MODE); } -#endif -#ifdef EMACS_MODE - if ( BABL_EMACS == shortcut ) { return switch_babble_mode(EMACS_MODE); } -#endif - - - - switch(babble_mode) { - -#ifdef MS_MODE - - case MS_MODE: - BABLM( BABL_GO_LEFT_1C, T(LEFT), END ); - BABLM( BABL_GO_RIGHT_1C , T(RIGHT), END ); - BABLM( BABL_GO_LEFT_WORD, D(LCTL), T(LEFT), U(LCTL), END ); - BABLM( BABL_GO_RIGHT_WORD, D(LCTL), T(RIGHT), U(LCTL), END ); - BABLM( BABL_GO_START_LINE, T(HOME), END ); - BABLM( BABL_GO_END_LINE, T(END), END ); - BABLM( BABL_GO_START_DOC, D(LCTL),T(HOME), U(LCTL),END ); - BABLM( BABL_GO_END_DOC, D(LCTL),T(END), U(LCTL),END ); - BABLM( BABL_GO_NEXT_LINE, T(DOWN), END ); - BABLM( BABL_GO_PREV_LINE, T(UP), END ); - BABLM( BABL_PGDN, T(PGDN), END ); - BABLM( BABL_PGUP, T(PGUP), END ); - BABLM( BABL_DEL_RIGHT_1C, T(DEL), END ); - BABLM( BABL_DEL_LEFT_WORD, D(LCTL), T(BSPACE), U(LCTL), END ); - BABLM( BABL_DEL_RIGHT_WORD, D(LCTL), T(DEL), U(LCTL), END ); - BABLM( BABL_DEL_TO_LINE_END, D(RSFT), T(HOME), U(RSFT), T(DEL), END); - BABLM( BABL_DEL_TO_LINE_START, D(RSFT), T(END), U(RSFT), T(DEL), END ); -#ifndef BABL_MOVEMENTONLY - BABLM( BABL_UNDO, D(LCTL), T(Z), U(LCTL), END ); - BABLM( BABL_REDO, D(LCTL), T(Y), U(LCTL), END ); - BABLM( BABL_CUT, D(LCTL), T(X), U(LCTL), END ); - BABLM( BABL_COPY, D(LCTL), T(C), U(LCTL), END ); - BABLM( BABL_PASTE, D(LCTL), T(V), U(LCTL), END ); - BABLM( BABL_SELECT_ALL, D(LCTL), T(A), U(LCTL), END ); - BABLM( BABL_FIND, D(LCTL),T(F), U(LCTL),END ); - BABLM( BABL_FIND_NEXT, T(F3),END ); - BABLM( BABL_FIND_REPLACE, D(LCTL),T(H), U(LCTL),END ); - BABLM( BABL_RUNAPP, D(LGUI),T(R), U(LGUI),END ); - BABLM( BABL_SWITCH_APP_NEXT, D(LALT),T(TAB), U(LALT),END ); - BABLM( BABL_SWITCH_APP_LAST, D(LSFT),D(LALT),T(TAB), U(LALT), U(LSFT),END ); - BABLM( BABL_CLOSE_APP, D(LALT),T(F4), U(LALT),END ); - BABLM( BABL_HELP, T(F1),END ); -#ifndef BABL_NOBROWSER - BABLM( BABL_BROWSER_NEW_TAB, D(LCTL), T(T), U(LCTL),END ); - BABLM( BABL_BROWSER_CLOSE_TAB, D(LCTL), T(W), U(LCTL),END ); - BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LCTL), D(RSFT),T(T), U(RSFT),U(LCTL),END ); - BABLM( BABL_BROWSER_NEXT_TAB, D(LCTL), T(TAB), U(LCTL),END ); - BABLM( BABL_BROWSER_PREV_TAB, D(LCTL), D(RSFT), T(TAB), U(RSFT), U(LCTL),END ); - BABLM( BABL_BROWSER_URL_BAR, D(LCTL), T(L), U(LCTL),END ); - BABLM( BABL_BROWSER_FORWARD, D(LALT), T(RIGHT), U(LALT),END ); - BABLM( BABL_BROWSER_BACK, D(LALT), T(LEFT), U(LALT),END ); - BABLM( BABL_BROWSER_FIND, D(LCTL), T(F), U(LCTL),END ); - BABLM( BABL_BROWSER_BOOKMARK, D(LCTL), T(D), U(LCTL),END ); - //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LCTL),END ); // EDGE - BABLM( BABL_BROWSER_DEV_TOOLS, D(LCTL), T(T), U(LCTL),END ); // Chrome - // Chrome - BABLM( BABL_BROWSER_RELOAD, D(LCTL), T(F5), U(LCTL),END ); // hard reload w/o cache - BABLM( BABL_BROWSER_FULLSCREEN, T(F11),END ); //command shift F - BABLM( BABL_BROWSER_ZOOM_IN, D(LCTL), D(RSFT), T(EQL), U(RSFT), U(LCTL),END ); // ctr+ + - BABLM( BABL_BROWSER_ZOOM_OUT, D(LCTL), T(MINS), U(LCTL),END ); -#endif -#endif - - // Todo, ring bell, flash light, show user this isn't supported - return MACRO_NONE; - - -#endif /* MS_MODE*/ - - -#ifdef LINUX_MODE - - case LINUX_MODE: - BABLM( BABL_GO_LEFT_1C , T(LEFT), END ); - BABLM( BABL_GO_RIGHT_1C , T(RIGHT), END ); - BABLM( BABL_GO_LEFT_WORD , D(LCTL), T(LEFT), U(LCTL), END ); - BABLM( BABL_GO_RIGHT_WORD , D(LCTL), T(RIGHT), U(LCTL), END ); - BABLM( BABL_GO_START_LINE , T(HOME), END ); - BABLM( BABL_GO_END_LINE , T(END), END ); - BABLM( BABL_GO_START_DOC , D(LCTL),T(HOME), U(LCTL),END ); - BABLM( BABL_GO_END_DOC , D(LCTL),T(END), U(LCTL),END ); - BABLM( BABL_GO_NEXT_LINE , T(DOWN), END ); - BABLM( BABL_GO_PREV_LINE , T(UP), END ); - BABLM( BABL_PGDN , T(PGDN), END ); - BABLM( BABL_PGUP , T(PGUP), END ); - BABLM( BABL_DEL_RIGHT_1C , D(DEL), END ); - BABLM( BABL_DEL_LEFT_WORD , D(LCTL), T(BSPACE), U(LCTL), END ); - BABLM( BABL_DEL_RIGHT_WORD , D(LCTL), T(DEL), U(LCTL), END ); - BABLM( BABL_DEL_TO_LINE_END, D(RSFT), T(HOME), U(RSFT), T(DEL), END); - BABLM( BABL_DEL_TO_LINE_START, D(RSFT), T(END), U(RSFT), T(DEL), END ); -#ifndef BABL_MOVEMENTONLY - BABLM( BABL_UNDO , D(LCTL), T(Z), U(LCTL), END ); - BABLM( BABL_REDO , D(LCTL), T(Y), U(LCTL), END ); - BABLM( BABL_CUT , D(LCTL), T(X), U(LCTL), END ); - BABLM( BABL_COPY , D(LCTL), T(C), U(LCTL), END ); - BABLM( BABL_PASTE , D(LCTL), T(V), U(LCTL), END ); - BABLM( BABL_SELECT_ALL, D(LCTL), T(A), U(LCTL), END ); - BABLM( BABL_FIND, D(LCTL),T(F), U(LCTL),END ); - /* BABLM(BABL_FIND_NEXT , T(F3),END ); KDE */ - BABLM( BABL_FIND_NEXT, D(LCTL),T(G), U(LCTL),END ); // Gnome*/ - /* BABLM( , D(LCTL),T(R), U(LCTL),END ); KDE */ - BABLM( BABL_FIND_REPLACE, D(LCTL),T(H), U(LCTL),END ); // Gnome*/ - BABLM( BABL_RUNAPP, D(LALT),T(F2), U(LALT),END ); - BABLM( BABL_SWITCH_APP_NEXT, D(LCTL),T(TAB), U(LCTL),END ); - BABLM( BABL_SWITCH_APP_LAST, D(LSFT),D(LCTL),T(TAB), U(LCTL), U(LSFT),END ); - BABLM( BABL_CLOSE_APP, D(LALT),T(F4), U(LALT),END ); - //BABLM( BABL_HELP, END ); - -#ifndef BABL_NOBROWSER - BABLM( BABL_BROWSER_NEW_TAB, D(LCTL), T(T), U(LCTL),END ); - BABLM( BABL_BROWSER_CLOSE_TAB, D(LCTL), T(W), U(LCTL),END ); - BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LCTL), D(RSFT),T(T), U(RSFT),U(LCTL),END ); - BABLM( BABL_BROWSER_NEXT_TAB, D(LCTL), T(TAB), U(LCTL),END ); - BABLM( BABL_BROWSER_PREV_TAB, D(LCTL), D(RSFT), T(TAB), U(RSFT), U(LCTL),END ); - BABLM( BABL_BROWSER_URL_BAR, D(LCTL), T(L), U(LCTL),END ); - BABLM( BABL_BROWSER_FORWARD, D(LALT), T(RIGHT), U(LALT),END ); - BABLM( BABL_BROWSER_BACK, D(LALT), T(LEFT), U(LALT),END ); - BABLM( BABL_BROWSER_FIND, D(LCTL), T(F), U(LCTL),END ); - BABLM( BABL_BROWSER_BOOKMARK, D(LCTL), T(D), U(LCTL),END ); - BABLM( BABL_BROWSER_DEV_TOOLS, D(LCTL), T(T), U(LCTL),END ); // Chrome - BABLM( BABL_BROWSER_RELOAD, D(LCTL), T(F5), U(LCTL),END ); // hard reload w/o cache - BABLM( BABL_BROWSER_FULLSCREEN, T(F11),END ); //command shift F - BABLM( BABL_BROWSER_ZOOM_IN, D(LCTL), T(PLUS), U(LCTL),END ); - BABLM( BABL_BROWSER_ZOOM_OUT, D(LCTL), T(MINS), U(LCTL),END ); -#endif -#endif - return MACRO_NONE; - -#endif - -#ifdef MAC_MODE - - case MAC_MODE: - BABLM( BABL_GO_LEFT_1C , T(LEFT), END ); - BABLM( BABL_GO_RIGHT_1C, T(RIGHT), END ); - BABLM( BABL_GO_LEFT_WORD , D(LALT), T(LEFT), U(LALT), END ); - BABLM( BABL_GO_RIGHT_WORD , D(LALT), T(RIGHT), U(LALT), END ); - BABLM( BABL_GO_START_LINE , D(LGUI), T(LEFT), U(LGUI), END ); - BABLM( BABL_GO_END_LINE , D(LGUI), T(RIGHT), U(LGUI), END ); - BABLM( BABL_GO_START_DOC , D(LGUI),T(UP), U(LGUI),END ); - BABLM( BABL_GO_END_DOC , D(LGUI),T(DOWN), U(LGUI),END ); - BABLM( BABL_GO_NEXT_LINE , T(DOWN), END ); - BABLM( BABL_GO_PREV_LINE , T(UP), END ); - BABLM( BABL_PGDN , D(LALT),T(DOWN), U(LALT), END ); - BABLM( BABL_PGUP , D(LALT),T(UP), U(LALT), END ); - BABLM( BABL_DEL_RIGHT_1C , D(DEL), END ); - BABLM( BABL_DEL_LEFT_WORD , D(LALT), T(BSPACE), U(LALT), END ); - BABLM( BABL_DEL_RIGHT_WORD, D(LALT), T(DEL), U(LALT), END ); - BABLM( BABL_DEL_TO_LINE_END, D(LCTL), T(K), U(LCTL), END );// there must be another way - BABLM( BABL_DEL_TO_LINE_START, D(LGUI), T(BSPACE), U(LGUI), END ); -#ifndef BABL_MOVEMENTONLY - BABLM( BABL_UNDO , D(1), D(LGUI), T(Z), U(LGUI), END ); - BABLM( BABL_REDO , D(LSFT),D(LGUI), T(Z), U(LSFT),U(LGUI), END ); - BABLM( BABL_CUT , D(LGUI), T(X), U(LGUI), END ); - BABLM( BABL_COPY , D(LGUI), T(C), U(LGUI), END ); - BABLM( BABL_PASTE , D(LGUI), T(V), U(LGUI), END ); - BABLM( BABL_SELECT_ALL , D(LGUI), T(A), U(LGUI), END ); - BABLM( BABL_FIND , D(LGUI),T(F), U(LGUI),END ); - BABLM( BABL_FIND_NEXT, D(LGUI),T(G), U(LGUI),END ); - BABLM( BABL_FIND_REPLACE, D(LGUI),T(F), U(LGUI),END ); - BABLM( BABL_RUNAPP , D(LGUI),T(R), U(LGUI),END ); - BABLM( BABL_SWITCH_APP_NEXT , D(LGUI),T(TAB), U(LGUI),END ); - BABLM( BABL_SWITCH_APP_LAST , D(LSFT),D(LGUI),T(TAB), U(LGUI), U(LSFT),END ); - BABLM( BABL_CLOSE_APP , D(LGUI),T(Q), U(LGUI),END ); - BABLM( BABL_HELP , D(LSFT),D(LGUI),T(SLASH), U(LGUI), U(LSFT),END ); - -#ifndef BABL_NOBROWSER - BABLM( BABL_BROWSER_NEW_TAB, D(LGUI), T(T), U(LGUI),END ); - BABLM( BABL_BROWSER_CLOSE_TAB, D(LGUI), T(W), U(LGUI),END ); - BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LGUI), D(RSFT),T(T), U(RSFT),U(LGUI),END ); - BABLM( BABL_BROWSER_NEXT_TAB, D(LGUI),D(LALT), T(RIGHT),U(LALT), U(LGUI),END ); - BABLM( BABL_BROWSER_PREV_TAB, D(LGUI), D(RSFT), T(LEFT), U(RSFT), U(LGUI),END ); - BABLM( BABL_BROWSER_URL_BAR, D(LGUI), T(L), U(LGUI),END ); - BABLM( BABL_BROWSER_FORWARD, D(LGUI), T(RIGHT), U(LGUI),END ); - BABLM( BABL_BROWSER_BACK, D(LGUI), T(LEFT), U(LGUI),END ); - BABLM( BABL_BROWSER_FIND, D(LGUI), T(F), U(LGUI),END ); - BABLM( BABL_BROWSER_BOOKMARK, D(LGUI), T(D), U(LGUI),END ); - //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LGUI),END ); // EDGE - BABLM( BABL_BROWSER_DEV_TOOLS, D(LGUI), D(LALT), T(I), U(LALT),U(LGUI),END ); // Chrome - // Chrome - BABLM( BABL_BROWSER_RELOAD, D(LGUI), T(R), U(LGUI),END ); // add shift for reload w/o cache - BABLM( BABL_BROWSER_FULLSCREEN, D(LGUI), D(LCTL), T(P), U(LCTL), U(LGUI),END ); //command shift F - BABLM( BABL_BROWSER_ZOOM_IN, D(LGUI), D(RSFT), T(EQL), U(RSFT), U(LGUI),END ); // ctr+ + - BABLM( BABL_BROWSER_ZOOM_OUT, D(LGUI), T(MINS), U(LGUI),END ); -#endif -#endif - - return MACRO_NONE; -#endif - -#ifdef EMACS_MODE - - case EMACS_MODE: - switch(shortcut) { -//probably should allow meta to not be ALT - - BABLM( BABL_GO_LEFT_1C, T(LEFT), END ); - BABLM( BABL_GO_RIGHT_1C, T(RIGHT), END ); - BABLM( BABL_GO_LEFT_WORD, D(LALT), T(B), U(LALT), END ); - BABLM( BABL_GO_RIGHT_WORD , D(LALT), T(F), U(LALT), END ); - BABLM( BABL_GO_START_LINE , D(LCTL), T(A), U(LCTL), END ); - BABLM( BABL_GO_END_LINE , D(LCTL), T(E), U(LCTL), END ); - BABLM( BABL_GO_START_DOC , D(LALT), D(LSFT), T(COMM),U(LSFT), U(LALT) ,END ); - BABLM( BABL_GO_END_DOC , D(LALT), D(LSFT), T(DOT), U(LSFT), U(LALT) ,END ); - BABLM( BABL_GO_NEXT_LINE , D(LCTL), T(N), U(LCTL), END ); - BABLM( BABL_GO_PREV_LINE , D(LCTL), T(P), U(LCTL), END ); - BABLM( BABL_PGDN , D(LCTL), T(V), U(LCTL), END ); - BABLM( BABL_PGUP , D(LALT), T(V), U(LALT), END ); - BABLM( BABL_DEL_RIGHT_1C, D(LCTL), T(D), U(LCTL),END ); - BABLM( BABL_DEL_LEFT_WORD , D(LCTL), T(BSPACE), U(LCTL), END ); - BABLM( BABL_DEL_RIGHT_WORD , D(LALT), T(D), U(LALT), END ); - BABLM( BABL_DEL_TO_LINE_END, D(LCTL), T(K), U(LCTL), END ); - BABLM( BABL_DEL_TO_LINE_START, T(ESC), T(0), D(LCTL), T(K), U(LCTL), END ); -#ifndef BABL_MOVEMENTONLY - BABLM( BABL_UNDO , D(LCTL), T(X), U(LCTL),T(C), END ); - BABLM( BABL_REDO , D(LCTL), T(X), U(LCTL),T(C), END ); // arguably - BABLM( BABL_CUT , D(LCTL), T(W), U(LCTL), END ); - BABLM( BABL_COPY , D(LALT), T(W), U(LALT), END ); //really? - BABLM( BABL_PASTE , D(LCTL), T(Y), U(LCTL), END ); - BABLM( BABL_SELECT_ALL ,D(LCTL), T(X), U(LCTL),T(H), END ); - BABLM( BABL_FIND , D(LCTL), T(S), U(LCTL),END ); - BABLM( BABL_FIND_NEXT , D(LCTL), T(S), U(LCTL),END ); - BABLM( BABL_FIND_REPLACE , D(LALT),D(LSFT), T(5),U(LSFT), U(LALT), END ); - BABLM( BABL_RUNAPP , D(LALT), T(X), U(LALT),T(S),T(H),T(E),T(L),T(L),END );// arguably - BABLM( BABL_SWITCH_APP_NEXT , D(LCTL), T(X), U(LCTL),T(RIGHT), END ); // arguably - BABLM( BABL_SWITCH_APP_LAST , D(LCTL), T(X), U(LCTL),T(LEFT), END ); // arguably - BABLM( BABL_CLOSE_APP , D(LCTL), T(X), U(LCTL),T(C),END ); - BABLM( BABL_HELP , D(LCTL),T(H), U(LCTL),T(A),END); // start search in help -#ifndef BABL_NOBROWSER -/* you get to figure w3 out - BABLM( BABL_BROWSER_NEW_TAB, D(LGUI), T(T), U(LGUI),END ); - BABLM( BABL_BROWSER_CLOSE_TAB, D(LGUI), T(W), U(LGUI),END ); - BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LGUI), D(RSFT),T(T), U(RSFT),U(LGUI),END ); - BABLM( BABL_BROWSER_NEXT_TAB, D(LGUI),D(LALT), T(RIGHT),U(LALT), U(LGUI),END ); - BABLM( BABL_BROWSER_PREV_TAB, D(LGUI), D(RSFT), T(LEFT), U(RSFT), U(LGUI),END ); - BABLM( BABL_BROWSER_URL_BAR, D(LGUI), T(L), U(LGUI),END ); - BABLM( BABL_BROWSER_FORWARD, D(LGUI), T(RIGHT), U(LGUI),END ); - BABLM( BABL_BROWSER_BACK, D(LGUI), T(LEFT), U(LGUI),END ); - BABLM( BABL_BROWSER_FIND, D(LGUI), T(F), U(LGUI),END ); - BABLM( BABL_BROWSER_BOOKMARK, D(LGUI), T(D), U(LGUI),END ); - //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LGUI),END ); // EDGE - BABLM( BABL_BROWSER_DEV_TOOLS, D(LGUI), D(LALT), T(I), U(LALT),U(LGUI),END ); // Chrome - // Chrome - BABLM( BABL_BROWSER_RELOAD, D(LGUI), T(R), U(LGUI),END ); // add shift for reload w/o cache - BABLM( BABL_BROWSER_FULLSCREEN, D(LGUI), D(LCTL), T(P), U(LCTL), U(LGUI),END ); //command shift F - BABLM( BABL_BROWSER_ZOOM_IN, D(LGUI), D(RSFT), T(EQL), U(RSFT), U(LGUI),END ); // ctr+ + - BABLM( BABL_BROWSER_ZOOM_OUT, D(LGUI), T(MINS), U(LGUI),END ); -*/ -#endif -#endif - break; - - return MACRO_NONE; - } - -#endif - - -#ifdef VI_MODE - case VI_MODE: -// you have to track the modes yourself. Otherwise motion is awful (bell, bell, bell) - - - BABLM( BABL_GO_LEFT_1C , T(H), END ); - BABLM( BABL_GO_RIGHT_1C , T(L), END ); - BABLM( BABL_GO_LEFT_WORD , T(B),END ); - BABLM( BABL_GO_RIGHT_WORD , T(W), END ); - BABLM( BABL_GO_START_LINE , D(LSFT), T(6),U(LSFT), END ); //^ - BABLM( BABL_GO_END_LINE , D(LSFT), T(4),U(LSFT) , END ); //$ - BABLM( BABL_GO_START_DOC , T(G),T(G) ,END ); - BABLM( BABL_GO_END_DOC , D(LSFT), T(G),U(LSFT),END ); - BABLM( BABL_GO_NEXT_LINE , T(J), END ); - BABLM( BABL_GO_PREV_LINE, T(K), END ); - BABLM( BABL_PGDN ,D(LCTL), T(F), U(LCTL), END ); - BABLM( BABL_PGUP , D(LCTL), T(B), U(LCTL), END ); - BABLM( BABL_DEL_RIGHT_1C , T(X),END ); - BABLM( BABL_DEL_LEFT_WORD , T(D),T(G),T(E),END ); - BABLM( BABL_DEL_RIGHT_WORD , T(D),T(W),END ); - BABLM( BABL_DEL_TO_LINE_END, T(D),D(LSFT), T(4),U(LSFT) ,END ); // d$ - BABLM( BABL_DEL_TO_LINE_START, T(D),D(LSFT), T(6),U(LSFT) ,END ); -#ifndef BABL_MOVEMENTONLY - BABLM( BABL_UNDO , T(U), END ); - BABLM( BABL_REDO , D(LCTL), T(R), U(LCTL), END ); - BABLM( BABL_CUT , T(X), END ); - BABLM( BABL_COPY , T(Y),END ); - BABLM( BABL_PASTE , T(P), END ); - BABLM( BABL_SELECT_ALL , D(LSFT), T(SCLN),U(LSFT),D(LSFT), T(5),U(LSFT),T(Y), END ); // wrong but helpful? - BABLM( BABL_FIND , T(SLASH),END ); - BABLM( BABL_FIND_NEXT , T(N),END ); - BABLM( BABL_FIND_REPLACE , D(LALT),D(LSFT), T(5),U(LSFT), U(LALT), END ); - BABLM( BABL_RUNAPP,END ); - BABLM( BABL_SWITCH_APP_NEXT ,END ); - BABLM( BABL_SWITCH_APP_LAST ,END ); - BABLM(BABL_CLOSE_APP, D(LSFT), T(SCLN),U(LSFT), T(Q), D(RSFT), T(1),U(RSFT), END ); - BABLM(BABL_HELP, D(LSFT), T(SCLN),U(LSFT),T(H),END); // start search in help -#ifndef BABL_NOBROWSER -/* you get to figure this out - BABLM( BABL_BROWSER_NEW_TAB, D(LGUI), T(T), U(LGUI),END ); - BABLM( BABL_BROWSER_CLOSE_TAB, D(LGUI), T(W), U(LGUI),END ); - BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LGUI), D(RSFT),T(T), U(RSFT),U(LGUI),END ); - BABLM( BABL_BROWSER_NEXT_TAB, D(LGUI),D(LALT), T(RIGHT),U(LALT), U(LGUI),END ); - BABLM( BABL_BROWSER_PREV_TAB, D(LGUI), D(RSFT), T(LEFT), U(RSFT), U(LGUI),END ); - BABLM( BABL_BROWSER_URL_BAR, D(LGUI), T(L), U(LGUI),END ); - BABLM( BABL_BROWSER_FORWARD, D(LGUI), T(RIGHT), U(LGUI),END ); - BABLM( BABL_BROWSER_BACK, D(LGUI), T(LEFT), U(LGUI),END ); - BABLM( BABL_BROWSER_FIND, D(LGUI), T(F), U(LGUI),END ); - BABLM( BABL_BROWSER_BOOKMARK, D(LGUI), T(D), U(LGUI),END ); - //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LGUI),END ); // EDGE - BABLM( BABL_BROWSER_DEV_TOOLS, D(LGUI), D(LALT), T(I), U(LALT),U(LGUI),END ); // Chrome - // Chrome - BABLM( BABL_BROWSER_RELOAD, D(LGUI), T(R), U(LGUI),END ); // add shift for reload w/o cache - BABLM( BABL_BROWSER_FULLSCREEN, D(LGUI), D(LCTL), T(P), U(LCTL), U(LGUI),END ); //command shift F - BABLM( BABL_BROWSER_ZOOM_IN, D(LGUI), T(PLUS), U(LGUI),END ); - BABLM( BABL_BROWSER_ZOOM_OUT, D(LGUI), T(MINS), U(LGUI),END ); -*/ -#endif -#endif - return MACRO_NONE; -#endif - - - - -#ifdef READMUX_MODE -// Readline command line editing + tmux windowing -// I havent decided how much to do readline and how much tmux - - - case READMUX_MODE: - - BABLM( BABL_GO_LEFT_1C , T(LEFT), END ); - BABLM( BABL_GO_RIGHT_1C , T(RIGHT), END ); - BABLM( BABL_GO_LEFT_WORD , D(LALT), T(B), U(LALT), END ); - BABLM( BABL_GO_RIGHT_WORD , D(LALT), T(F), U(LALT), END ); - BABLM( BABL_GO_START_LINE , D(LCTL), T(A), U(LCTL), END ); - BABLM( BABL_GO_END_LINE , D(LCTL), T(E), U(LCTL), END ); - //BABLM( BABL_GO_START_DOC ,END );// tmux? - //BABLM( BABL_GO_END_DOC ,END ); // tmux? - BABLM( BABL_GO_NEXT_LINE , D(LCTL), T(N), U(LCTL), END ); - BABLM( BABL_GO_PREV_LINE , D(LCTL), T(P), U(LCTL), END ); - BABLM( BABL_PGDN , T(PGDN), END ); - BABLM( BABL_PGUP , T(PGUP), END ); - BABLM( BABL_DEL_RIGHT_1C , D(LCTL), T(D), U(LCTL),END ); - BABLM( BABL_DEL_LEFT_WORD , D(LCTL), T(W), U(LCTL), END ); - BABLM( BABL_DEL_RIGHT_WORD , D(LALT), T(D), U(LALT), END ); - BABLM( BABL_DEL_TO_LINE_END, D(LCTL), T(K), U(LCTL), END ); - BABLM( BABL_DEL_TO_LINE_START, D(LCTL), T(U), U(LCTL), END ); -#ifndef BABL_MOVEMENTONLY - BABLM( BABL_UNDO , D(LALT), T(R), U(LALT) , END ); - BABLM( BABL_REDO , D(LCTL), T(X), U(LCTL),T(C), END ); // arguably - BABLM( BABL_CUT , D(LCTL), T(K), U(LCTL), END ); // wrong half the time - //BABLM( BABL_COPY ,END ); - BABLM( BABL_PASTE , D(LCTL), T(Y), U(LCTL), END ); - BABLM( BABL_SELECT_ALL , D(LCTL), T(A), T(K), T(Y), U(LCTL) , END ); - BABLM( BABL_FIND , D(LCTL), T(R), U(LCTL), END ); // search history - BABLM(BABL_FIND_NEXT, D(LCTL), T(S), U(LCTL), END ); - //BABLM( BABL_FIND_REPLACE ,END ); - BABLM( BABL_RUNAPP , D(LCTL), T(B), U(LCTL), T(C),END ); //tmux - BABLM( BABL_SWITCH_APP_NEXT , D(LCTL), T(B), U(LCTL), T(N),END ); //tmux - BABLM( BABL_SWITCH_APP_LAST , D(LCTL), T(B), U(LCTL), T(P),END ); //tmux - BABLM( BABL_CLOSE_APP , D(LCTL), T(B), U(LCTL), T(D),END); // usually what I want - // BABLM( BABL_HELP ,END ); -#ifndef BABL_NOBROWSER -/* Add lynx shortcuts? - BABLM( BABL_BROWSER_NEW_TAB, D(LGUI), T(T), U(LGUI),END ); - BABLM( BABL_BROWSER_CLOSE_TAB, D(LGUI), T(W), U(LGUI),END ); - BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LGUI), D(RSFT),T(T), U(RSFT),U(LGUI),END ); - BABLM( BABL_BROWSER_NEXT_TAB, D(LGUI),D(LALT), T(RIGHT),U(LALT), U(LGUI),END ); - BABLM( BABL_BROWSER_PREV_TAB, D(LGUI), D(RSFT), T(LEFT), U(RSFT), U(LGUI),END ); - BABLM( BABL_BROWSER_URL_BAR, D(LGUI), T(L), U(LGUI),END ); - BABLM( BABL_BROWSER_FORWARD, D(LGUI), T(RIGHT), U(LGUI),END ); - BABLM( BABL_BROWSER_BACK, D(LGUI), T(LEFT), U(LGUI),END ); - BABLM( BABL_BROWSER_FIND, D(LGUI), T(F), U(LGUI),END ); - BABLM( BABL_BROWSER_BOOKMARK, D(LGUI), T(D), U(LGUI),END ); - //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LGUI),END ); // EDGE - BABLM( BABL_BROWSER_DEV_TOOLS, D(LGUI), D(LALT), T(I), U(LALT),U(LGUI),END ); // Chrome - // Chrome - BABLM( BABL_BROWSER_RELOAD, D(LGUI), T(R), U(LGUI),END ); // add shift for reload w/o cache - BABLM( BABL_BROWSER_FULLSCREEN, D(LGUI), D(LCTL), T(P), U(LCTL), U(LGUI),END ); //command shift F - BABLM( BABL_BROWSER_ZOOM_IN, D(LGUI), T(PLUS), U(LGUI),END ); - BABLM( BABL_BROWSER_ZOOM_OUT, D(LGUI), T(MINS), U(LGUI),END ); -*/ -#endif -#endif - - return MACRO_NONE; - -#endif - - default: - return MACRO_NONE; - } - -} - - -#endif \ No newline at end of file diff --git a/keyboards/handwired/MS-sculpt-mobile/babblePaste.h b/keyboards/handwired/MS-sculpt-mobile/babblePaste.h deleted file mode 100644 index 3067c854d..000000000 --- a/keyboards/handwired/MS-sculpt-mobile/babblePaste.h +++ /dev/null @@ -1,238 +0,0 @@ -/* 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 bable_mode is done by another macro, or TBD interaction with the host. - -Huge thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts -and jeebak & algernon's keymap -*/ -#ifndef _babblePaste_h_included__ -#define _babblePaste_h_included__ -#include "action_layer.h" -#include "quantum_keycodes.h" -#include "config.h" - -#ifdef USE_BABLPASTE - -/* *************************** - -// Uncomment any modes you want. Whatever mode = 0 will be the default on boot -// Expect to get errors if you comment a feature out and leave it in your keymap. - -#define USE_BABLPASTE - -//#define MS_MODE 0 // Windows. -//#define MAC_MODE 1 -//#define LINUX_MODE 2 //aka gnome+KDE -//#define EMACS_MODE 3 -//#define VI_MODE 4 -//#define WORDSTAR_MODE 5 -//#define READMUX 6 // Readline and tmux - -// This removes everything but cursor movement -//#define BABL_MOVEMENTONLY -// and this just removes browser shortcuts -//#define BABL_NOBROWSER -****************************/ - - -// Uncomment if you need more free flash space -// It removes everything but cursor movement -//#define BABL_MOVEMENTONLY - - -// Define starting number for BABL macros in the macro range. -// Probably can start the default even lower -#define BABL_START_NUM 50 - -/* Macros handled by babblepaste. Most should be available for all platforms. -Whatever isn't defined will NOP */ -enum { -// Movement macros - // left & right - BABL_GO_LEFT_1C= BABL_START_NUM, - BABL_GO_RIGHT_1C, - BABL_GO_LEFT_WORD, - BABL_GO_RIGHT_WORD, - BABL_GO_START_LINE, - BABL_GO_END_LINE, - // now up & down - BABL_GO_START_DOC, - BABL_GO_END_DOC, - BABL_GO_NEXT_LINE, - BABL_GO_PREV_LINE, - BABL_PGDN, - BABL_PGUP, - // And the delete options - //BABL_DEL_LEFT_1C == backspace, so why bother. - BABL_DEL_RIGHT_1C, // usually = Del - BABL_DEL_LEFT_WORD, - BABL_DEL_RIGHT_WORD, - BABL_DEL_TO_LINE_END, // delete from cursor to end of line - BABL_DEL_TO_LINE_START, // delete from cursor to begining line -#ifndef BABL_MOVEMENTONLY - // Cut & Paste - BABL_UNDO, - BABL_REDO, - BABL_CUT, - BABL_COPY, - BABL_PASTE, - BABL_SELECT_ALL, - /* not yet implemented - BABL_SWAP_LAST2C // swap last characters before the cursor - BABL_SWAP_LAST2W // Swap the last two words before the cursor - */ - // find & replace - BABL_FIND, - BABL_FIND_NEXT, - BABL_FIND_REPLACE, - // GUI or app - BABL_RUNAPP, - BABL_SWITCH_APP_NEXT, - BABL_SWITCH_APP_LAST, // previous - BABL_CLOSE_APP, - BABL_HELP, - -#ifndef BABL_NOBROWSER - BABL_BROWSER_NEW_TAB, - BABL_BROWSER_CLOSE_TAB, - BABL_BROWSER_REOPEN_LAST_TAB, - BABL_BROWSER_NEXT_TAB, - BABL_BROWSER_PREV_TAB, - BABL_BROWSER_URL_BAR, - BABL_BROWSER_FORWARD, - BABL_BROWSER_BACK, - BABL_BROWSER_FIND, - BABL_BROWSER_BOOKMARK, - BABL_BROWSER_DEV_TOOLS, // hard one to remember - BABL_BROWSER_RELOAD, - BABL_BROWSER_FULLSCREEN, - BABL_BROWSER_ZOOM_IN, - BABL_BROWSER_ZOOM_OUT, - -#endif - -#endif -// Macros for mode switching -#ifdef MS_MODE - BABL_WINDOWS, -#endif -#ifdef MAC_MODE - BABL_MAC, -#endif -#ifdef LINUX_MODE - BABL_LINUX, -#endif -#ifdef EMACS_MODE - BABL_EMACS, -#endif -#ifdef VI_MODE - BABL_VI, -#endif -#ifdef READMUX_MODE - BABL_READLINE, -#endif - - -}; - -// BUG, used to jump to babble functiion. Surely there is a way to calculate size of enum? -#define BABL_NUM_MACROS 48+4 // 48 + # of defined modes. - -/* And all the shorthand keymap ready versions */ -// First the mode switching macros -#ifdef MS_MODE -#define B_WIN M(BABL_WINDOWS) -#endif -#ifdef MAC_MODE -#define B_MAC M(BABL_MAC) -#endif -#ifdef LINUX_MODE -#define B_LNX M(BABL_LINUX) -#endif -#ifdef EMACS_MODE -#define B_EMAX M(BABL_EMACS) -#endif -#ifdef VI_MODE -#define B_VI M(BABL_VI) -#endif -#ifdef READMUX_MODE -#define B_READ M(BABL_READLINE) -#endif - -// and all the movement & action. - -#define B_L1C M(BABL_GO_LEFT_1C) -#define B_R1C M(BABL_GO_RIGHT_1C) -#define B_L1W M(BABL_GO_LEFT_WORD) -#define B_R1W M(BABL_GO_RIGHT_WORD) -#define B_GSOL M(BABL_GO_START_LINE) -#define B_GEOL M(BABL_GO_END_LINE) -#define B_GTOP M(BABL_GO_START_DOC) -#define B_GEND M(BABL_GO_END_DOC) -#define B_DOWN M(BABL_GO_NEXT_LINE) -#define B_UP M(BABL_GO_PREV_LINE) -#define B_PGDN M(BABL_PGDN) -#define B_PGUP M(BABL_PGUP) -//#define B_BKSP M(BABL_DEL_LEFT_1C) == backspace so why bother. -#define B_DEL M(BABL_DEL_RIGHT_1C) // usually = Del -#define B_DLW M(BABL_DEL_LEFT_WORD) -#define B_DRW M(BABL_DEL_RIGHT_WORD) -#define B_DEOL M(BABL_DEL_TO_LINE_END) // delete from cursor to end of line -#define B_DSOL M(BABL_DEL_TO_LINE_START) // delete from cursor to begining line -#define B_UNDO M(BABL_UNDO) -#define B_REDO M(BABL_REDO) -#define B_CUT M(BABL_CUT) -#define B_COPY M(BABL_COPY) -#define B_PAST M(BABL_PASTE) -#define B_SELA M(BABL_SELECT_ALL) -#define B_FIND M(BABL_FIND) -#define B_FINDN M(BABL_FIND_NEXT) -#define B_FINDR M(BABL_FIND_REPLACE) -#define B_RAPP M(BABL_RUNAPP) -#define B_NAPP M(BABL_SWITCH_APP_NEXT) -#define B_PAPP M(BABL_SWITCH_APP_LAST) // previous -#define B_CAPP M(BABL_CLOSE_APP) -#define B_HELP M(BABL_HELP) -#define B_NTAB M(BABL_BROWSER_NEW_TAB) -#define B_CTAB M(BABL_BROWSER_CLOSE_TAB) -#define B_ROTB M(BABL_BROWSER_REOPEN_LAST_TAB) -#define B_NXTB M(BABL_BROWSER_NEXT_TAB) -#define B_PTAB M(BABL_BROWSER_PREV_TAB) -#define B_NURL M(BABL_BROWSER_URL_BAR) -#define B_BFWD M(BABL_BROWSER_FORWARD) -#define B_BBAK M(BABL_BROWSER_BACK) -#define B_BFND M(BABL_BROWSER_FIND) -#define B_BOOK M(BABL_BROWSER_BOOKMARK) -#define B_BDEV M(BABL_BROWSER_DEV_TOOLS) // hard one to remember -#define B_BRLD M(BABL_BROWSER_RELOAD) -#define B_BFUlL M(BABL_BROWSER_FULLSCREEN) -#define B_ZMIN M(BABL_BROWSER_ZOOM_IN) -#define B_ZMOT M(BABL_BROWSER_ZOOM_OUT) - - - - - - - -/* from action_macro.h -typedef uint8_t macro_t; - -#define MACRO_NONE (macro_t*)0 -#define MACRO(...) ({ static const macro_t __m[] PROGMEM = { __VA_ARGS__ }; &__m[0]; }) -#define MACRO_GET(p) pgm_read_byte(p) - -#define BABL_MSTART (entry, os, macro...) ( const macro_t bablDict[entry][os] PROGMEM = { macro... }; ) - -*/ - -const macro_t *babblePaste(keyrecord_t *record, uint8_t shortcut); - -macro_t* switch_babble_mode( uint8_t id); - - -#endif -#endif - diff --git a/keyboards/handwired/MS-sculpt-mobile/babblePaste.txt b/keyboards/handwired/MS-sculpt-mobile/babblePaste.txt deleted file mode 100644 index cf75e153e..000000000 --- a/keyboards/handwired/MS-sculpt-mobile/babblePaste.txt +++ /dev/null @@ -1,123 +0,0 @@ - BabblePaste is a library of common macros used to make sure that -you can have one "paste" button on one layer, and it will do the -right thing on any OS or app. Windows=Ctrl-V. Mac = Command-V and so on. - -The babblepaste library looks for the current status in a babble_mode global variable. -To switch modes, run the switch_babble_mode() function, or a pre defined macro. -Currently supported are Windows, OS X, Gnome/kde, Emacs, VI and readline, -across 42+ common macro actions. - - -###To use the library -1) Paste the following into your config.h. - -//////Begin////// -#define USE_BABLPASTE 1 - -#ifdef USE_BABLPASTE -/* define BabblePaste maps. Whatever = 0 will be the default. */ -// MAC_MODE 0 -// MS_MODE 1 -// LINUX_MODE 2 -// EMACS_MODE 3 -// VI_MODE 3 -// Readline and tmux -// READMUX_MODE 2 -// WORDSTAR_MODE 5 -#endif - -// Uncomment these to remove options an free up flash space - -// This removes everything but cursor movement -// BABL_MOVEMENTONLY -// and this just removes browser shortcuts -// BABL_NOBROWSER -///////End/////// - -2) Add the following to your keymap in the action_get_macro - -//////Begin////// -#ifdef USE_BABLPASTE - - if( id >= BABL_START_NUM && id < (BABL_START_NUM + BABL_NUM_MACROS ) ) { - if (record->event.pressed) { // is there a case where this isn't desired? - - babblePaste ( record, id ); - return MACRO_NONE; - } - } -#endif -///////End/////// - -3) add Babbelpaste actions to your keymap. See the full list in babblePaste.h, or the -list below -B_L1C // go left 1 char -B_R1C // go Right 1 char - B_L1W //GO_LEFT_1 WORD - B_R1W //BABL_GO_RIGHT_1 WORD - B_GSOL // BABL_GOTO_START of _LINE - B_GEOL // BABL_GOTO_END_LINE - B_GTOP //BABL_GOTO_START_DOC - B_GEND //BABL_GO_END_DOC - B_DOWN //BABL_GO_NEXT_LINE - B_UP // BABL_GO_PREV_LINE - B_PGDN //PGDN - B_PGUP //PGUP -// B_BKSP //backspace so why bother. - B_DEL // DEL_RIGHT_1 Char // usually = Del - B_DLW // DEL_LEFT_ 1 WORD) - B_DRW //DEL_RIGHT_1 WORD - B_DEOL // delete from cursor to end of line - B_DSOL // delete from cursor to begining line - B_UNDO //UNDO - B_REDO // REDO - B_CUT // CUT) - B_COPY // COPY) - B_PAST // PASTE) - B_SELA // SELECT_ALL - B_FIND // FIND) - B_FINDN //FIND_NEXT) - B_FINDR // FIND_REPLACE) - B_RAPP // open application launcher - B_NAPP // switch to next app - B_PAPP // switch to previous app - B_CAPP // CLOSE_APP) - B_HELP // HELP) - B_NTAB // BROWSER_NEW_TAB) - B_CTAB //BROWSER_CLOSE_TAB) - B_ROTB //BROWSER_REOPEN_LAST_TAB) - B_NXTB //BROWSER_NEXT_TAB) - B_PTAB //BROWSER_PREV_TAB) - B_NURL //BROWSER_jump to URL_BAR) - B_BFWD // BROWSER_FORWARD (in history) - B_BBAK //BROWSER_BACK (in history) - B_BFND // BROWSER_FIND) - B_BOOK //BROWSER_New BOOKMARK) - B_BDEV //BROWSER_ Open DEV_TOOLS) // hard one to remember - B_BRLD // BROWSER_RELOAD Page - B_BFUlL // BROWSER_FULLSCREEN) - B_ZMIN // BROWSER_ZOOM_IN) - B_ZMOT //BROWSER_ZOOM_OUT) - - -#### Development notes --Why a new function? Because it would make the keymap too ugly to put it there. --Why not return the macro to action_get_macro? Because I kept running into scope problems -and pointers to the wrong type. --Why not an array of arrays as a lookup instead of a function? That would allow you -to store the lookup table in PROGMEM. True, but that takes more pre-processor skill -than I had. - --Have you tested this on every platform? No. Submit a patch. - - -### Next steps for someone. -Make it easier to pair macros with modifiers. So key foo will jump to start of line, and -Shift(foo) will jump to the first tab in a browser. - -## Thanks - -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 -And of course QMK... - diff --git a/keyboards/handwired/MS-sculpt-mobile/config.h b/keyboards/handwired/MS-sculpt-mobile/config.h deleted file mode 100644 index f89514278..000000000 --- a/keyboards/handwired/MS-sculpt-mobile/config.h +++ /dev/null @@ -1,100 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0001 -#define MANUFACTURER Microsoftplus -#define DESCRIPTION 6000 - -/* key matrix size */ -#define MATRIX_ROWS 8 -#define MATRIX_COLS 18 - -#ifdef ASTAR -#define PRODUCT sculpt mobile astar - /*0 1 2 3 4 5 6 7 8 */ -#define MATRIX_ROW_PINS {D7, C6, D4, D0, D1, D3, D2, E2} -/* A B C D E F G H I J K L M N O P Q R */ -#define MATRIX_COL_PINS {B4, B5, E6, B7, B6, D6, C7, F7, F6, F4,F5, F1,F0, D5, B0, B1, B2, B3} - -#else -#define PRODUCT sculpt mobile teensypp -/* 0 1 2 3 4 5 6 7 */ -#define MATRIX_ROW_PINS { F7,F6,F4,F5,F3,F2,F1,F0} -/* A B C D E F G H I J K L M N O P Q R */ -#define MATRIX_COL_PINS { B7, D0, D1, D2, D3, D4, D5, D6, D7, E0,E1,C1, C0, C3, C2, C5, C4,C7} -#define UNUSED_PINS { B6,B5,B4,B3,B2,B1,B0 } - - -#endif - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION ROW2COL - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -//#define NO_DEBUG - -/* disable print */ -//#define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -#define PREVENT_STUCK_MODIFIERS - -#endif diff --git a/keyboards/handwired/MS-sculpt-mobile/keymaps/default/Makefile b/keyboards/handwired/MS-sculpt-mobile/keymaps/default/Makefile deleted file mode 100644 index 8b829218b..000000000 --- a/keyboards/handwired/MS-sculpt-mobile/keymaps/default/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR - include ../../../../../Makefile -endif diff --git a/keyboards/handwired/MS-sculpt-mobile/keymaps/default/config.h b/keyboards/handwired/MS-sculpt-mobile/keymaps/default/config.h deleted file mode 100644 index 8893d122e..000000000 --- a/keyboards/handwired/MS-sculpt-mobile/keymaps/default/config.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -// place overrides here - -#endif diff --git a/keyboards/handwired/MS-sculpt-mobile/keymaps/default/keymap.c b/keyboards/handwired/MS-sculpt-mobile/keymaps/default/keymap.c deleted file mode 100644 index ab09dcdd1..000000000 --- a/keyboards/handwired/MS-sculpt-mobile/keymaps/default/keymap.c +++ /dev/null @@ -1,64 +0,0 @@ -#include "MS-sculpt-mobile.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* -* -* |ESC | F1 | F2 | F3 | F4 | F5 | F6 | f7 | F8 | F9 | F10| F11| F12|Vol-|Vol+|Mute| -* -------------------------------------------------------------------------------' -* | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Bakspace| Del | -* -------------------------------------------------------------------------- -* | tab | q | w | e | r | t | y | u | i | o | p | [ | ] | \ | | -* -------------------------------------------------------------------------------' -* | caps | a | s | d | f | g | h | j | k | l | ; | ' | enter |PgUp| -* -------------------------------------------------------------------------------- -* |Lsft | z | x | c | v | b | n | m | , | . | / | Rsft| Up| PgDn| -* --------------------------------------------------------------------------------- -* |Lctl |Lgui |Lalt | Space |Ralt | FN | Rctl |Left|Down|Rght| -* --------------------------------------------------------------------------------- -*/ - -[0] = KEYMAP( \ - 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, KC_MUTE,\ - 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,\ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,\ - KC_CAPS, 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,\ - 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,\ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_RALT, RSFT(KC_1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT -) - -}; -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - -} diff --git a/keyboards/handwired/MS-sculpt-mobile/keymaps/default/readme.md b/keyboards/handwired/MS-sculpt-mobile/keymaps/default/readme.md deleted file mode 100644 index e67ddc6fe..000000000 --- a/keyboards/handwired/MS-sculpt-mobile/keymaps/default/readme.md +++ /dev/null @@ -1 +0,0 @@ -# The default keymap for microsoft-sculpt-mobile diff --git a/keyboards/handwired/MS-sculpt-mobile/keymaps/milestogo/Makefile b/keyboards/handwired/MS-sculpt-mobile/keymaps/milestogo/Makefile deleted file mode 100644 index 1209ad781..000000000 --- a/keyboards/handwired/MS-sculpt-mobile/keymaps/milestogo/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR - include ../../../../../Makefile -endif diff --git a/keyboards/handwired/MS-sculpt-mobile/keymaps/milestogo/config.h b/keyboards/handwired/MS-sculpt-mobile/keymaps/milestogo/config.h deleted file mode 100644 index 8cf4202cd..000000000 --- a/keyboards/handwired/MS-sculpt-mobile/keymaps/milestogo/config.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -#define USE_BABLPASTE - -// Expect to get errors if you comment a feature out and leave it in your keymap. - -#ifdef USE_BABLPASTE -//define BabblePaste maps -// Windows. -#define MAC_MODE 0 -#define MS_MODE 1 -//aka gnome+KDE -//#define LINUX_MODE 2 -//#define EMACS_MODE 3 -#define VI_MODE 3 -// Readline and tmux -#define READMUX_MODE 2 -//#define WORDSTAR_MODE 5 -#endif - -// Uncomment if you need more free flash space - -// This removes everything but cursor movement -//#define BABL_MOVEMENTONLY -// and this just removes browser shortcuts -//#define BABL_NOBROWSER - -// place overrides here -#endif diff --git a/keyboards/handwired/MS-sculpt-mobile/keymaps/milestogo/keymap.c b/keyboards/handwired/MS-sculpt-mobile/keymaps/milestogo/keymap.c deleted file mode 100644 index 395a9fb47..000000000 --- a/keyboards/handwired/MS-sculpt-mobile/keymaps/milestogo/keymap.c +++ /dev/null @@ -1,272 +0,0 @@ -#include "MS-sculpt-mobile.h" -#include "action_layer.h" -#include "action_util.h" -#include "babblePaste.h" - -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif - -#define _QWR 0 -#define _CDH 2 -#define _SYM 3 -#define _MOV 4 -#define _TRAN 5 - - -enum layer_keycodes { -QWR, -CDH, -SYM, -MOV, -NUM, -TRAN -}; - - -// Shorter spacing -#define XXXX KC_NO -#define ____ KC_TRNS - -// Custom macros - -/* Fn Keys */ -#define TT_SYM MO(_SYM) -#define TT_MOV KC_FN2 -#define TT_NUM MO(_NUM) -#define SSFT ACTION_MODS_ONESHOT(MOD_LSFT) - -enum macro_keycodes { -DHPASTE=1, -VIBRK, -}; - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* QWERTY -* -* |ESC | F1 | F2 | F3 | F4 | F5 | F6 | f7 | F8 | F9 | F10| F11| F12|Vol-|Vol+|_CDH| -* -------------------------------------------------------------------------------' -* | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Bakspace| Del| -* --------------------------------------------------------------------------- -* | tab | q | w | e | r | t | y | u | i | o | p | [ | ] | \ | | -* -------------------------------------------------------------------------------' -* |Bak/Mov| a | s | d | f | g | h | j | k | l | ; | ' | enter |PgUp| -* -------------------------------------------------------------------------------- -* |Lsft | z | x | c | v | b | n | m | , | . | / | Rsft| Up| PgDn| -* --------------------------------------------------------------------------------- -* |Lctl |Lgui |Lalt | Space/Sym | GUI | Sym | Rctl |Left|Down|Rght| -* --------------------------------------------------------------------------------- -*/ - -[_QWR] = KEYMAP( \ - 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, CDH,\ - KC_ESC, 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,\ - 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,\ - TT_MOV, 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,\ - 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,\ - KC_LCTL, KC_LGUI, KC_LALT, KC_FN1, KC_RGUI,TT_SYM,KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT -), - -[_CDH] = KEYMAP (\ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, QWR, \ - KC_ESC, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, ____, ____, ____,\ - TT_MOV, 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,\ - KC_LSFT, KC_Z, KC_X, KC_C, M(DHPASTE), KC_V, KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, ____, KC_1,\ - ____, ____, ____ , KC_FN1, ____, ____, ____, ____, ____, ____ - -), - - -/* SYM -* -* |ESC | F1 | F2 | F3 | F4 | F5 | F6 | f7 | F8 | F9 | F10| F11| F12|Vol-|Vol+|_CDH| -* -------------------------------------------------------------------------------' -* | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Bakspace|Del | -* -------------------------------------------------------------------------- -* | ESC: | ^ | { | } | @ | % | | [ | ( | ) | _ | [ | ] | \ | | -* -------------------------------------------------------------------------------' -* |Bak/Mov| ! | # | 0 | = | { | } | - | 1 | + | ] | ` | enter |PgUp| -* -------------------------------------------------------------------------------- -* |Lsft | ; | ~ | : | ~ | "|"| $ | * | | . | / | Rsft| Up| PgDn| -* --------------------------------------------------------------------------------- -* |Lctl |Lgui |Lalt | Space/Sym | GUI | Sym | Rctl |Left|Down|Rght| -* --------------------------------------------------------------------------------- -*/ - -[_SYM] = KEYMAP (\ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - M(VIBRK), KC_CIRC, KC_LCBR, KC_RCBR,KC_AT, KC_PERC, ____, KC_LBRC,KC_LPRN,KC_RPRN,KC_UNDS, ____, ____, ____,\ - ____, KC_EXLM, KC_HASH, KC_0, KC_EQL, KC_LCBR, KC_RCBR,KC_MINS,KC_1, KC_PLUS,KC_RBRC, KC_GRV, ____, ____,\ - ____, KC_SCLN, KC_TILDE, KC_COLN, KC_TILDE, KC_PIPE, KC_DLR, KC_ASTR, ____, KC_DOT , KC_SLSH, ____, ____, ____,\ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____ -), -/* -* |ESC | MAC| Win|RdLn| VI | | | | | | | | | | | | -* -------------------------------------------------------------------------------' -* | | | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Bakspace| Del| -* --------------------------------------------------------------------------- -* | tab | | |Find| |pTab |DSOL|DelW| Up |DelW|DEOL| [ | ] | \ | | -* -------------------------------------------------------------------------------' -* |Bak/Mov| | | | |nTab |GSOL| <- | Dwn | -> | EOL | ' | enter |PgUp| -* -------------------------------------------------------------------------------- -* |Lsft |Undo| Cut|Copy|Pste| | | | | | / | Rsft| Up| PgDn| -* --------------------------------------------------------------------------------- -* |Lctl |Lgui |Lalt | Space/Sym | GUI | Sym | Rctl |Left|Down|Rght| -* --------------------------------------------------------------------------------- -*/ - -[_MOV] = KEYMAP (\ - ____, B_MAC,B_WIN,B_READ, B_VI, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - ____, ____, B_PAPP, B_NAPP, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - ____, B_UNDO, ____, B_BFND, ____, B_PTAB, B_DSOL, B_DLW, B_UP, B_DRW, B_DEOL, ____, ____, ____, \ - ____, B_SELA, B_BRLD, ____, ____, B_NXTB, B_GSOL, B_L1C, B_DOWN, B_R1C,B_GEOL, ____, ____, ____,\ - ____, B_UNDO,B_CUT, B_COPY, B_PAST, B_PAST, ____, ____, ____, ____, ____, ____, ____, ____, \ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____ -), - -[_TRAN] = KEYMAP (\ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____ -) -}; - -const uint16_t PROGMEM fn_actions[] = { -[1] = ACTION_LAYER_TAP_KEY(_SYM,KC_SPACE), -[2] = ACTION_LAYER_TAP_KEY(_MOV,KC_BSPC) -}; - -#ifdef AUDIO_ENABLE - -float tone_startup[][2] = SONG(STARTUP_SOUND); -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float tone_colemak[][2] = SONG(COLEMAK_SOUND); -#endif - - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWR: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_NOTE_ARRAY(tone_qwerty, false, 0); - #endif - layer_off(_CDH); - } - return false; - break; - - case CDH: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_NOTE_ARRAY(tone_colemak, false, 0); - #endif - layer_on(_CDH); - } - return false; - break; - - case SYM: - if (record->event.pressed) { - layer_on(_SYM); - } else { - layer_off(_SYM); - } - return false; - break; - - } - return true; - -} - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - -/* If id is in the range of BABL macros, call the babl function */ -/* Any clever remapping with modifiers should happen here e.g. shift bablkey does opposite*/ -#ifdef USE_BABLPASTE - - if( id >= BABL_START_NUM && id < (BABL_START_NUM + BABL_NUM_MACROS ) ) { - if (record->event.pressed) { // is there a case where this isn't desired? - - babblePaste ( record, id ); - return MACRO_NONE; - } - } -#endif - - - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - - /* Colemak mod-dh moves the D key to the qwerty V position - This hack makes apple-V_position do what I mean */ - case DHPASTE: - if(keyboard_report->mods & MOD_BIT(KC_LGUI) ) { - if (record->event.pressed) { - clear_keyboard_but_mods(); - register_code(KC_V); - } else { - unregister_code(KC_V); - } - } else { - if (record->event.pressed) { - register_code(KC_D); - } else { - unregister_code(KC_D); - } - } - break; - - case VIBRK: // vi esc: - if (record->event.pressed) { - return MACRO( T(ESC),D(LSFT),T(SCLN),U(LSFT), END ); - } - break; - - - - - default: - return MACRO_NONE; - } - - -return MACRO_NONE; -}; - - - - - -void matrix_init_user(void) { -} - -void matrix_scan_user(void) { - -} - - -void led_set_user(uint8_t usb_led) { - -} - - - - - - diff --git a/keyboards/handwired/MS-sculpt-mobile/keymaps/milestogo/readme.md b/keyboards/handwired/MS-sculpt-mobile/keymaps/milestogo/readme.md deleted file mode 100644 index 96ee0e77a..000000000 --- a/keyboards/handwired/MS-sculpt-mobile/keymaps/milestogo/readme.md +++ /dev/null @@ -1 +0,0 @@ -# A more programmer oriented keymap for microsoft-sculpt-mobile diff --git a/keyboards/handwired/MS-sculpt-mobile/readme.md b/keyboards/handwired/MS-sculpt-mobile/readme.md deleted file mode 100644 index d435b449f..000000000 --- a/keyboards/handwired/MS-sculpt-mobile/readme.md +++ /dev/null @@ -1,58 +0,0 @@ - -This is a way to take a Microsoft ergonomic bluetooth keyboard, and make it -into a hard-wired keyboard running QMK. - -The keyboard is known under several different names: -Mobile Bluetooth 5000, Mobile 6000, Sculpt mobile, and Asus rebranded - -I had a stack of them,since they're cheap on ebay, travel well, and are just ergo enough. - -The ribbon cable is 1mm pitch, which is hard to hand solder. I bought a cheap set of -"pitch adapter" boards https://www.amazon.com/Double-Sided-0-4mm-1-0-Adapter-60mmx38mm/dp/B00OK42118 - -Cut the original ribbon cable sockets off the bluetooth board using a razor, they're hard to desolder. -They're also allow the cable to be inserted on top or bottom. - -If I was going to do it again, I'd make the MCU connection come out the top of the keyboard -and avoid the wires dangling out the bottom. - -As I was debugging the matrix, I started to get random failures. In desparation I tried a second MCU, -but had the same problems. It turns out that the ribbon cable connections can get worn. Shave a -half millimeter off the end of the ribbon cable & the errors go away. - -My method for discovering the matrix was to set up a KEYMAP macro that included all pins. -See MATRIX_TESTING_KEYMAP if you need it. Then set up a keymap that has all printable symbols -in the first 4 rows. test each key & record output. Then switch the printable symbols to the -bottom 4 rows & repeat. This was enough to show the matrix. - - -The full original keymap for the sculpt is - A B C D E F G H ---> -0 b n m , . / -1 g h " -2 7 8 9 0 Del PgUp -3 p [ ] \ -4 y u i o -5 ~ - += j k l ; 5 -6 a s d q w e, Up left -7 F7 F8 F9 F10 F11 F12 f - ------> I J K L M N O P Q R -0 Caps FN -1 Vol+ mute Rctl vol- pgdn LCTL -2 Rshift LShift -3 Ralt LAlt -4 LGUI -5 6 bakspc 1 2 3 4 F4 F5 F6 -6 Down right spc F1 F2 F3 tab -7 r t z x c v enter Esc - -This works with 18 cols + 8 rows on a Teensy++, or Arm based Teensy. - -The Astar mini has all pins exposed , so you can do 18x8 -If you want a speaker, LEDs &etc, you'll need to free up a pin. I recommend joining columns -R and L to the same pin. - -Building - add ASTAR=1 to the compile line or leave out for teensy2++ - - diff --git a/keyboards/handwired/MS-sculpt-mobile/rules.mk b/keyboards/handwired/MS-sculpt-mobile/rules.mk deleted file mode 100644 index 680389c84..000000000 --- a/keyboards/handwired/MS-sculpt-mobile/rules.mk +++ /dev/null @@ -1,48 +0,0 @@ - -## Project specific files -SRC= babblePaste.c - - -ifdef ASTAR - CFLAGS=-D ASTAR - OPT_DEFS += -DBOOTLOADER_SIZE=4096 - MCU = atmega32u4 - OPT_DEFS += -DCATERINA_BOOTLOADER - SCULPT_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done ; \ - avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB) - -else - MCU = at90usb1286 - OPT_DEFS += -DBOOTLOADER_SIZE=2048 - SCULPT_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex -endif - -F_CPU = 16000000 -ARCH = AVR8 -F_USB = $(F_CPU) -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - -# -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE ?= no # USB Nkey Rollover -BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE ?= no # MIDI controls -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE ?= no # Audio output on port C6 - - -USB ?= /dev/cu.usbmodem14141 - - - -upload: build - $(SCULPT_UPLOAD_COMMAND) diff --git a/keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.c b/keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.c new file mode 100644 index 000000000..4c735a6c2 --- /dev/null +++ b/keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.c @@ -0,0 +1 @@ +#include "MS-sculpt-mobile.h" diff --git a/keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.h b/keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.h new file mode 100644 index 000000000..1583dea6e --- /dev/null +++ b/keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.h @@ -0,0 +1,48 @@ +#ifndef MICROSOFT_SCULPT_MOBILE_H +#define MICROSOFT_SCULPT_MOBILE_H + +#include "quantum.h" + + +#define KEYMAP( \ + k7Q, k6O, k6P, k6Q, k5O, k5P, k5Q, k7A, k7B, k7C, k7D, k7E, k7F, k1O, k1K, k1L, \ + k5A, k5K, k5L, k5M, k5N, k5H, k5I, k2A, k2B, k2C, k2D, k5B, k5C, k5J, k2E, \ + k6R, k6D, k6E, k6F, k7I, k7J, k4A, k4B, k4C, k4D, k3A, k3B, k3C, k3D, \ + k0J, k6A, k6B, k6C, k7H, k1A, k1B, k5D, k5E, k5F, k5G, k1C, k7P, k2G, \ + k2P, k7K, k7L, k7M, k7O, k0A, k0B, k0C, k0D, k0E, k0F, k2L, k6G, k1P,\ + k1Q, k4N, k3O,k6N, k3K, k0R, k1M, k6H, k6I, k6J \ +) \ +{ \ + {k0A, k0B, k0C, k0D, k0E, k0F, KC_NO, KC_NO, KC_NO, k0J, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,KC_NO, KC_NO, k0R},\ + {k1A, k1B, k1C, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k1K, k1L, k1M, KC_NO, k1O, k1P, k1Q, KC_NO},\ + {k2A, k2B, k2C, k2D, k2E, KC_NO, k2G, KC_NO, KC_NO, KC_NO, KC_NO, k2L, KC_NO, KC_NO, KC_NO, k2P, KC_NO, KC_NO},\ + {k3A, k3B, k3C, k3D, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k3K, KC_NO, KC_NO, KC_NO, k3O, KC_NO, KC_NO, KC_NO},\ + {k4A, k4B, k4C, k4D, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k4N, KC_NO,KC_NO, KC_NO, KC_NO},\ + {k5A, k5B, k5C, k5D, k5E, k5F, k5G, k5H, k5I, k5J, k5K, k5L, k5M, k5N, k5O, k5P, k5Q, KC_NO },\ + {k6A, k6B, k6C, k6D, k6E, k6F, k6G, k6H, k6I, k6J, KC_NO, KC_NO, KC_NO, k6N, k6O, k6P, k6Q, k6R},\ + {k7A, k7B, k7C, k7D, k7E, k7F, KC_NO, k7H, k7I, k7J, k7K, k7L, k7M, KC_NO, k7O, k7P, k7Q, KC_NO},\ +} + + +#define MATRIX_TESTING_KEYMAP( \ + k0A, k0B, k0C, k0D, k0E, k0F, k0G, k0H, k0I, k0, k0J, k0K, k0L, k0M, k0N, k0O, k0P, k0Q,\ + k1A, k1B, k1C, k1D, k1E, k1F, k1G, k1H, k1I, k1, k1J, k1K, k1L, k1M, k1N, k1O, k1P, k1Q,\ + k2A, k2B, k2C, k2D, k2E, k2F, k2G, k2H, k2I, k2, k2J, k2K, k2L, k2M, k2N, k2O, k2P, k2Q,\ + k3A, k3B, k3C, k3D, k3E, k3F, k3G, k3H, k3I, k3, k3J, k3K, k3L, k3M, k3N, k3O, k3P, k3Q,\ + k4A, k4B, k4C, k4D, k4E, k4F, k4G, k4H, k4I, k4, k4J, k4K, k4L, k4M, k4N, k4O, k4P, k4Q,\ + k5A, k5B, k5C, k5D, k5E, k5F, k5G, k5H, k5I, k5, k5J, k5K, k5L, k5M, k5N, k5O, k5P, k5Q,\ + k6A, k6B, k6C, k6D, k6E, k6F, k6G, k6H, k6I, k6, k6J, k6K, k6L, k6M, k6N, k6O, k6P, k6Q,\ + k7A, k7B, k7C, k7D, k7E, k7F, k7G, k7H, k7I, k7, k7J, k7K, k7L, k7M, k7N, k7O, k7P, k7Q\ +) \ +{ \ + {k0A, k0B, k0C, k0D, k0E, k0F, k0G, k0H, k0I, k0, k0J, k0K, k0L, k0M, k0N, k0O, k0P, k0Q},\ + {k1A, k1B, k1C, k1D, k1E, k1F, k1G, k1H, k1I, k1, k1J, k1K, k1L, k1M, k1N, k1O, k1P, k1Q},\ + {k2A, k2B, k2C, k2D, k2E, k2F, k2G, k2H, k2I, k2, k2J, k2K, k2L, k2M, k2N, k2O, k2P, k2Q},\ + {k3A, k3B, k3C, k3D, k3E, k3F, k3G, k3H, k3I, k3, k3J, k3K, k3L, k3M, k3N, k3O, k3P, k3Q},\ + {k4A, k4B, k4C, k4D, k4E, k4F, k4G, k4H, k4I, k4, k4J, k4K, k4L, k4M, k4N, k4O, k4P, k4Q},\ + {k5A, k5B, k5C, k5D, k5E, k5F, k5G, k5H, k5I, k5, k5J, k5K, k5L, k5M, k5N, k5O, k5P, k5Q},\ + {k6A, k6B, k6C, k6D, k6E, k6F, k6G, k6H, k6I, k6, k6J, k6K, k6L, k6M, k6N, k6O, k6P, k6Q},\ + {k7A, k7B, k7C, k7D, k7E, k7F, k7G, k7H, k7I, k7, k7J, k7K, k7L, k7M, k7N, k7O, k7P, k7Q},\ +} + +#endif diff --git a/keyboards/handwired/MS_sculpt_mobile/Makefile b/keyboards/handwired/MS_sculpt_mobile/Makefile new file mode 100644 index 000000000..bd09e5885 --- /dev/null +++ b/keyboards/handwired/MS_sculpt_mobile/Makefile @@ -0,0 +1,3 @@ +ifndef MAKEFILE_INCLUDED + include ../../../Makefile +endif diff --git a/keyboards/handwired/MS_sculpt_mobile/babblePaste.c b/keyboards/handwired/MS_sculpt_mobile/babblePaste.c new file mode 100644 index 000000000..3a9b86997 --- /dev/null +++ b/keyboards/handwired/MS_sculpt_mobile/babblePaste.c @@ -0,0 +1,459 @@ +/* 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 "babblePaste.h" +#include "action_macro.h" + +#ifdef USE_BABLPASTE + +// GLOBAL variable to determine mode. Sets startup default if no eeppom +uint8_t babble_mode =0 ; + +// small function that we might also want to call from a keymap. + +macro_t* switch_babble_mode( uint8_t id) { + babble_mode= id; + return MACRO_NONE; //less typing where called +} + + +// Today I learned that the preprocessor can not create a switch statement label from an argument +// And else statements have problems, see https://gcc.gnu.org/onlinedocs/gcc-3.0.1/cpp_3.html#SEC15 +#define BABLM(ent, macro...) \ + if ( ent == shortcut ) \ + { action_macro_play( MACRO(macro)); return MACRO_NONE; } + + +/* this function runs the appropriate babblepaste macro, given +the global babble_mode, and a shortcut from the ENUM in babblePaste.h +TODO, the pointers in this function should be stored in a PROGMEM array, not ram. +But that requires even more clever preprocessor foo. +*/ +const macro_t *babblePaste (keyrecord_t *record, uint8_t shortcut) { +/* + if ( shortcut < BABL_START_NUM || \ + shortcut >= (BABL_START_NUM + BABL_NUM_MACROS ) ) { + return MACRO_NONE; + } +*/ + + +#ifdef MS_MODE + if ( BABL_WINDOWS == shortcut ) { return switch_babble_mode(MS_MODE); } +#endif +#ifdef MAC_MODE + if ( BABL_MAC == shortcut) { return switch_babble_mode(MAC_MODE); } +#endif +#ifdef LINUX_MODE + if ( BABL_LINUX == shortcut ) { return switch_babble_mode(LINUX_MODE); } +#endif + #ifdef READMUX_MODE + if ( BABL_READLINE == shortcut ) { switch_babble_mode(READMUX_MODE); return MACRO_NONE; } +#endif +#ifdef VI_MODE + if ( BABL_VI == shortcut ) { return switch_babble_mode(VI_MODE); } +#endif +#ifdef EMACS_MODE + if ( BABL_EMACS == shortcut ) { return switch_babble_mode(EMACS_MODE); } +#endif + + + + switch(babble_mode) { + +#ifdef MS_MODE + + case MS_MODE: + BABLM( BABL_GO_LEFT_1C, T(LEFT), END ); + BABLM( BABL_GO_RIGHT_1C , T(RIGHT), END ); + BABLM( BABL_GO_LEFT_WORD, D(LCTL), T(LEFT), U(LCTL), END ); + BABLM( BABL_GO_RIGHT_WORD, D(LCTL), T(RIGHT), U(LCTL), END ); + BABLM( BABL_GO_START_LINE, T(HOME), END ); + BABLM( BABL_GO_END_LINE, T(END), END ); + BABLM( BABL_GO_START_DOC, D(LCTL),T(HOME), U(LCTL),END ); + BABLM( BABL_GO_END_DOC, D(LCTL),T(END), U(LCTL),END ); + BABLM( BABL_GO_NEXT_LINE, T(DOWN), END ); + BABLM( BABL_GO_PREV_LINE, T(UP), END ); + BABLM( BABL_PGDN, T(PGDN), END ); + BABLM( BABL_PGUP, T(PGUP), END ); + BABLM( BABL_DEL_RIGHT_1C, T(DEL), END ); + BABLM( BABL_DEL_LEFT_WORD, D(LCTL), T(BSPACE), U(LCTL), END ); + BABLM( BABL_DEL_RIGHT_WORD, D(LCTL), T(DEL), U(LCTL), END ); + BABLM( BABL_DEL_TO_LINE_END, D(RSFT), T(HOME), U(RSFT), T(DEL), END); + BABLM( BABL_DEL_TO_LINE_START, D(RSFT), T(END), U(RSFT), T(DEL), END ); +#ifndef BABL_MOVEMENTONLY + BABLM( BABL_UNDO, D(LCTL), T(Z), U(LCTL), END ); + BABLM( BABL_REDO, D(LCTL), T(Y), U(LCTL), END ); + BABLM( BABL_CUT, D(LCTL), T(X), U(LCTL), END ); + BABLM( BABL_COPY, D(LCTL), T(C), U(LCTL), END ); + BABLM( BABL_PASTE, D(LCTL), T(V), U(LCTL), END ); + BABLM( BABL_SELECT_ALL, D(LCTL), T(A), U(LCTL), END ); + BABLM( BABL_FIND, D(LCTL),T(F), U(LCTL),END ); + BABLM( BABL_FIND_NEXT, T(F3),END ); + BABLM( BABL_FIND_REPLACE, D(LCTL),T(H), U(LCTL),END ); + BABLM( BABL_RUNAPP, D(LGUI),T(R), U(LGUI),END ); + BABLM( BABL_SWITCH_APP_NEXT, D(LALT),T(TAB), U(LALT),END ); + BABLM( BABL_SWITCH_APP_LAST, D(LSFT),D(LALT),T(TAB), U(LALT), U(LSFT),END ); + BABLM( BABL_CLOSE_APP, D(LALT),T(F4), U(LALT),END ); + BABLM( BABL_HELP, T(F1),END ); +#ifndef BABL_NOBROWSER + BABLM( BABL_BROWSER_NEW_TAB, D(LCTL), T(T), U(LCTL),END ); + BABLM( BABL_BROWSER_CLOSE_TAB, D(LCTL), T(W), U(LCTL),END ); + BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LCTL), D(RSFT),T(T), U(RSFT),U(LCTL),END ); + BABLM( BABL_BROWSER_NEXT_TAB, D(LCTL), T(TAB), U(LCTL),END ); + BABLM( BABL_BROWSER_PREV_TAB, D(LCTL), D(RSFT), T(TAB), U(RSFT), U(LCTL),END ); + BABLM( BABL_BROWSER_URL_BAR, D(LCTL), T(L), U(LCTL),END ); + BABLM( BABL_BROWSER_FORWARD, D(LALT), T(RIGHT), U(LALT),END ); + BABLM( BABL_BROWSER_BACK, D(LALT), T(LEFT), U(LALT),END ); + BABLM( BABL_BROWSER_FIND, D(LCTL), T(F), U(LCTL),END ); + BABLM( BABL_BROWSER_BOOKMARK, D(LCTL), T(D), U(LCTL),END ); + //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LCTL),END ); // EDGE + BABLM( BABL_BROWSER_DEV_TOOLS, D(LCTL), T(T), U(LCTL),END ); // Chrome + // Chrome + BABLM( BABL_BROWSER_RELOAD, D(LCTL), T(F5), U(LCTL),END ); // hard reload w/o cache + BABLM( BABL_BROWSER_FULLSCREEN, T(F11),END ); //command shift F + BABLM( BABL_BROWSER_ZOOM_IN, D(LCTL), D(RSFT), T(EQL), U(RSFT), U(LCTL),END ); // ctr+ + + BABLM( BABL_BROWSER_ZOOM_OUT, D(LCTL), T(MINS), U(LCTL),END ); +#endif +#endif + + // Todo, ring bell, flash light, show user this isn't supported + return MACRO_NONE; + + +#endif /* MS_MODE*/ + + +#ifdef LINUX_MODE + + case LINUX_MODE: + BABLM( BABL_GO_LEFT_1C , T(LEFT), END ); + BABLM( BABL_GO_RIGHT_1C , T(RIGHT), END ); + BABLM( BABL_GO_LEFT_WORD , D(LCTL), T(LEFT), U(LCTL), END ); + BABLM( BABL_GO_RIGHT_WORD , D(LCTL), T(RIGHT), U(LCTL), END ); + BABLM( BABL_GO_START_LINE , T(HOME), END ); + BABLM( BABL_GO_END_LINE , T(END), END ); + BABLM( BABL_GO_START_DOC , D(LCTL),T(HOME), U(LCTL),END ); + BABLM( BABL_GO_END_DOC , D(LCTL),T(END), U(LCTL),END ); + BABLM( BABL_GO_NEXT_LINE , T(DOWN), END ); + BABLM( BABL_GO_PREV_LINE , T(UP), END ); + BABLM( BABL_PGDN , T(PGDN), END ); + BABLM( BABL_PGUP , T(PGUP), END ); + BABLM( BABL_DEL_RIGHT_1C , D(DEL), END ); + BABLM( BABL_DEL_LEFT_WORD , D(LCTL), T(BSPACE), U(LCTL), END ); + BABLM( BABL_DEL_RIGHT_WORD , D(LCTL), T(DEL), U(LCTL), END ); + BABLM( BABL_DEL_TO_LINE_END, D(RSFT), T(HOME), U(RSFT), T(DEL), END); + BABLM( BABL_DEL_TO_LINE_START, D(RSFT), T(END), U(RSFT), T(DEL), END ); +#ifndef BABL_MOVEMENTONLY + BABLM( BABL_UNDO , D(LCTL), T(Z), U(LCTL), END ); + BABLM( BABL_REDO , D(LCTL), T(Y), U(LCTL), END ); + BABLM( BABL_CUT , D(LCTL), T(X), U(LCTL), END ); + BABLM( BABL_COPY , D(LCTL), T(C), U(LCTL), END ); + BABLM( BABL_PASTE , D(LCTL), T(V), U(LCTL), END ); + BABLM( BABL_SELECT_ALL, D(LCTL), T(A), U(LCTL), END ); + BABLM( BABL_FIND, D(LCTL),T(F), U(LCTL),END ); + /* BABLM(BABL_FIND_NEXT , T(F3),END ); KDE */ + BABLM( BABL_FIND_NEXT, D(LCTL),T(G), U(LCTL),END ); // Gnome*/ + /* BABLM( , D(LCTL),T(R), U(LCTL),END ); KDE */ + BABLM( BABL_FIND_REPLACE, D(LCTL),T(H), U(LCTL),END ); // Gnome*/ + BABLM( BABL_RUNAPP, D(LALT),T(F2), U(LALT),END ); + BABLM( BABL_SWITCH_APP_NEXT, D(LCTL),T(TAB), U(LCTL),END ); + BABLM( BABL_SWITCH_APP_LAST, D(LSFT),D(LCTL),T(TAB), U(LCTL), U(LSFT),END ); + BABLM( BABL_CLOSE_APP, D(LALT),T(F4), U(LALT),END ); + //BABLM( BABL_HELP, END ); + +#ifndef BABL_NOBROWSER + BABLM( BABL_BROWSER_NEW_TAB, D(LCTL), T(T), U(LCTL),END ); + BABLM( BABL_BROWSER_CLOSE_TAB, D(LCTL), T(W), U(LCTL),END ); + BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LCTL), D(RSFT),T(T), U(RSFT),U(LCTL),END ); + BABLM( BABL_BROWSER_NEXT_TAB, D(LCTL), T(TAB), U(LCTL),END ); + BABLM( BABL_BROWSER_PREV_TAB, D(LCTL), D(RSFT), T(TAB), U(RSFT), U(LCTL),END ); + BABLM( BABL_BROWSER_URL_BAR, D(LCTL), T(L), U(LCTL),END ); + BABLM( BABL_BROWSER_FORWARD, D(LALT), T(RIGHT), U(LALT),END ); + BABLM( BABL_BROWSER_BACK, D(LALT), T(LEFT), U(LALT),END ); + BABLM( BABL_BROWSER_FIND, D(LCTL), T(F), U(LCTL),END ); + BABLM( BABL_BROWSER_BOOKMARK, D(LCTL), T(D), U(LCTL),END ); + BABLM( BABL_BROWSER_DEV_TOOLS, D(LCTL), T(T), U(LCTL),END ); // Chrome + BABLM( BABL_BROWSER_RELOAD, D(LCTL), T(F5), U(LCTL),END ); // hard reload w/o cache + BABLM( BABL_BROWSER_FULLSCREEN, T(F11),END ); //command shift F + BABLM( BABL_BROWSER_ZOOM_IN, D(LCTL), T(PLUS), U(LCTL),END ); + BABLM( BABL_BROWSER_ZOOM_OUT, D(LCTL), T(MINS), U(LCTL),END ); +#endif +#endif + return MACRO_NONE; + +#endif + +#ifdef MAC_MODE + + case MAC_MODE: + BABLM( BABL_GO_LEFT_1C , T(LEFT), END ); + BABLM( BABL_GO_RIGHT_1C, T(RIGHT), END ); + BABLM( BABL_GO_LEFT_WORD , D(LALT), T(LEFT), U(LALT), END ); + BABLM( BABL_GO_RIGHT_WORD , D(LALT), T(RIGHT), U(LALT), END ); + BABLM( BABL_GO_START_LINE , D(LGUI), T(LEFT), U(LGUI), END ); + BABLM( BABL_GO_END_LINE , D(LGUI), T(RIGHT), U(LGUI), END ); + BABLM( BABL_GO_START_DOC , D(LGUI),T(UP), U(LGUI),END ); + BABLM( BABL_GO_END_DOC , D(LGUI),T(DOWN), U(LGUI),END ); + BABLM( BABL_GO_NEXT_LINE , T(DOWN), END ); + BABLM( BABL_GO_PREV_LINE , T(UP), END ); + BABLM( BABL_PGDN , D(LALT),T(DOWN), U(LALT), END ); + BABLM( BABL_PGUP , D(LALT),T(UP), U(LALT), END ); + BABLM( BABL_DEL_RIGHT_1C , D(DEL), END ); + BABLM( BABL_DEL_LEFT_WORD , D(LALT), T(BSPACE), U(LALT), END ); + BABLM( BABL_DEL_RIGHT_WORD, D(LALT), T(DEL), U(LALT), END ); + BABLM( BABL_DEL_TO_LINE_END, D(LCTL), T(K), U(LCTL), END );// there must be another way + BABLM( BABL_DEL_TO_LINE_START, D(LGUI), T(BSPACE), U(LGUI), END ); +#ifndef BABL_MOVEMENTONLY + BABLM( BABL_UNDO , D(1), D(LGUI), T(Z), U(LGUI), END ); + BABLM( BABL_REDO , D(LSFT),D(LGUI), T(Z), U(LSFT),U(LGUI), END ); + BABLM( BABL_CUT , D(LGUI), T(X), U(LGUI), END ); + BABLM( BABL_COPY , D(LGUI), T(C), U(LGUI), END ); + BABLM( BABL_PASTE , D(LGUI), T(V), U(LGUI), END ); + BABLM( BABL_SELECT_ALL , D(LGUI), T(A), U(LGUI), END ); + BABLM( BABL_FIND , D(LGUI),T(F), U(LGUI),END ); + BABLM( BABL_FIND_NEXT, D(LGUI),T(G), U(LGUI),END ); + BABLM( BABL_FIND_REPLACE, D(LGUI),T(F), U(LGUI),END ); + BABLM( BABL_RUNAPP , D(LGUI),T(R), U(LGUI),END ); + BABLM( BABL_SWITCH_APP_NEXT , D(LGUI),T(TAB), U(LGUI),END ); + BABLM( BABL_SWITCH_APP_LAST , D(LSFT),D(LGUI),T(TAB), U(LGUI), U(LSFT),END ); + BABLM( BABL_CLOSE_APP , D(LGUI),T(Q), U(LGUI),END ); + BABLM( BABL_HELP , D(LSFT),D(LGUI),T(SLASH), U(LGUI), U(LSFT),END ); + +#ifndef BABL_NOBROWSER + BABLM( BABL_BROWSER_NEW_TAB, D(LGUI), T(T), U(LGUI),END ); + BABLM( BABL_BROWSER_CLOSE_TAB, D(LGUI), T(W), U(LGUI),END ); + BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LGUI), D(RSFT),T(T), U(RSFT),U(LGUI),END ); + BABLM( BABL_BROWSER_NEXT_TAB, D(LGUI),D(LALT), T(RIGHT),U(LALT), U(LGUI),END ); + BABLM( BABL_BROWSER_PREV_TAB, D(LGUI), D(RSFT), T(LEFT), U(RSFT), U(LGUI),END ); + BABLM( BABL_BROWSER_URL_BAR, D(LGUI), T(L), U(LGUI),END ); + BABLM( BABL_BROWSER_FORWARD, D(LGUI), T(RIGHT), U(LGUI),END ); + BABLM( BABL_BROWSER_BACK, D(LGUI), T(LEFT), U(LGUI),END ); + BABLM( BABL_BROWSER_FIND, D(LGUI), T(F), U(LGUI),END ); + BABLM( BABL_BROWSER_BOOKMARK, D(LGUI), T(D), U(LGUI),END ); + //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LGUI),END ); // EDGE + BABLM( BABL_BROWSER_DEV_TOOLS, D(LGUI), D(LALT), T(I), U(LALT),U(LGUI),END ); // Chrome + // Chrome + BABLM( BABL_BROWSER_RELOAD, D(LGUI), T(R), U(LGUI),END ); // add shift for reload w/o cache + BABLM( BABL_BROWSER_FULLSCREEN, D(LGUI), D(LCTL), T(P), U(LCTL), U(LGUI),END ); //command shift F + BABLM( BABL_BROWSER_ZOOM_IN, D(LGUI), D(RSFT), T(EQL), U(RSFT), U(LGUI),END ); // ctr+ + + BABLM( BABL_BROWSER_ZOOM_OUT, D(LGUI), T(MINS), U(LGUI),END ); +#endif +#endif + + return MACRO_NONE; +#endif + +#ifdef EMACS_MODE + + case EMACS_MODE: + switch(shortcut) { +//probably should allow meta to not be ALT + + BABLM( BABL_GO_LEFT_1C, T(LEFT), END ); + BABLM( BABL_GO_RIGHT_1C, T(RIGHT), END ); + BABLM( BABL_GO_LEFT_WORD, D(LALT), T(B), U(LALT), END ); + BABLM( BABL_GO_RIGHT_WORD , D(LALT), T(F), U(LALT), END ); + BABLM( BABL_GO_START_LINE , D(LCTL), T(A), U(LCTL), END ); + BABLM( BABL_GO_END_LINE , D(LCTL), T(E), U(LCTL), END ); + BABLM( BABL_GO_START_DOC , D(LALT), D(LSFT), T(COMM),U(LSFT), U(LALT) ,END ); + BABLM( BABL_GO_END_DOC , D(LALT), D(LSFT), T(DOT), U(LSFT), U(LALT) ,END ); + BABLM( BABL_GO_NEXT_LINE , D(LCTL), T(N), U(LCTL), END ); + BABLM( BABL_GO_PREV_LINE , D(LCTL), T(P), U(LCTL), END ); + BABLM( BABL_PGDN , D(LCTL), T(V), U(LCTL), END ); + BABLM( BABL_PGUP , D(LALT), T(V), U(LALT), END ); + BABLM( BABL_DEL_RIGHT_1C, D(LCTL), T(D), U(LCTL),END ); + BABLM( BABL_DEL_LEFT_WORD , D(LCTL), T(BSPACE), U(LCTL), END ); + BABLM( BABL_DEL_RIGHT_WORD , D(LALT), T(D), U(LALT), END ); + BABLM( BABL_DEL_TO_LINE_END, D(LCTL), T(K), U(LCTL), END ); + BABLM( BABL_DEL_TO_LINE_START, T(ESC), T(0), D(LCTL), T(K), U(LCTL), END ); +#ifndef BABL_MOVEMENTONLY + BABLM( BABL_UNDO , D(LCTL), T(X), U(LCTL),T(C), END ); + BABLM( BABL_REDO , D(LCTL), T(X), U(LCTL),T(C), END ); // arguably + BABLM( BABL_CUT , D(LCTL), T(W), U(LCTL), END ); + BABLM( BABL_COPY , D(LALT), T(W), U(LALT), END ); //really? + BABLM( BABL_PASTE , D(LCTL), T(Y), U(LCTL), END ); + BABLM( BABL_SELECT_ALL ,D(LCTL), T(X), U(LCTL),T(H), END ); + BABLM( BABL_FIND , D(LCTL), T(S), U(LCTL),END ); + BABLM( BABL_FIND_NEXT , D(LCTL), T(S), U(LCTL),END ); + BABLM( BABL_FIND_REPLACE , D(LALT),D(LSFT), T(5),U(LSFT), U(LALT), END ); + BABLM( BABL_RUNAPP , D(LALT), T(X), U(LALT),T(S),T(H),T(E),T(L),T(L),END );// arguably + BABLM( BABL_SWITCH_APP_NEXT , D(LCTL), T(X), U(LCTL),T(RIGHT), END ); // arguably + BABLM( BABL_SWITCH_APP_LAST , D(LCTL), T(X), U(LCTL),T(LEFT), END ); // arguably + BABLM( BABL_CLOSE_APP , D(LCTL), T(X), U(LCTL),T(C),END ); + BABLM( BABL_HELP , D(LCTL),T(H), U(LCTL),T(A),END); // start search in help +#ifndef BABL_NOBROWSER +/* you get to figure w3 out + BABLM( BABL_BROWSER_NEW_TAB, D(LGUI), T(T), U(LGUI),END ); + BABLM( BABL_BROWSER_CLOSE_TAB, D(LGUI), T(W), U(LGUI),END ); + BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LGUI), D(RSFT),T(T), U(RSFT),U(LGUI),END ); + BABLM( BABL_BROWSER_NEXT_TAB, D(LGUI),D(LALT), T(RIGHT),U(LALT), U(LGUI),END ); + BABLM( BABL_BROWSER_PREV_TAB, D(LGUI), D(RSFT), T(LEFT), U(RSFT), U(LGUI),END ); + BABLM( BABL_BROWSER_URL_BAR, D(LGUI), T(L), U(LGUI),END ); + BABLM( BABL_BROWSER_FORWARD, D(LGUI), T(RIGHT), U(LGUI),END ); + BABLM( BABL_BROWSER_BACK, D(LGUI), T(LEFT), U(LGUI),END ); + BABLM( BABL_BROWSER_FIND, D(LGUI), T(F), U(LGUI),END ); + BABLM( BABL_BROWSER_BOOKMARK, D(LGUI), T(D), U(LGUI),END ); + //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LGUI),END ); // EDGE + BABLM( BABL_BROWSER_DEV_TOOLS, D(LGUI), D(LALT), T(I), U(LALT),U(LGUI),END ); // Chrome + // Chrome + BABLM( BABL_BROWSER_RELOAD, D(LGUI), T(R), U(LGUI),END ); // add shift for reload w/o cache + BABLM( BABL_BROWSER_FULLSCREEN, D(LGUI), D(LCTL), T(P), U(LCTL), U(LGUI),END ); //command shift F + BABLM( BABL_BROWSER_ZOOM_IN, D(LGUI), D(RSFT), T(EQL), U(RSFT), U(LGUI),END ); // ctr+ + + BABLM( BABL_BROWSER_ZOOM_OUT, D(LGUI), T(MINS), U(LGUI),END ); +*/ +#endif +#endif + break; + + return MACRO_NONE; + } + +#endif + + +#ifdef VI_MODE + case VI_MODE: +// you have to track the modes yourself. Otherwise motion is awful (bell, bell, bell) + + + BABLM( BABL_GO_LEFT_1C , T(H), END ); + BABLM( BABL_GO_RIGHT_1C , T(L), END ); + BABLM( BABL_GO_LEFT_WORD , T(B),END ); + BABLM( BABL_GO_RIGHT_WORD , T(W), END ); + BABLM( BABL_GO_START_LINE , D(LSFT), T(6),U(LSFT), END ); //^ + BABLM( BABL_GO_END_LINE , D(LSFT), T(4),U(LSFT) , END ); //$ + BABLM( BABL_GO_START_DOC , T(G),T(G) ,END ); + BABLM( BABL_GO_END_DOC , D(LSFT), T(G),U(LSFT),END ); + BABLM( BABL_GO_NEXT_LINE , T(J), END ); + BABLM( BABL_GO_PREV_LINE, T(K), END ); + BABLM( BABL_PGDN ,D(LCTL), T(F), U(LCTL), END ); + BABLM( BABL_PGUP , D(LCTL), T(B), U(LCTL), END ); + BABLM( BABL_DEL_RIGHT_1C , T(X),END ); + BABLM( BABL_DEL_LEFT_WORD , T(D),T(G),T(E),END ); + BABLM( BABL_DEL_RIGHT_WORD , T(D),T(W),END ); + BABLM( BABL_DEL_TO_LINE_END, T(D),D(LSFT), T(4),U(LSFT) ,END ); // d$ + BABLM( BABL_DEL_TO_LINE_START, T(D),D(LSFT), T(6),U(LSFT) ,END ); +#ifndef BABL_MOVEMENTONLY + BABLM( BABL_UNDO , T(U), END ); + BABLM( BABL_REDO , D(LCTL), T(R), U(LCTL), END ); + BABLM( BABL_CUT , T(X), END ); + BABLM( BABL_COPY , T(Y),END ); + BABLM( BABL_PASTE , T(P), END ); + BABLM( BABL_SELECT_ALL , D(LSFT), T(SCLN),U(LSFT),D(LSFT), T(5),U(LSFT),T(Y), END ); // wrong but helpful? + BABLM( BABL_FIND , T(SLASH),END ); + BABLM( BABL_FIND_NEXT , T(N),END ); + BABLM( BABL_FIND_REPLACE , D(LALT),D(LSFT), T(5),U(LSFT), U(LALT), END ); + BABLM( BABL_RUNAPP,END ); + BABLM( BABL_SWITCH_APP_NEXT ,END ); + BABLM( BABL_SWITCH_APP_LAST ,END ); + BABLM(BABL_CLOSE_APP, D(LSFT), T(SCLN),U(LSFT), T(Q), D(RSFT), T(1),U(RSFT), END ); + BABLM(BABL_HELP, D(LSFT), T(SCLN),U(LSFT),T(H),END); // start search in help +#ifndef BABL_NOBROWSER +/* you get to figure this out + BABLM( BABL_BROWSER_NEW_TAB, D(LGUI), T(T), U(LGUI),END ); + BABLM( BABL_BROWSER_CLOSE_TAB, D(LGUI), T(W), U(LGUI),END ); + BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LGUI), D(RSFT),T(T), U(RSFT),U(LGUI),END ); + BABLM( BABL_BROWSER_NEXT_TAB, D(LGUI),D(LALT), T(RIGHT),U(LALT), U(LGUI),END ); + BABLM( BABL_BROWSER_PREV_TAB, D(LGUI), D(RSFT), T(LEFT), U(RSFT), U(LGUI),END ); + BABLM( BABL_BROWSER_URL_BAR, D(LGUI), T(L), U(LGUI),END ); + BABLM( BABL_BROWSER_FORWARD, D(LGUI), T(RIGHT), U(LGUI),END ); + BABLM( BABL_BROWSER_BACK, D(LGUI), T(LEFT), U(LGUI),END ); + BABLM( BABL_BROWSER_FIND, D(LGUI), T(F), U(LGUI),END ); + BABLM( BABL_BROWSER_BOOKMARK, D(LGUI), T(D), U(LGUI),END ); + //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LGUI),END ); // EDGE + BABLM( BABL_BROWSER_DEV_TOOLS, D(LGUI), D(LALT), T(I), U(LALT),U(LGUI),END ); // Chrome + // Chrome + BABLM( BABL_BROWSER_RELOAD, D(LGUI), T(R), U(LGUI),END ); // add shift for reload w/o cache + BABLM( BABL_BROWSER_FULLSCREEN, D(LGUI), D(LCTL), T(P), U(LCTL), U(LGUI),END ); //command shift F + BABLM( BABL_BROWSER_ZOOM_IN, D(LGUI), T(PLUS), U(LGUI),END ); + BABLM( BABL_BROWSER_ZOOM_OUT, D(LGUI), T(MINS), U(LGUI),END ); +*/ +#endif +#endif + return MACRO_NONE; +#endif + + + + +#ifdef READMUX_MODE +// Readline command line editing + tmux windowing +// I havent decided how much to do readline and how much tmux + + + case READMUX_MODE: + + BABLM( BABL_GO_LEFT_1C , T(LEFT), END ); + BABLM( BABL_GO_RIGHT_1C , T(RIGHT), END ); + BABLM( BABL_GO_LEFT_WORD , D(LALT), T(B), U(LALT), END ); + BABLM( BABL_GO_RIGHT_WORD , D(LALT), T(F), U(LALT), END ); + BABLM( BABL_GO_START_LINE , D(LCTL), T(A), U(LCTL), END ); + BABLM( BABL_GO_END_LINE , D(LCTL), T(E), U(LCTL), END ); + //BABLM( BABL_GO_START_DOC ,END );// tmux? + //BABLM( BABL_GO_END_DOC ,END ); // tmux? + BABLM( BABL_GO_NEXT_LINE , D(LCTL), T(N), U(LCTL), END ); + BABLM( BABL_GO_PREV_LINE , D(LCTL), T(P), U(LCTL), END ); + BABLM( BABL_PGDN , T(PGDN), END ); + BABLM( BABL_PGUP , T(PGUP), END ); + BABLM( BABL_DEL_RIGHT_1C , D(LCTL), T(D), U(LCTL),END ); + BABLM( BABL_DEL_LEFT_WORD , D(LCTL), T(W), U(LCTL), END ); + BABLM( BABL_DEL_RIGHT_WORD , D(LALT), T(D), U(LALT), END ); + BABLM( BABL_DEL_TO_LINE_END, D(LCTL), T(K), U(LCTL), END ); + BABLM( BABL_DEL_TO_LINE_START, D(LCTL), T(U), U(LCTL), END ); +#ifndef BABL_MOVEMENTONLY + BABLM( BABL_UNDO , D(LALT), T(R), U(LALT) , END ); + BABLM( BABL_REDO , D(LCTL), T(X), U(LCTL),T(C), END ); // arguably + BABLM( BABL_CUT , D(LCTL), T(K), U(LCTL), END ); // wrong half the time + //BABLM( BABL_COPY ,END ); + BABLM( BABL_PASTE , D(LCTL), T(Y), U(LCTL), END ); + BABLM( BABL_SELECT_ALL , D(LCTL), T(A), T(K), T(Y), U(LCTL) , END ); + BABLM( BABL_FIND , D(LCTL), T(R), U(LCTL), END ); // search history + BABLM(BABL_FIND_NEXT, D(LCTL), T(S), U(LCTL), END ); + //BABLM( BABL_FIND_REPLACE ,END ); + BABLM( BABL_RUNAPP , D(LCTL), T(B), U(LCTL), T(C),END ); //tmux + BABLM( BABL_SWITCH_APP_NEXT , D(LCTL), T(B), U(LCTL), T(N),END ); //tmux + BABLM( BABL_SWITCH_APP_LAST , D(LCTL), T(B), U(LCTL), T(P),END ); //tmux + BABLM( BABL_CLOSE_APP , D(LCTL), T(B), U(LCTL), T(D),END); // usually what I want + // BABLM( BABL_HELP ,END ); +#ifndef BABL_NOBROWSER +/* Add lynx shortcuts? + BABLM( BABL_BROWSER_NEW_TAB, D(LGUI), T(T), U(LGUI),END ); + BABLM( BABL_BROWSER_CLOSE_TAB, D(LGUI), T(W), U(LGUI),END ); + BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LGUI), D(RSFT),T(T), U(RSFT),U(LGUI),END ); + BABLM( BABL_BROWSER_NEXT_TAB, D(LGUI),D(LALT), T(RIGHT),U(LALT), U(LGUI),END ); + BABLM( BABL_BROWSER_PREV_TAB, D(LGUI), D(RSFT), T(LEFT), U(RSFT), U(LGUI),END ); + BABLM( BABL_BROWSER_URL_BAR, D(LGUI), T(L), U(LGUI),END ); + BABLM( BABL_BROWSER_FORWARD, D(LGUI), T(RIGHT), U(LGUI),END ); + BABLM( BABL_BROWSER_BACK, D(LGUI), T(LEFT), U(LGUI),END ); + BABLM( BABL_BROWSER_FIND, D(LGUI), T(F), U(LGUI),END ); + BABLM( BABL_BROWSER_BOOKMARK, D(LGUI), T(D), U(LGUI),END ); + //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LGUI),END ); // EDGE + BABLM( BABL_BROWSER_DEV_TOOLS, D(LGUI), D(LALT), T(I), U(LALT),U(LGUI),END ); // Chrome + // Chrome + BABLM( BABL_BROWSER_RELOAD, D(LGUI), T(R), U(LGUI),END ); // add shift for reload w/o cache + BABLM( BABL_BROWSER_FULLSCREEN, D(LGUI), D(LCTL), T(P), U(LCTL), U(LGUI),END ); //command shift F + BABLM( BABL_BROWSER_ZOOM_IN, D(LGUI), T(PLUS), U(LGUI),END ); + BABLM( BABL_BROWSER_ZOOM_OUT, D(LGUI), T(MINS), U(LGUI),END ); +*/ +#endif +#endif + + return MACRO_NONE; + +#endif + + default: + return MACRO_NONE; + } + +} + + +#endif \ No newline at end of file diff --git a/keyboards/handwired/MS_sculpt_mobile/babblePaste.h b/keyboards/handwired/MS_sculpt_mobile/babblePaste.h new file mode 100644 index 000000000..3067c854d --- /dev/null +++ b/keyboards/handwired/MS_sculpt_mobile/babblePaste.h @@ -0,0 +1,238 @@ +/* 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 bable_mode is done by another macro, or TBD interaction with the host. + +Huge thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts +and jeebak & algernon's keymap +*/ +#ifndef _babblePaste_h_included__ +#define _babblePaste_h_included__ +#include "action_layer.h" +#include "quantum_keycodes.h" +#include "config.h" + +#ifdef USE_BABLPASTE + +/* *************************** + +// Uncomment any modes you want. Whatever mode = 0 will be the default on boot +// Expect to get errors if you comment a feature out and leave it in your keymap. + +#define USE_BABLPASTE + +//#define MS_MODE 0 // Windows. +//#define MAC_MODE 1 +//#define LINUX_MODE 2 //aka gnome+KDE +//#define EMACS_MODE 3 +//#define VI_MODE 4 +//#define WORDSTAR_MODE 5 +//#define READMUX 6 // Readline and tmux + +// This removes everything but cursor movement +//#define BABL_MOVEMENTONLY +// and this just removes browser shortcuts +//#define BABL_NOBROWSER +****************************/ + + +// Uncomment if you need more free flash space +// It removes everything but cursor movement +//#define BABL_MOVEMENTONLY + + +// Define starting number for BABL macros in the macro range. +// Probably can start the default even lower +#define BABL_START_NUM 50 + +/* Macros handled by babblepaste. Most should be available for all platforms. +Whatever isn't defined will NOP */ +enum { +// Movement macros + // left & right + BABL_GO_LEFT_1C= BABL_START_NUM, + BABL_GO_RIGHT_1C, + BABL_GO_LEFT_WORD, + BABL_GO_RIGHT_WORD, + BABL_GO_START_LINE, + BABL_GO_END_LINE, + // now up & down + BABL_GO_START_DOC, + BABL_GO_END_DOC, + BABL_GO_NEXT_LINE, + BABL_GO_PREV_LINE, + BABL_PGDN, + BABL_PGUP, + // And the delete options + //BABL_DEL_LEFT_1C == backspace, so why bother. + BABL_DEL_RIGHT_1C, // usually = Del + BABL_DEL_LEFT_WORD, + BABL_DEL_RIGHT_WORD, + BABL_DEL_TO_LINE_END, // delete from cursor to end of line + BABL_DEL_TO_LINE_START, // delete from cursor to begining line +#ifndef BABL_MOVEMENTONLY + // Cut & Paste + BABL_UNDO, + BABL_REDO, + BABL_CUT, + BABL_COPY, + BABL_PASTE, + BABL_SELECT_ALL, + /* not yet implemented + BABL_SWAP_LAST2C // swap last characters before the cursor + BABL_SWAP_LAST2W // Swap the last two words before the cursor + */ + // find & replace + BABL_FIND, + BABL_FIND_NEXT, + BABL_FIND_REPLACE, + // GUI or app + BABL_RUNAPP, + BABL_SWITCH_APP_NEXT, + BABL_SWITCH_APP_LAST, // previous + BABL_CLOSE_APP, + BABL_HELP, + +#ifndef BABL_NOBROWSER + BABL_BROWSER_NEW_TAB, + BABL_BROWSER_CLOSE_TAB, + BABL_BROWSER_REOPEN_LAST_TAB, + BABL_BROWSER_NEXT_TAB, + BABL_BROWSER_PREV_TAB, + BABL_BROWSER_URL_BAR, + BABL_BROWSER_FORWARD, + BABL_BROWSER_BACK, + BABL_BROWSER_FIND, + BABL_BROWSER_BOOKMARK, + BABL_BROWSER_DEV_TOOLS, // hard one to remember + BABL_BROWSER_RELOAD, + BABL_BROWSER_FULLSCREEN, + BABL_BROWSER_ZOOM_IN, + BABL_BROWSER_ZOOM_OUT, + +#endif + +#endif +// Macros for mode switching +#ifdef MS_MODE + BABL_WINDOWS, +#endif +#ifdef MAC_MODE + BABL_MAC, +#endif +#ifdef LINUX_MODE + BABL_LINUX, +#endif +#ifdef EMACS_MODE + BABL_EMACS, +#endif +#ifdef VI_MODE + BABL_VI, +#endif +#ifdef READMUX_MODE + BABL_READLINE, +#endif + + +}; + +// BUG, used to jump to babble functiion. Surely there is a way to calculate size of enum? +#define BABL_NUM_MACROS 48+4 // 48 + # of defined modes. + +/* And all the shorthand keymap ready versions */ +// First the mode switching macros +#ifdef MS_MODE +#define B_WIN M(BABL_WINDOWS) +#endif +#ifdef MAC_MODE +#define B_MAC M(BABL_MAC) +#endif +#ifdef LINUX_MODE +#define B_LNX M(BABL_LINUX) +#endif +#ifdef EMACS_MODE +#define B_EMAX M(BABL_EMACS) +#endif +#ifdef VI_MODE +#define B_VI M(BABL_VI) +#endif +#ifdef READMUX_MODE +#define B_READ M(BABL_READLINE) +#endif + +// and all the movement & action. + +#define B_L1C M(BABL_GO_LEFT_1C) +#define B_R1C M(BABL_GO_RIGHT_1C) +#define B_L1W M(BABL_GO_LEFT_WORD) +#define B_R1W M(BABL_GO_RIGHT_WORD) +#define B_GSOL M(BABL_GO_START_LINE) +#define B_GEOL M(BABL_GO_END_LINE) +#define B_GTOP M(BABL_GO_START_DOC) +#define B_GEND M(BABL_GO_END_DOC) +#define B_DOWN M(BABL_GO_NEXT_LINE) +#define B_UP M(BABL_GO_PREV_LINE) +#define B_PGDN M(BABL_PGDN) +#define B_PGUP M(BABL_PGUP) +//#define B_BKSP M(BABL_DEL_LEFT_1C) == backspace so why bother. +#define B_DEL M(BABL_DEL_RIGHT_1C) // usually = Del +#define B_DLW M(BABL_DEL_LEFT_WORD) +#define B_DRW M(BABL_DEL_RIGHT_WORD) +#define B_DEOL M(BABL_DEL_TO_LINE_END) // delete from cursor to end of line +#define B_DSOL M(BABL_DEL_TO_LINE_START) // delete from cursor to begining line +#define B_UNDO M(BABL_UNDO) +#define B_REDO M(BABL_REDO) +#define B_CUT M(BABL_CUT) +#define B_COPY M(BABL_COPY) +#define B_PAST M(BABL_PASTE) +#define B_SELA M(BABL_SELECT_ALL) +#define B_FIND M(BABL_FIND) +#define B_FINDN M(BABL_FIND_NEXT) +#define B_FINDR M(BABL_FIND_REPLACE) +#define B_RAPP M(BABL_RUNAPP) +#define B_NAPP M(BABL_SWITCH_APP_NEXT) +#define B_PAPP M(BABL_SWITCH_APP_LAST) // previous +#define B_CAPP M(BABL_CLOSE_APP) +#define B_HELP M(BABL_HELP) +#define B_NTAB M(BABL_BROWSER_NEW_TAB) +#define B_CTAB M(BABL_BROWSER_CLOSE_TAB) +#define B_ROTB M(BABL_BROWSER_REOPEN_LAST_TAB) +#define B_NXTB M(BABL_BROWSER_NEXT_TAB) +#define B_PTAB M(BABL_BROWSER_PREV_TAB) +#define B_NURL M(BABL_BROWSER_URL_BAR) +#define B_BFWD M(BABL_BROWSER_FORWARD) +#define B_BBAK M(BABL_BROWSER_BACK) +#define B_BFND M(BABL_BROWSER_FIND) +#define B_BOOK M(BABL_BROWSER_BOOKMARK) +#define B_BDEV M(BABL_BROWSER_DEV_TOOLS) // hard one to remember +#define B_BRLD M(BABL_BROWSER_RELOAD) +#define B_BFUlL M(BABL_BROWSER_FULLSCREEN) +#define B_ZMIN M(BABL_BROWSER_ZOOM_IN) +#define B_ZMOT M(BABL_BROWSER_ZOOM_OUT) + + + + + + + +/* from action_macro.h +typedef uint8_t macro_t; + +#define MACRO_NONE (macro_t*)0 +#define MACRO(...) ({ static const macro_t __m[] PROGMEM = { __VA_ARGS__ }; &__m[0]; }) +#define MACRO_GET(p) pgm_read_byte(p) + +#define BABL_MSTART (entry, os, macro...) ( const macro_t bablDict[entry][os] PROGMEM = { macro... }; ) + +*/ + +const macro_t *babblePaste(keyrecord_t *record, uint8_t shortcut); + +macro_t* switch_babble_mode( uint8_t id); + + +#endif +#endif + diff --git a/keyboards/handwired/MS_sculpt_mobile/babblePaste.txt b/keyboards/handwired/MS_sculpt_mobile/babblePaste.txt new file mode 100644 index 000000000..cf75e153e --- /dev/null +++ b/keyboards/handwired/MS_sculpt_mobile/babblePaste.txt @@ -0,0 +1,123 @@ + BabblePaste is a library of common macros used to make sure that +you can have one "paste" button on one layer, and it will do the +right thing on any OS or app. Windows=Ctrl-V. Mac = Command-V and so on. + +The babblepaste library looks for the current status in a babble_mode global variable. +To switch modes, run the switch_babble_mode() function, or a pre defined macro. +Currently supported are Windows, OS X, Gnome/kde, Emacs, VI and readline, +across 42+ common macro actions. + + +###To use the library +1) Paste the following into your config.h. + +//////Begin////// +#define USE_BABLPASTE 1 + +#ifdef USE_BABLPASTE +/* define BabblePaste maps. Whatever = 0 will be the default. */ +// MAC_MODE 0 +// MS_MODE 1 +// LINUX_MODE 2 +// EMACS_MODE 3 +// VI_MODE 3 +// Readline and tmux +// READMUX_MODE 2 +// WORDSTAR_MODE 5 +#endif + +// Uncomment these to remove options an free up flash space + +// This removes everything but cursor movement +// BABL_MOVEMENTONLY +// and this just removes browser shortcuts +// BABL_NOBROWSER +///////End/////// + +2) Add the following to your keymap in the action_get_macro + +//////Begin////// +#ifdef USE_BABLPASTE + + if( id >= BABL_START_NUM && id < (BABL_START_NUM + BABL_NUM_MACROS ) ) { + if (record->event.pressed) { // is there a case where this isn't desired? + + babblePaste ( record, id ); + return MACRO_NONE; + } + } +#endif +///////End/////// + +3) add Babbelpaste actions to your keymap. See the full list in babblePaste.h, or the +list below +B_L1C // go left 1 char +B_R1C // go Right 1 char + B_L1W //GO_LEFT_1 WORD + B_R1W //BABL_GO_RIGHT_1 WORD + B_GSOL // BABL_GOTO_START of _LINE + B_GEOL // BABL_GOTO_END_LINE + B_GTOP //BABL_GOTO_START_DOC + B_GEND //BABL_GO_END_DOC + B_DOWN //BABL_GO_NEXT_LINE + B_UP // BABL_GO_PREV_LINE + B_PGDN //PGDN + B_PGUP //PGUP +// B_BKSP //backspace so why bother. + B_DEL // DEL_RIGHT_1 Char // usually = Del + B_DLW // DEL_LEFT_ 1 WORD) + B_DRW //DEL_RIGHT_1 WORD + B_DEOL // delete from cursor to end of line + B_DSOL // delete from cursor to begining line + B_UNDO //UNDO + B_REDO // REDO + B_CUT // CUT) + B_COPY // COPY) + B_PAST // PASTE) + B_SELA // SELECT_ALL + B_FIND // FIND) + B_FINDN //FIND_NEXT) + B_FINDR // FIND_REPLACE) + B_RAPP // open application launcher + B_NAPP // switch to next app + B_PAPP // switch to previous app + B_CAPP // CLOSE_APP) + B_HELP // HELP) + B_NTAB // BROWSER_NEW_TAB) + B_CTAB //BROWSER_CLOSE_TAB) + B_ROTB //BROWSER_REOPEN_LAST_TAB) + B_NXTB //BROWSER_NEXT_TAB) + B_PTAB //BROWSER_PREV_TAB) + B_NURL //BROWSER_jump to URL_BAR) + B_BFWD // BROWSER_FORWARD (in history) + B_BBAK //BROWSER_BACK (in history) + B_BFND // BROWSER_FIND) + B_BOOK //BROWSER_New BOOKMARK) + B_BDEV //BROWSER_ Open DEV_TOOLS) // hard one to remember + B_BRLD // BROWSER_RELOAD Page + B_BFUlL // BROWSER_FULLSCREEN) + B_ZMIN // BROWSER_ZOOM_IN) + B_ZMOT //BROWSER_ZOOM_OUT) + + +#### Development notes +-Why a new function? Because it would make the keymap too ugly to put it there. +-Why not return the macro to action_get_macro? Because I kept running into scope problems +and pointers to the wrong type. +-Why not an array of arrays as a lookup instead of a function? That would allow you +to store the lookup table in PROGMEM. True, but that takes more pre-processor skill +than I had. + +-Have you tested this on every platform? No. Submit a patch. + + +### Next steps for someone. +Make it easier to pair macros with modifiers. So key foo will jump to start of line, and +Shift(foo) will jump to the first tab in a browser. + +## Thanks + +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 +And of course QMK... + diff --git a/keyboards/handwired/MS_sculpt_mobile/config.h b/keyboards/handwired/MS_sculpt_mobile/config.h new file mode 100644 index 000000000..f89514278 --- /dev/null +++ b/keyboards/handwired/MS_sculpt_mobile/config.h @@ -0,0 +1,100 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Microsoftplus +#define DESCRIPTION 6000 + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 18 + +#ifdef ASTAR +#define PRODUCT sculpt mobile astar + /*0 1 2 3 4 5 6 7 8 */ +#define MATRIX_ROW_PINS {D7, C6, D4, D0, D1, D3, D2, E2} +/* A B C D E F G H I J K L M N O P Q R */ +#define MATRIX_COL_PINS {B4, B5, E6, B7, B6, D6, C7, F7, F6, F4,F5, F1,F0, D5, B0, B1, B2, B3} + +#else +#define PRODUCT sculpt mobile teensypp +/* 0 1 2 3 4 5 6 7 */ +#define MATRIX_ROW_PINS { F7,F6,F4,F5,F3,F2,F1,F0} +/* A B C D E F G H I J K L M N O P Q R */ +#define MATRIX_COL_PINS { B7, D0, D1, D2, D3, D4, D5, D6, D7, E0,E1,C1, C0, C3, C2, C5, C4,C7} +#define UNUSED_PINS { B6,B5,B4,B3,B2,B1,B0 } + + +#endif + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION ROW2COL + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#define PREVENT_STUCK_MODIFIERS + +#endif diff --git a/keyboards/handwired/MS_sculpt_mobile/keymaps/default/Makefile b/keyboards/handwired/MS_sculpt_mobile/keymaps/default/Makefile new file mode 100644 index 000000000..8b829218b --- /dev/null +++ b/keyboards/handwired/MS_sculpt_mobile/keymaps/default/Makefile @@ -0,0 +1,21 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../../Makefile +endif diff --git a/keyboards/handwired/MS_sculpt_mobile/keymaps/default/config.h b/keyboards/handwired/MS_sculpt_mobile/keymaps/default/config.h new file mode 100644 index 000000000..8893d122e --- /dev/null +++ b/keyboards/handwired/MS_sculpt_mobile/keymaps/default/config.h @@ -0,0 +1,8 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif diff --git a/keyboards/handwired/MS_sculpt_mobile/keymaps/default/keymap.c b/keyboards/handwired/MS_sculpt_mobile/keymaps/default/keymap.c new file mode 100644 index 000000000..ab09dcdd1 --- /dev/null +++ b/keyboards/handwired/MS_sculpt_mobile/keymaps/default/keymap.c @@ -0,0 +1,64 @@ +#include "MS-sculpt-mobile.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* +* +* |ESC | F1 | F2 | F3 | F4 | F5 | F6 | f7 | F8 | F9 | F10| F11| F12|Vol-|Vol+|Mute| +* -------------------------------------------------------------------------------' +* | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Bakspace| Del | +* -------------------------------------------------------------------------- +* | tab | q | w | e | r | t | y | u | i | o | p | [ | ] | \ | | +* -------------------------------------------------------------------------------' +* | caps | a | s | d | f | g | h | j | k | l | ; | ' | enter |PgUp| +* -------------------------------------------------------------------------------- +* |Lsft | z | x | c | v | b | n | m | , | . | / | Rsft| Up| PgDn| +* --------------------------------------------------------------------------------- +* |Lctl |Lgui |Lalt | Space |Ralt | FN | Rctl |Left|Down|Rght| +* --------------------------------------------------------------------------------- +*/ + +[0] = KEYMAP( \ + 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, KC_MUTE,\ + 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,\ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,\ + KC_CAPS, 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,\ + 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,\ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_RALT, RSFT(KC_1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT +) + +}; +const uint16_t PROGMEM fn_actions[] = { + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/handwired/MS_sculpt_mobile/keymaps/default/readme.md b/keyboards/handwired/MS_sculpt_mobile/keymaps/default/readme.md new file mode 100644 index 000000000..e67ddc6fe --- /dev/null +++ b/keyboards/handwired/MS_sculpt_mobile/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for microsoft-sculpt-mobile diff --git a/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/Makefile b/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/Makefile new file mode 100644 index 000000000..1209ad781 --- /dev/null +++ b/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/Makefile @@ -0,0 +1,21 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../../Makefile +endif diff --git a/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/config.h b/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/config.h new file mode 100644 index 000000000..8cf4202cd --- /dev/null +++ b/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/config.h @@ -0,0 +1,32 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#define USE_BABLPASTE + +// Expect to get errors if you comment a feature out and leave it in your keymap. + +#ifdef USE_BABLPASTE +//define BabblePaste maps +// Windows. +#define MAC_MODE 0 +#define MS_MODE 1 +//aka gnome+KDE +//#define LINUX_MODE 2 +//#define EMACS_MODE 3 +#define VI_MODE 3 +// Readline and tmux +#define READMUX_MODE 2 +//#define WORDSTAR_MODE 5 +#endif + +// Uncomment if you need more free flash space + +// This removes everything but cursor movement +//#define BABL_MOVEMENTONLY +// and this just removes browser shortcuts +//#define BABL_NOBROWSER + +// place overrides here +#endif diff --git a/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/keymap.c b/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/keymap.c new file mode 100644 index 000000000..395a9fb47 --- /dev/null +++ b/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/keymap.c @@ -0,0 +1,272 @@ +#include "MS-sculpt-mobile.h" +#include "action_layer.h" +#include "action_util.h" +#include "babblePaste.h" + +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif + +#define _QWR 0 +#define _CDH 2 +#define _SYM 3 +#define _MOV 4 +#define _TRAN 5 + + +enum layer_keycodes { +QWR, +CDH, +SYM, +MOV, +NUM, +TRAN +}; + + +// Shorter spacing +#define XXXX KC_NO +#define ____ KC_TRNS + +// Custom macros + +/* Fn Keys */ +#define TT_SYM MO(_SYM) +#define TT_MOV KC_FN2 +#define TT_NUM MO(_NUM) +#define SSFT ACTION_MODS_ONESHOT(MOD_LSFT) + +enum macro_keycodes { +DHPASTE=1, +VIBRK, +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* QWERTY +* +* |ESC | F1 | F2 | F3 | F4 | F5 | F6 | f7 | F8 | F9 | F10| F11| F12|Vol-|Vol+|_CDH| +* -------------------------------------------------------------------------------' +* | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Bakspace| Del| +* --------------------------------------------------------------------------- +* | tab | q | w | e | r | t | y | u | i | o | p | [ | ] | \ | | +* -------------------------------------------------------------------------------' +* |Bak/Mov| a | s | d | f | g | h | j | k | l | ; | ' | enter |PgUp| +* -------------------------------------------------------------------------------- +* |Lsft | z | x | c | v | b | n | m | , | . | / | Rsft| Up| PgDn| +* --------------------------------------------------------------------------------- +* |Lctl |Lgui |Lalt | Space/Sym | GUI | Sym | Rctl |Left|Down|Rght| +* --------------------------------------------------------------------------------- +*/ + +[_QWR] = KEYMAP( \ + 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, CDH,\ + KC_ESC, 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,\ + 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,\ + TT_MOV, 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,\ + 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,\ + KC_LCTL, KC_LGUI, KC_LALT, KC_FN1, KC_RGUI,TT_SYM,KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT +), + +[_CDH] = KEYMAP (\ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, QWR, \ + KC_ESC, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, ____, ____, ____,\ + TT_MOV, 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,\ + KC_LSFT, KC_Z, KC_X, KC_C, M(DHPASTE), KC_V, KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, ____, KC_1,\ + ____, ____, ____ , KC_FN1, ____, ____, ____, ____, ____, ____ + +), + + +/* SYM +* +* |ESC | F1 | F2 | F3 | F4 | F5 | F6 | f7 | F8 | F9 | F10| F11| F12|Vol-|Vol+|_CDH| +* -------------------------------------------------------------------------------' +* | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Bakspace|Del | +* -------------------------------------------------------------------------- +* | ESC: | ^ | { | } | @ | % | | [ | ( | ) | _ | [ | ] | \ | | +* -------------------------------------------------------------------------------' +* |Bak/Mov| ! | # | 0 | = | { | } | - | 1 | + | ] | ` | enter |PgUp| +* -------------------------------------------------------------------------------- +* |Lsft | ; | ~ | : | ~ | "|"| $ | * | | . | / | Rsft| Up| PgDn| +* --------------------------------------------------------------------------------- +* |Lctl |Lgui |Lalt | Space/Sym | GUI | Sym | Rctl |Left|Down|Rght| +* --------------------------------------------------------------------------------- +*/ + +[_SYM] = KEYMAP (\ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + M(VIBRK), KC_CIRC, KC_LCBR, KC_RCBR,KC_AT, KC_PERC, ____, KC_LBRC,KC_LPRN,KC_RPRN,KC_UNDS, ____, ____, ____,\ + ____, KC_EXLM, KC_HASH, KC_0, KC_EQL, KC_LCBR, KC_RCBR,KC_MINS,KC_1, KC_PLUS,KC_RBRC, KC_GRV, ____, ____,\ + ____, KC_SCLN, KC_TILDE, KC_COLN, KC_TILDE, KC_PIPE, KC_DLR, KC_ASTR, ____, KC_DOT , KC_SLSH, ____, ____, ____,\ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____ +), +/* +* |ESC | MAC| Win|RdLn| VI | | | | | | | | | | | | +* -------------------------------------------------------------------------------' +* | | | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Bakspace| Del| +* --------------------------------------------------------------------------- +* | tab | | |Find| |pTab |DSOL|DelW| Up |DelW|DEOL| [ | ] | \ | | +* -------------------------------------------------------------------------------' +* |Bak/Mov| | | | |nTab |GSOL| <- | Dwn | -> | EOL | ' | enter |PgUp| +* -------------------------------------------------------------------------------- +* |Lsft |Undo| Cut|Copy|Pste| | | | | | / | Rsft| Up| PgDn| +* --------------------------------------------------------------------------------- +* |Lctl |Lgui |Lalt | Space/Sym | GUI | Sym | Rctl |Left|Down|Rght| +* --------------------------------------------------------------------------------- +*/ + +[_MOV] = KEYMAP (\ + ____, B_MAC,B_WIN,B_READ, B_VI, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, ____, B_PAPP, B_NAPP, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, B_UNDO, ____, B_BFND, ____, B_PTAB, B_DSOL, B_DLW, B_UP, B_DRW, B_DEOL, ____, ____, ____, \ + ____, B_SELA, B_BRLD, ____, ____, B_NXTB, B_GSOL, B_L1C, B_DOWN, B_R1C,B_GEOL, ____, ____, ____,\ + ____, B_UNDO,B_CUT, B_COPY, B_PAST, B_PAST, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____ +), + +[_TRAN] = KEYMAP (\ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____ +) +}; + +const uint16_t PROGMEM fn_actions[] = { +[1] = ACTION_LAYER_TAP_KEY(_SYM,KC_SPACE), +[2] = ACTION_LAYER_TAP_KEY(_MOV,KC_BSPC) +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +#endif + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWR: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + layer_off(_CDH); + } + return false; + break; + + case CDH: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_colemak, false, 0); + #endif + layer_on(_CDH); + } + return false; + break; + + case SYM: + if (record->event.pressed) { + layer_on(_SYM); + } else { + layer_off(_SYM); + } + return false; + break; + + } + return true; + +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + +/* If id is in the range of BABL macros, call the babl function */ +/* Any clever remapping with modifiers should happen here e.g. shift bablkey does opposite*/ +#ifdef USE_BABLPASTE + + if( id >= BABL_START_NUM && id < (BABL_START_NUM + BABL_NUM_MACROS ) ) { + if (record->event.pressed) { // is there a case where this isn't desired? + + babblePaste ( record, id ); + return MACRO_NONE; + } + } +#endif + + + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + + /* Colemak mod-dh moves the D key to the qwerty V position + This hack makes apple-V_position do what I mean */ + case DHPASTE: + if(keyboard_report->mods & MOD_BIT(KC_LGUI) ) { + if (record->event.pressed) { + clear_keyboard_but_mods(); + register_code(KC_V); + } else { + unregister_code(KC_V); + } + } else { + if (record->event.pressed) { + register_code(KC_D); + } else { + unregister_code(KC_D); + } + } + break; + + case VIBRK: // vi esc: + if (record->event.pressed) { + return MACRO( T(ESC),D(LSFT),T(SCLN),U(LSFT), END ); + } + break; + + + + + default: + return MACRO_NONE; + } + + +return MACRO_NONE; +}; + + + + + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { + +} + + +void led_set_user(uint8_t usb_led) { + +} + + + + + + diff --git a/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/readme.md b/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/readme.md new file mode 100644 index 000000000..96ee0e77a --- /dev/null +++ b/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/readme.md @@ -0,0 +1 @@ +# A more programmer oriented keymap for microsoft-sculpt-mobile diff --git a/keyboards/handwired/MS_sculpt_mobile/readme.md b/keyboards/handwired/MS_sculpt_mobile/readme.md new file mode 100644 index 000000000..d435b449f --- /dev/null +++ b/keyboards/handwired/MS_sculpt_mobile/readme.md @@ -0,0 +1,58 @@ + +This is a way to take a Microsoft ergonomic bluetooth keyboard, and make it +into a hard-wired keyboard running QMK. + +The keyboard is known under several different names: +Mobile Bluetooth 5000, Mobile 6000, Sculpt mobile, and Asus rebranded + +I had a stack of them,since they're cheap on ebay, travel well, and are just ergo enough. + +The ribbon cable is 1mm pitch, which is hard to hand solder. I bought a cheap set of +"pitch adapter" boards https://www.amazon.com/Double-Sided-0-4mm-1-0-Adapter-60mmx38mm/dp/B00OK42118 + +Cut the original ribbon cable sockets off the bluetooth board using a razor, they're hard to desolder. +They're also allow the cable to be inserted on top or bottom. + +If I was going to do it again, I'd make the MCU connection come out the top of the keyboard +and avoid the wires dangling out the bottom. + +As I was debugging the matrix, I started to get random failures. In desparation I tried a second MCU, +but had the same problems. It turns out that the ribbon cable connections can get worn. Shave a +half millimeter off the end of the ribbon cable & the errors go away. + +My method for discovering the matrix was to set up a KEYMAP macro that included all pins. +See MATRIX_TESTING_KEYMAP if you need it. Then set up a keymap that has all printable symbols +in the first 4 rows. test each key & record output. Then switch the printable symbols to the +bottom 4 rows & repeat. This was enough to show the matrix. + + +The full original keymap for the sculpt is + A B C D E F G H ---> +0 b n m , . / +1 g h " +2 7 8 9 0 Del PgUp +3 p [ ] \ +4 y u i o +5 ~ - += j k l ; 5 +6 a s d q w e, Up left +7 F7 F8 F9 F10 F11 F12 f + +-----> I J K L M N O P Q R +0 Caps FN +1 Vol+ mute Rctl vol- pgdn LCTL +2 Rshift LShift +3 Ralt LAlt +4 LGUI +5 6 bakspc 1 2 3 4 F4 F5 F6 +6 Down right spc F1 F2 F3 tab +7 r t z x c v enter Esc + +This works with 18 cols + 8 rows on a Teensy++, or Arm based Teensy. + +The Astar mini has all pins exposed , so you can do 18x8 +If you want a speaker, LEDs &etc, you'll need to free up a pin. I recommend joining columns +R and L to the same pin. + +Building - add ASTAR=1 to the compile line or leave out for teensy2++ + + diff --git a/keyboards/handwired/MS_sculpt_mobile/rules.mk b/keyboards/handwired/MS_sculpt_mobile/rules.mk new file mode 100644 index 000000000..680389c84 --- /dev/null +++ b/keyboards/handwired/MS_sculpt_mobile/rules.mk @@ -0,0 +1,48 @@ + +## Project specific files +SRC= babblePaste.c + + +ifdef ASTAR + CFLAGS=-D ASTAR + OPT_DEFS += -DBOOTLOADER_SIZE=4096 + MCU = atmega32u4 + OPT_DEFS += -DCATERINA_BOOTLOADER + SCULPT_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done ; \ + avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB) + +else + MCU = at90usb1286 + OPT_DEFS += -DBOOTLOADER_SIZE=2048 + SCULPT_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex +endif + +F_CPU = 16000000 +ARCH = AVR8 +F_USB = $(F_CPU) +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE ?= no # USB Nkey Rollover +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE ?= no # Audio output on port C6 + + +USB ?= /dev/cu.usbmodem14141 + + + +upload: build + $(SCULPT_UPLOAD_COMMAND) -- cgit v1.2.3 From bbe8876c8df3d37c7fd2b85bd2ef9a1a60ad5fe1 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 9 Apr 2017 22:49:07 +0300 Subject: Rename MS-sculpt-mobile to MS_scuplpt_mobile Subprojects with "-" have problems, since the build system creates a define containing the subproject name, and "-" is illegal in macro names. --- keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.c | 2 +- keyboards/handwired/MS_sculpt_mobile/babblePaste.c | 7 ++++--- keyboards/handwired/MS_sculpt_mobile/babblePaste.h | 2 +- keyboards/handwired/MS_sculpt_mobile/keymaps/default/config.h | 2 +- keyboards/handwired/MS_sculpt_mobile/keymaps/default/keymap.c | 2 +- keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/config.h | 2 +- keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/keymap.c | 4 ++-- 7 files changed, 11 insertions(+), 10 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.c b/keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.c index 4c735a6c2..64982fb62 100644 --- a/keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.c +++ b/keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.c @@ -1 +1 @@ -#include "MS-sculpt-mobile.h" +#include "MS_sculpt_mobile.h" diff --git a/keyboards/handwired/MS_sculpt_mobile/babblePaste.c b/keyboards/handwired/MS_sculpt_mobile/babblePaste.c index 3a9b86997..22394cc7d 100644 --- a/keyboards/handwired/MS_sculpt_mobile/babblePaste.c +++ b/keyboards/handwired/MS_sculpt_mobile/babblePaste.c @@ -7,7 +7,8 @@ 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 "babblePaste.h" +#include "../MS_sculpt_mobile/babblePaste.h" + #include "action_macro.h" #ifdef USE_BABLPASTE @@ -27,7 +28,7 @@ macro_t* switch_babble_mode( uint8_t id) { // And else statements have problems, see https://gcc.gnu.org/onlinedocs/gcc-3.0.1/cpp_3.html#SEC15 #define BABLM(ent, macro...) \ if ( ent == shortcut ) \ - { action_macro_play( MACRO(macro)); return MACRO_NONE; } + { action_macro_play( MACRO(macro)); return MACRO_NONE; } /* this function runs the appropriate babblepaste macro, given @@ -456,4 +457,4 @@ const macro_t *babblePaste (keyrecord_t *record, uint8_t shortcut) { } -#endif \ No newline at end of file +#endif diff --git a/keyboards/handwired/MS_sculpt_mobile/babblePaste.h b/keyboards/handwired/MS_sculpt_mobile/babblePaste.h index 3067c854d..cedd7d92b 100644 --- a/keyboards/handwired/MS_sculpt_mobile/babblePaste.h +++ b/keyboards/handwired/MS_sculpt_mobile/babblePaste.h @@ -9,9 +9,9 @@ and jeebak & algernon's keymap */ #ifndef _babblePaste_h_included__ #define _babblePaste_h_included__ +#include "../MS_sculpt_mobile/config.h" #include "action_layer.h" #include "quantum_keycodes.h" -#include "config.h" #ifdef USE_BABLPASTE diff --git a/keyboards/handwired/MS_sculpt_mobile/keymaps/default/config.h b/keyboards/handwired/MS_sculpt_mobile/keymaps/default/config.h index 8893d122e..4f3a425b7 100644 --- a/keyboards/handwired/MS_sculpt_mobile/keymaps/default/config.h +++ b/keyboards/handwired/MS_sculpt_mobile/keymaps/default/config.h @@ -1,7 +1,7 @@ #ifndef CONFIG_USER_H #define CONFIG_USER_H -#include "../../config.h" +#include "../../../MS_sculpt_mobile/config.h" // place overrides here diff --git a/keyboards/handwired/MS_sculpt_mobile/keymaps/default/keymap.c b/keyboards/handwired/MS_sculpt_mobile/keymaps/default/keymap.c index ab09dcdd1..a8802c99a 100644 --- a/keyboards/handwired/MS_sculpt_mobile/keymaps/default/keymap.c +++ b/keyboards/handwired/MS_sculpt_mobile/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -#include "MS-sculpt-mobile.h" +#include "../../MS_sculpt_mobile.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* diff --git a/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/config.h b/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/config.h index 8cf4202cd..5c04f647c 100644 --- a/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/config.h +++ b/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/config.h @@ -1,7 +1,7 @@ #ifndef CONFIG_USER_H #define CONFIG_USER_H -#include "../../config.h" +#include "../../../MS_sculpt_mobile/config.h" #define USE_BABLPASTE diff --git a/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/keymap.c b/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/keymap.c index 395a9fb47..c9a8ccdb6 100644 --- a/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/keymap.c +++ b/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/keymap.c @@ -1,7 +1,7 @@ -#include "MS-sculpt-mobile.h" +#include "../../../MS_sculpt_mobile/babblePaste.h" +#include "../../MS_sculpt_mobile.h" #include "action_layer.h" #include "action_util.h" -#include "babblePaste.h" #ifdef AUDIO_ENABLE #include "audio.h" -- cgit v1.2.3 From acd63bc03cd2dec86b04df2d4199cce1d3e13768 Mon Sep 17 00:00:00 2001 From: David Baldwynn Date: Mon, 17 Apr 2017 12:05:47 -0700 Subject: Fixed dvorak layout for Atreus50 --- keyboards/handwired/atreus50/keymaps/default/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/atreus50/keymaps/default/keymap.c b/keyboards/handwired/atreus50/keymaps/default/keymap.c index 415405ec2..77cf942c3 100644 --- a/keyboards/handwired/atreus50/keymaps/default/keymap.c +++ b/keyboards/handwired/atreus50/keymaps/default/keymap.c @@ -66,7 +66,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //,----+----+----+----+----+----. ,----+----+----+----+----+----. TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,MINS, //|----+----+----+----+----+----| |----+----+----+----+----+----| - X0 , A , O , E , U , I , D , H , R , N , S ,SLSH, + X0 , A , O , E , U , I , D , H , T , N , S ,SLSH, //|----+----+----+----+----+----| |----+----+----+----+----+----| LSFT,SCLN, Q , J , K , X , B , M , W , V , Z , X4 , //|----+----+----+----+----+----|----+----|----+----+----+----+----+----| -- cgit v1.2.3 From 93b2f23bba16348e2ea5d8c83d928e3a45e2b7cc Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Wed, 19 Apr 2017 01:38:08 +0700 Subject: Promethium rev2 * 10 more indicator LEDs * Piezo buzzer * Uses HC138 decoder to free up 5 pins * Trackpoint buttons are now part of matrix --- keyboards/handwired/promethium/config.h | 37 ++- .../handwired/promethium/keymaps/priyadi/Makefile | 1 + .../handwired/promethium/keymaps/priyadi/keymap.c | 48 ++-- keyboards/handwired/promethium/matrix.c | 306 +++++++++++++++++++++ keyboards/handwired/promethium/promethium.c | 5 + keyboards/handwired/promethium/rules.mk | 4 +- 6 files changed, 372 insertions(+), 29 deletions(-) create mode 100644 keyboards/handwired/promethium/matrix.c (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/config.h b/keyboards/handwired/promethium/config.h index 24f02993f..a13406b0d 100644 --- a/keyboards/handwired/promethium/config.h +++ b/keyboards/handwired/promethium/config.h @@ -35,12 +35,13 @@ along with this program. If not, see . #define DESCRIPTION /* key matrix size */ -#define MATRIX_ROWS 8 #define MATRIX_COLS 6 +#define MATRIX_ROWS 9 /* default pin-out */ -#define MATRIX_COL_PINS { B6, B7, D6, C7, F6, F7 } -#define MATRIX_ROW_PINS { D7, C6, D0, D1, F5, F4, F1, F0 } +#define MATRIX_COL_PINS { F4, F1, F0, D6, D0, D1 } +#define MATRIX_ROW_PINS { F5, F6, F7 } +#define TRACKPOINT_PINS { B7, B6, D7 } #define UNUSED_PINS /* @@ -152,17 +153,20 @@ along with this program. If not, see . //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION -#define PS2_INIT_DELAY 2000 +#define PS2_INIT_DELAY 3000 #define BATTERY_PIN 9 #define BATTERY_POLL 30000 #define MAX_VOLTAGE 4.2 #define MIN_VOLTAGE 3.2 +#define ___ KC_NO + #define KEYMAP( \ - k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \ - k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \ - k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \ - k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c \ + k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \ + k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \ + k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \ + k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, \ + tp1, tp2, tp3 \ ) \ { \ {k11, k12, k13, k14, k15, k16}, \ @@ -172,18 +176,29 @@ along with this program. If not, see . {k17, k18, k19, k1a, k1b, k1c}, \ {k27, k28, k29, k2a, k2b, k2c}, \ {k37, k38, k39, k3a, k3b, k3c}, \ - {k47, k48, k49, k4a, k4b, k4c} \ + {k47, k48, k49, k4a, k4b, k4c}, \ + {tp1, tp2, tp3, ___, ___, ___} \ } #ifndef __ASSEMBLER__ // assembler doesn't like enum in .h file enum led_sequence { + LED_IND_LINUX, + LED_IND_APPLE, + LED_IND_WINDOWS, + LED_IND_QWERTY, + LED_IND_ALT, + LED_IND_AUDIO, LED_IND_BLUETOOTH, LED_IND_USB, - LED_IND_BATTERY, + LED_IND_BATTERY, + LED_IND_CAPSLOCK, + LED_IND_GUI, LED_IND_FUN, LED_IND_NUM, + LED_IND_PUNC, LED_IND_EMOJI, + LED_IND_GREEK, LED_BKSP, LED_ENT, @@ -261,7 +276,7 @@ enum led_sequence { # define PS2_CLOCK_PORT PORTD # define PS2_CLOCK_PIN PIND # define PS2_CLOCK_DDR DDRD -# define PS2_CLOCK_BIT 1 +# define PS2_CLOCK_BIT 3 # define PS2_DATA_PORT PORTD # define PS2_DATA_PIN PIND # define PS2_DATA_DDR DDRD diff --git a/keyboards/handwired/promethium/keymaps/priyadi/Makefile b/keyboards/handwired/promethium/keymaps/priyadi/Makefile index 46fdfa011..e3428254f 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/Makefile +++ b/keyboards/handwired/promethium/keymaps/priyadi/Makefile @@ -19,6 +19,7 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. PS2_MOUSE_ENABLE = yes PS2_USE_INT = yes +FAUXCLICKY_ENABLE = yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index cf7c67339..61af0a889 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -574,7 +574,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT , 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_LCTL, KC_LALT, KC_LGUI, EMPTY, NUM, LSPACE, RSPACE, FUN, GREEK, KC_RGUI, C_RALT, KC_RCTL + KC_LCTL, KC_LALT, KC_LGUI, EMPTY, NUM, LSPACE, RSPACE, FUN, GREEK, KC_RGUI, C_RALT, KC_RCTL, + _______, _______, _______ ), /* Dvorak @@ -593,7 +594,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, _______, _______, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, _______, _______, KC_SLSH, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______ ), #endif @@ -614,7 +616,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_QUOT, _______, _______, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, _______, _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______ ), #endif @@ -635,7 +638,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, KC_Q, KC_W, KC_D, KC_F, KC_K, KC_J, KC_U, KC_R, KC_L, KC_QUOT, _______, _______, KC_A, KC_S, KC_E, KC_T, KC_G, KC_Y, KC_N, KC_I, KC_O, KC_H, _______, _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_P, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______ ), #endif @@ -656,7 +660,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_QUOT, _______, _______, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, _______, _______, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______ ), #endif @@ -675,7 +680,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, X(LTEQ), X(GTEQ), _______, KC_GRV, KC_ASTR, KC_BSLS, KC_MINS, KC_EQL, KC_SLSH, X(NOTEQ),KC_LPRN, KC_RPRN, KC_LABK, KC_RABK, _______, KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, KC_QUES, X(PLMIN),KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_COLN, _______ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_COLN, _______, + _______, _______, _______ ), /* Num @@ -690,10 +696,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_NUM] = KEYMAP( - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, S(KC_A), KC_7, KC_8, KC_9, S(KC_D), _______, + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, S(KC_A), KC_1, KC_2, KC_3, S(KC_D), _______, KC_GRV, KC_ASTR, KC_BSLS, KC_MINS, KC_EQL, KC_SLSH, S(KC_B), KC_4, KC_5, KC_6, S(KC_E), _______, - KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, KC_QUES, S(KC_C), KC_1, KC_2, KC_3, S(KC_F), _______, - _______, _______, KC_X, _______, _______, _______, _______, FUN0 , KC_COMM, KC_DOT, KC_COLN, _______ + KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, KC_QUES, S(KC_C), KC_7, KC_8, KC_9, S(KC_F), _______, + _______, _______, KC_X, _______, _______, _______, _______, FUN0 , KC_COMM, KC_DOT, KC_COLN, _______, + _______, _______, _______ ), /* Func @@ -711,7 +718,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_INS, XXXXXXX, KC_PGUP, KC_UP, KC_PGDN, KC_PGUP, KC_DEL, KC_CAPS, KC_F5, KC_F6, KC_F7, KC_F8, KC_PSCR, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, _______, KC_F9, KC_F10, KC_F11, KC_F12, KC_PAUS, XXXXXXX, XXXXXXX, KC_HOME, KC_END, XXXXXXX, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______ ), /* Uppercase Greek @@ -729,7 +737,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, XXXXXXX, XXXXXXX,X(UEPSI), X(URHO), X(UTAU),X(UUPSI),X(UTHET),X(UIOTA),X(UOMIC), X(UPI), _______, _______,X(UALPH),X(USIGM),X(UDELT), X(UPHI),X(UGAMM), X(UETA), X(UXI),X(UKAPP),X(ULAMB), KC_QUOT, _______, _______,X(UZETA), X(UCHI), X(UPSI),X(UOMEG),X(UBETA), X(UNU), X(UMU), KC_COMM, KC_DOT, KC_SLSH, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______ ), /* Lowercase Greek @@ -747,7 +756,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, XXXXXXX,X(FSIGM),X(LEPSI), X(LRHO), X(LTAU),X(LUPSI),X(LTHET),X(LIOTA),X(LOMIC), X(LPI), _______, _______,X(LALPH),X(LSIGM),X(LDELT), X(LPHI),X(LGAMM), X(LETA), X(LXI),X(LKAPP),X(LLAMB), KC_QUOT, _______, _______,X(LZETA), X(LCHI), X(LPSI),X(LOMEG),X(LBETA), X(LNU), X(LMU), KC_COMM, KC_DOT, KC_SLSH, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______ ), /* Empty @@ -765,7 +775,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______ ), /* Emoji @@ -783,7 +794,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { X(HART2), X(CRY2),X(WEARY),X(EYERT),X(SMIRK), X(TJOY),X(RECYC),X(UNAMU),X(MUSIC),X(OKHND),X(PENSV), X(PHEW), X(THMUP), X(PRAY),X(SMILE),X(SMIL2),X(FLUSH), X(GRIN),X(HEART), X(BYE), X(KISS),X(CELEB), X(COOL),X(NOEVS), X(THMDN),X(SLEEP), X(CLAP), X(CRY), X(VIC),X(BHART), X(SUN),X(SMEYE), X(WINK), X(MOON),X(CONFU),X(NOEVH), - X(POO), X(EYES), X(HUNRD),_______, X(SKULL),X(HORNS), X(HALO), X(FEAR),_______,X(YUMMY),X(DISAP),X(NOEVK) + X(POO), X(EYES), X(HUNRD),_______, X(SKULL),X(HORNS), X(HALO), X(FEAR),_______,X(YUMMY),X(DISAP),X(NOEVK), + _______, _______, _______ ), /* GUI @@ -801,7 +813,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { XXXXXXX, G(KC_1), G(KC_2), G(KC_3), G(KC_4), G(KC_5), G(KC_6), G(KC_7), G(KC_8), G(KC_9), G(KC_0), XXXXXXX, KC_ESC, XXXXXXX, S(KC_TAB),KC_ESC, KC_TAB, XXXXXXX, XXXXXXX, KC_WWWB, XXXXXXX, KC_WWWF, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_VOLD, KC_MUTE, KC_VOLU, KC_SPC, KC_SPC, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, _______, _______ ), /* Sys @@ -816,10 +829,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_SYS] = KEYMAP( - XXXXXXX, QWERTY, WIN, XXXXXXX, RESET, XXXXXXX, XXXXXXX, OUT_USB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + DEBUG, QWERTY, WIN, XXXXXXX, RESET, XXXXXXX, XXXXXXX, OUT_USB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, FC_TOG, XXXXXXX, DVORAK, XXXXXXX, GLOW, XXXXXXX, XXXXXXX, WORKMAN, LINUX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, COLEMAK, XXXXXXX, OUT_BLE, NORMAN, OSX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + _______, _______, _______ ), diff --git a/keyboards/handwired/promethium/matrix.c b/keyboards/handwired/promethium/matrix.c new file mode 100644 index 000000000..2b7ce2bf5 --- /dev/null +++ b/keyboards/handwired/promethium/matrix.c @@ -0,0 +1,306 @@ +/* +Copyright 2012 Jun Wako +Copyright 2014 Jack Humbert +Copyright 2017 Priyadi Iman Nurcahyo + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include +#include +#if defined(__AVR__) +#include +#endif +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "timer.h" + + +/* Set 0 if debouncing isn't needed */ + +#ifndef DEBOUNCING_DELAY +# define DEBOUNCING_DELAY 5 +#endif + +#if (DEBOUNCING_DELAY > 0) + static uint16_t debouncing_time; + static bool debouncing = false; +#endif + +#if (MATRIX_COLS <= 8) +# define print_matrix_header() print("\nr/c 01234567\n") +# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop(matrix[i]) +# define ROW_SHIFTER ((uint8_t)1) +#elif (MATRIX_COLS <= 16) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop16(matrix[i]) +# define ROW_SHIFTER ((uint16_t)1) +#elif (MATRIX_COLS <= 32) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop32(matrix[i]) +# define ROW_SHIFTER ((uint32_t)1) +#endif + +#ifdef MATRIX_MASKED + extern const matrix_row_t matrix_mask[]; +#endif + +static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; +static const uint8_t tp_pins[3] = TRACKPOINT_PINS; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static void init_cols(void); +static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row); +static void unselect_rows(void); +static void select_row(uint8_t row); +static void unselect_row(uint8_t row); + +__attribute__ ((weak)) +void matrix_init_quantum(void) { + matrix_init_kb(); +} + +__attribute__ ((weak)) +void matrix_scan_quantum(void) { + matrix_scan_kb(); +} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +inline +uint8_t matrix_rows(void) { + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) { + return MATRIX_COLS; +} + +void matrix_init(void) { + + // To use PORTF disable JTAG with writing JTD bit twice within four cycles. + #if (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) || defined(__AVR_ATmega32U4__)) + MCUCR |= _BV(JTD); + MCUCR |= _BV(JTD); + #endif + + // initialize row and col + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + + matrix_init_quantum(); +} + +uint8_t matrix_scan(void +){ + // Set row, read cols + for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { +# if (DEBOUNCING_DELAY > 0) + bool matrix_changed = read_cols_on_row(matrix_debouncing, current_row); + + if (matrix_changed) { + debouncing = true; + debouncing_time = timer_read(); + } + +# else + read_cols_on_row(matrix, current_row); +# endif + + } + +# if (DEBOUNCING_DELAY > 0) + if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = matrix_debouncing[i]; + } + debouncing = false; + } +# endif + + matrix_scan_quantum(); + return 1; +} + +bool matrix_is_modified(void) +{ +#if (DEBOUNCING_DELAY > 0) + if (debouncing) return false; +#endif + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) + +{ + return (matrix[row] & ((matrix_row_t)1> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } + + // rows + DDRF |= ROW_MASK; + PORTF &= ~ROW_MASK; + + // trackpoint + for(uint8_t x = 0; x < 3; x++) { + uint8_t pin = tp_pins[x]; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } +} + +static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) + { + // Store last value of row prior to reading + matrix_row_t last_row_value = current_matrix[current_row]; + + // Clear data in matrix row + current_matrix[current_row] = 0; + + // special case for trackpoint + if (current_row == 8) { + for(uint8_t tp_index = 0; tp_index < 3; tp_index++) { + + // Select the TP pin to read (active low) + uint8_t pin = tp_pins[tp_index]; + uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)); + + // Populate the matrix row with the state of the col pin + current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << tp_index); + } + return (last_row_value != current_matrix[current_row]); + } + + // Select row and wait for row selecton to stabilize + select_row(current_row); + _delay_us(5); // without this wait it won't read stable value. + // wait_us(50); + + // For each col... + for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { + + // Select the col pin to read (active low) + uint8_t pin = col_pins[col_index]; + uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)); + + // Populate the matrix row with the state of the col pin + current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); + } + + // Unselect row + unselect_row(current_row); + + return (last_row_value != current_matrix[current_row]); +} + +static void select_row(uint8_t row) +{ + PORTF = row_bit[row] | (PORTF & ~ROW_MASK); +} + +static void unselect_row(uint8_t row) +{ +} + +static void unselect_rows(void) +{ +} + diff --git a/keyboards/handwired/promethium/promethium.c b/keyboards/handwired/promethium/promethium.c index 4943f8c9f..8b1a0c71f 100644 --- a/keyboards/handwired/promethium/promethium.c +++ b/keyboards/handwired/promethium/promethium.c @@ -2,6 +2,11 @@ #include "analog.h" #include "timer.h" #include "matrix.h" +#include "musical_notes.h" + +float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_F3, .03125); +float fauxclicky_released_note[2] = MUSICAL_NOTE(_C3, .03125); +float fauxclicky_beep_note[2] = MUSICAL_NOTE(_C3, .03125); // cubic fit {3.3, 0}, {3.5, 2.9}, {3.6, 5}, {3.7, 8.6}, {3.8, 36}, {3.9, 62}, {4.0, 73}, {4.05, 83}, {4.1, 89}, {4.15, 94}, {4.2, 100} diff --git a/keyboards/handwired/promethium/rules.mk b/keyboards/handwired/promethium/rules.mk index e75cf4dde..a5e503ff7 100644 --- a/keyboards/handwired/promethium/rules.mk +++ b/keyboards/handwired/promethium/rules.mk @@ -67,10 +67,12 @@ PS2_MOUSE_ENABLE ?= yes PS2_USE_INT ?= yes ADAFRUIT_BLE_ENABLE ?= yes API_SYSEX_ENABLE ?= no +CUSTOM_MATRIX ?= yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend SRC += $(QUANTUM_DIR)/light_ws2812.c SRC += rgbsps.c -SRC += $(QUANTUM_DIR)/analog.c \ No newline at end of file +SRC += $(QUANTUM_DIR)/analog.c +SRC += matrix.c -- cgit v1.2.3 From 3fa0b66289770ccc4d8a5b39eaf66ff3b7c67529 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Wed, 19 Apr 2017 02:52:57 +0700 Subject: Keymap updates and some adjustment for latest version of QMK --- .../handwired/promethium/keymaps/priyadi/Makefile | 1 + .../handwired/promethium/keymaps/priyadi/README.md | 4 +- .../handwired/promethium/keymaps/priyadi/keymap.c | 142 ++++++++++++++++++--- keyboards/handwired/promethium/rules.mk | 2 +- 4 files changed, 125 insertions(+), 24 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/Makefile b/keyboards/handwired/promethium/keymaps/priyadi/Makefile index e3428254f..bd1a06734 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/Makefile +++ b/keyboards/handwired/promethium/keymaps/priyadi/Makefile @@ -20,6 +20,7 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this PS2_MOUSE_ENABLE = yes PS2_USE_INT = yes FAUXCLICKY_ENABLE = yes +BLUETOOTH = AdafruitBLE # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/handwired/promethium/keymaps/priyadi/README.md b/keyboards/handwired/promethium/keymaps/priyadi/README.md index ddeaed939..48824b9f7 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/README.md +++ b/keyboards/handwired/promethium/keymaps/priyadi/README.md @@ -37,8 +37,8 @@ On Promethium, USB or Bluetooth output is detected on startup. If USB is connect SYS-W, SYS-L, SYS-M switch Unicode input method. SYS-Q, SYS-D, SYS-C, SYS-K, SYS-N switch to QWERTY, DVORAK, Colemak, Workman and Norman, respectively. -On Planck, SYS-A (mnemonic: audio) toggles faux clicky: use buzzer to emit clicks on key presses and releases. +SYS-A (mnemonic: audio) toggles faux clicky: use buzzer to emit clicks on key presses and releases. -On Promethium there are 6 indicator LEDs, and under switch LEDs on each switches, including Trackpoint buttons. Totaling 57 LEDs. Output is limited to 0xF for each LEDs to conserve power. SYS-G (mnemonic: glow) toggles various backlighting modes. +On Promethium there are 16 indicator LEDs, and under switch LEDs on each switches, including Trackpoint buttons. Totaling 67 LEDs. Output is limited to 0xF for each LEDs to conserve power. SYS-G (mnemonic: glow) toggles various backlighting modes. On Promethium, there's a LED to indicate battery level. Hue indicates level: green is full, red is empty. \ No newline at end of file diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 61af0a889..55e028f18 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -38,6 +38,19 @@ along with this program. If not, see . #endif #ifdef FAUXCLICKY_ENABLE #include "fauxclicky.h" +#ifdef RGBSPS_ENABLE +#undef FAUXCLICKY_OFF +#define FAUXCLICKY_OFF do { \ + fauxclicky_enabled = false; \ + rgbsps_set(LED_AUDIO, 0, 0, 0); \ + fauxclicky_stop(); \ +} while (0) +#undef FAUXCLICKY_ON +#define FAUXCLICKY_ON do { \ + fauxclicky_enabled = true; \ + rgbsps_set(LED_AUDIO, 8, 0, 8); \ +} while (0) +#endif #endif #include "outputselect.h" #include "led.h" @@ -128,8 +141,8 @@ enum planck_keycodes { #ifndef FAUXCLICKY_ENABLE FC_TOG, #endif -#ifndef ADAFRUIT_BLE_ENABLE - OUT_BLE, +#ifndef MODULE_ADAFRUIT_BLE + OUT_BT, #endif KEYCODE_END }; @@ -428,12 +441,23 @@ const uint8_t PROGMEM LED_FN[] = { }; const uint8_t PROGMEM LED_INDICATORS[] = { - LED_IND_EMOJI, - LED_IND_NUM, - LED_IND_FUN, - LED_IND_BATTERY, - LED_IND_USB, + LED_IND_LINUX, + LED_IND_APPLE, + LED_IND_WINDOWS, + LED_IND_QWERTY, + LED_IND_ALT, + LED_IND_AUDIO, LED_IND_BLUETOOTH, + LED_IND_USB, + + LED_IND_BATTERY, + LED_IND_CAPSLOCK, + LED_IND_GUI, + LED_IND_FUN, + LED_IND_NUM, + LED_IND_PUNC, + LED_IND_EMOJI, + LED_IND_GREEK, }; const uint8_t PROGMEM LED_TRACKPOINT[] = { @@ -486,15 +510,31 @@ void led_reset(void) { } } +void led_set_default_layer_indicator(void) { + uint8_t default_layer = biton32(default_layer_state); + if (default_layer == _QWERTY) { + rgbsps_set(LED_IND_QWERTY, 15, 10, 0); + rgbsps_set(LED_IND_ALT, 0, 0, 0); + } else { + rgbsps_set(LED_IND_QWERTY, 0, 0, 0); + rgbsps_set(LED_IND_ALT, 15, 10, 0); + } + rgbsps_send(); + return; +} + void led_set_layer_indicator(void) { static uint8_t oldlayer = 255; + led_reset(); + + rgbsps_set(LED_IND_GUI, 0, 0, 0); rgbsps_set(LED_IND_FUN, 0, 0, 0); - // rgbsps_set(LED_IND_NUM, 0, 0, 0); + rgbsps_set(LED_IND_NUM, 0, 0, 0); + rgbsps_set(LED_IND_PUNC, 0, 0, 0); + rgbsps_set(LED_IND_GREEK, 0, 0, 0); rgbsps_set(LED_IND_EMOJI, 0, 0, 0); - led_reset(); - uint8_t layer = biton32(layer_state); if (oldlayer == layer) { return; @@ -508,24 +548,57 @@ void led_set_layer_indicator(void) { } switch(layer) { + case _GUI: + rgbsps_set(LED_IND_GUI, 15, 0, 15); + break; case _FUN: rgbsps_set(LED_IND_FUN, 15, 0, 0); break; - // case _NUM: - // rgbsps_set(LED_IND_NUM, 0, 0, 15); - // break; + case _NUM: + rgbsps_set(LED_IND_NUM, 0, 0, 15); + break; + case _PUNC: + rgbsps_set(LED_IND_PUNC, 0, 15, 0); + break; + case _GREEKL: + case _GREEKU: + rgbsps_set(LED_IND_GREEK, 0, 15, 15); + break; case _EMOJI: rgbsps_set(LED_IND_EMOJI, 15, 15, 0); break; default: + rgbsps_set(LED_IND_GUI, 3, 3, 3); rgbsps_set(LED_IND_FUN, 3, 3, 3); - // rgbsps_set(LED_IND_NUM, 3, 3, 3); + rgbsps_set(LED_IND_NUM, 3, 3, 3); + rgbsps_set(LED_IND_PUNC, 3, 3, 3); + rgbsps_set(LED_IND_GREEK, 3, 3, 3); rgbsps_set(LED_IND_EMOJI, 3, 3, 3); } rgbsps_send(); } +void led_set_unicode_input_mode(void) { + rgbsps_set(LED_IND_LINUX, 0, 0, 0); + rgbsps_set(LED_IND_APPLE, 0, 0, 0); + rgbsps_set(LED_IND_WINDOWS, 0, 0, 0); + + switch (get_unicode_input_mode()) { + case UC_LNX: + rgbsps_set(LED_IND_LINUX, 15, 15, 15); + break; + case UC_OSX: + rgbsps_set(LED_IND_APPLE, 15, 15, 15); + break; + case UC_WIN: + case UC_WINC: + rgbsps_set(LED_IND_WINDOWS, 15, 15, 15); + break; + } + rgbsps_send(); +} + void led_set_output_ble(void) { rgbsps_set(LED_IND_BLUETOOTH, 0, 0, 15); rgbsps_set(LED_IND_USB, 0, 0, 0); @@ -552,7 +625,16 @@ void led_init(void) { rgbsps_set(LED_TRACKPOINT1, 15, 0, 0); rgbsps_set(LED_TRACKPOINT2, 0, 0, 15); rgbsps_set(LED_TRACKPOINT3, 15, 0, 0); + + // unicode input mode + led_set_unicode_input_mode(); + + // layer indicator + led_set_layer_indicator(); + led_set_default_layer_indicator(); } + + #endif // RGBSPS_ENABLE // keymaps @@ -831,7 +913,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_SYS] = KEYMAP( DEBUG, QWERTY, WIN, XXXXXXX, RESET, XXXXXXX, XXXXXXX, OUT_USB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, FC_TOG, XXXXXXX, DVORAK, XXXXXXX, GLOW, XXXXXXX, XXXXXXX, WORKMAN, LINUX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, COLEMAK, XXXXXXX, OUT_BLE, NORMAN, OSX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, COLEMAK, XXXXXXX, OUT_BT, NORMAN, OSX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______ ), @@ -842,6 +924,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { void persistant_default_layer_set(uint16_t default_layer) { eeconfig_update_default_layer(default_layer); default_layer_set(default_layer); + led_set_default_layer_indicator(); } #ifdef DOUBLESPACE_LAYER_ENABLE @@ -1086,14 +1169,23 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { // OS switchers case LINUX: set_unicode_input_mode(UC_LNX); +#ifdef RGBSPS_ENABLE + led_set_unicode_input_mode(); +#endif return false; break; case WIN: set_unicode_input_mode(UC_WINC); +#ifdef RGBSPS_ENABLE + led_set_unicode_input_mode(); +#endif return false; break; case OSX: set_unicode_input_mode(UC_OSX); +#ifdef RGBSPS_ENABLE + led_set_unicode_input_mode(); +#endif return false; break; @@ -1115,6 +1207,14 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { // faux clicky indicator #ifdef FAUXCLICKY_ENABLE case FC_TOG: +#ifdef RGBSPS_ENABLE + if (fauxclicky_enabled) { + rgbsps_set(LED_IND_AUDIO, 0, 0, 0); + } else { + rgbsps_set(LED_IND_AUDIO, 5, 11, 13); + } + rgbsps_send(); +#endif return true; break; #endif @@ -1123,12 +1223,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } void set_output_user(uint8_t output) { -#ifdef ADAFRUIT_BLE_ENABLE +#ifdef MODULE_ADAFRUIT_BLE switch(output) { case OUTPUT_USB: led_set_output_usb(); break; - case OUTPUT_ADAFRUIT_BLE: + case OUTPUT_BLUETOOTH: led_set_output_ble(); break; default: @@ -1147,12 +1247,12 @@ void matrix_init_user() { #endif // auto detect output on init -#ifdef ADAFRUIT_BLE_ENABLE +#ifdef MODULE_ADAFRUIT_BLE uint8_t output = auto_detect_output(); if (output == OUTPUT_USB) { set_output(OUTPUT_USB); } else { - set_output(OUTPUT_ADAFRUIT_BLE); + set_output(OUTPUT_BLUETOOTH); } #endif } @@ -1178,9 +1278,9 @@ void turn_off_capslock() { bool new_capslock = usb_led & (1< Date: Wed, 19 Apr 2017 02:55:19 +0700 Subject: Fix Planck compatibility --- keyboards/handwired/promethium/keymaps/priyadi/keymap.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 55e028f18..efa5d9756 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -924,7 +924,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { void persistant_default_layer_set(uint16_t default_layer) { eeconfig_update_default_layer(default_layer); default_layer_set(default_layer); +#ifdef RGBSPS_ENABLE led_set_default_layer_indicator(); +#endif } #ifdef DOUBLESPACE_LAYER_ENABLE -- cgit v1.2.3