From 79d7b22817eab66224af1b921bcd780e32765793 Mon Sep 17 00:00:00 2001 From: mmccoyd Date: Sat, 4 Dec 2021 13:45:28 -0800 Subject: [PATCH] firmware: QMK hillside firmware files --- firmware/QMK/hillside/0_1/0_1.c | 4 + firmware/QMK/hillside/0_1/0_1.h | 34 ++++ firmware/QMK/hillside/0_1/config.h | 38 ++++ firmware/QMK/hillside/0_1/info.json | 13 ++ firmware/QMK/hillside/0_1/rules.mk | 8 + firmware/QMK/hillside/info.json | 97 ++++++++++ .../QMK/hillside/keymaps/default/README.md | 179 ++++++++++++++++++ .../QMK/hillside/keymaps/default/keymap.json | 102 ++++++++++ firmware/QMK/hillside/keymaps/json2hill.py | 136 +++++++++++++ firmware/QMK/hillside/keymaps/via/keymap.json | 101 ++++++++++ firmware/QMK/hillside/readme.md | 31 +++ 11 files changed, 743 insertions(+) create mode 100644 firmware/QMK/hillside/0_1/0_1.c create mode 100644 firmware/QMK/hillside/0_1/0_1.h create mode 100644 firmware/QMK/hillside/0_1/config.h create mode 100644 firmware/QMK/hillside/0_1/info.json create mode 100644 firmware/QMK/hillside/0_1/rules.mk create mode 100644 firmware/QMK/hillside/info.json create mode 100644 firmware/QMK/hillside/keymaps/default/README.md create mode 100644 firmware/QMK/hillside/keymaps/default/keymap.json create mode 100755 firmware/QMK/hillside/keymaps/json2hill.py create mode 100644 firmware/QMK/hillside/keymaps/via/keymap.json create mode 100644 firmware/QMK/hillside/readme.md diff --git a/firmware/QMK/hillside/0_1/0_1.c b/firmware/QMK/hillside/0_1/0_1.c new file mode 100644 index 0000000..ee096f1 --- /dev/null +++ b/firmware/QMK/hillside/0_1/0_1.c @@ -0,0 +1,4 @@ +// Copyright 2021 Michael McCoyd (@mmccoyd) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "0_1.h" diff --git a/firmware/QMK/hillside/0_1/0_1.h b/firmware/QMK/hillside/0_1/0_1.h new file mode 100644 index 0000000..0aeefdf --- /dev/null +++ b/firmware/QMK/hillside/0_1/0_1.h @@ -0,0 +1,34 @@ +// Copyright 2021 Michael McCoyd (@mmccoyd) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "quantum.h" + +/* This is a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts those identifiers into a two-dimensional array which + * represents the switch matrix. + */ + +// clang-format off +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, LT4, RT4, R20, R21, R22, R23, R24, R25, \ + L30, LT0, LT1, LT2, LT3, RT3, RT2, RT1, RT0, R30 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, LT0, LT1, LT2, LT3, LT4 }, \ + { R05, R04, R03, R02, R01, R00 }, \ + { R15, R14, R13, R12, R11, R10 }, \ + { R25, R24, R23, R22, R21, R20 }, \ + { R30, RT0, RT1, RT2, RT3, RT4 } \ + } +// clang-format on diff --git a/firmware/QMK/hillside/0_1/config.h b/firmware/QMK/hillside/0_1/config.h new file mode 100644 index 0000000..74b6b6e --- /dev/null +++ b/firmware/QMK/hillside/0_1/config.h @@ -0,0 +1,38 @@ +// Copyright 2021 Michael McCoyd (@mmccoyd) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "config_common.h" + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 8 +#define MATRIX_COLS 6 + +/* Serial */ +#define SERIAL_USE_MULTI_TRANSACTION + +/* Encoder */ +#define ENCODERS_PAD_A { F5 } +#define ENCODERS_PAD_B { F4 } +#define ENCODERS_PAD_A_RIGHT { F4 } +#define ENCODERS_PAD_B_RIGHT { F5 } + +#define RGBLIGHT_SLEEP + +/* Haptic hardware */ +// The Pimoroni is the likely hardware, for which these settings work +#define FB_ERM_LRA 1 +#define FB_BRAKEFACTOR 3 /* 1x:0, 2x:1, 3x:2, 4x:3, 6:4, 8:5, 16:6, Disable:7 */ +#define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */ +/* Please refer to your datasheet for optimal setting for your specific motor.*/ +#define RATED_VOLTAGE 2 +#define V_PEAK 2.8 +#define V_RMS 2.0 +#define F_LRA 205 /* resonance freq */ + +/* Haptic waveforms */ +// Two mild waveforms +#define DRV_GREETING alert_750ms +#define DRV_MODE_DEFAULT sharp_tick3_60 diff --git a/firmware/QMK/hillside/0_1/info.json b/firmware/QMK/hillside/0_1/info.json new file mode 100644 index 0000000..e45e457 --- /dev/null +++ b/firmware/QMK/hillside/0_1/info.json @@ -0,0 +1,13 @@ +{ + "matrix_pins": { + "rows": ["D7", "E6", "B4", "B5"], + "cols": ["F6", "F7", "B1", "B3", "B2", "B6"], + }, + "diode_direction": "COL2ROW", + + "usb": { + "vid": "0xFEED", + "pid": "0x67C0", + "device_ver": "0x0001" + }, +} diff --git a/firmware/QMK/hillside/0_1/rules.mk b/firmware/QMK/hillside/0_1/rules.mk new file mode 100644 index 0000000..2501147 --- /dev/null +++ b/firmware/QMK/hillside/0_1/rules.mk @@ -0,0 +1,8 @@ +SPLIT_KEYBOARD = yes # Use shared split_common code +LTO_ENABLE = yes # Use link time optimization for smaller firmware + +# If you add a haptic board, +# enable it and set its driver here or in your keymap folder +# The Pimoroni board's driver is DRV2605L +# HAPTIC_ENABLE = yes # Enable haptic driver +# HAPTIC_DRIVER = DRV2605L diff --git a/firmware/QMK/hillside/info.json b/firmware/QMK/hillside/info.json new file mode 100644 index 0000000..7a29df1 --- /dev/null +++ b/firmware/QMK/hillside/info.json @@ -0,0 +1,97 @@ +{ + "manufacturer": "mmccoyd", + "maintainer": "mmccoyd", + + "keyboard_name": "Hillside", + "url": "http://github.com/mmccoyd/hillside/", + + "tags": ["split", "column stagger", "choc v1", "choc spaced" ], + + "processor": "atmega32u4", + + "features": { + "encoder": true, + "extrakey": true, + "rgblight": true + }, + "split": { + "soft_serial_pin": "D2", + "main": "left" + }, + + "rgblight": { + "led_count": 5, + "pin": "D3", + "split": true, + "hue_steps": 8, + "saturation_steps": 8, + "brightness_steps": 8 + }, + + "layouts": { + "LAYOUT": { + "layout": [ + + {"label": "Tab", "x": 0, "y": 0.93}, + {"label": "Q", "x": 1, "y": 0.93}, + {"label": "W", "x": 2, "y": 0.31}, + {"label": "E", "x": 3, "y": 0}, + {"label": "R", "x": 4, "y": 0.28}, + {"label": "T", "x": 5, "y": 0.42}, + + {"label": "Y", "x": 9.5, "y": 0.42}, + {"label": "U", "x": 10.5, "y": 0.28}, + {"label": "I", "x": 11.5, "y": 0}, + {"label": "O", "x": 12.5, "y": 0.31}, + {"label": "P", "x": 13.5, "y": 0.93}, + {"label": "Backspace", "x": 14.5, "y": 0.93}, + + + {"label": "Ctrl", "x": 0, "y": 1.93}, + {"label": "A", "x": 1, "y": 1.93}, + {"label": "S", "x": 2, "y": 1.31}, + {"label": "D", "x": 3, "y": 1}, + {"label": "F", "x": 4, "y": 1.28}, + {"label": "G", "x": 5, "y": 1.42}, + + {"label": "H", "x": 9.5, "y": 1.42}, + {"label": "J", "x": 10.5, "y": 1.28}, + {"label": "K", "x": 11.5, "y": 1}, + {"label": "L", "x": 12.5, "y": 1.31}, + {"label": ";", "x": 13.5, "y": 1.93}, + {"label": "'", "x": 14.5, "y": 1.93}, + + + {"label": "Shift", "x": 0, "y": 2.93}, + {"label": "Z", "x": 1, "y": 2.93}, + {"label": "X", "x": 2, "y": 2.31}, + {"label": "C", "x": 3, "y": 2}, + {"label": "V", "x": 4, "y": 2.28}, + {"label": "B", "x": 5, "y": 2.42}, + {"label": "`", "x": 6, "y": 2.78}, + + {"label": "Esc", "x": 8.5, "y": 2.78}, + {"label": "N", "x": 9.5, "y": 2.42}, + {"label": "M", "x": 10.5, "y": 2.28}, + {"label": ",", "x": 11.5, "y": 2}, + {"label": ".", "x": 12.5, "y": 2.31}, + {"label": "/", "x": 13.5, "y": 2.93}, + {"label": "Shift", "x": 14.5, "y": 2.93}, + + + {"label": "Enter", "x": 2, "y": 3.31}, + {"label": "Gui", "x": 3.5, "y": 3.28}, + {"label": "Alt", "x": 4.5, "y": 3.42}, + {"label": "Num", "x": 5.5, "y": 3.78}, + {"label": "Nav", "x": 6.5, "y": 4.14}, + + + {"label": "Sym", "x": 8, "y": 4.14}, + {"label": "Space", "x": 9, "y": 3.78}, + {"label": "Alt", "x": 10, "y": 3.42}, + {"label": "Gui", "x": 11, "y": 3.28}, + {"label": "App", "x": 12.5, "y": 3.31} + ] + } + } +} diff --git a/firmware/QMK/hillside/keymaps/default/README.md b/firmware/QMK/hillside/keymaps/default/README.md new file mode 100644 index 0000000..9713a9f --- /dev/null +++ b/firmware/QMK/hillside/keymaps/default/README.md @@ -0,0 +1,179 @@ +# Default Keymap + +For ease of initial use, + this keymap tries to follow many of the norms seen in non-programmable keyboards. +It is meant as a starting point that you will tweak over time to better suit _your_ preferences. +You can easily rearrange it in the online configurator or with the via firmware. + +Features: +- A mostly normal base layer with shift, mods, delete in places expected from non-programmable keyboards. +- QWERTY, Colemak-DH and Dvorak options for the base layer layout. +- Modifiers on the home row of the non-base layers (Nav/Edit, Functions/Symbols, Numbers) to make key and modifier combinations comfortable. +- Edit keys and by word navigation in the Nav layer +- A number pad that is slightly optimized with the more frequently used numbers on the home row. + +Features deliberately missing: +- Combos: as the online tools that may configuration changes easy do not handle them. +- Multi function mod-tap keys, auto shift capitalization, auto-exit modes like CAPWORD or NUMWORD: as they may be too large a step for someone new to programmable keyboards. + +## Base Layer + +``` +| TAB | Q | W | E | R | T |---------------------------| Y | U | I | O | P | BKSPC | +| CTRL | A | S | D | F | G |---------------------------| H | J | K | L | ; | ' | +| SHIFT | Z | X | C | V | B | ~ |---------------| ESC | N | M | , | . | / | SHIFT | +--------------|ENTER|-----| GUI | ALT | Num | Nav |---| Sym |SPACE| ALT | GUI |-----| APP |-------------- +``` + +The base layer can be either QWERTY, Colemak-DH or Dvorak, with the non-alpha and non-symbol keys identical between them. QWERTY is the default. + + +A standard keyboard layout is used for: + +- Tab, backspace, and shifts in the outer columns +- Alt/option and GUI/command on both thumbs, with the location swappable for windows or mac. + +The differences from a standard layout are: + +- Three additional "shift" keys access the navigation/editing, symbol/function, and number layers. +- Enter is on the left thumb. + This location allowed the more common right hand keys to be preserved. + Feel free to adjust it or have it share the right shift key. +- Control is in the caps lock spot. +- Esc and `~ are above the thumbs. +- The rarer AltGr key is in a layer. + +
+Details of Dvorak and Colemak-DH +In the Dvorak layout, the outer home row key is the "/?" symbols, so that the same 12 symbols can be skipped in the symbols layer. + +``` +Dvorak +| TAB | ' | , | . | P | Y |---------------------------| F | G | C | R | L | BKSPC | +| CTRL | A | O | E | U | I |---------------------------| D | H | T | N | S | / | +| SHIFT | ; | Q | J | K | X | ~ |---------------| ESC | B | M | W | V | Z | SHIFT | +--------------|ENTER|-----| GUI | ALT | Num | Nav |---| Sym |SPACE| ALT | GUI |-----| APP |-------------- + +Colemak-DH +| TAB | Q | W | F | P | B |---------------------------| J | L | U | Y | ; | BKSPC | +| CTRL | A | R | S | T | G |---------------------------| M | N | E | I | O | ' | +| SHIFT | Z | X | C | D | V | ~ |---------------| ESC | K | H | , | . | / | SHIFT | +--------------|ENTER|-----| GUI | ALT | Num | Nav |---| Sym |SPACE| ALT | GUI |-----| APP |-------------- +``` +
+ +## Navigation, Editing and Media Layer + +``` +| CAPS | INS | | | |VOL+ |---------------------------|PG_UP|HOME | | END| | DEL | +| CTRL | GUI | ALT |CTRL |SHIFT|VOL- |---------------------------|PG_DN|LEFT | UP |RIGHT| | CTRL | +| SHIFT |UNDO | CUT |COPY |PASTE|REDO |MUTE |---------------| ESC | |WORDL|DOWN |WORDR|RALT | SHIFT | +--------------|ENTER|-----| GUI | ALT | Num | *** |---| Adj |BSPC | ALT | GUI |-----| APP |-------------- +``` +Holding down the Nav key accesses a navigation and editing layer: + +- Navigation arrows are on and below the right home row in a cross pattern, For a column stagger keyboard this feels more natural than an inverted T. The keys below them move left or right by a word. Home, end, and page up/down are beside them. +- Modifiers in the left home row make it easier to use the arrows to select text with shift or move between desktops or tabs. +- Editing keys appear on the lower left. + They, the modifiers and arrows make it easy to move text around without having to exit the layer. +- Delete is in the upper right, and a back space key is on the thumb. +- The base layer modifiers and escape are in the same spots as on the base layer, and a right control mirrors the left one. +- Media volume and play keys are on the left, accessible with one hand. +- AltGr and caps lock fill out the layer. +- A few keys do nothing and are available for more user specific needs. + +## Symbol and Function Layer + +``` +| F12 | ! | @ | # | $ | % |---------------------------| ^ | & | * | ( | ) | BSPC | +| CTRL | F1 | F2 | F3 | F4 | F5 |---------------------------| | |SHIFT|CTRL | ALT | GUI | CTRL | +| SHIFT | F6 | F7 | F8 | F9 | F10 | F11 |---------------| ESC | \ | [ | ] | { | } | SHIFT | +--------------|ENTER|-----| GUI | ALT | Num | Adj |---| *** |SPACE| ALT | GUI |-----| APP |-------------- +``` +Holding down the Sym key accesses symbol and function keys: + +- The normal number row symbols are in the top row. + If desired, these keys can be used for other things as the symbols are also accessible from the number pad layer with the shift key. +- The remaining symbols appear on the right. +- The function keys are on the left, aligned below the 1-5 numbers. +- A row of modifiers in the home row allow comfortable creation of any function key and modifier combination. +- The base layer modifier and escape keys are still available, plus the extra right control key. + +## Number Pad and Algebraic Layer +``` +| | - | + | = | / | * |---------------------------| . | 7 | 8 | 9 | | BSPC | +| CTRL | GUI | ALT |CTRL |SHIFT| |---------------------------| 0 | 1 | 2 | 3 | _ | CTRL | +| SHIFT | | | | | | |---------------| ESC | , | 4 | 5 | 6 | | SHIFT | +--------------|ENTER|-----| GUI | ALT | *** | |---| |BSSP | ALT | GUI |-----| APP |-------------- +``` +Holding down the Num key accesses a number pad and arithmetic symbols: + +- The number pad has the smallest numbers swapped into the home row as these are the most commonly used. +- A row of modifiers in the home row allow comfortable creation of any number and modifier combination. +- Symbols commonly used with numbers fill out the layer, and can be combined with the home row mods or the existing base layer modifiers on the right hand. +- Several keys remain unused and await more user specific needs. + + +## Adjust Layer +``` +| |QWERT|DVORK|COLMK|AG_SWAP|AG_NORM|-----------------------| | | | | | | +| | | | | | |---------------------------|MOD+ |BRI+ |HUE+ |SAT+ | | | +| RESET | | | | | | |--------------|RGBTOG|MOD- |BRI- |HUE- |SAT- | | | +--------------| |-----| | | | *** |---| *** | | | |-----| |-------------- +``` +Holding down the Nav and Sym keys simultaneously enables keys to adjust various keyboard settings: + +- The base layer can be set to QWERTY, Colemak-DH or Dvorak, until the keyboard is powered off, when it reverts to QWERTY. +- Alt/option and GUI/command can be swapped for or mac users or restored to the windows norm. This setting does persist over power loss. +- The backlight LEDs can be enabled, disabled, and controlled. This setting also persists over power loss. + + +## Make it Yours + +If you are coming from a more traditional keyboard with a full set of physical keys and a row staggered layout, the adjustment to a column staggered (ergo) layout and the use of layers instead of finger reaches to access numbers, symbols, and functions is an adjustment for your muscle memory and mental map of your keyboard. This layout tries to make that simpler by keeping things in the expected spot when possible. + +Yet this layout is only a decent compromise, and not optimal for each user. + +The online configurator makes it easy to fill in some of your most used key combinations into the navigation layer. You can add additional layers or completely switch around what these ones do. + +Some changes you might consider making: +- If you are on a mac, switch the editing and word navigation keys from ctrl-x, to cmd-x. +- Change the shift keys to one-shot shift keys, where pressing and releasing them causes the next key pressed to be shifted. That is much easier on your hands than holding them down. Yet, they can still be held as normal if desired. +- Instead of holding down the thumb key to keep the symbol layer active, you could use a one shot layer key. This will likely be less stress on your hands and may even be faster. You can still hold it down instead. +- Instead of holding down the key for the number pad layer, you could make it a layer toggle, like caps lock is a capitalization toggle key. + +Some other keymaps for inspiration and ideas can be seen here: +- [Ferris default](https://github.com/qmk/qmk_firmware/tree/master/keyboards/ferris/keymaps/default), which uses more advanced features as it has far fewer keys to work with. +- [Miryoku](https://github.com/manna-harbour/miryoku/tree/master/docs/reference), which is about ensuring all modifiers are comfortably available no matter what character key needs to be pressed. +- [Kyria default](https://github.com/qmk/qmk_firmware/tree/master/keyboards/splitkb/kyria/keymaps/default). + +A useful metaphor is to think of your keymap as a bonsai tree that you tweak slightly over time + in response to ideas of how it might serve you better. + + +## Why no keymap.c + +Via and the online configurator both provide very easy visual ways to work with a simple layout. +This is easiest if the keymap is maintained in the json format they use. +This default ```keymap.json``` was created with the online configurator and formated for easier reading. + +If you wish, you can edit it direcly in a text editor and use the below script to restore the spacing. + +Or, you can edit the keymap with the graphical online tool. To do that: + +- Open the [QMK configurator](https://config.qmk.fm/#/handwired/hillside/LAYOUT) +- Using the green up arrow button load the keymap from ```qmk_firmware/keyboards/handwired/hillside/keymaps/default/keymap.json``` +- Make the changes you wish to the layout +- Save the keymap using the green down arrow button. +- Copy those changes back into your QMK repository and reformat for easy reading using the format script: +``` +./keyboards/handwired/hillside/keymaps/json2hill.py --input /default.json > ./keyboards/handwired/hillside/keymaps/default/keymap.json +``` + You may need to make that script executable with ```chmod +x```. After your keymap is safely copied and formated, you may want to remove the keymap from your download directory so later downloads can recieve the same name. + + +After either method of editing, compile and flash the keymap as normal. + +With a bit more complexity, you can combine a json keymap with more advanced features specified in C files. +See for example +[pierrec83's Kyria map](https://github.com/qmk/qmk_firmware/tree/master/keyboards/splitkb/kyria/keymaps/pierrec83) diff --git a/firmware/QMK/hillside/keymaps/default/keymap.json b/firmware/QMK/hillside/keymaps/default/keymap.json new file mode 100644 index 0000000..f5871b0 --- /dev/null +++ b/firmware/QMK/hillside/keymaps/default/keymap.json @@ -0,0 +1,102 @@ +{ + "version": 1, + "notes": "", + "documentation": "\"This file is a QMK Configurator export. You can import this at . It can also be used directly with QMK's source code.\n\nTo setup your QMK environment check out the tutorial: \n\nYou can convert this file to a keymap.c using this command: `qmk json2c {keymap}`\n\nYou can compile this keymap using this command: `qmk compile {keymap}`\"\n", + "keyboard": "handwired/hillside/0_1", + "author": "@mmccoyd", + "keymap": "default", + "layout": "LAYOUT", + "layers": [ + ["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_LCTL", "KC_A" , "KC_S" , "KC_D" , "KC_F" , "KC_G", + "KC_H" , "KC_J" , "KC_K" , "KC_L" , "KC_SCLN" , "KC_QUOT", + + "KC_LSFT", "KC_Z" , "KC_X" , "KC_C" , "KC_V" , "KC_B" , "KC_GRV", + "KC_ESC" , "KC_N" , "KC_M" , "KC_COMM" , "KC_DOT" , "KC_SLSH" , "KC_RSFT", + + "KC_ENT" , "KC_LGUI" , "KC_LALT" , "MO(5)" , "MO(3)", + "MO(4)" , "KC_SPC" , "KC_LALT" , "KC_RGUI" , "KC_APP" + + ], + ["KC_TAB" , "KC_QUOT" , "KC_COMM" , "KC_DOT" , "KC_P" , "KC_Y", + "KC_F" , "KC_G" , "KC_C" , "KC_R" , "KC_L" , "KC_BSPC", + + "KC_LCTL", "KC_A" , "KC_O" , "KC_E" , "KC_U" , "KC_I", + "KC_D" , "KC_H" , "KC_T" , "KC_N" , "KC_S" , "KC_SLSH", + + "KC_LSFT", "KC_SCLN" , "KC_Q" , "KC_J" , "KC_K" , "KC_X" , "KC_GRV", + "KC_ESC" , "KC_B" , "KC_M" , "KC_W" , "KC_V" , "KC_Z" , "KC_RSFT", + + "KC_ENT" , "KC_LGUI" , "KC_LALT" , "MO(5)" , "MO(3)", + "MO(4)" , "KC_SPC" , "KC_LALT" , "KC_RGUI" , "KC_APP" + + ], + ["KC_TAB" , "KC_Q" , "KC_W" , "KC_F" , "KC_P" , "KC_B", + "KC_J" , "KC_L" , "KC_U" , "KC_Y" , "KC_SCLN" , "KC_BSPC", + + "KC_LCTL", "KC_A" , "KC_R" , "KC_S" , "KC_T" , "KC_G", + "KC_M" , "KC_N" , "KC_E" , "KC_I" , "KC_O" , "KC_QUOT", + + "KC_LSFT", "KC_Z" , "KC_X" , "KC_C" , "KC_D" , "KC_V" , "KC_GRV", + "KC_ESC" , "KC_K" , "KC_H" , "KC_COMM" , "KC_DOT" , "KC_SLSH" , "KC_RSFT", + + "KC_ENT" , "KC_LGUI" , "KC_LALT" , "MO(5)" , "MO(3)", + "MO(4)" , "KC_SPC" , "KC_LALT" , "KC_RGUI" , "KC_APP" + + ], + ["KC_CAPS", "KC_INS" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_VOLU", + "KC_PGUP", "KC_HOME" , "KC_NO" , "KC_END" , "KC_NO" , "KC_DEL", + + "KC_LCTL", "KC_LGUI" , "KC_LALT" , "KC_LCTL" , "KC_LSFT" , "KC_VOLD", + "KC_PGDN", "KC_LEFT" , "KC_UP" , "KC_RGHT" , "KC_NO" , "KC_RCTL", + + "KC_LSFT", "LCTL(KC_Z)", "LCTL(KC_X)" , "LCTL(KC_C)", "LCTL(KC_V)" , "LCTL(KC_Y)", "KC_MUTE", + "KC_ESC" , "KC_NO" , "LCTL(KC_LEFT)", "KC_DOWN" , "LCTL(KC_RGHT)", "KC_RALT" , "KC_RSFT", + + "KC_TRNS", "KC_TRNS" , "KC_TRNS" , "KC_TRNS" , "KC_TRNS", + "MO(6)" , "KC_BSPC" , "KC_TRNS" , "KC_TRNS" , "KC_TRNS" + + ], + ["KC_F12" , "KC_EXLM" , "KC_AT" , "KC_HASH" , "KC_DLR" , "KC_PERC", + "KC_CIRC", "KC_AMPR" , "KC_ASTR" , "KC_LPRN" , "KC_RPRN" , "KC_BSPC", + + "KC_LCTL", "KC_F1" , "KC_F2" , "KC_F3" , "KC_F4" , "KC_F5", + "KC_PIPE", "KC_LSFT" , "KC_LCTL" , "KC_LALT" , "KC_LGUI" , "KC_RCTL", + + "KC_LSFT", "KC_F6" , "KC_F7" , "KC_F8" , "KC_F9" , "KC_F10" , "KC_F11", + "KC_ESC" , "KC_BSLS" , "KC_LBRC" , "KC_RBRC" , "KC_LCBR" , "KC_RCBR" , "KC_RSFT", + + "KC_TRNS", "KC_TRNS" , "KC_TRNS" , "KC_TRNS" , "MO(6)", + "KC_TRNS", "KC_TRNS" , "KC_TRNS" , "KC_TRNS" , "KC_TRNS" + + ], + ["KC_NO" , "KC_MINS" , "KC_PLUS" , "KC_EQL" , "KC_SLSH" , "KC_ASTR", + "KC_COMM", "KC_7" , "KC_8" , "KC_9" , "KC_NO" , "KC_TRNS", + + "KC_TRNS", "KC_LGUI" , "KC_LALT" , "KC_LCTL" , "KC_LSFT" , "KC_NO", + "KC_0" , "KC_1" , "KC_2" , "KC_3" , "KC_UNDS" , "KC_RCTL", + + "KC_TRNS", "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO", + "KC_NO" , "KC_DOT" , "KC_4" , "KC_5" , "KC_6" , "KC_NO" , "KC_TRNS", + + "KC_TRNS", "KC_TRNS" , "KC_TRNS" , "KC_TRNS" , "KC_NO", + "KC_NO" , "KC_BSPC" , "KC_TRNS" , "KC_TRNS" , "KC_TRNS" + + ], + ["KC_NO" , "DF(0)" , "DF(1)" , "DF(2)" , "AG_SWAP" , "AG_NORM", + "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO", + + "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO", + "RGB_MOD", "RGB_VAI" , "RGB_HUI" , "RGB_SAI" , "KC_NO" , "KC_NO", + + "RESET" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO", + "RGB_TOG", "RGB_RMOD" , "RGB_VAD" , "RGB_HUD" , "RGB_SAD" , "KC_NO" , "KC_NO", + + "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_TRNS", + "KC_TRNS", "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" + + ] + ] +} diff --git a/firmware/QMK/hillside/keymaps/json2hill.py b/firmware/QMK/hillside/keymaps/json2hill.py new file mode 100755 index 0000000..a9971c0 --- /dev/null +++ b/firmware/QMK/hillside/keymaps/json2hill.py @@ -0,0 +1,136 @@ +#!/usr/bin/env python3 + +# Copyright 2020-2021 Pierre Viseu Chevalier, Michael McCoyd (@pierrechevalier83, @mmccoyd) +# SPDX-License-Identifier: GPL-2.0-or-later + +"""Pretty print keymap json in more readable row/side organized format.""" + +import argparse +import json +import sys +from typing import NamedTuple + +"""Print keymap json in row and side format, though as still re-readable json. + +For example, for one layer: + + ["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_LCTL", "KC_A" , "KC_S" , "KC_D" , "KC_F" , "KC_G", + "KC_H" , "KC_J" , "KC_K" , "KC_L" , "KC_SCLN", "KC_QUOT", + + "KC_LSFT", "KC_Z" , "KC_X" , "KC_C" , "KC_V" , "KC_B" , "KC_GRV", + "KC_ESC" , "KC_N" , "KC_M" , "KC_COMM", "KC_DOT" , "KC_SLSH", "KC_RSFT", + + "KC_ENT" , "KC_LGUI", "KC_LALT", "MO(5)" , "MO(3)", + "MO(4)" , "KC_SPC" , "KC_LALT", "KC_RGUI", "KC_APP" + ], +""" + +indent_level=4 # number of spaces of initial indent per output line + +# The structure of the keymap +# [[Endpoint of sides with identical widths, side width, mapping to column],...] +KEYS_TO_COL = [[24, 6, lambda n: n % 6], + [38, 7, lambda n: (n - 24) % 7], + [48, 5, lambda n: (n - 38) % 5]] +LAST_KEY = KEYS_TO_COL[-1][0] - 1 + +def parse_cli(): + parser = argparse.ArgumentParser(description='Hillside keymap formatter') + parser.add_argument("--input", type=argparse.FileType('r'), + default=sys.stdin, help="Input keymap " + "(json file produced by qmk configurator)") + return parser.parse_args() + +class Column(NamedTuple): + """Column number within keymap side, if it ends side, and ends row. + + Position within a keyboard row runs from 0 to n and again 0 to n""" + num: int + ends_side: bool + ends_row: bool + +def get_col(key_index): + """Return Column for key_index.""" + for keys, num_cols, col_fn in KEYS_TO_COL: + if key_index < keys: + col_num = col_fn(key_index) + return Column(col_num, + ends_side=col_num == num_cols - 1, + ends_row=(keys - 1 - key_index) % (2 * num_cols) == 0) + +def format_layers(layers): + formatted = indent_level * " " + "\"layers\": [\n" + + # Find max key length per column + max_key_length = {} + for layer in layers: + for (index, keycode) in enumerate(layer): + col = get_col(index) + max_length = max_key_length.get(col.num) + if (not max_length) or len(keycode) > max_length: + max_key_length.update({col.num: len(keycode)}) + # Format each layer + for (layer_index, layer) in enumerate(layers): + # Opening [ + formatted += 2 * indent_level * " " + formatted += "[" + + # Split keys into pairs of left and right rows by key row length + for (index, keycode) in enumerate(layer): + col = get_col(index) + + # Indent for rows past first + if col.num == 0 and index != 0: + formatted += (1 + 2 * indent_level) * " " + + # Print key + formatted += json.dumps(keycode) + + # End layer, or end side, or space to next key + if index == LAST_KEY: + formatted += "\n" + elif col.ends_side: + formatted += ",\n" + else: + n_spaces = max_key_length[get_col(index).num] - len(keycode) + formatted += n_spaces * " " + formatted += ", " + + # Split groups of row sides + if col.ends_row: + formatted += "\n" + + # Closing ] with , or without + formatted += 2 * indent_level * " " + if layer_index < len(layers) - 1: + formatted += "],\n" + else: + formatted += "]\n" + + formatted += indent_level * " " + formatted += "]" + + return formatted + +def format_keymap(keymap_json): + formatted = "{" + for (index, k) in enumerate(keymap_json): + if k == "layers": + formatted += format_layers(keymap_json[k]) + else: + formatted += f"{indent_level * ' '}{json.dumps(k)}: {json.dumps(keymap_json[k])}" + if index < len(keymap_json) - 1: + formatted += "," + formatted += "\n" + formatted += "}" + return formatted + +def main(): + args=parse_cli() + keymap_json = json.loads(args.input.read()) + print(format_keymap(keymap_json)) + +main() diff --git a/firmware/QMK/hillside/keymaps/via/keymap.json b/firmware/QMK/hillside/keymaps/via/keymap.json new file mode 100644 index 0000000..8b4810c --- /dev/null +++ b/firmware/QMK/hillside/keymaps/via/keymap.json @@ -0,0 +1,101 @@ +{ + "version": 1, + "notes": "", + "keyboard": "handwired/hillside/0_1", + "author": "@mmccoyd", + "keymap": "via", + "layout": "LAYOUT", + "layers": [ + ["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_LCTL", "KC_A" , "KC_S" , "KC_D" , "KC_F" , "KC_G", + "KC_H" , "KC_J" , "KC_K" , "KC_L" , "KC_SCLN" , "KC_QUOT", + + "KC_LSFT", "KC_Z" , "KC_X" , "KC_C" , "KC_V" , "KC_B" , "KC_GRV", + "KC_ESC" , "KC_N" , "KC_M" , "KC_COMM" , "KC_DOT" , "KC_SLSH" , "KC_RSFT", + + "KC_ENT" , "KC_LGUI" , "KC_LALT" , "MO(5)" , "MO(3)", + "MO(4)" , "KC_SPC" , "KC_LALT" , "KC_RGUI" , "KC_APP" + + ], + ["KC_TAB" , "KC_QUOT" , "KC_COMM" , "KC_DOT" , "KC_P" , "KC_Y", + "KC_F" , "KC_G" , "KC_C" , "KC_R" , "KC_L" , "KC_BSPC", + + "KC_LCTL", "KC_A" , "KC_O" , "KC_E" , "KC_U" , "KC_I", + "KC_D" , "KC_H" , "KC_T" , "KC_N" , "KC_S" , "KC_SLSH", + + "KC_LSFT", "KC_SCLN" , "KC_Q" , "KC_J" , "KC_K" , "KC_X" , "KC_GRV", + "KC_ESC" , "KC_B" , "KC_M" , "KC_W" , "KC_V" , "KC_Z" , "KC_RSFT", + + "KC_ENT" , "KC_LGUI" , "KC_LALT" , "MO(5)" , "MO(3)", + "MO(4)" , "KC_SPC" , "KC_LALT" , "KC_RGUI" , "KC_APP" + + ], + ["KC_TAB" , "KC_Q" , "KC_W" , "KC_F" , "KC_P" , "KC_B", + "KC_J" , "KC_L" , "KC_U" , "KC_Y" , "KC_SCLN" , "KC_BSPC", + + "KC_LCTL", "KC_A" , "KC_R" , "KC_S" , "KC_T" , "KC_G", + "KC_M" , "KC_N" , "KC_E" , "KC_I" , "KC_O" , "KC_QUOT", + + "KC_LSFT", "KC_Z" , "KC_X" , "KC_C" , "KC_D" , "KC_V" , "KC_GRV", + "KC_ESC" , "KC_K" , "KC_H" , "KC_COMM" , "KC_DOT" , "KC_SLSH" , "KC_RSFT", + + "KC_ENT" , "KC_LGUI" , "KC_LALT" , "MO(5)" , "MO(3)", + "MO(4)" , "KC_SPC" , "KC_LALT" , "KC_RGUI" , "KC_APP" + + ], + ["KC_CAPS", "KC_INS" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_VOLU", + "KC_PGUP", "KC_HOME" , "KC_NO" , "KC_END" , "KC_NO" , "KC_DEL", + + "KC_LCTL", "KC_LGUI" , "KC_LALT" , "KC_LCTL" , "KC_LSFT" , "KC_VOLD", + "KC_PGDN", "KC_LEFT" , "KC_UP" , "KC_RGHT" , "KC_NO" , "KC_RCTL", + + "KC_LSFT", "LCTL(KC_Z)", "LCTL(KC_X)" , "LCTL(KC_C)", "LCTL(KC_V)" , "LCTL(KC_Y)", "KC_MUTE", + "KC_ESC" , "KC_NO" , "LCTL(KC_LEFT)", "KC_DOWN" , "LCTL(KC_RGHT)", "KC_RALT" , "KC_RSFT", + + "KC_TRNS", "KC_TRNS" , "KC_TRNS" , "KC_TRNS" , "KC_TRNS", + "MO(6)" , "KC_BSPC" , "KC_TRNS" , "KC_TRNS" , "KC_TRNS" + + ], + ["KC_F12" , "KC_EXLM" , "KC_AT" , "KC_HASH" , "KC_DLR" , "KC_PERC", + "KC_CIRC", "KC_AMPR" , "KC_ASTR" , "KC_LPRN" , "KC_RPRN" , "KC_BSPC", + + "KC_LCTL", "KC_F1" , "KC_F2" , "KC_F3" , "KC_F4" , "KC_F5", + "KC_PIPE", "KC_LSFT" , "KC_LCTL" , "KC_LALT" , "KC_LGUI" , "KC_RCTL", + + "KC_LSFT", "KC_F6" , "KC_F7" , "KC_F8" , "KC_F9" , "KC_F10" , "KC_F11", + "KC_ESC" , "KC_BSLS" , "KC_LBRC" , "KC_RBRC" , "KC_LCBR" , "KC_RCBR" , "KC_RSFT", + + "KC_TRNS", "KC_TRNS" , "KC_TRNS" , "KC_TRNS" , "MO(6)", + "KC_TRNS", "KC_TRNS" , "KC_TRNS" , "KC_TRNS" , "KC_TRNS" + + ], + ["KC_NO" , "KC_MINS" , "KC_PLUS" , "KC_EQL" , "KC_SLSH" , "KC_ASTR", + "KC_COMM", "KC_7" , "KC_8" , "KC_9" , "KC_NO" , "KC_TRNS", + + "KC_TRNS", "KC_LGUI" , "KC_LALT" , "KC_LCTL" , "KC_LSFT" , "KC_NO", + "KC_0" , "KC_1" , "KC_2" , "KC_3" , "KC_UNDS" , "KC_RCTL", + + "KC_TRNS", "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO", + "KC_NO" , "KC_DOT" , "KC_4" , "KC_5" , "KC_6" , "KC_NO" , "KC_TRNS", + + "KC_TRNS", "KC_TRNS" , "KC_TRNS" , "KC_TRNS" , "KC_NO", + "KC_NO" , "KC_BSPC" , "KC_TRNS" , "KC_TRNS" , "KC_TRNS" + + ], + ["KC_NO" , "DF(0)" , "DF(1)" , "DF(2)" , "AG_SWAP" , "AG_NORM", + "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO", + + "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO", + "RGB_MOD", "RGB_VAI" , "RGB_HUI" , "RGB_SAI" , "KC_NO" , "KC_NO", + + "RESET" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO", + "RGB_TOG", "RGB_RMOD" , "RGB_VAD" , "RGB_HUD" , "RGB_SAD" , "KC_NO" , "KC_NO", + + "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_TRNS", + "KC_TRNS", "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" + + ] + ] +} diff --git a/firmware/QMK/hillside/readme.md b/firmware/QMK/hillside/readme.md new file mode 100644 index 0000000..c4b573e --- /dev/null +++ b/firmware/QMK/hillside/readme.md @@ -0,0 +1,31 @@ +# Hillside + +![hillside](https://imgur.com/XW0rX13.png) + +[Hillside](https://github.com/mmccoyd/hillside) + is a split ergonomic keyboard with 3x6+4+2 choc-spaced keys with + aggressive column stager, + a longer thumb arc and a breakoff outer pinky column. + +* Keyboard Maintainer: [Michael McCoyd](https://github.com/mmccoyd) +* Hardware Supported: ProMicro/Elite-C and compatible +* Hardware Availability: https://github.com/mmccoyd/hillside + +Make example for this keyboard (after setting up your build environment): + + make handwired/hillside/0_1:default + +Flashing example for this keyboard: + + make handwired/hillside/0_1:default:flash + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +## Bootloader + +Enter the bootloader by either: + +* **Physical reset button**: Briefly press the button on the front of the PCB. +* **Keycode in layout**: Press the key mapped to `RESET` if it is available + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).