diff --git a/README.org b/README.org new file mode 100644 index 0000000..2e091ff --- /dev/null +++ b/README.org @@ -0,0 +1,323 @@ +# -*- mode: org; coding: utf-8; -*- +#+author: nik gaffney +#+title: QMK config for Charybdis + +Charybdis is an ergonomic keyboard using a split 4x6 layout (or 3x5) with 5+3 thumb keys and integrated trackball. + +[[file:img/charybdis-4x6.jpg]] + + +The keyboard can be programmed using [[https://qmk.fm/][QMK]] firmware for the [[https://github.com/Bastardkb/charybdis][charybdis]] (which currently requires the CNano branch of QMK) With the help of [[https://github.com/mihaiolteanu/mugur][mugur]] (and org-mode) this file can be used as a literate config to generate a keymap and the relevant build files for the QMK firmware… + +For reference, comparison and reading the [[https://github.com/manna-harbour/qmk_firmware/blob/crkbd/keyboards/crkbd/keymaps/manna-harbour/readme.org][Crkbd Keymap by Manna Harbour]] and [[https://github.com/qmk/qmk_firmware/tree/master/users/drashna][drashna]] provide good examples of detailed configs, and the [[https://github.com/qmk/qmk_firmware/tree/master/keyboards/crkbd/keymaps][QMK tree]] has further specifics with a wide range of examples. + + +#+caption: alphanumeric, movement and mouse layers +[[file:img/zzkt-charybdis-4x6.png]] + + +see also [[http://www.keyboard-layout-editor.com/#/gists/d94578d8f4d7e0b961b52790e8c3a367][KLE layers (pt.1)]] and KLE layers (pt.2) etc. + +* general principles + +This config uses a mulit-layer qwerty layout which has emerged from a combination of writing and programming using emacs (and emacs style keybindings) on macos and linux. The numeric layer has numbers on the home row and shifted symbols on the row above, with commonly used brackets on the lowest row symmetrically between sides. The emacs layer(s) provide both command and prefix keys. The movement layer provides arrows (as WASD and HJKL) and jump keys on the left. When the mouse layer is active the keys above the trackball can be used as mouse buttons. There is a QMK reset key on each half of the keyboard. + +* specific mappings + +Details of keyboard layout, layers, macros and general confusion can be found in the [[https://docs.qmk.fm/#/][QMK docs]] + +*Layers* + - qwerty and modifiers + - numbers, symbols & brackets + - movement. arrows & jump + - emacs layers + - mouse layer + +*Trackball* + - mounted on the right half + - uses keys above the trackball as mouse buttons (i.e. =M=, =comma=, and =dot= with qwerty layout) + - sniping, drag_scroll, etc + +*Modifiers* + - Left thumb (base layer) Alt/Meta, space and GUI (held) or space (tap) on top row, with Emacs layer and =KC_LAPO= below + - Right thumb (base layer) Tap toggle numeric layer, Enter (tap) or Right GUI (held) on top row and =KC_RAPC= below + +The =KC_LAPO= key is Left Alt when held and =(= when tapped, it can be used as =Meta=. The =KC_RAPC= key is Right Alt when held and =)= when tapped, it can be used for accents and non-ascii characters with the international macOS input sources. + +The =emacs= layer is activated with Left-thumb (=k45=) and the =hypm= layer can be activated with (=k80=) and can be used to provide the =H-= prefix bindings defined in =.emacs= The =hyper= key seen by emacs can be mapped to =KC_RGUI= rather than the =KC_HYPR= modifier combination (see also the “[[https://github.com/qmk/qmk_firmware/issues/2179][the infamous Apple Fn key]]” for compatibility) + +*QMK Reset* + - Left. =k45= & =k30= + - Right. =k70= & =k80= + + +To create a new layer, start with a blank layer. + +#+BEGIN_SRC emacs-lisp :tangle no :results silent :eval no +("blank" + --- --- --- --- --- --- --- --- --- --- --- --- + --- --- --- --- --- --- --- --- --- --- --- --- + --- --- --- --- --- --- --- --- --- --- --- --- + --- --- --- --- --- --- --- --- --- --- --- --- + --- --- --- --- --- -x- + --- --- --- -x-) +#+END_SRC + +Details of the =mugur= keycode naming can be found in the documentation of =mugur--symbol= + +#+BEGIN_SRC emacs-lisp :tangle no :results silent +(find-function 'mugur--symbol) +#+END_SRC + +A complete keymap can be defined within =mugur-mugur= which will generate the required files to build the firmware. + +#+name: keymap +#+BEGIN_SRC emacs-lisp :tangle no :results silent :eval query +(require 'mugur) + +(let ((mugur-qmk-path "~/code/keyboards/Charybdis/qmk") + (mugur-keyboard-name "bastardkb/charybdis/4x6") + (mugur-layout-name "LAYOUT_split_4x6_5") + (mugur-keymap-name "zzkt") + (mugur-tapping-term 175)) + + (mugur-mugur + '(("base" + esc 1 2 3 4 5 6 7 8 9 0 bspace + tab q w e r t y u i o p - + C a s d f g h j k l scolon (LT move ?\') + (S up) (LT mouse z) x c v b n m comma dot (LT mouse slash) (LT hypm down) + M space (G spc) (TT numeric) (G ent) -x- + (MO emacs) lapo rapc -x-) + + ("numeric" + "~" ?\! ?\@ ?\# ?\$ ?\% ?\^ ?\& ?\* _ + bspace + tab ?\! ?\@ ?\# ?\$ ?\% ?\^ ?\& ?\* - = --- + 0 1 2 3 4 5 6 7 8 9 0 (LT move ent) + (S left) "`" ?\\ ?\\ ?\{ ?\[ ?\] ?\} comma dot | (S right) + --- --- --- --- enter -x- + (TG mouse) lapo rapc -x-) + + ("move" + --- M-< --- --- --- --- --- --- --- --- --- --- + --- M-v up --- --- --- --- --- --- --- --- --- + C-a left down right C-e --- left up down right -x- --- + --- M-< C-v M-> --- --- --- --- --- --- --- --- + C S --- --- --- -x- + --- --- --- -x-) + + ("emacs" + esc --- --- (C-x 0) (C-x 2) (C-x 3) (C-x 4 t) --- --- --- --- --- + --- --- --- (C-x 0) (C-x 2) (C-x 3) (C-x 4 t) --- --- (C-M o) --- --- + --- --- M-% --- --- (H-t) (C-x b) --- --- "λ" --- --- + reset --- M-x C-c --- ?\( ?\) (M-x "magit" ent) --- --- --- --- + --- --- (H-i e) (C-x 8) (MO hypm) -x- + --- --- --- -x-) + + ("hypm" + x --- --- --- --- ( C-a "* " ) --- --- --- --- --- --- + x --- --- --- --- " - [ ] " --- --- H-i (H-i o) (H-i l) --- + --- --- --- H-d --- " - " --- --- --- --- --- reset + --- --- --- --- --- --- (H-m n) (H-m m) (H-m s) --- --- --- + --- --- --- --- --- -x- + --- --- --- -x-) + + ("mouse" + --- --- --- --- --- --- --- --- --- --- --- --- + --- "SNIPER_CONFIG" --- --- --- --- --- --- --- --- --- --- + --- "DPI_CONFIG" "DRAG_SCROLL" --- --- --- --- --- "DRAG_SCROLL" --- --- --- + --- --- --- --- --- --- --- btn1 btn2 btn3 --- --- + btn2 btn1 G --- --- -x- + C S --- -x-) + ))) +#+END_SRC + + +an optional base config for Colemak + +#+BEGIN_SRC emacs-lisp +("colemak" + esc 1 2 3 4 5 6 7 8 9 0 bspace + tab q w f p g j l u y scolon - + C a r s t d h n e i o (LT move ?\') + (LT S up) z x c v b k m comma dot slash (LT hypm down) + (MO emacs) lapo (G space) ent rapc (TT numeric)) +#+END_SRC + +** keymap.c + +This will generate a =keymap.c= file with =org-babel-tangle= and should be run before the elisp code block for the keymap described above. + +#+BEGIN_SRC c :tangle keymap.c +#include QMK_KEYBOARD_H +#include "version.h" +#include "split_util.h" +#+END_SRC + + =mugur= will write the keymap and only overwrite the region between these comments. + +#+BEGIN_SRC c :tangle keymap.c +// START-MUGUR-REGION +// END-MUGUR-REGION +#+END_SRC + +turn on (or off) debug info (check that =CONSOLE_ENABLE= is set accordingly in =rules.mk= ) + +#+BEGIN_SRC c :tangle keymap.c +void keyboard_post_init_user(void) { + // debug_enable=true; + // debug_matrix=true; + // debug_keyboard=true; + // debug_mouse=true; +} +#+END_SRC + +** rules.mk + +this will create a =rules.mk= file with some specifics for the Charybdis + +#+BEGIN_SRC makefile :tangle rules.mk +# START-MUGUR-REGION +# END-MUGUR-REGION + +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = atmel-dfu + +SPLIT_KEYBOARD = yes + +# uncode +UNICODE_ENABLE = yes + +# Build Options +BOOTMAGIC_ENABLE = no # Bootmagic Lite +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # USB Nkey Rollover + +# trackball & mousekeys +MOUSEKEY_ENABLE = yes +POINTING_DEVICE_ENABLE = yes +MOUSE_SHARED_EP = no + +# enable configuraiton with VIA +VIA_ENABLE = no + +# No lighting or audio +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output +RGB_MATRIX_ENABLE = no + +# trackpad driver +SRC += drivers/sensors/pmw3360.c +QUANTUM_LIB_SRC += spi_master.c + +# enable Link Time Optimization to reduce firmware size +# see also https://thomasbaart.nl/2018/12/01/reducing-firmware-size-in-qmk/ +EXTRAFLAGS += -flto +#+END_SRC + +** config.h + +This will generate a =config.h= file + +#+BEGIN_SRC c :tangle config.h +// START-MUGUR-REGION +// END-MUGUR-REGION +#+END_SRC + +#+BEGIN_SRC c :tangle config.h +#define EE_HANDS +#+END_SRC + +…and some layers + +#+BEGIN_SRC c :tangle config.h +#define DYNAMIC_KEYMAP_LAYER_COUNT 6 +#+END_SRC + +taping timing and tap/hold (as seen in the [[https://beta.docs.qmk.fm/using-qmk/software-features/tap_hold][QMK docs]]) + +#+BEGIN_SRC c :tangle config.h +#define TAPPING_TERM 175 +#define COMBO_TERM 300 +#define PERMISSIVE_HOLD +#+END_SRC + +Unicode input method (tangle as required) + +#+BEGIN_SRC c :tangle config.h +#define UNICODE_SELECTED_MODES UC_MAC +#+END_SRC + +#+BEGIN_SRC c :tangle no +#define UNICODE_SELECTED_MODES UC_LNX, UC_MAC +#+END_SRC + +The mouse layer can activate auotosniping + +#+BEGIN_SRC c :tangle config.h +#undef CHARYBDIS_AUTO_SNIPER_LAYER +#define CHARYBDIS_AUTO_SNIPER_LAYER 5 +#+END_SRC + +for VIA compatibility (if needed) + +#+BEGIN_SRC text +VENDOR_ID 0x43256 +PRODUCT_ID 0x6195 +#+END_SRC + + +** build (generate, compile and flash cycle) + +first tangle this file + +#+BEGIN_SRC emacs-lisp :tangle no :results silent +(org-babel-tangle) +#+END_SRC + +then write the keymap as defined above + +#+BEGIN_SRC emacs-lisp :noweb yes :tangle no :results silent +<> +#+END_SRC + +then compile and/or write to the keyboard + +#+name: qmk +#+BEGIN_SRC shell :dir ~/qmk_firmware :wrap SRC text :results raw :tangle no +qmk compile -kb bastardkb/charybdis/4x6 -km zzkt +#+END_SRC + +flash the firmware one side at a time. if =EE_HANDS= is enabled, the same command can be used for both sides. + +#+name: qmk +#+BEGIN_SRC shell :dir ~/qmk_firmware :wrap SRC text :results raw :tangle no +qmk flash -kb bastardkb/charybdis/4x6 -km zzkt -bl dfu +#+END_SRC + +without =EE_HANDS= or to set handedness the first time… + +#+name: qmk +#+BEGIN_SRC shell :dir ~/qmk_firmware :wrap SRC text :results raw :tangle no +qmk flash -km zzkt -bl dfu-split-left +#+END_SRC + +#+name: qmk +#+BEGIN_SRC shell :dir ~/qmk_firmware wrap SRC text :results raw :tangle no +qmk flash -km zzkt -bl dfu-split-right +#+END_SRC + + +* further + + - [[https://config.qmk.fm/#/crkbd/rev1/common/LAYOUT_split_3x6_3][QMK Configurator]] (for crkbd) + - [[https://josef-adamcik.cz/electronics/corne-keyboard-build-log.html][Build log - Josef Adamčík]] + - [[https://thomasbaart.nl/2018/11/26/corne-keyboard-helidox-build-log/][Build log - Thomas Baart]] + - [[https://en.wikipedia.org/wiki/Keyboard_layout][Keyboard Layouts]] (wikipedia) diff --git a/config.h b/config.h new file mode 100644 index 0000000..2b42052 --- /dev/null +++ b/config.h @@ -0,0 +1,13 @@ + +#define EE_HANDS + +#define DYNAMIC_KEYMAP_LAYER_COUNT 6 + +#define TAPPING_TERM 175 +#define COMBO_TERM 300 +#define PERMISSIVE_HOLD + +#define UNICODE_SELECTED_MODES UC_MAC + +#undef CHARYBDIS_AUTO_SNIPER_LAYER +#define CHARYBDIS_AUTO_SNIPER_LAYER 5 diff --git a/data/zzkt-charybdis-4x6.json b/data/zzkt-charybdis-4x6.json new file mode 100644 index 0000000..c6354f8 --- /dev/null +++ b/data/zzkt-charybdis-4x6.json @@ -0,0 +1,547 @@ +[ + { + "name": "Charybdis 4x6", + "author": "https://github.com/zzkt/charybdis", + "notes": "layers\n0 - base layer. qwerty and modifiers\n1 - numbers, symbols & brackets\n2 - movement. arrows & jump\n3 - emacs layer\n4 - emacs layer (hypm)\n5 - mouse layer\n" + }, + [ + { + "x": 3.5, + "a": 5 + }, + "#\n\n\n\n\n\n3", + { + "x": 7 + }, + "*\n\n\n\n\n\n8" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "@\n\n\n\n\n\n2", + { + "x": 1 + }, + "$\n\n\n\n\n\n4", + { + "x": 5 + }, + "&\n\n\n\n\n\n7", + { + "x": 1, + "t": "#000000\n\n\n#dd3c84", + "a": 4 + }, + "\n\n\n_\n\n\n\n\n(\n9" + ], + [ + { + "y": -0.875, + "x": 5.5, + "t": "#000000", + "a": 5 + }, + "%\n\n\n\n\n\n5", + { + "x": 3 + }, + "^\n\n\n\n\n\n6" + ], + [ + { + "y": -0.875, + "x": 0.5, + "t": "#000000\n\n\n#dd3c84", + "a": 4 + }, + "\n\n\n~\n\n\n\n\n\nesc", + { + "t": "#000000", + "a": 5 + }, + "!\n\n\n\n\n\n1", + { + "x": 11, + "t": "#000000\n\n\n#dd3c84", + "a": 4 + }, + "\n\n\n+\n\n\n\n\n)\n0", + { + "t": "#000000", + "a": 7, + "fa": [ + 2 + ] + }, + "bspace" + ], + [ + { + "y": -0.375, + "x": 3.5, + "t": "#000000\n\n\n#dd3c84", + "a": 4, + "fa": [ + 2, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4 + ] + }, + "\n\n\n#\n\n\n\n\n\nE", + { + "x": 7 + }, + "\n\n\n*\n\n\n\n\n\nI" + ], + [ + { + "y": -0.875, + "x": 2.5, + "t": "#000000\n#1c937f\n\n#dd3c84" + }, + "\n▲\n\n@\n\n\n\n\n\nW", + { + "x": 1, + "t": "#000000\n\n\n#dd3c84" + }, + "\n\n\n$\n\n\n\n\n\nR", + { + "x": 5 + }, + "\n\n\n&\n\n\n\n\n\nU", + { + "x": 1, + "t": "#000000\n\n\n#dd3c84\n\n\n\n#dd3c84" + }, + "\n\n\n-\n\n\n\n_\n\nO" + ], + [ + { + "y": -0.875, + "x": 5.5, + "t": "#000000\n\n\n#dd3c84" + }, + "\n\n\n%\n\n\n\n\n\nT", + { + "x": 3 + }, + "\n\n\n^\n\n\n\n\n\nY" + ], + [ + { + "y": -0.875, + "x": 0.5, + "t": "#000000", + "a": 7, + "fa": [ + 4 + ] + }, + "tab", + { + "t": "#000000\n#1c937f\n\n#dd3c84\n#2022e2", + "a": 4, + "fa": [ + 4, + 2, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4 + ] + }, + "\nM-v\n\n!\nDPI\n\n\n\n\nQ", + { + "x": 11, + "t": "#000000\n\n\n#dd3c84\n\n\n\n#dd3c84", + "fa": [ + 4, + 2, + 0, + 2, + 0, + 0, + 0, + 2, + 0, + 4 + ] + }, + "\n\n\n=\n\n\n\n+\n\nP", + { + "t": "#000000", + "a": 5, + "f": 3 + }, + "_\n\n\n\n\n\n-" + ], + [ + { + "y": -0.375, + "x": 3.5, + "t": "#000000\n#1c937f\n\n#dd3c84", + "a": 4, + "fa": [ + 4, + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 0, + 4 + ] + }, + "\n►\n\n3\n\n\n\n\n\nD", + { + "x": 7, + "t": "#000000\n#1c937f\n\n#dd3c84\n#2022e2" + }, + "\n▲\n\n8\nscroll\n\n\n\n\nK" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "\n▼\n\n2\nscroll\n\n\n\n\nS", + { + "x": 1, + "t": "#000000\n#1c937f\n\n#dd3c84", + "fa": [ + 4, + 2, + 0, + 0, + 0, + 0, + 0, + 2, + 0, + 4 + ] + }, + "\nC e\n\n4\n\n\n\n\n\nF", + { + "x": 5, + "fa": [ + 4, + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 0, + 4 + ] + }, + "\n▼\n\n7\n\n\n\n\n\nJ", + { + "x": 1 + }, + "\n►\n\n9\n\n\n\n\n\nL" + ], + [ + { + "y": -0.875, + "x": 5.5, + "t": "#000000\n\n\n#dd3c84" + }, + "\n\n\n5\n\n\n\n\n\nG", + { + "x": 3, + "t": "#000000\n#1c937f\n\n#dd3c84", + "fa": [ + 4, + 1, + 0, + 0, + 0, + 0, + 0, + 2, + 0, + 4 + ] + }, + "\n◀︎\n\n6\n\n\n\n\n\nH" + ], + [ + { + "y": -0.875, + "x": 0.5, + "fa": [ + 4, + 2, + 0, + 0, + 0, + 0, + 0, + 2, + 0, + 4 + ] + }, + "\nC a\n\n0\n\n\n\n\n\nctrl", + { + "t": "#000000\n#1c937f\n\n#dd3c84\n#2022e2", + "fa": [ + 4, + 1, + 0, + 0, + 0, + 0, + 0, + 2, + 0, + 4 + ] + }, + "\n◀︎\n\n1\nsniper\n\n\n\n\nA", + { + "x": 11, + "t": "#000000\n\n\n#dd3c84", + "f": 3 + }, + "\n\n\n0\n\n\n\n\n:\n;", + { + "t": "#000000\n#1c937f\n\n#dd3c84", + "fa": [ + 4, + 4, + 4, + 0, + 0, + 0, + 0, + 4, + 0, + 2 + ] + }, + "\n●\n\"\n↵\n\n\n\n'\n\n(LT 1)" + ], + [ + { + "y": -0.375, + "x": 3.5, + "fa": [ + 4, + 2, + 4, + 0, + 0, + 0, + 0, + 4, + 0, + 4 + ] + }, + "\nM <\n\n\\\n\n\n\n\n\nC", + { + "x": 7, + "t": "#000000\n\n\n\n#2022e2", + "a": 5, + "f": 3 + }, + "<\n\n\n\nMaus 2\n\n," + ], + [ + { + "y": -0.875, + "x": 2.5, + "t": "#000000\n#1c937f\n\n#dd3c84", + "a": 4, + "f": 3 + }, + "\nC-v\n\n\\\n\n\n\n\n\nX", + { + "x": 1, + "t": "#000000\n\n\n#dd3c84", + "f": 3 + }, + "\n\n\n{\n\n\n\n\n\nV", + { + "x": 5, + "t": "#000000\n\n\n#dd3c84\n#2022e2", + "f": 3 + }, + "\n\n\n}\nMaus 1\n\n\n\n\nM", + { + "x": 1, + "t": "#000000\n\n\n\n#2022e2", + "a": 5, + "f": 3 + }, + ">\n\n\n\nMaus 3\n\n." + ], + [ + { + "y": -0.875, + "x": 5.5, + "t": "#000000\n\n\n#dd3c84", + "a": 4, + "f": 3 + }, + "\n\n\n[\n\n\n\n\n\nB", + { + "x": 3, + "f": 3 + }, + "\n\n\n]\n\n\n\n\n\nN" + ], + [ + { + "y": -0.875, + "x": 0.5, + "t": "#000000", + "a": 5, + "f": 3 + }, + "\n▲\n\n\n\n\nShift", + { + "t": "#000000\n#1c937f\n\n#dd3c84\n\n#2022e2", + "a": 0, + "fa": [ + 4, + 2, + 4, + 5, + 0, + 0, + 0, + 4, + 0, + 4 + ] + }, + "\nM <\n\n`\n\n●\n\n\n\nZ", + { + "x": 11, + "t": "#000000\n\n\n#dd3c84\n\n#2022e2", + "f": 3 + }, + "\n\n\n|\n\n●\n\n\n?\n/", + { + "t": "#000000", + "a": 5, + "fa": [ + 4, + 0, + 4, + 5, + 0, + 0, + 2 + ] + }, + "\n▼\n\n\n\n\n(LT 4)" + ], + [ + { + "y": 0.125, + "x": 11.25, + "c": "#f9f9f9", + "fa": [ + 4, + 0, + 4, + 5, + 0, + 0, + 9 + ], + "w": 1.25, + "h": 1.25, + "d": true + }, + "\n(trackball)\n\n\n\n\n🔮" + ], + [ + { + "r": 30, + "rx": 6.5, + "ry": 4.25, + "y": 0.75, + "x": -1.25, + "c": "#cccccc", + "t": "#000000\n#1c937f\n\n\n#2022e2", + "a": 4, + "fa": [ + 4, + 2 + ] + }, + "\nctrl\n\n\nMaus 2\n\n\n\n\nmeta", + "\nshift\n\n\nMaus 1\n\n\n\n\nspc", + { + "t": "#000000\n\n\n\n#2022e2", + "a": 7, + "fa": [ + 2 + ] + }, + "(⌘ spc)\n\n\n\nMaus 3" + ], + [ + { + "x": -0.25, + "t": "#000000" + }, + "(MO 3)", + { + "f": 3 + }, + "lapo" + ], + [ + { + "r": -30, + "rx": 13, + "y": -1, + "x": -4.75, + "t": "#000000\n\n\n#dd3c84", + "a": 4, + "fa": [ + 2, + 0, + 0, + 5 + ] + }, + "\n\n\n●", + { + "t": "#000000", + "a": 7, + "f": 3 + }, + "(⌘ ↵)" + ], + [ + { + "x": -4.75, + "f": 3 + }, + "rapc" + ] +] \ No newline at end of file diff --git a/img/charybdis-4x6.jpg b/img/charybdis-4x6.jpg new file mode 100644 index 0000000..5dce0cf Binary files /dev/null and b/img/charybdis-4x6.jpg differ diff --git a/img/zzkt-charybdis-4x6.png b/img/zzkt-charybdis-4x6.png new file mode 100644 index 0000000..6a9c9db Binary files /dev/null and b/img/zzkt-charybdis-4x6.png differ diff --git a/img/zzkt-charybdis-4x6.svg b/img/zzkt-charybdis-4x6.svg new file mode 100644 index 0000000..999c593 --- /dev/null +++ b/img/zzkt-charybdis-4x6.svg @@ -0,0 +1,1854 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/keymap.c b/keymap.c new file mode 100644 index 0000000..8bc9059 --- /dev/null +++ b/keymap.c @@ -0,0 +1 @@ +#include QMK_KEYBOARD_H #include "version.h" // START-MUGUR-REGION /* Macros */ enum custom_keycodes {EPRM = KEYMAP_SAFE_RANGE, MACRO_25, MACRO_24, MACRO_23, MACRO_22, MACRO_21, MACRO_20, MACRO_19, MACRO_18, MACRO_17, MACRO_16, MACRO_15, MACRO_14, MACRO_13, MACRO_12, MACRO_11, MACRO_10, MACRO_9, MACRO_8, MACRO_7, MACRO_6, MACRO_5, MACRO_4, MACRO_3, MACRO_2, MACRO_1}; bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { switch (keycode) { case MACRO_1: SEND_STRING(SS_LCTL(SS_TAP(X_X)) SS_TAP(X_0)); return false; case MACRO_2: SEND_STRING(SS_LCTL(SS_TAP(X_X)) SS_TAP(X_2)); return false; case MACRO_3: SEND_STRING(SS_LCTL(SS_TAP(X_X)) SS_TAP(X_3)); return false; case MACRO_4: SEND_STRING(SS_LCTL(SS_TAP(X_X)) SS_TAP(X_4) SS_TAP(X_T)); return false; case MACRO_5: SEND_STRING(SS_LCTL(SS_TAP(X_LALT)) SS_TAP(X_O)); return false; case MACRO_6: SEND_STRING(SS_LCTL(SS_TAP(X_X)) SS_TAP(X_0)); return false; case MACRO_7: SEND_STRING(SS_LCTL(SS_TAP(X_X)) SS_TAP(X_2)); return false; case MACRO_8: SEND_STRING(SS_LCTL(SS_TAP(X_X)) SS_TAP(X_3)); return false; case MACRO_9: SEND_STRING(SS_LCTL(SS_TAP(X_X)) SS_TAP(X_4) SS_TAP(X_T)); return false; case MACRO_10: SEND_STRING(SS_LCTL(SS_TAP(X_LALT)) SS_TAP(X_O)); return false; case MACRO_11: SEND_STRING(SS_LALT(SS_TAP(X_X)) "gtd" SS_TAP(X_ENTER)); return false; case MACRO_12: SEND_STRING(SS_LCTL(SS_TAP(X_X)) SS_TAP(X_B)); return false; case MACRO_13: SEND_STRING("λ"); return false; case MACRO_14: SEND_STRING(SS_LALT(SS_TAP(X_X)) "magit" SS_TAP(X_ENTER)); return false; case MACRO_15: SEND_STRING(SS_RCMD(SS_TAP(X_I)) SS_TAP(X_E)); return false; case MACRO_16: SEND_STRING(SS_LCTL(SS_TAP(X_X)) SS_TAP(X_8)); return false; case MACRO_17: SEND_STRING(" - [ ] "); return false; case MACRO_18: SEND_STRING(SS_RCMD(SS_TAP(X_I)) SS_TAP(X_O)); return false; case MACRO_19: SEND_STRING(SS_RCMD(SS_TAP(X_I)) SS_TAP(X_L)); return false; case MACRO_20: SEND_STRING(" - [ ] "); return false; case MACRO_21: SEND_STRING(SS_RCMD(SS_TAP(X_I)) SS_TAP(X_O)); return false; case MACRO_22: SEND_STRING(SS_RCMD(SS_TAP(X_I)) SS_TAP(X_L)); return false; case MACRO_23: SEND_STRING(" - "); return false; case MACRO_24: SEND_STRING(SS_RCMD(SS_TAP(X_M)) SS_TAP(X_N)); return false; case MACRO_25: SEND_STRING(SS_RCMD(SS_TAP(X_M)) SS_TAP(X_M)); return false;} } return true; }; /* Layer Codes and Matrix */ enum layer_codes {BASE, NUMERIC, MOVE, EMACS, HYPM, MOUSE}; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [BASE] = LAYOUT_split_4x6_5(KC_ESCAPE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPACE, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINUS, KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCOLON, LT(MOVE, KC_QUOTE), MT(MOD_LSFT, KC_UP), LT(MOUSE, KC_Z), KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, LT(MOUSE, KC_SLASH), LT(HYPM, KC_DOWN), KC_LALT, KC_SPACE, MT(MOD_LGUI, KC_SPACE), TT(NUMERIC), MT(MOD_LGUI, KC_ENTER), KC_NO, MO(EMACS), KC_LAPO, KC_RAPC, KC_NO), [NUMERIC] = LAYOUT_split_4x6_5(KC_TILDE, KC_EXCLAIM, KC_AT, KC_HASH, KC_DOLLAR, KC_PERCENT, KC_CIRCUMFLEX, KC_AMPERSAND, KC_ASTERISK, KC_MINUS, KC_EQUAL, KC_BSPACE, KC_TILDE, KC_EXCLAIM, KC_AT, KC_HASH, KC_DOLLAR, KC_PERCENT, KC_CIRCUMFLEX, KC_AMPERSAND, KC_ASTERISK, KC_MINUS, KC_EQUAL, KC_BSPACE, KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, LT(MOVE, KC_ENTER), MT(MOD_LSFT, KC_LEFT), KC_GRAVE, KC_TRNS, KC_BSLASH, KC_LEFT_CURLY_BRACE, KC_LBRACKET, KC_RBRACKET, KC_RIGHT_CURLY_BRACE, KC_COMMA, KC_DOT, KC_PIPE, MT(MOD_LSFT, KC_RIGHT), TG(MOUSE), KC_LAPO, KC_TRNS, KC_TRNS, KC_RAPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), [MOVE] = LAYOUT_split_4x6_5(KC_TRNS, LALT(KC_V), KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, LALT(KC_V), KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, LCTL(KC_A), KC_LEFT, KC_DOWN, KC_RIGHT, LCTL(KC_E), KC_TRNS, KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT, KC_NO, KC_TRNS, KC_TRNS, LALT(KC_LEFT_ANGLE_BRACKET), LCTL(KC_V), LALT(KC_RIGHT_ANGLE_BRACKET), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LCTL, KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO), [EMACS] = LAYOUT_split_4x6_5(KC_ESCAPE, KC_TRNS, KC_TRNS, MACRO_1, MACRO_2, MACRO_3, MACRO_4, KC_TRNS, KC_TRNS, MACRO_5, KC_TRNS, KC_TRNS, KC_ESCAPE, KC_TRNS, KC_TRNS, MACRO_6, MACRO_7, MACRO_8, MACRO_9, KC_TRNS, KC_TRNS, MACRO_10, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, LALT(KC_PERCENT), KC_TRNS, KC_TRNS, MACRO_11, MACRO_12, KC_TRNS, KC_TRNS, MACRO_13, KC_TRNS, KC_TRNS, RESET, KC_TRNS, LALT(KC_X), LCTL(KC_C), KC_TRNS, KC_LEFT_PAREN, KC_RIGHT_PAREN, MACRO_14, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MACRO_15, MACRO_16, MO(HYPM), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO), [HYPM] = LAYOUT_split_4x6_5(KC_X, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MACRO_17, KC_TRNS, KC_TRNS, KC_I, MACRO_18, MACRO_19, KC_TRNS, KC_X, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MACRO_20, KC_TRNS, KC_TRNS, KC_I, MACRO_21, MACRO_22, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_D, KC_TRNS, MACRO_23, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MACRO_24, MACRO_25, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO), [MOUSE] = LAYOUT_split_4x6_5(KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, SNIPER_CONFIG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DPI_CONFIG, DRAG_SCROLL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DRAG_SCROLL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, KC_BTN3, KC_TRNS, KC_TRNS, KC_BTN2, KC_BTN1, KC_BTN3, KC_TRNS, KC_NO, KC_NO, KC_LSFT, KC_LGUI, KC_TRNS, KC_NO)}; // END-MUGUR-REGION void keyboard_post_init_user(void) { // debug_enable=true; // debug_matrix=true; // debug_keyboard=true; // debug_mouse=true; } \ No newline at end of file diff --git a/rules.mk b/rules.mk new file mode 100644 index 0000000..3b51a73 --- /dev/null +++ b/rules.mk @@ -0,0 +1,37 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = atmel-dfu + +SPLIT_KEYBOARD = yes + +# uncode +UNICODE_ENABLE = yes + +# Build Options +BOOTMAGIC_ENABLE = no # Bootmagic Lite +EXTRAKEY_ENABLE = no # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # USB Nkey Rollover + +# trackball & mousekeys +MOUSEKEY_ENABLE = yes # Mouse keys +POINTING_DEVICE_ENABLE = yes +MOUSE_SHARED_EP = no + +# enable configuraiton with VIA +VIA_ENABLE = no + +# No lighting or audio +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output +RGB_MATRIX_ENABLE = no + +SRC += drivers/sensors/pmw3360.c +QUANTUM_LIB_SRC += spi_master.c + +EXTRAFLAGS += -flto