commit 7bc7ab6bd502b22de66782799c4a97709de559c8 Author: Frieder Schlesier Date: Fri Jan 7 23:01:27 2022 +0100 initial commit diff --git a/README.org b/README.org new file mode 100644 index 0000000..82567ec --- /dev/null +++ b/README.org @@ -0,0 +1,24 @@ +* Keyboard Config + +for Keyboardio Atreus based on Kaleidoscope + + +** The Layout + +[[./keyboard-layout-colemak-DHm.png]] + +- colemak-dhm variant +- https://dreymar.colemak.org/ergo-mods.html#CurlDH +- [[https://kaleidoscope.readthedocs.io/en/latest/quick_start.html][Kaleidoscope Quick Start]] +- a great blog article about customizing the Atreus for german and programming: https://www.gettommy.com/posts/my-ergonomic-40-percent-keyboard-layout-for-german-developers/#where-to-go-from-here +- get used to the new layout with deliberate practise at https://www.keybr.com/ +- typing speedtest with layout emulator: https://monkeytype.com/ +- [[http://www.keyboard-layout-editor.com/][Keyboard Layout Editor]] + +** Build and run + +- git clone Kaleidoscope +- export KALEIDOSCOPE +- make flash + + diff --git a/colemak-dhm.ino b/colemak-dhm.ino new file mode 100644 index 0000000..73b7415 --- /dev/null +++ b/colemak-dhm.ino @@ -0,0 +1,227 @@ +/* -*- mode: c++ -*- + * Atreus -- Chrysalis-enabled Sketch for the Keyboardio Atreus + * Copyright (C) 2018, 2019 Keyboard.io, Inc + * + * 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, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/* +* https://colemakmods.github.io/mod-dh/keyboards.html#matrix-keyboards +* german base keys +* Umlauts via Qubit keys +* navigation with vim-like homerow +*/ + +#ifndef BUILD_INFORMATION +#define BUILD_INFORMATION "locally built on " __DATE__ " at " __TIME__ +#endif + +#include "Kaleidoscope.h" +#include "Kaleidoscope-EEPROM-Settings.h" +#include "Kaleidoscope-EEPROM-Keymap.h" +#include "Kaleidoscope-FocusSerial.h" +#include "Kaleidoscope-Macros.h" +#include "Kaleidoscope-MouseKeys.h" +#include "Kaleidoscope-OneShot.h" +#include "Kaleidoscope-Qukeys.h" +#include "Kaleidoscope-SpaceCadet.h" +#include "Kaleidoscope-Languages.h" +#include "kaleidoscope/lang/de-qwertz.h" + + +#define MO(n) ShiftToLayer(n) +#define TG(n) LockLayer(n) + +enum { + MACRO_QWERTY, + MACRO_VERSION_INFO +}; + +/* TODO add QWERTZ layer for gaming (and colleagues) */ +/* QWERTZ+Shift should be MOVED to (and back) still with ability to use SYMBOLS layer from there */ +enum { + BASE, // Colemak-DHm: no modifiers + SHIFT, // Shifted: hold Shift like a sane person + SYMBOLS, // SUPER key + NAVI, // with FUN or Any key (below , and .) + MOUSE // while holding M key +}; + +/* *INDENT-OFF* */ +KEYMAPS( + [BASE] = KEYMAP_STACKED + ( + Key_de_Q ,Key_de_W ,Key_de_F ,Key_de_P ,Key_de_B + ,Key_de_A ,Key_de_R ,Key_de_S ,Key_de_T ,Key_de_G + ,Key_de_Y ,Key_de_X ,Key_de_C ,Key_de_D ,Key_de_V ,Key_de_Slash + ,Key_de_LeftControl ,Key_de_Tab ,Key_LeftGui ,MO(SHIFT) ,Key_de_Spacebar ,Key_de_Escape + + + ,Key_de_J ,Key_de_L ,Key_de_U ,Key_de_Z ,Key_de_Semicolon + ,Key_de_M ,Key_de_N ,Key_de_E ,Key_de_I ,Key_de_O + ,Key_de_Backslash ,Key_de_K ,Key_de_H ,Key_de_Comma ,Key_de_Period ,Key_de_Slash + ,Key_de_LeftAlt ,MO(SYMBOLS) ,Key_de_Backspace ,MO(NAVI) ,MO(NAVI) ,Key_Enter + ), + + [SHIFT] = KEYMAP_STACKED + ( + LSHIFT(Key_de_Q) ,LSHIFT(Key_de_W) ,LSHIFT(Key_de_F) ,LSHIFT(Key_de_P) ,LSHIFT(Key_de_B) + ,LSHIFT(Key_de_A) ,LSHIFT(Key_de_R) ,LSHIFT(Key_de_S) ,LSHIFT(Key_de_T) ,LSHIFT(Key_de_G) + ,LSHIFT(Key_de_Y) ,LSHIFT(Key_de_X) ,LSHIFT(Key_de_C) ,LSHIFT(Key_de_D) ,LSHIFT(Key_de_V) ,Key_de_LessThan + ,___ ,LSHIFT(Key_de_Tab) ,___ ,___ ,___ ,___ + + + ,LSHIFT(Key_de_J) ,LSHIFT(Key_de_L) ,LSHIFT(Key_de_U) ,LSHIFT(Key_de_Z) ,LSHIFT(Key_de_W) + ,LSHIFT(Key_de_M) ,LSHIFT(Key_de_N) ,LSHIFT(Key_de_E) ,LSHIFT(Key_de_I) ,LSHIFT(Key_de_O) + ,LSHIFT(Key_de_LessThan) ,LSHIFT(Key_de_K) ,LSHIFT(Key_de_H) ,Key_de_Semicolon ,Key_de_Colon ,Key_de_Backslash + ,___ ,___ ,Key_de_Delete ,___ ,___ ,___ + ), + + [SYMBOLS] = KEYMAP_STACKED + ( + Key_de_ExlamationMark ,Key_de_At ,Key_de_QuestionMark ,Key_de_Dollar ,Key_de_Percent + ,Key_de_Tilde ,Key_de_LeftCurly ,Key_de_LeftParen ,Key_de_LeftBracket ,Key_de_Quote + ,Key_de_Pipe ,Key_de_RightCurly ,Key_de_RightParen ,Key_de_RightBracket ,Key_de_DoubleQuote ,Key_de_LessThan + ,___ ,Key_de_Insert ,___ ,Key_de_LeftShift ,Key_de_Spacebar ,Key_de_GreaterThan + + + ,Key_de_Slash ,Key_de_7 ,Key_de_8 ,Key_de_9 ,Key_de_Plus + ,Key_de_Asterisk ,Key_de_4 ,Key_de_5 ,Key_de_6 ,Key_de_Minus + ,Key_de_GreaterThan ,Key_de_0 ,Key_de_1 ,Key_de_2 ,Key_de_3 ,Key_de_Slash + ,Key_de_LeftAlt ,___ ,___ ,Key_de_Period ,Key_de_Comma ,Key_de_Equals + ), + + [NAVI] = KEYMAP_STACKED + ( + Key_de_UpArrow ,Key_de_F7 ,Key_de_F8 ,Key_de_F9 ,Key_de_F10 + ,Key_de_DownArrow ,Key_de_F4 ,Key_de_F5 ,Key_de_F6 ,Key_de_F11 + ,___ ,Key_de_F1 ,Key_de_F2 ,Key_de_F3 ,Key_de_F12 ,___ + ,MoveToLayer(BASE) ,___ ,___ ,___ ,___ ,___ + + + ,Key_de_Insert ,Key_de_Home ,Key_de_UpArrow ,Key_de_End ,Key_de_PageUp + ,Key_de_LeftArrow ,Key_de_DownArrow ,Key_de_UpArrow ,Key_de_RightArrow ,Key_de_PageDown + ,___ ,Key_de_VolumeDown ,Key_de_VolumeUp ,Key_de_Mute ,___ ,Consumer_PlaySlashPause + ,___ ,___ ,___ ,___ ,___ ,___ + ), + + [MOUSE] = KEYMAP_STACKED + ( + XXX, Key_mouseBtnP, Key_mouseUp, Key_mouseBtnN, XXX, + XXX, Key_mouseL, Key_mouseDn, Key_mouseR, XXX, + XXX, XXX, XXX, XXX, XXX, XXX, + XXX, XXX, XXX, Key_mouseBtnL, Key_mouseScrollUp, Key_mouseScrollL, + + XXX, XXX, XXX, XXX, XXX, + XXX, XXX, XXX, XXX, XXX, + XXX, XXX, XXX, XXX, XXX, XXX, + Key_mouseScrollR, Key_mouseScrollDn, Key_mouseBtnR, XXX, XXX, XXX + ), +) +/* *INDENT-ON* */ + + + +KALEIDOSCOPE_INIT_PLUGINS( + EEPROMSettings, + EEPROMKeymap, + Focus, + FocusEEPROMCommand, + FocusSettingsCommand, + Qukeys, + SpaceCadet, + OneShot, + Macros, + MouseKeys +); + +const macro_t *macroAction(uint8_t macro_id, KeyEvent &event) { + if (keyToggledOn(event.state)) { + switch (macro_id) { + case MACRO_QWERTY: + // This macro is currently unused, but is kept around for compatibility + // reasons. We used to use it in place of `MoveToLayer(QWERTY)`, but no + // longer do. We keep it so that if someone still has the old layout with + // the macro in EEPROM, it will keep working after a firmware update. + Layer.move(BASE); + break; + case MACRO_VERSION_INFO: + Macros.type(PSTR("Keyboardio Atreus - Kaleidoscope ")); + Macros.type(PSTR(BUILD_INFORMATION)); + break; + default: + break; + } + } + return MACRO_NONE; +} + +void setup() { + QUKEYS( + //Qukey(layer, key_addr, alternate_key) + + //umlaute + kaleidoscope::plugin::Qukey(BASE, KeyAddr(1, 2), Key_de_SS), // s -> ß + kaleidoscope::plugin::Qukey(BASE, KeyAddr(1, 0), Key_de_AUml), // a -> ä + kaleidoscope::plugin::Qukey(SHIFT, KeyAddr(1, 0), LSHIFT(Key_de_AUml)), // A -> Ä + kaleidoscope::plugin::Qukey(BASE, KeyAddr(1, 11), Key_de_OUml), // o -> ö + kaleidoscope::plugin::Qukey(SHIFT, KeyAddr(1, 11), LSHIFT(Key_de_OUml)), // o -> Ö + kaleidoscope::plugin::Qukey(BASE, KeyAddr(0, 9), Key_de_UUml), // u -> ü + kaleidoscope::plugin::Qukey(SHIFT, KeyAddr(0, 9), LSHIFT(Key_de_UUml)), // U -> Ü + + //common special characters + kaleidoscope::plugin::Qukey(BASE, KeyAddr(0, 0), Key_de_At), // q -> @ + kaleidoscope::plugin::Qukey(BASE, KeyAddr(1, 9), Key_de_Euro), // e -> € + kaleidoscope::plugin::Qukey(BASE, KeyAddr(1, 8), Key_de_Tilde), // n -> ~ + + //layer shifts/switches + kaleidoscope::plugin::Qukey(BASE, KeyAddr(1, 7), MO(MOUSE)), // shift to mouse controls + + //hold for "ctrl+" version of the key + // kaleidoscope::plugin::Qukey(BASE, KeyAddr(2, 2), LCTRL(Key_de_C)), // c copy + // kaleidoscope::plugin::Qukey(BASE, KeyAddr(2, 4), LCTRL(Key_de_V)), // v paste + // kaleidoscope::plugin::Qukey(BASE, KeyAddr(2, 1), LCTRL(Key_de_X)), // x cut + // kaleidoscope::plugin::Qukey(BASE, KeyAddr(2, 0), LCTRL(Key_de_Z)), // z undo + // kaleidoscope::plugin::Qukey(BASE, KeyAddr(0, 10), LCTRL(Key_de_Y)), // y redo + // kaleidoscope::plugin::Qukey(BASE, KeyAddr(1, 3), LCTRL(Key_de_F)), // f find + // kaleidoscope::plugin::Qukey(BASE, KeyAddr(0, 8), LCTRL(Key_de_L)), // l select address bar + // kaleidoscope::plugin::Qukey(BASE, KeyAddr(1, 1), LCTRL(Key_de_R)), // r reload page + + //ease of use + // kaleidoscope::plugin::Qukey(BASE, KeyAddr(2, 9), Key_de_Semicolon), // semi-colon + // kaleidoscope::plugin::Qukey(BASE, KeyAddr(2, 10), Key_de_Colon), // colon + + //other + // kaleidoscope::plugin::Qukey(BASE, KeyAddr(3, 11), Key_de_LeftAlt), // esc -> alt + + /* todo: + * p = print + * s = save or leave ß + * t = new tab + * n = new page/browser window/doc or leave ~ + */ + ) + + //Qukey settings + Qukeys.setHoldTimeout(250); + Qukeys.setOverlapThreshold(80); + Kaleidoscope.setup(); + SpaceCadet.disable(); + EEPROMKeymap.setup(10); +} + +void loop() { + Kaleidoscope.loop(); +} diff --git a/keyboard-layout-colemak-DHm.json b/keyboard-layout-colemak-DHm.json new file mode 100644 index 0000000..f164d8d --- /dev/null +++ b/keyboard-layout-colemak-DHm.json @@ -0,0 +1,396 @@ +[ + { + "background": { + "name": "PBT Black", + "style": "background-image: url('/bg/plastic/pbt-black.png');" + } + }, + [ + { + "r": 10, + "rx": 1, + "y": -0.09999999999999998, + "x": 2, + "t": "#267dff\n#1fa12e\n\n#c76c00\n\n\n\n\n\n000000", + "fa": [ + 0, + 4, + 0, + 0 + ] + }, + "?\n\n\n\n\n\n\n\n\nF" + ], + [ + { + "y": -0.65, + "x": 1, + "t": "#267dff\n\n\n\n\n\n\n\n\n000000" + }, + "@\n\n\n\n\n\n\n\n\nW", + { + "x": 1 + }, + "$\n\n\n\n\n\n\n\n\nP" + ], + [ + { + "y": -0.75, + "t": "#267dff\n\n\n\n\n\n\n\n\n#000000", + "fa": [ + 0, + 4, + 0, + 1 + ] + }, + "!\n\n\nIns\n\n\n\n\n\nQ" + ], + [ + { + "y": -0.9, + "x": 4, + "t": "#267dff\n\n\n#c76c00\n\n\n\n\n\n000000" + }, + "%\n\n\n\n\n\n\n\n\nB" + ], + [ + { + "y": -0.7000000000000001, + "x": 2, + "t": "#267dff\n#1fa12e\n\n#c76c00\n\n\n\n\n\n000000" + }, + "(\n\n\n\n\n\n\n\n\nS" + ], + [ + { + "y": -0.6499999999999999, + "x": 1 + }, + "{\n\n\n\n\n\n\n\n\nR", + { + "x": 1 + }, + "[\n\n\n\n\n\n\n\n\nT" + ], + [ + { + "y": -0.75, + "t": "#267dff\n\n\n\n\n\n\n\n\n000000" + }, + "~\n\n\n\n\n\n\n\n\nA" + ], + [ + { + "y": -0.8999999999999999, + "x": 4, + "t": "#267dff\n\n\n#c76c00\n\n\n\n\n\n000000" + }, + "'\n\n\n\n\n\n\n\n\nG" + ], + [ + { + "y": -0.7000000000000002, + "x": 2, + "t": "#267dff\n\n\n\n\n\n\n\n\n000000", + "f": 3 + }, + ")\n\n\n\n\n\n\n\n\nC" + ], + [ + { + "y": -0.6499999999999999, + "x": 1, + "f": 3 + }, + "}\n\n\n\n\n\n\n\n\nX", + { + "x": 1, + "f": 3 + }, + "]\n\n\n\n\n\n\n\n\nD" + ], + [ + { + "y": -0.75 + }, + "|\n\n\n\n\n\n\n\n\nY", + { + "x": 4, + "t": "#000000", + "a": 5 + }, + "<\n\n\n\n\n\n/" + ], + [ + { + "y": -0.8999999999999999, + "x": 4, + "a": 4, + "fa": [ + 0, + 4, + 0, + 2 + ] + }, + "\"\n\n\nDel\n\n\n\n\n\nV" + ], + [ + { + "y": -0.7000000000000002, + "x": 2, + "a": 7, + "fa": [ + 9 + ] + }, + "" + ], + [ + { + "y": -0.6499999999999999, + "x": 1, + "f": 6 + }, + "", + { + "x": 1, + "t": "#000000\n#1fa12e", + "a": 4, + "f": 3, + "fa": [ + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 6 + ] + }, + "\nLclick\n\n\n\n\n\n\n\n" + ], + [ + { + "y": -0.75, + "t": "#000000", + "a": 7 + }, + "Ctrl", + { + "x": 4 + }, + "Esc" + ], + [ + { + "y": -0.8999999999999999, + "x": 4 + }, + "Space" + ], + [ + { + "r": -10, + "y": -0.34999999999999964, + "x": 4.75, + "a": 5 + }, + ">\n\n\n\n\n\n\\" + ], + [ + { + "rx": 7, + "ry": 0.965, + "y": -0.20000000000000018, + "x": 2, + "t": "#267dff\n\n\n#c76c00\n\n\n\n\n\n000000", + "a": 4, + "f": 3 + }, + "8\n\n\n\n\n\n\n\n\nU" + ], + [ + { + "y": -0.6499999999999999, + "x": 1, + "fa": [ + 0, + 1, + 0, + 1 + ] + }, + "7\n\n\nHOME\n\n\n\n\n\nL", + { + "x": 1 + }, + "9\n\n\nEnd\n\n\n\n\n\nZ" + ], + [ + { + "y": -0.75, + "x": 4, + "fa": [ + 4 + ] + }, + "-\n\n\n\n\n\n\n\n\n;" + ], + [ + { + "y": -0.8999999999999999, + "t": "#267dff\n\n\n\n\n\n\n\n\n000000" + }, + "/\n\n\n\n\n\n\n\n\nJ" + ], + [ + { + "y": -0.7000000000000002, + "x": 2, + "t": "#267dff\n\n\n#c76c00\n\n\n\n\n\n000000", + "f": 3 + }, + "5\n\n\n\n\n\n\n\n\nE" + ], + [ + { + "y": -0.6499999999999999, + "x": 1, + "f": 3 + }, + "4\n\n\n\n\n\n\n\n\nN", + { + "x": 1, + "f": 3 + }, + "6\n\n\n\n\n\n\n\n\nI" + ], + [ + { + "y": -0.75, + "x": 4, + "f": 3 + }, + "+\n\n\n\n\n\n\n\n\nO" + ], + [ + { + "y": -0.8999999999999999, + "t": "#267dff\n#1fa12e\n\n#c76c00\n\n\n\n\n\n000000", + "f": 3 + }, + "*\n\n\n\n\n\n\n\n\nM" + ], + [ + { + "y": -0.7000000000000002, + "x": 2, + "t": "#267dff\n\n\n\n\n\n\n\n000000\n000000", + "f": 3 + }, + "2\n\n\n\n\n\n\n\n;\n," + ], + [ + { + "y": -0.6499999999999999, + "x": 1, + "t": "#267dff\n\n\n\n\n\n\n\n\n000000", + "f": 3 + }, + "1\n\n\n\n\n\n\n\n\nH", + { + "x": 1, + "t": "#267dff\n\n\n\n\n\n\n\n000000\n000000", + "f": 3 + }, + "3\n\n\n\n\n\n\n\n:\n." + ], + [ + { + "y": -0.7500000000000004, + "x": 4, + "t": "#000000\n\n\n#267dff", + "sm": "alps", + "sb": "matias", + "f": 3 + }, + "\n\n\n\n\n\n\n\n\n/" + ], + [ + { + "y": -0.9000000000000004, + "t": "#267dff\n\n\n\n\n\n\n\n\n000000", + "f": 3 + }, + "0\n\n\n\n\n\n\n\n\nK" + ], + [ + { + "y": -0.6999999999999997, + "x": 2, + "c": "#c76c00", + "t": "#000000" + }, + "\n\n\n\n\n\n\n\n\nNAV" + ], + [ + { + "y": -0.6500000000000004, + "x": 1, + "c": "#cccccc", + "t": "#000000\n#1fa12e", + "fa": [ + 4, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 6 + ] + }, + "\nRclick\n\n\n\n\n\n\n\n", + { + "x": 1, + "c": "#c76c00", + "t": "#000000", + "f": 3 + }, + "\n\n\n\n\n\n\n\n\nNAV" + ], + [ + { + "y": -0.8650000000000002, + "x": -1, + "c": "#cccccc", + "a": 7, + "f": 3 + }, + "Alt" + ], + [ + { + "y": -0.8849999999999998, + "x": 4, + "f": 8 + }, + "" + ], + [ + { + "y": -0.9000000000000004, + "c": "#267dff", + "a": 4, + "f": 3 + }, + "\n\n\n\n\n\n\n\n\nSYMB" + ] +] \ No newline at end of file diff --git a/keyboard-layout-colemak-DHm.png b/keyboard-layout-colemak-DHm.png new file mode 100644 index 0000000..65680f7 Binary files /dev/null and b/keyboard-layout-colemak-DHm.png differ