diff --git a/.gitignore b/.gitignore index bae2658b00..49eb2d5587 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ tags *~ build/ *.bak +.vagrant/ diff --git a/QUICK_START.md b/QUICK_START.md new file mode 100644 index 0000000000..6be377db3c --- /dev/null +++ b/QUICK_START.md @@ -0,0 +1,25 @@ +# Quick Start Directions + +This project includes a Vagrantfile that will allow you to build a new firmware for your keyboard very easily without major changes to your primary operating system. This also ensures that when you clone the project and perform a build, you have the exact same environment as anyone else using the Vagrantfile to build. This makes it much easier for people to help you troubleshoot any issues you encounter. + +## Requirements + +Using the Vagrantfile in this repository requires you have [Vagrant](http://www.vagrantup.com/) as well as [VirtualBox](https://www.virtualbox.org/) (or [VMware Workstation](https://www.vmware.com/products/workstation) and [Vagrant VMware plugin](http://www.vagrantup.com/vmware) but the (paid) VMware plugin requires a licensed copy of VMware Workstation/Fusion). + +*COMPATIBILITY NOTICE* Certain versions of Virtualbox 5 appear to have an incompatibility with the Virtualbox extensions installed in the boxes in this Vagrantfile. If you encounter any issues with the /vagrant mount not succeeding, please upgrade your version of Virtualbox to at least 5.0.12. + +Other than having Vagrant and Virtualbox installed and possibly a restart of your computer afterwards, you can simple run a 'vagrant up' anywhere inside the folder where you checked out this project and it will start a Linux virtual machine that contains all the tools required to build this project. There is a post Vagrant startup hint that will get you off on the right foot, otherwise you can also reference the build documentation below. + +Build Firmware and Program Controller +------------------------------------- +See [doc/build.md](tmk_core/doc/build.md), or the README in the particular keyboard/* folder. + +Change your keymap +------------------ +See [doc/keymap.md](tmk_core/doc/keymap.md). + +## Flashing the firmware + +The "easy" way to flash the firmware is using a tool from your host OS like the Teensy programming app. [ErgoDox EZ](keyboard/ergodox_ez/README.md) gives a great example. + +If you want to program via the command line you can uncomment the ['modifyvm'] lines in the Vagrantfile to enable the USB passthrough into Linux and then program using the command line tools like dfu-util/dfu-programmer or you can install the Teensy CLI version. diff --git a/README.md b/README.md index f46bd68e26..2ed05e76e2 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ The documentation below explains QMK customizations and elaborates on some of th ## Getting started * **If you're looking to customize a keyboard that currently runs QMK or TMK** , find your keyboard's directory under `/keyboard/` and read the README file. This will get you all set up. +* Read the [QUICK_START.md](QUICK_START.md) if you want to hit the ground running with minimal fuss or you aren't a technical person and you just want to build the firmware with the least amount of hassle possible. * If you're looking to apply this firmware to an entirely new hardware project (a new kind of keyboard), you can create your own Quantum-based project by using `./new_project.sh `, which will create `/keyboard/` with all the necessary components for a Quantum project. You have access to a bunch of goodies! Check out the Makefile to enable/disable some of the features. Uncomment the `#` to enable them. Setting them to `no` does nothing and will only confuse future you. diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000000..1abe8ff3b1 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,88 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +Vagrant.configure(2) do |config| + # You can only have one config.vm.box uncommented at a time + + # Comment this and uncomment another if you don't want to use the minimal Arch box + config.vm.box = "dragon788/arch-ala-elasticdog" + + # VMware/Virtualbox 64 bit + # config.vm.box = "phusion/ubuntu-14.04-amd64" + # + # VMware/Virtualbox 64 bit + #config.vm.box = "puphpet/centos65-x64" + # + # The opensuse boxes don't have dfu-util in their default repositories + # + # The virtualbox version has tools issues + # VMware/Virtualbox 64 bit + #config.vm.box = "bento/opensuse-13.2-x86_64" + # + # Virtualbox only + #config.vm.box = "bento/opensuse-13.2-i386" + # config.vm.box = "" + # config.vm.box = "" + + # This section allows you to customize the Virtualbox VM + # settings, ie showing the GUI or upping the memory + # or cores if desired + config.vm.provider "virtualbox" do |vb| + # Hide the VirtualBox GUI when booting the machine + vb.gui = false + # Uncomment the below lines if you want to program + # your Teensy via the VM rather than your host OS + #vb.customize ['modifyvm', :id, '--usb', 'on'] + #vb.customize ['usbfilter', 'add', '0', + # '--target', :id, + # '--name', 'teensy', + # '--vendorid', '0x16c0', + # '--productid','0x0478' + # ] + # Customize the amount of memory on the VM: + vb.memory = "512" + end + + # This section allows you to customize the VMware VM + # settings, ie showing the GUI or upping the memory + # or cores if desired + config.vm.provider "vmware_workstation" do |vmw| + # Hide the VMware GUI when booting the machine + vmw.gui = false + + # Customize the amount of memory on the VM: + vmw.memory = "512" + end + + config.vm.provider "vmware_fusion" do |vmf| + # Hide the vmfare GUI when booting the machine + vmf.gui = false + + # Customize the amount of memory on the VM: + vmf.memory = "512" + end + + # This script ensures the required packages for AVR programming are installed + # It also ensures the system always gets the latest updates when powered on + # If this causes issues you can run a 'vagrant destroy' and then + # add a # before ,args: and run 'vagrant up' to get a working + # non-updated box and then attempt to troubleshoot or open a Github issue + + config.vm.provision "shell", run: "always", path: "avr_setup.sh", args: "-update" + + config.vm.post_up_message = """ + Log into the VM using 'vagrant ssh' on OSX or from Git Bash (Win) + or 'vagrant ssh-config' and Putty or Bitvise SSH or another SSH tool + + Change directory (cd) to the keyboard you wish to program + (Optionally) modify your layout, + then run 'make clean' + and then 'make' to compile the .eep and .hex files. + + Or you can copy and paste the example line below. + + cd /vagrant; cd keyboard; cd ergodox_ez; make clean; make + + + """ +end diff --git a/avr_setup.sh b/avr_setup.sh new file mode 100644 index 0000000000..34a8a3281b --- /dev/null +++ b/avr_setup.sh @@ -0,0 +1,72 @@ +#!/usr/bin/env bash +# This script will attempt to setup the Linux dependencies for compiling QMK/TMK + +# This could probably go much lower, but since we are including an Arch vagrant, +# making it the first match makes sense + +if [[ -n "$(type -P pacman )" ]]; then + # Arch linux and derivatives like Apricity + # Future improvements: + # Allow user to speed up package installs using powerpill/wget tweaks + # Always run the pacman mirror update script if possible when vagrant comes up + # This will ensure that users never get stalled on a horribly slow mirror + pacman -Syyu --needed --noconfirm + pacman -S --needed --noconfirm \ + base-devel \ + avr-gcc \ + avr-binutils \ + avr-libc \ + dfu-util + +elif [[ -n "$(type -P apt-get)" ]]; then + # Debian and derivatives + # This block performs completely non-interactive updates {{ + export DEBIAN_FRONTEND=noninteractive + export DEBCONF_NONINTERACTIVE_SEEN=true + echo "grub-pc hold" | dpkg --set-selections + apt-get -y update + apt-get -y --allow-unauthenticated upgrade \ + -o Dpkg::Options::="--force-confdef" \ + -o Dpkg::Options::="--force-confold" + # }} + apt-get install -y \ + build-essential \ + gcc \ + unzip \ + wget \ + zip \ + gcc-avr \ + binutils-avr \ + avr-libc \ + dfu-util + +elif [[ -n "$(type -P yum)" ]]; then + # Fedora, CentOS or RHEL and derivatives + yum -y makecache && yum -y update + yum -y install \ + gcc \ + glibc-headers \ + kernel-devel \ + kernel-headers \ + make \ + perl \ + git \ + wget \ + avr-binutils \ + avr-gcc \ + avr-libc \ + dfu-util + +elif [[ -n "$(type -P zypper)" ]]; then + # openSUSE + zypper --non-interactive refresh && zypper --non-interactive update + zypper --non-interactive install \ + git \ + make \ + gcc \ + kernel-devel \ + patch \ + wget \ + dfu-programmer + +fi diff --git a/keyboard/ergodox_ez/keymaps/keymap_dragon788.c b/keyboard/ergodox_ez/keymaps/keymap_dragon788.c new file mode 100644 index 0000000000..d18ce73bfe --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/keymap_dragon788.c @@ -0,0 +1,229 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys +#define PLVR 3 // Plover layer + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | LGui | |Plover| 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | L1 | | L2 | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * |Esc/Ctrl| A | S | D | F | G |------| |------| H | J | K | L | ; | '"/Ctrl| + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | ~L1 | Grv | '" | Left |Rgt/L2| | Up/L2| Down | [ | ] | ~L1 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | App | Home | | PgUp |Ctrl/Esc| + * ,------|------|------| |------+--------+------. + * | | | End | | PgDn | | | + * |Backsp|Delete|------| |------| Enter |Space | + * | ace | | LAlt | |TabCtl| | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LGUI, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(1), + CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), + KC_FN1, KC_GRV, KC_QUOT,KC_LEFT, LT(MDIA, KC_RGHT), + KC_APP, KC_HOME, + KC_END, + KC_BSPC,KC_DELT,KC_LALT, + // right hand + TG(3), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(2), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, KC_SCLN, CTL_T(KC_QUOT), + MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, + LT(MDIA, KC_UP), KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + KC_PGUP, CTL_T(KC_ESC), + KC_PGDN, + CTL_T(KC_TAB),KC_ENT, KC_SPC + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | Calc | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + KC_TRNS, KC_CALC, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | Rclk | Lclk | | | | | | Lclk | Rclk | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft| MsUp |MsDown|MsRght|------| |------|MsLeft|MsDown| MsUp |MsRght| | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | Prev | |VolUp | | + * ,------|------|------| |------+------+------. + * | | | Play | | Mute |Brwser|Brwser| + * | Lclk | Rclk |------| |------|Fwd |Back | + * | | | Next | |VolDn | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +KEYMAP( + RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN2, KC_BTN1, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_U, KC_MS_D, KC_MS_R, + 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, KC_MPRV, + KC_MPLY, + KC_BTN1, KC_BTN2, KC_MNXT, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, KC_TRNS, KC_TRNS, KC_TRNS, + KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, 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, KC_TRNS, + KC_VOLU, KC_TRNS, + KC_MUTE, + KC_VOLD, KC_WBAK, KC_WFWD +), + +/* Keymap 4: Steno for Plover from https://github.com/shayneholmes/tmk_keyboard/commit/11290f8489013018f778627db725160c745e75bd + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | q | w | e | r | t |------| |------| y | u | i | o | p | [ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | a | s | d | f | g | | | | h | j | k | l | ; | ' | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | c | v |------| |------| n | m | + * | | | | | | | | + * `--------------------' `--------------------' + */ + +[PLVR] = KEYMAP( // layout: layer 4: Steno for Plover + // left hand + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_NO, + KC_NO, KC_Q, KC_W, KC_E, KC_R, KC_T, + KC_NO, KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_FN4, KC_NO, + KC_NO, + KC_C, KC_V, KC_NO, + // right hand + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, + KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, + KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + KC_NO, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_NO, KC_N, KC_M +), + +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +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; +}; + +// Runs just one time when the keyboard initializes. +void * matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void * matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboard/ergodox_ez/keymaps/keymap_plover.c b/keyboard/ergodox_ez/keymaps/keymap_plover.c new file mode 100644 index 0000000000..bd356c47c5 --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/keymap_plover.c @@ -0,0 +1,228 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys +#define PLVR 3 // Plover layer + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | LGui | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | L1 | |Plover| Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Esc | A | S | D | F | G |------| |------| H | J | K | L |; / L2| ' | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | App | Home | | Alt |Ctrl/Esc| + * ,------|------|------| |------+--------+------. + * | | | End | | PgUp | | | + * |Backsp|Delete|------| |------| Enter |Space | + * | ace | | LAlt | | PgDn | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LGUI, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(1), + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), + LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, + ALT_T(KC_APP), KC_HOME, + KC_END, + KC_BSPC,KC_DELT,KC_LALT, + // right hand + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(3), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_QUOT, + MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + KC_LALT, CTL_T(KC_ESC), + KC_PGUP, + KC_PGDN,KC_ENT, KC_SPC + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | |------| |------|MsLeft|MsDown| MsUp |MsRght| | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | |Brwser|Brwser| + * | Lclk | Rclk |------| |------|Fwd |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + 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_TRNS, KC_TRNS, + KC_TRNS, + KC_BTN1, KC_BTN2, KC_TRNS, + // right hand + 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, KC_TRNS, + KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_WBAK, KC_WFWD +), + +/* Keymap 4: Steno for Plover from https://github.com/shayneholmes/tmk_keyboard/commit/11290f8489013018f778627db725160c745e75bd + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | q | w | e | r | t |------| |------| y | u | i | o | p | [ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | a | s | d | f | g | | | | h | j | k | l | ; | ' | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | c | v |------| |------| n | m | + * | | | | | | | | + * `--------------------' `--------------------' + */ + +[PLVR] = KEYMAP( // layout: layer 4: Steno for Plover + // left hand + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_NO, + KC_NO, KC_Q, KC_W, KC_E, KC_R, KC_T, + KC_NO, KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_FN4, KC_NO, + KC_NO, + KC_C, KC_V, KC_NO, + // right hand + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, + KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, + KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + KC_NO, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_NO, KC_N, KC_M +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +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; +}; + +// Runs just one time when the keyboard initializes. +void * matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void * matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/tmk_core/doc/build.md b/tmk_core/doc/build.md index 20702e94c9..dffc699a3a 100644 --- a/tmk_core/doc/build.md +++ b/tmk_core/doc/build.md @@ -6,7 +6,7 @@ Download and Install -------------------- ### 1. Install Tools -1. **Toolchain** On Windows install [MHV AVR Tools][mhv] for AVR GCC compiler and [Cygwin][cygwin](or [MinGW][mingw]) for shell terminal. On Mac you can use [CrossPack][crosspack]. On Linux you can install AVR GCC with your favorite package manager. +1. **Toolchain** On Windows install [MHV AVR Tools][mhv] for AVR GCC compiler and [Cygwin][cygwin](or [MinGW][mingw]) for shell terminal. On Mac you can use [CrossPack][crosspack]. On Linux you can install AVR GCC (and avr-libc) with your favorite package manager. 2. **Programmer** On Windows install [Atmel FLIP][flip]. On Mac and Linux install [dfu-programmer][dfu-prog].