diff --git a/.gitignore b/.gitignore index ae342167d..8b8c45169 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +keyboard/planck/dfu-programmer.exe .dep *.o *.eep @@ -18,4 +19,5 @@ build/ # Eclipse Settings .cproject .project -.settings/ \ No newline at end of file +.settings/ + diff --git a/1-setup-path-win.bat b/1-setup-path-win.bat new file mode 100644 index 000000000..49fb00e14 --- /dev/null +++ b/1-setup-path-win.bat @@ -0,0 +1,9 @@ +@echo off +setx /M path "%PATH%;C:\MinGW\bin;C:\MinGW\msys\1.0\bin" > nul 2>&1 +if NOT ["%errorlevel%"]==["0"] ( + echo FAILED. Rerun with administrator privileges. + pause +) else ( + echo Success! + pause +) diff --git a/2-setup-environment-win.bat b/2-setup-environment-win.bat new file mode 100644 index 000000000..91b6c91e3 --- /dev/null +++ b/2-setup-environment-win.bat @@ -0,0 +1,41 @@ +@echo off +setx /M test test > nul 2>&1 +if NOT ["%errorlevel%"]==["0"] ( + echo FAILED. Rerun with administrator privileges. + pause + exit +) + +echo ------------------------------------------ +echo Installing wget and unzip +echo ------------------------------------------ +mingw-get install msys-wget-bin msys-unzip-bin +cd \MinGW\bin + +mkdir temp +cd temp +echo ------------------------------------------ +echo Installing dfu-programmer. +echo ------------------------------------------ +wget http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip +unzip dfu-programmer-win-0.7.2.zip +copy dfu-programmer.exe .. + +echo ------------------------------------------ +echo Downloading driver +echo ------------------------------------------ +wget http://iweb.dl.sourceforge.net/project/libusb-win32/libusb-win32-releases/1.2.6.0/libusb-win32-bin-1.2.6.0.zip +unzip libusb-win32-bin-1.2.6.0.zip +cp libusb-win32-bin-1.2.6.0\bin\x86\libusb0_x86.dll ../libusb0.dll + +echo ------------------------------------------ +echo Installing driver. Accept prompt. +echo ------------------------------------------ +pnputil -i -a dfu-prog-usb-1.2.2\atmel_usb_dfu.inf + +cd .. +rm -rf temp + +echo ------------------------------------------ +echo Finished! +pause \ No newline at end of file diff --git a/BUILD_GUIDE.md b/BUILD_GUIDE.md new file mode 100644 index 000000000..81c3ec44f --- /dev/null +++ b/BUILD_GUIDE.md @@ -0,0 +1,55 @@ +# Build Guide + +## Build Environment Setup + +### Windows +1. Install [MHV AVR Tools](https://infernoembedded.com/sites/default/files/project/MHV_AVR_Tools_20131101.exe). Disable smatch, but **be sure to leave the option to add the tools to the PATH checked**. +2. Install [MinGW](https://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download). During installation, uncheck the option to install a graphical user interface. **DO NOT change the default installation folder.** The scripts depend on the default location. +3. Clone this repository. [This link will download it as a zip file, which you'll need to extract.](https://github.com/jackhumbert/qmk_firmware/archive/master.zip) Open the extracted folder in Windows Explorer. +4. Right-click on the 1-setup-path-win batch script, select "Run as administrator", and accept the User Account Control prompt. Press the spacebar to dismiss the success message in the command prompt that pops up. +5. Right-click on the 2-setup-environment-win batch script, select "Run as administrator", and accept the User Account Control prompt. This part may take a couple of minutes, and you'll need to approve a driver installation, but once it finishes, your environment is complete! + +### Mac +If you're using [homebrew,](http://brew.sh/) you can use the following commands: + + brew tap osx-cross/avr + brew install avr-libc + brew install dfu-programmer + +This is the recommended method. If you don't have homebrew, [install it!](http://brew.sh/) It's very much worth it for anyone who works in the command line. + +You can also try these instructions: + +1. Install Xcode from the App Store. +2. Install the Command Line Tools from `Xcode->Preferences->Downloads`. +3. Install [DFU-Programmer][dfu-prog]. + +### Linux +Install AVR GCC and dfu-progammer with your favorite package manager. + +Debian/Ubuntu example: + + sudo apt-get update + sudo apt-get install gcc-avr dfu-programmer + +### Vagrant +If you have any problems building the firmware, you can try using a tool called Vagrant. It will set up a virtual computer with a known configuration that's ready-to-go for firmware building. OLKB does NOT host the files for this virtual computer. Details on how to set up Vagrant are in the [VAGRANT_GUIDE file](VAGRANT_GUIDE.md). + +## Verify Your Installation +1. If you haven't already, obtain this repository ([https://github.com/jackhumbert/qmk_firmware](https://github.com/jackhumbert/qmk_firmware)). You can either download it as a zip file and extract it, or clone it using the command line tool git or the Github Desktop application. +2. Open up a terminal or command prompt and navigate to the qmk_firmware folder using the `cd` command. The command prompt will typically open to your home directory. If, for example, you cloned the repository to your Documents folder, then you would type `cd Documents/qmk_firmware`. If you extracted the file from a zip, then it may be named `qmk_firmware-master` instead. +3. To confirm that you're in the correct location, you can display the contents of your current folder using the `dir` command on Windows, or the `ls` command on Linux or Mac. You should see several files, including `README.md` and a `quantum` folder. From here, you need to navigate to the appropriate folder under `keyboard/`. For example, if you're building for a Planck, run `cd keyboard/planck`. +4. Once you're in the correct keyboard-specific folder, run the `make` command. This should output a lot of information about the build process. + +## Customizing, Building, and Deploying Your Firmware +1. Running the `make` command from your keyboard's folder will generate a .hex file based on the default keymap. All keymaps for a particular keyboard live in the `keymaps` folder in that keyboard's folder. To create your own keymap, copy `keymaps/default/keymap.c` to the `keymaps` folder, and rename it with your name, for example jack.c. Or, if you don't care about the ability to share your keymap with the community via GitHub, you can just modify the default keymap itself. Details on how to program keymap files can be found in other guides. +2. To build a keymap other than the default, type `KEYMAP=` after `make`. So if I've named my keymap jack.c, the full command would be `make KEYMAP=jack`. +3. How you deploy the firmware will depend on whether you are using a PCB or a Teensy. In both cases, you'll need to put the keyboard in bootloader mode, either by pressing a button on the PCB/Teensy or pressing the key with the `RESET` keycode. Then, if you're using a PCB, just run `make KEYMAP= dfu` to both build and deploy the firmware. If you're using a Teensy, you'll probably need to take the .hex file that make produces in the keyboard's folder, and deploy it using the [Teensy Loader.](https://www.pjrc.com/teensy/loader.html) + +## Helpful Tips +1. On Linux or OS X, you can run `sleep 5; make KEYMAP= dfu` to delay building/deploying the firmware until for 5 seconds, giving you a chance to put the firmware into bootloader mode. You can change the 5 to any number of seconds. + +## Troubleshooting +1. Try running `make clean` if the make command fails. + + WIP \ No newline at end of file diff --git a/HAND-WIRE.md b/HAND_WIRE.md similarity index 100% rename from HAND-WIRE.md rename to HAND_WIRE.md diff --git a/README.md b/README.md index 6cb73f180..6a6bbed40 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,8 @@ 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. +* [BUILD_GUIDE.md](BUILD_GUIDE.md) contains instructions to set up a build environment, build the firmware, and deploy it to a keyboard. Once your build environment has been set up, all `make` commands to actually build the firmware must be run from a folder in `keyboard/`. +* If you're looking to customize a keyboard that currently runs QMK or TMK, find your keyboard's directory under `keyboard/` and run the make commands from there. * 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. @@ -309,3 +309,4 @@ what things are (and likely aren't) too risky. - EEPROM has around a 100000 write cycle. You shouldn't rewrite the firmware repeatedly and continually; that'll burn the EEPROM eventually. + \ No newline at end of file diff --git a/QUICK_START.md b/VAGRANT_GUIDE.md similarity index 99% rename from QUICK_START.md rename to VAGRANT_GUIDE.md index 948308ca1..922848fd7 100644 --- a/QUICK_START.md +++ b/VAGRANT_GUIDE.md @@ -23,3 +23,4 @@ See [doc/keymap.md](tmk_core/doc/keymap.md). 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. + \ No newline at end of file diff --git a/keyboard/atomic/atomic.c b/keyboard/atomic/atomic.c index fa66266a4..30e812289 100644 --- a/keyboard/atomic/atomic.c +++ b/keyboard/atomic/atomic.c @@ -1,16 +1,16 @@ #include "atomic.h" __attribute__ ((weak)) -void * matrix_init_user(void) { +void matrix_init_user(void) { // leave these blank -}; +} __attribute__ ((weak)) -void * matrix_scan_user(void) { +void matrix_scan_user(void) { // leave these blank -}; +} -void * matrix_init_kb(void) { +void matrix_init_kb(void) { // put your keyboard start-up code here // runs once when the firmware starts up @@ -25,16 +25,12 @@ void * matrix_init_kb(void) { DDRE |= (1<<6); PORTE |= (1<<6); - if (matrix_init_user) { - (*matrix_init_user)(); - } -}; + matrix_init_user(); +} -void * matrix_scan_kb(void) { +void matrix_scan_kb(void) { // put your looping keyboard code here // runs every cycle (a lot) - if (matrix_scan_user) { - (*matrix_scan_user)(); - } -}; \ No newline at end of file + matrix_scan_user(); +} \ No newline at end of file diff --git a/keyboard/atomic/atomic.h b/keyboard/atomic/atomic.h index 95982ecad..d8574efa9 100644 --- a/keyboard/atomic/atomic.h +++ b/keyboard/atomic/atomic.h @@ -24,7 +24,7 @@ { K40, K41, KC_NO, K43, KC_NO, KC_NO, K46, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D, K4E } \ } -void * matrix_init_user(void); -void * matrix_scan_user(void); +void matrix_init_user(void); +void matrix_scan_user(void); #endif \ No newline at end of file diff --git a/keyboard/atreus/atreus.c b/keyboard/atreus/atreus.c index bfc893084..9d1de631b 100644 --- a/keyboard/atreus/atreus.c +++ b/keyboard/atreus/atreus.c @@ -1,16 +1,16 @@ #include "atreus.h" __attribute__ ((weak)) -void * matrix_init_user(void) { +void matrix_init_user(void) { // leave these blank }; __attribute__ ((weak)) -void * matrix_scan_user(void) { +void matrix_scan_user(void) { // leave these blank }; -void * matrix_init_kb(void) { +void matrix_init_kb(void) { // put your keyboard start-up code here // runs once when the firmware starts up @@ -19,7 +19,7 @@ void * matrix_init_kb(void) { } }; -void * matrix_scan_kb(void) { +void matrix_scan_kb(void) { // put your looping keyboard code here // runs every cycle (a lot) diff --git a/keyboard/atreus/atreus.h b/keyboard/atreus/atreus.h index 9dd77859f..8d5989e44 100644 --- a/keyboard/atreus/atreus.h +++ b/keyboard/atreus/atreus.h @@ -22,7 +22,7 @@ { k2a, k30, k31, k32, k33, k34, k36, k37, k38, k39, k3a } \ } -void * matrix_init_user(void); -void * matrix_scan_user(void); +void matrix_init_user(void); +void matrix_scan_user(void); #endif diff --git a/keyboard/ergodox_ez/190hotfix.sh b/keyboard/ergodox_ez/190hotfix.sh new file mode 100755 index 000000000..bdc3adce2 --- /dev/null +++ b/keyboard/ergodox_ez/190hotfix.sh @@ -0,0 +1,19 @@ +#!/bin/bash +#a tool to fix broken keymaps as a result of pull request #190 +#changing the declaration of matrix_scan_user() and matrix_init_user() +# +#This script will save a copy of the specified keymap as keymap.c.bak +#and then create a new keymap.c with the definion corrected. +#this script must be run from the ergodox_ez directory +if [ $# -ne 1 ]; then + echo $0: usage: ./190hotfix keymap_name + exit 1 +fi + +echo Saving backup as ./keymaps/$1/keymap.c.bak ... +mv ./keymaps/$1/keymap.c ./keymaps/$1/keymap.c.bak + +echo Modifying ./keymaps/$1/keymap.c ... +cat ./keymaps/$1/keymap.c.bak | sed -r 's/^void \* matrix_/void matrix_/'>./keymaps/$1/keymap.c + +echo Complete! diff --git a/keyboard/ergodox_ez/ergodox_ez.c b/keyboard/ergodox_ez/ergodox_ez.c index d0eaf3392..97e6de1ee 100644 --- a/keyboard/ergodox_ez/ergodox_ez.c +++ b/keyboard/ergodox_ez/ergodox_ez.c @@ -5,16 +5,16 @@ bool i2c_initialized = 0; uint8_t mcp23018_status = 0x20; __attribute__ ((weak)) -void * matrix_init_user(void) { - return NULL; -}; +void matrix_init_user(void) { + +} __attribute__ ((weak)) -void * matrix_scan_user(void) { - return NULL; -}; +void matrix_scan_user(void) { -void * matrix_init_kb(void) { +} + +void matrix_init_kb(void) { // keyboard LEDs (see "PWM on ports OC1(A|B|C)" in "teensy-2-0.md") TCCR1A = 0b10101001; // set and configure fast PWM TCCR1B = 0b00001001; // set and configure fast PWM @@ -34,21 +34,12 @@ void * matrix_init_kb(void) { ergodox_blink_all_leds(); - if (matrix_init_user) { - (*matrix_init_user)(); - } + matrix_init_user(); +} - return NULL; -}; - -void * matrix_scan_kb(void) { - - if (matrix_scan_user) { - (*matrix_scan_user)(); - } - - return NULL; -}; +void matrix_scan_kb(void) { + matrix_scan_user(); +} void ergodox_blink_all_leds(void) diff --git a/keyboard/ergodox_ez/ergodox_ez.h b/keyboard/ergodox_ez/ergodox_ez.h index aceb7ed9c..1e446baf6 100644 --- a/keyboard/ergodox_ez/ergodox_ez.h +++ b/keyboard/ergodox_ez/ergodox_ez.h @@ -123,8 +123,8 @@ inline void ergodox_led_all_set(uint8_t n) { k0D, k1D, k2D, k3D, k4D, KC_NO } \ } -void * matrix_init_user(void); -void * matrix_scan_user(void); +void matrix_init_user(void); +void matrix_scan_user(void); diff --git a/keyboard/ergodox_ez/keymaps/andrew_osx/andrew_osx.hex b/keyboard/ergodox_ez/keymaps/andrew_osx/andrew_osx.hex index e3ee9afd3..fc0876d84 100644 Binary files a/keyboard/ergodox_ez/keymaps/andrew_osx/andrew_osx.hex and b/keyboard/ergodox_ez/keymaps/andrew_osx/andrew_osx.hex differ diff --git a/keyboard/ergodox_ez/keymaps/andrew_osx/keymap.c b/keyboard/ergodox_ez/keymaps/andrew_osx/keymap.c index 48f8c5d2f..48257d23a 100644 --- a/keyboard/ergodox_ez/keymaps/andrew_osx/keymap.c +++ b/keyboard/ergodox_ez/keymaps/andrew_osx/keymap.c @@ -158,12 +158,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) }; // Runs just one time when the keyboard initializes. -void * matrix_init_user(void) { +void matrix_init_user(void) { }; // Runs constantly in the background, in a loop. -void * matrix_scan_user(void) { +void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); diff --git a/keyboard/ergodox_ez/keymaps/coderkun_neo2/coderkun_neo2.hex b/keyboard/ergodox_ez/keymaps/coderkun_neo2/coderkun_neo2.hex index 2c7f3ec54..f14a11fb5 100644 Binary files a/keyboard/ergodox_ez/keymaps/coderkun_neo2/coderkun_neo2.hex and b/keyboard/ergodox_ez/keymaps/coderkun_neo2/coderkun_neo2.hex differ diff --git a/keyboard/ergodox_ez/keymaps/coderkun_neo2/keymap.c b/keyboard/ergodox_ez/keymaps/coderkun_neo2/keymap.c index be29a1bff..25ab0ff18 100644 --- a/keyboard/ergodox_ez/keymaps/coderkun_neo2/keymap.c +++ b/keyboard/ergodox_ez/keymaps/coderkun_neo2/keymap.c @@ -243,12 +243,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // Runs just one time when the keyboard initializes. -void * matrix_init_user(void) { +void matrix_init_user(void) { }; // Runs constantly in the background, in a loop. -void * matrix_scan_user(void) +void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); diff --git a/keyboard/ergodox_ez/keymaps/colemak/colemak.hex b/keyboard/ergodox_ez/keymaps/colemak/colemak.hex index cd3bf781a..0f5bba3b5 100644 Binary files a/keyboard/ergodox_ez/keymaps/colemak/colemak.hex and b/keyboard/ergodox_ez/keymaps/colemak/colemak.hex differ diff --git a/keyboard/ergodox_ez/keymaps/colemak/keymap.c b/keyboard/ergodox_ez/keymaps/colemak/keymap.c index ee72c4263..9601726f7 100644 --- a/keyboard/ergodox_ez/keymaps/colemak/keymap.c +++ b/keyboard/ergodox_ez/keymaps/colemak/keymap.c @@ -155,12 +155,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) }; // Runs just one time when the keyboard initializes. -void * matrix_init_user(void) { +void matrix_init_user(void) { }; // Runs constantly in the background, in a loop. -void * matrix_scan_user(void) { +void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); diff --git a/keyboard/ergodox_ez/keymaps/colemak_osx_pc_no/colemak_osx_pc_no.hex b/keyboard/ergodox_ez/keymaps/colemak_osx_pc_no/colemak_osx_pc_no.hex index ecf97c9f1..1d87acd14 100644 Binary files a/keyboard/ergodox_ez/keymaps/colemak_osx_pc_no/colemak_osx_pc_no.hex and b/keyboard/ergodox_ez/keymaps/colemak_osx_pc_no/colemak_osx_pc_no.hex differ diff --git a/keyboard/ergodox_ez/keymaps/csharp_dev/csharp_dev.hex b/keyboard/ergodox_ez/keymaps/csharp_dev/csharp_dev.hex index e29c17860..12efef223 100644 Binary files a/keyboard/ergodox_ez/keymaps/csharp_dev/csharp_dev.hex and b/keyboard/ergodox_ez/keymaps/csharp_dev/csharp_dev.hex differ diff --git a/keyboard/ergodox_ez/keymaps/csharp_dev/csharp_dev.png b/keyboard/ergodox_ez/keymaps/csharp_dev/csharp_dev.png index 5c4c7c7c1..6fba568fc 100644 Binary files a/keyboard/ergodox_ez/keymaps/csharp_dev/csharp_dev.png and b/keyboard/ergodox_ez/keymaps/csharp_dev/csharp_dev.png differ diff --git a/keyboard/ergodox_ez/keymaps/csharp_dev/csharp_dev_legend.png b/keyboard/ergodox_ez/keymaps/csharp_dev/csharp_dev_legend.png index dbc51b79b..b0a1c513c 100644 Binary files a/keyboard/ergodox_ez/keymaps/csharp_dev/csharp_dev_legend.png and b/keyboard/ergodox_ez/keymaps/csharp_dev/csharp_dev_legend.png differ diff --git a/keyboard/ergodox_ez/keymaps/csharp_dev/keymap.c b/keyboard/ergodox_ez/keymaps/csharp_dev/keymap.c index 537b15eea..46005b533 100644 --- a/keyboard/ergodox_ez/keymaps/csharp_dev/keymap.c +++ b/keyboard/ergodox_ez/keymaps/csharp_dev/keymap.c @@ -3,8 +3,7 @@ #include "action_layer.h" #define BASE 0 // default layer -#define QWERTY 1 // qwerty keys -#define FKEYS 2 // F keys + macros +#define FKEYS 1 // F keys + macros #define MACRO_PUBLIC 10 #define MACRO_PRIVATE 11 @@ -43,12 +42,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Tab~CL| < | > | | | & | | = | + | - | * | L1 | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. - * |. ~L1 | , ~L2| |Home~L1| End~L2| - * ,------|------|------| |------+--------+------. - * | | | Copy | | UP | | | - * | Enter| Space|------| |------| Space |Enter | - * | ~LSFT| ~WIN | Past | | DOWN | ~WIN | ~LSFT| - * `--------------------' `----------------------' + * |. ~L1 | , | |Home |End~L1| + * ,------|------|------| |------+------+------. + * | | | Copy | | UP | | | + * | Enter| Space|------| |------| Space|Enter | + * | ~WIN | ~LSFT| Past | | DOWN | ~LSFT| ~WIN | + * `--------------------' `--------------------' */ // If it accepts an argument (i.e, is a function), it doesn't need KC_. // Otherwise, it needs KC_* @@ -59,110 +58,68 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCBR, KC_A, KC_S, KC_D, KC_F, KC_G, KC_RCBR, ALT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_SLASH, CTL_T(KC_TAB), LSFT(KC_COMMA),LSFT(KC_DOT),KC_PIPE,KC_AMPR, - LT(1,KC_DOT), LT(2,KC_COMM), + LT(1,KC_DOT), KC_COMM, LCTL(KC_C), - SFT_T(KC_ENTER),GUI_T(KC_SPACE),LCTL(KC_V), + GUI_T(KC_ENTER),SFT_T(KC_SPACE),LCTL(KC_V), // right hand LCTL(KC_S) , KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRACKET, KC_DELETE, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RBRACKET, KC_H, KC_J, KC_K, KC_L, KC_UNDS,LCTL(KC_Y), KC_SCOLON,KC_N, KC_M, KC_QUOTE ,KC_EXLM , LSFT(KC_SLASH), LCTL(KC_Z), KC_EQUAL,KC_PLUS , KC_MINUS,KC_ASTR , TG(1), - LT(2,KC_HOME), LT(1,KC_END), + KC_HOME, LT(1,KC_END), KC_UP, - KC_DOWN,GUI_T(KC_SPACE), SFT_T(KC_ENTER) + KC_DOWN,SFT_T(KC_SPACE), GUI_T(KC_ENTER) ), -/* Keymap 1: QWERTY layer + +/* Keymap 1: F keys + macros * * ,--------------------------------------------------. ,--------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | - | | = | 6 | 7 | 8 | 9 | 0 | | + * | ESC | F1 | F2 | F3 | F4 | F5 | ` | | Calc | F6 | F7 | F8 | F9 | F10 | F11 | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | | | | Y | U | I | O | P | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Esc | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | - * |--------+------+------+------+------+------| Tab | | Esc |------+------+------+------+------+--------| - * | LSHFT | Z | X | C | V | B | | | | N | M | , | . | / | \ | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | CTRL | WIN | ALT |ALT GR| Esc | | PgUp | PgDw | Ins | PtSc | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | Cut | | | | - * ,------|------|------| |------+--------+------. - * | | | | | | | | - * | | |------| |------| Left | Right| - * | | | | | | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[QWERTY] = KEYMAP( // layer 2 : QWERTY - // left hand - KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINUS, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_TRNS, - KC_ESCAPE, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_TAB, - KC_LCTRL, KC_LGUI,KC_LALT, KC_RALT, KC_ESCAPE, - KC_TRNS, LCTL(KC_X), - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_EQUAL , KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, - KC_TRNS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_TRNS, - KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_QUOTE, - KC_ESCAPE,KC_N, KC_M, KC_TRNS,KC_DOT , KC_SLASH, KC_NONUS_BSLASH, - KC_PGUP , KC_PGDOWN,KC_INSERT ,KC_PSCREEN, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS,KC_LEFT, KC_RIGHT - ), -/* Keymap 2: F keys + macros - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | Calc | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | |Public|Static|string|int |return| | | |//TODO| | | | | F12 | + * | Tab |Public|Static|string|int |return| | | |//TODO| | | | | F12 | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | |Privat|Const |var |float |null |------| |------|new | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * |--------+------+------+------+------+------| \ | | ~ |------+------+------+------+------+--------| * | | | |void |bool |break;| | | |(); | | | | | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | Alt | | | | | | | | | | + * | | WIN | Alt | | | | PgUp | PgDw | Ins | PtSc | | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. * | | Cut | | | | * ,------|------|------| |------+------+------. * | | | | | | | | - * | | |------| |------| | | + * | | |------| |------| Left | Right| * | | | | | | | | * `--------------------' `--------------------' */ // FKEYS + MACROS [FKEYS] = KEYMAP( // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,M(MACRO_PUBLIC),M(MACRO_STATIC), M(MACRO_STRING),M(MACRO_INT),M(MACRO_RETURN),KC_TRNS, + KC_ESCAPE,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_GRAVE, + KC_TAB,M(MACRO_PUBLIC),M(MACRO_STATIC), M(MACRO_STRING),M(MACRO_INT),M(MACRO_RETURN),KC_TRNS, KC_TRNS,M(MACRO_PRIVATE),M(MACRO_CONST), M(MACRO_VAR),M(MACRO_FLOAT),M(MACRO_NULL), - KC_TRNS,KC_TRNS,KC_TRNS,M(MACRO_VOID),M(MACRO_BOOL),M(MACRO_BREAK),KC_TRNS, - KC_TRNS,KC_LALT,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,M(MACRO_VOID),M(MACRO_BOOL),M(MACRO_BREAK),KC_BSLASH, + KC_TRNS,KC_LGUI,KC_LALT,KC_TRNS,KC_TRNS, + KC_TRNS,LCTL(KC_X), KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, // right hand KC_CALCULATOR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_TRNS, M(MACRO_TODO), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F12, M(MACRO_NEW), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, M(MACRO_PARENTHESE), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TILD, M(MACRO_PARENTHESE), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_PGUP,KC_PGDOWN, KC_INSERT, KC_PSCREEN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS + KC_TRNS, KC_LEFT, KC_RIGHT ), }; const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(QWERTY) // FN1 - Momentary Layer 1 + [1] = ACTION_LAYER_TAP_TOGGLE(FKEYS) // FN1 - Momentary Layer 1 }; const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) @@ -253,12 +210,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) }; // Runs just one time when the keyboard initializes. -void * matrix_init_user(void) { +void matrix_init_user(void) { }; // Runs constantly in the background, in a loop. -void * matrix_scan_user(void) { +void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); diff --git a/keyboard/ergodox_ez/keymaps/csharp_dev/readme.md b/keyboard/ergodox_ez/keymaps/csharp_dev/readme.md index 3ceb77eca..96af077ad 100644 --- a/keyboard/ergodox_ez/keymaps/csharp_dev/readme.md +++ b/keyboard/ergodox_ez/keymaps/csharp_dev/readme.md @@ -4,6 +4,8 @@ * Feb 12, 2016 (V1): * First version commit +* Mar 20, 2016 (V2): + * Removed "Classic QWERTY" layer, inverted GUI and SHIFT on Hold for Space and Enter ## About This layout was conceived in an attempt to optimise keyboard layout for developers (C# more specifically, but it can work with most of other languages), and limit the keys required to perform the most frequent actions. @@ -38,7 +40,6 @@ Still there are many way to improve or iterate on this: * Make it language agnostic * Check and compile language's keyboard's heatmaps to statistically define keys priority (e.g. https://dzone.com/articles/most-pressed-keys-various ) * QWERTY is still not the most efficient typing layout, I would like to create a Dvorak based similar layout in a near futur -* Layout 1 is mainly here for safety, most of its unique keys could be transfered to Layout 2 and it could then be removed ## Issues One of the issues encountered while creating this layout was that I did not find a way to have a key to send a modifier on hold, and a key combination while pressed (e.g. I can't set a Key to do Save (Ctrl + S) when pressed and Shift modifier when hold ) diff --git a/keyboard/ergodox_ez/keymaps/dave/dave.hex b/keyboard/ergodox_ez/keymaps/dave/dave.hex index 767a9ca11..363e7234d 100644 Binary files a/keyboard/ergodox_ez/keymaps/dave/dave.hex and b/keyboard/ergodox_ez/keymaps/dave/dave.hex differ diff --git a/keyboard/ergodox_ez/keymaps/dave/keymap.c b/keyboard/ergodox_ez/keymaps/dave/keymap.c index a0c74ad80..3ac2842fb 100644 --- a/keyboard/ergodox_ez/keymaps/dave/keymap.c +++ b/keyboard/ergodox_ez/keymaps/dave/keymap.c @@ -154,12 +154,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) }; // Runs just one time when the keyboard initializes. -void * matrix_init_user(void) { - return NULL; +void matrix_init_user(void) { + }; // Runs constantly in the background, in a loop. -void * matrix_scan_user(void) { +void matrix_scan_user(void) { /* leds is a static array holding the current brightness of each of the * three keyboard LEDs. It's 4 long simply to avoid the ugliness of +1s and * -1s in the code below, and because wasting a byte really doesn't matter @@ -191,5 +191,5 @@ void * matrix_scan_user(void) { } } - return NULL; + }; diff --git a/keyboard/ergodox_ez/keymaps/default/default.hex b/keyboard/ergodox_ez/keymaps/default/default.hex index 14f5b7c79..bd5cd4341 100644 Binary files a/keyboard/ergodox_ez/keymaps/default/default.hex and b/keyboard/ergodox_ez/keymaps/default/default.hex differ diff --git a/keyboard/ergodox_ez/keymaps/default/keymap.c b/keyboard/ergodox_ez/keymaps/default/keymap.c index f252bf71d..1c3bb5171 100644 --- a/keyboard/ergodox_ez/keymaps/default/keymap.c +++ b/keyboard/ergodox_ez/keymaps/default/keymap.c @@ -155,12 +155,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) }; // Runs just one time when the keyboard initializes. -void * matrix_init_user(void) { +void matrix_init_user(void) { }; // Runs constantly in the background, in a loop. -void * matrix_scan_user(void) { +void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); diff --git a/keyboard/ergodox_ez/keymaps/default_osx/default_osx.hex b/keyboard/ergodox_ez/keymaps/default_osx/default_osx.hex index 3a1cc4f79..02ee97554 100644 Binary files a/keyboard/ergodox_ez/keymaps/default_osx/default_osx.hex and b/keyboard/ergodox_ez/keymaps/default_osx/default_osx.hex differ diff --git a/keyboard/ergodox_ez/keymaps/default_osx/keymap.c b/keyboard/ergodox_ez/keymaps/default_osx/keymap.c index 9d7364d37..81b49ceff 100644 --- a/keyboard/ergodox_ez/keymaps/default_osx/keymap.c +++ b/keyboard/ergodox_ez/keymaps/default_osx/keymap.c @@ -158,12 +158,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) }; // Runs just one time when the keyboard initializes. -void * matrix_init_user(void) { +void matrix_init_user(void) { }; // Runs constantly in the background, in a loop. -void * matrix_scan_user(void) { +void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); diff --git a/keyboard/ergodox_ez/keymaps/dragon788/dragon788.hex b/keyboard/ergodox_ez/keymaps/dragon788/dragon788.hex index 36adaad1d..1ca511fe1 100644 Binary files a/keyboard/ergodox_ez/keymaps/dragon788/dragon788.hex and b/keyboard/ergodox_ez/keymaps/dragon788/dragon788.hex differ diff --git a/keyboard/ergodox_ez/keymaps/dragon788/keymap.c b/keyboard/ergodox_ez/keymaps/dragon788/keymap.c index d18ce73bf..3aec8c6cf 100644 --- a/keyboard/ergodox_ez/keymaps/dragon788/keymap.c +++ b/keyboard/ergodox_ez/keymaps/dragon788/keymap.c @@ -200,12 +200,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) }; // Runs just one time when the keyboard initializes. -void * matrix_init_user(void) { +void matrix_init_user(void) { }; // Runs constantly in the background, in a loop. -void * matrix_scan_user(void) { +void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); diff --git a/keyboard/ergodox_ez/keymaps/dvorak/dvorak.hex b/keyboard/ergodox_ez/keymaps/dvorak/dvorak.hex index 8e1ac3f21..2568c571e 100644 Binary files a/keyboard/ergodox_ez/keymaps/dvorak/dvorak.hex and b/keyboard/ergodox_ez/keymaps/dvorak/dvorak.hex differ diff --git a/keyboard/ergodox_ez/keymaps/dvorak/keymap.c b/keyboard/ergodox_ez/keymaps/dvorak/keymap.c index 53934ea34..22947327d 100644 --- a/keyboard/ergodox_ez/keymaps/dvorak/keymap.c +++ b/keyboard/ergodox_ez/keymaps/dvorak/keymap.c @@ -155,12 +155,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) }; // Runs just one time when the keyboard initializes. -void * matrix_init_user(void) { +void matrix_init_user(void) { }; // Runs constantly in the background, in a loop. -void * matrix_scan_user(void) { +void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); diff --git a/keyboard/ergodox_ez/keymaps/emacs_osx_dk/emacs_osx_dk.hex b/keyboard/ergodox_ez/keymaps/emacs_osx_dk/emacs_osx_dk.hex index 542a4662b..f05b3cc19 100644 Binary files a/keyboard/ergodox_ez/keymaps/emacs_osx_dk/emacs_osx_dk.hex and b/keyboard/ergodox_ez/keymaps/emacs_osx_dk/emacs_osx_dk.hex differ diff --git a/keyboard/ergodox_ez/keymaps/emacs_osx_dk/keymap.c b/keyboard/ergodox_ez/keymaps/emacs_osx_dk/keymap.c index bdac229e5..1d8e66a08 100644 --- a/keyboard/ergodox_ez/keymaps/emacs_osx_dk/keymap.c +++ b/keyboard/ergodox_ez/keymaps/emacs_osx_dk/keymap.c @@ -155,12 +155,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) }; // Runs just one time when the keyboard initializes. -void * matrix_init_user(void) { +void matrix_init_user(void) { }; // Runs constantly in the background, in a loop. -void * matrix_scan_user(void) { +void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); diff --git a/keyboard/ergodox_ez/keymaps/erez_experimental/erez_experimental.hex b/keyboard/ergodox_ez/keymaps/erez_experimental/erez_experimental.hex index 928c0ecc3..aa0884565 100644 Binary files a/keyboard/ergodox_ez/keymaps/erez_experimental/erez_experimental.hex and b/keyboard/ergodox_ez/keymaps/erez_experimental/erez_experimental.hex differ diff --git a/keyboard/ergodox_ez/keymaps/erez_experimental/keymap.c b/keyboard/ergodox_ez/keymaps/erez_experimental/keymap.c index 20c95f1ee..24ff1c688 100644 --- a/keyboard/ergodox_ez/keymaps/erez_experimental/keymap.c +++ b/keyboard/ergodox_ez/keymaps/erez_experimental/keymap.c @@ -156,12 +156,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) }; // Runs just one time when the keyboard initializes. -void * matrix_init_user(void) { +void matrix_init_user(void) { }; // Runs constantly in the background, in a loop. -void * matrix_scan_user(void) { +void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); diff --git a/keyboard/ergodox_ez/keymaps/german-kinergo/german-kinergo.hex b/keyboard/ergodox_ez/keymaps/german-kinergo/german-kinergo.hex index 574e81066..03df47596 100644 Binary files a/keyboard/ergodox_ez/keymaps/german-kinergo/german-kinergo.hex and b/keyboard/ergodox_ez/keymaps/german-kinergo/german-kinergo.hex differ diff --git a/keyboard/ergodox_ez/keymaps/german-kinergo/keymap.c b/keyboard/ergodox_ez/keymaps/german-kinergo/keymap.c index 751049ac5..572e03a1d 100644 --- a/keyboard/ergodox_ez/keymaps/german-kinergo/keymap.c +++ b/keyboard/ergodox_ez/keymaps/german-kinergo/keymap.c @@ -182,12 +182,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) }; // Runs just one time when the keyboard initializes. -void * matrix_init_user(void) { +void matrix_init_user(void) { }; // Runs constantly in the background, in a loop. -void * matrix_scan_user(void) { +void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); diff --git a/keyboard/ergodox_ez/keymaps/german/german.hex b/keyboard/ergodox_ez/keymaps/german/german.hex index a2f30d7cb..ce54b5476 100644 Binary files a/keyboard/ergodox_ez/keymaps/german/german.hex and b/keyboard/ergodox_ez/keymaps/german/german.hex differ diff --git a/keyboard/ergodox_ez/keymaps/german/keymap.c b/keyboard/ergodox_ez/keymaps/german/keymap.c index d91f1e937..7ec8d99cc 100644 --- a/keyboard/ergodox_ez/keymaps/german/keymap.c +++ b/keyboard/ergodox_ez/keymaps/german/keymap.c @@ -157,12 +157,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) }; // Runs just one time when the keyboard initializes. -void * matrix_init_user(void) { +void matrix_init_user(void) { }; // Runs constantly in the background, in a loop. -void * matrix_scan_user(void) { +void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); diff --git a/keyboard/ergodox_ez/keymaps/j3rn/j3rn.hex b/keyboard/ergodox_ez/keymaps/j3rn/j3rn.hex index 61af86e72..40fcc2ba0 100644 Binary files a/keyboard/ergodox_ez/keymaps/j3rn/j3rn.hex and b/keyboard/ergodox_ez/keymaps/j3rn/j3rn.hex differ diff --git a/keyboard/ergodox_ez/keymaps/j3rn/keymap.c b/keyboard/ergodox_ez/keymaps/j3rn/keymap.c index ddc64e55e..b5463cb72 100644 --- a/keyboard/ergodox_ez/keymaps/j3rn/keymap.c +++ b/keyboard/ergodox_ez/keymaps/j3rn/keymap.c @@ -157,12 +157,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) }; // Runs just one time when the keyboard initializes. -void * matrix_init_user(void) { +void matrix_init_user(void) { }; // Runs constantly in the background, in a loop. -void * matrix_scan_user(void) { +void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); diff --git a/keyboard/ergodox_ez/keymaps/jack/jack.hex b/keyboard/ergodox_ez/keymaps/jack/jack.hex index 5651572ab..cfccb8726 100644 Binary files a/keyboard/ergodox_ez/keymaps/jack/jack.hex and b/keyboard/ergodox_ez/keymaps/jack/jack.hex differ diff --git a/keyboard/ergodox_ez/keymaps/jack/keymap.c b/keyboard/ergodox_ez/keymaps/jack/keymap.c index f8f73a1af..80bf9d535 100644 --- a/keyboard/ergodox_ez/keymaps/jack/keymap.c +++ b/keyboard/ergodox_ez/keymaps/jack/keymap.c @@ -89,12 +89,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) }; // Runs just one time when the keyboard initializes. -void * matrix_init_user(void) { +void matrix_init_user(void) { }; // Runs constantly in the background, in a loop. -void * matrix_scan_user(void) { +void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); diff --git a/keyboard/ergodox_ez/keymaps/jacobono/jacobono.hex b/keyboard/ergodox_ez/keymaps/jacobono/jacobono.hex index cf68f854f..f780f648f 100644 Binary files a/keyboard/ergodox_ez/keymaps/jacobono/jacobono.hex and b/keyboard/ergodox_ez/keymaps/jacobono/jacobono.hex differ diff --git a/keyboard/ergodox_ez/keymaps/jacobono/keymap.c b/keyboard/ergodox_ez/keymaps/jacobono/keymap.c index ed8dfc731..6b19800af 100644 --- a/keyboard/ergodox_ez/keymaps/jacobono/keymap.c +++ b/keyboard/ergodox_ez/keymaps/jacobono/keymap.c @@ -244,12 +244,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) }; // Runs just one time when the keyboard initializes. -void * matrix_init_user(void) { +void matrix_init_user(void) { }; // Runs constantly in the background, in a loop. -void * matrix_scan_user(void) { +void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); diff --git a/keyboard/ergodox_ez/keymaps/jgarr/jgarr.hex b/keyboard/ergodox_ez/keymaps/jgarr/jgarr.hex index f87413b56..38be3e468 100644 Binary files a/keyboard/ergodox_ez/keymaps/jgarr/jgarr.hex and b/keyboard/ergodox_ez/keymaps/jgarr/jgarr.hex differ diff --git a/keyboard/ergodox_ez/keymaps/jgarr/keymap.c b/keyboard/ergodox_ez/keymaps/jgarr/keymap.c index fbdc25109..a3ad2040f 100644 --- a/keyboard/ergodox_ez/keymaps/jgarr/keymap.c +++ b/keyboard/ergodox_ez/keymaps/jgarr/keymap.c @@ -155,12 +155,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) }; // Runs just one time when the keyboard initializes. -void * matrix_init_user(void) { +void matrix_init_user(void) { }; // Runs constantly in the background, in a loop. -void * matrix_scan_user(void) { +void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); diff --git a/keyboard/ergodox_ez/keymaps/kastyle/kastyle.hex b/keyboard/ergodox_ez/keymaps/kastyle/kastyle.hex index 8c5409ac6..684e65404 100644 Binary files a/keyboard/ergodox_ez/keymaps/kastyle/kastyle.hex and b/keyboard/ergodox_ez/keymaps/kastyle/kastyle.hex differ diff --git a/keyboard/ergodox_ez/keymaps/kastyle/keymap.c b/keyboard/ergodox_ez/keymaps/kastyle/keymap.c index ecf1be872..3982e0a19 100644 --- a/keyboard/ergodox_ez/keymaps/kastyle/keymap.c +++ b/keyboard/ergodox_ez/keymaps/kastyle/keymap.c @@ -155,12 +155,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) }; // Runs just one time when the keyboard initializes. -void * matrix_init_user(void) { +void matrix_init_user(void) { }; // Runs constantly in the background, in a loop. -void * matrix_scan_user(void) { +void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); diff --git a/keyboard/ergodox_ez/keymaps/kines-ish/keymap.c b/keyboard/ergodox_ez/keymaps/kines-ish/keymap.c index 20cb53241..5063c99f2 100644 --- a/keyboard/ergodox_ez/keymaps/kines-ish/keymap.c +++ b/keyboard/ergodox_ez/keymaps/kines-ish/keymap.c @@ -155,12 +155,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) }; // Runs just one time when the keyboard initializes. -void * matrix_init_user(void) { +void matrix_init_user(void) { }; // Runs constantly in the background, in a loop. -void * matrix_scan_user(void) { +void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); diff --git a/keyboard/ergodox_ez/keymaps/kines-ish/kines-ish.hex b/keyboard/ergodox_ez/keymaps/kines-ish/kines-ish.hex index eea5130bd..c04a78512 100644 Binary files a/keyboard/ergodox_ez/keymaps/kines-ish/kines-ish.hex and b/keyboard/ergodox_ez/keymaps/kines-ish/kines-ish.hex differ diff --git a/keyboard/ergodox_ez/keymaps/mpiechotka/keymap.c b/keyboard/ergodox_ez/keymaps/mpiechotka/keymap.c index 178c29066..0c4f85a3d 100644 --- a/keyboard/ergodox_ez/keymaps/mpiechotka/keymap.c +++ b/keyboard/ergodox_ez/keymaps/mpiechotka/keymap.c @@ -29,7 +29,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Del | Q | W | F | P | G | L1 | | L1 | J | L | U | Y | ; | \ | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | Esc | A | R | S | T | D |------| |------| H | N | E | I | O | ' | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * |--------+------+------+------+------+------| = | | - |------+------+------+------+------+--------| * | LShift |Z/Ctrl| X | C | V | B | | | | K | M | , | . |//Ctrl| RShift | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | @@ -50,7 +50,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, KC_DELT, KC_Q, KC_W, KC_F, KC_P, KC_G, TG(SYMB), KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_EQL, LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT, KC_RGHT, KC_LALT, F(LWIN), KC_HOME, @@ -59,7 +59,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, TG(SYMB), KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, - MEH_T(KC_NO),KC_K, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + KC_MINS, KC_K, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, LT(SYMB,KC_NO), KC_LALT, KC_RALT, KC_PGUP, @@ -73,7 +73,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Del | Q | W | F | P | G | L1 | | L1 | J | L | U | Y | ; | \ | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | Esc | A | R | S | T | D |------| |------| H | N | E | I | O | ' | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * |--------+------+------+------+------+------| = | | - |------+------+------+------+------+--------| * | LShift |Z/Ctrl| X | C | V | B | | | | K | M | , | . |//Ctrl| RShift | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | @@ -94,7 +94,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, KC_DELT, CM_Q, CM_W, CM_F, CM_P, CM_G, TG(SYMB), KC_ESC, CM_A, CM_R, CM_S, CM_T, CM_D, - KC_LSFT, CM_Z, CM_X, CM_C, CM_V, CM_B, ALL_T(KC_NO), + KC_LSFT, CM_Z, CM_X, CM_C, CM_V, CM_B, KC_EQL, LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT, KC_RGHT, KC_LALT, F(LWIN), KC_HOME, @@ -103,7 +103,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, TG(SYMB), CM_J, CM_L, CM_U, CM_Y, KC_P, /*CM_SCLN*/ KC_BSLS, CM_H, CM_N, CM_E, CM_I, CM_O, KC_QUOT, - MEH_T(KC_NO),CM_K, CM_M, CM_COMM,CM_DOT, CTL_T(CM_SLSH), KC_RSFT, + KC_MINS, CM_K, CM_M, CM_COMM,CM_DOT, CTL_T(CM_SLSH), KC_RSFT, KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, LT(SYMB,KC_NO), KC_LALT, KC_RALT, KC_PGUP, @@ -222,33 +222,38 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) } else { unregister_code(KC_LGUI); } + break; case PC1: if (!record->event.pressed) { - return MACRO(T(SLCK), T(SLCK), T(1), T(ENT), END); + return MACRO(T(SLCK), W(50), T(SLCK), W(50), T(1), W(50), T(ENT), END); } + break; case PC2: if (!record->event.pressed) { - return MACRO(T(SLCK), T(SLCK), T(2), T(ENT), END); + return MACRO(T(SLCK), W(50), T(SLCK), W(50), T(2), W(50), T(ENT), END); } + break; case PC3: if (!record->event.pressed) { - return MACRO(T(SLCK), T(SLCK), T(3), T(ENT), END); + return MACRO(T(SLCK), W(50), T(SLCK), W(50), T(3), W(50), T(ENT), END); } + break; case PC4: if (!record->event.pressed) { - return MACRO(T(SLCK), T(SLCK), T(4), T(ENT), END); + return MACRO(T(SLCK), W(50), T(SLCK), W(50), T(4), W(50), T(ENT), END); } + break; } return MACRO_NONE; } // Runs just one time when the keyboard initializes. -void * matrix_init_user(void) { - return NULL; +void matrix_init_user(void) { + }; // Runs constantly in the background, in a loop. -void * matrix_scan_user(void) { +void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); diff --git a/keyboard/ergodox_ez/keymaps/mpiechotka/mpiechotka.hex b/keyboard/ergodox_ez/keymaps/mpiechotka/mpiechotka.hex index 4bb17147f..287cfcd6e 100644 Binary files a/keyboard/ergodox_ez/keymaps/mpiechotka/mpiechotka.hex and b/keyboard/ergodox_ez/keymaps/mpiechotka/mpiechotka.hex differ diff --git a/keyboard/ergodox_ez/keymaps/ordinary/keymap.c b/keyboard/ergodox_ez/keymaps/ordinary/keymap.c new file mode 100644 index 000000000..3343c2296 --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/ordinary/keymap.c @@ -0,0 +1,190 @@ +#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 + +/* + * Ordinary Ergodox EZ keyboard layout, v1 + * modifications from default by Nicholas Keene ergodoxez@nicholaskeene.com + * Details: http://nicholas.rinard.us/2016/03/ergodox-ez-layout.html + */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | Grv | 1 | 2 | 3 | 4 | 5 | ESC | | = | 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | \ | | / | Y | U | I | O | P | ~L2 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | ~L1 | A | S | D | F | G |------| |------| H | J | K | L |; / L2| ~L1 | + * |--------+------+------+------+------+------| [ | | ] |------+------+------+------+------+--------| + * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |'/Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |LCtrl | Meh |Hyper | LAlt | LGui | | RGui | RAlt | Hyper| Meh |RCtrl | + * `----------------------------------' `----------------------------------' + * ,---------------. ,---------------. + * | Home | End | | Left | Right | + * ,------|--------|------| |------+--------+------. + * | | | PgUp | | Up | | | + * |Backsp| Del |------| |------| Enter | Space| + * | | | PgDn | | Down | | |; + * `----------------------' `----------------------' + */ +// 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_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_BSLS, + KC_FN1, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT,CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_LBRC, + KC_LCTL,MEH_T(KC_NO),ALL_T(KC_NO),KC_LALT,KC_LGUI, + KC_HOME, KC_END, + KC_PGUP, + KC_BSPC, KC_DEL, KC_PGDN, + // right hand + KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_SLSH, KC_Y, KC_U, KC_I, KC_O, KC_P, LT(MDIA, KC_SLSH), + KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_FN1, + KC_RBRC, KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_QUOT),KC_RSFT, + KC_RGUI, KC_RALT, ALL_T(KC_NO),MEH_T(KC_NO), KC_RCTL, + KC_LEFT, KC_RGHT, + KC_UP, + KC_DOWN, 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 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | CAPS | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | CAPS | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | . | 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_CAPS,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_CAPS, + 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 + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | Sleep| | | | | |MyComp| Mail | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp |ScrlUp| |ScrlUp| |ScrlUp| | | | | Mute | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | |MsDown|ScrlDn| |ScrlDn| |ScrlDn| | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | Stop |Refrsh| | Prev | Next | + * ,------|------|------| |------+------+------. + * |Brwser|Brwser| Home | |VolUp | | | + * |Back | Fwd |------| |------| Stop | Play | + * | | |Search| |VolDn | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SLEP, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_WH_U, KC_TRNS, KC_WH_U, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_D, KC_TRNS, KC_TRNS, KC_WH_D, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_WH_D, + KC_WSTP, KC_WREF, + KC_WHOM, + KC_WBAK, KC_TRNS, KC_WSCH, + // right hand + KC_WSCH, KC_TRNS, KC_TRNS, KC_TRNS, KC_MYCM, KC_MAIL, KC_TRNS, + KC_WH_U, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_WH_D, 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_MNXT, + KC_VOLU, + KC_VOLD, KC_MSTP, KC_MPLY +), +}; + +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/ordinary/ordinary.hex b/keyboard/ergodox_ez/keymaps/ordinary/ordinary.hex new file mode 100644 index 000000000..5a847aa6e Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/ordinary/ordinary.hex differ diff --git a/keyboard/ergodox_ez/keymaps/ordinary/ordinary.png b/keyboard/ergodox_ez/keymaps/ordinary/ordinary.png new file mode 100644 index 000000000..c83f972cf Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/ordinary/ordinary.png differ diff --git a/keyboard/ergodox_ez/keymaps/ordinary/readme.md b/keyboard/ergodox_ez/keymaps/ordinary/readme.md new file mode 100644 index 000000000..033e8ef4d --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/ordinary/readme.md @@ -0,0 +1,5 @@ +# The Ordinary Layout. for users of common keyboards + +You can read more about the reasoning behind this layout over at [Nicholas's blog](http://nicholas.rinard.us/2016/03/ergodox-ez-layout.html). The idea is to make a layout that's as familiar as possible for users of "regular" keyboards. + +![Ordinary layout](ordinary.png) diff --git a/keyboard/ergodox_ez/keymaps/osx_de/keymap.c b/keyboard/ergodox_ez/keymaps/osx_de/keymap.c index 0298cb702..b31d0edcd 100644 --- a/keyboard/ergodox_ez/keymaps/osx_de/keymap.c +++ b/keyboard/ergodox_ez/keymaps/osx_de/keymap.c @@ -390,12 +390,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) }; // Runs just one time when the keyboard initializes. -void * matrix_init_user(void) { +void matrix_init_user(void) { }; // Runs constantly in the background, in a loop. -void * matrix_scan_user(void) { +void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); diff --git a/keyboard/ergodox_ez/keymaps/osx_de/osx_de.hex b/keyboard/ergodox_ez/keymaps/osx_de/osx_de.hex index 2c83055b0..fde7201c1 100644 Binary files a/keyboard/ergodox_ez/keymaps/osx_de/osx_de.hex and b/keyboard/ergodox_ez/keymaps/osx_de/osx_de.hex differ diff --git a/keyboard/ergodox_ez/keymaps/osx_de_adnw_koy/keymap.c b/keyboard/ergodox_ez/keymaps/osx_de_adnw_koy/keymap.c index fb8635118..70ac8f01f 100644 --- a/keyboard/ergodox_ez/keymaps/osx_de_adnw_koy/keymap.c +++ b/keyboard/ergodox_ez/keymaps/osx_de_adnw_koy/keymap.c @@ -227,12 +227,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) }; // Runs just one time when the keyboard initializes. -void * matrix_init_user(void) { +void matrix_init_user(void) { }; // Runs constantly in the background, in a loop. -void * matrix_scan_user(void) { +void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); diff --git a/keyboard/ergodox_ez/keymaps/osx_de_adnw_koy/osx_de_adnw_koy.hex b/keyboard/ergodox_ez/keymaps/osx_de_adnw_koy/osx_de_adnw_koy.hex index 403076335..56448283d 100644 Binary files a/keyboard/ergodox_ez/keymaps/osx_de_adnw_koy/osx_de_adnw_koy.hex and b/keyboard/ergodox_ez/keymaps/osx_de_adnw_koy/osx_de_adnw_koy.hex differ diff --git a/keyboard/ergodox_ez/keymaps/osx_fr/keymap.c b/keyboard/ergodox_ez/keymaps/osx_fr/keymap.c index 4b59d2eb2..f1806ffff 100644 --- a/keyboard/ergodox_ez/keymaps/osx_fr/keymap.c +++ b/keyboard/ergodox_ez/keymaps/osx_fr/keymap.c @@ -158,12 +158,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) }; // Runs just one time when the keyboard initializes. -void * matrix_init_user(void) { +void matrix_init_user(void) { }; // Runs constantly in the background, in a loop. -void * matrix_scan_user(void) { +void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); diff --git a/keyboard/ergodox_ez/keymaps/osx_fr/osx_fr.hex b/keyboard/ergodox_ez/keymaps/osx_fr/osx_fr.hex index 8915d9caa..abe089a9f 100644 Binary files a/keyboard/ergodox_ez/keymaps/osx_fr/osx_fr.hex and b/keyboard/ergodox_ez/keymaps/osx_fr/osx_fr.hex differ diff --git a/keyboard/ergodox_ez/keymaps/osx_kinesis_pnut/keymap.c b/keyboard/ergodox_ez/keymaps/osx_kinesis_pnut/keymap.c index f71ca28ce..1032be549 100644 --- a/keyboard/ergodox_ez/keymaps/osx_kinesis_pnut/keymap.c +++ b/keyboard/ergodox_ez/keymaps/osx_kinesis_pnut/keymap.c @@ -162,12 +162,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) }; // Runs just one time when the keyboard initializes. -void * matrix_init_user(void) { +void matrix_init_user(void) { }; // Runs constantly in the background, in a loop. -void * matrix_scan_user(void) { +void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); diff --git a/keyboard/ergodox_ez/keymaps/plover/keymap.c b/keyboard/ergodox_ez/keymaps/plover/keymap.c index bd356c47c..a991e6082 100644 --- a/keyboard/ergodox_ez/keymaps/plover/keymap.c +++ b/keyboard/ergodox_ez/keymaps/plover/keymap.c @@ -199,12 +199,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) }; // Runs just one time when the keyboard initializes. -void * matrix_init_user(void) { +void matrix_init_user(void) { }; // Runs constantly in the background, in a loop. -void * matrix_scan_user(void) { +void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); diff --git a/keyboard/ergodox_ez/keymaps/plover/plover.hex b/keyboard/ergodox_ez/keymaps/plover/plover.hex index 53b0747d7..d63cbb8fa 100644 Binary files a/keyboard/ergodox_ez/keymaps/plover/plover.hex and b/keyboard/ergodox_ez/keymaps/plover/plover.hex differ diff --git a/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/keymap.c b/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/keymap.c new file mode 100644 index 000000000..9971b834c --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/keymap.c @@ -0,0 +1,134 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 +#define SYMB 1 +#define PLVR 2 +#define ARRW 3 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [BASE] = KEYMAP( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F14, + KC_TAB, KC_Q, KC_W, KC_D, KC_F, KC_K, TG(PLVR), + CTL_T(KC_ESC), KC_A, KC_S, KC_E, KC_T, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, + KC_F1, KC_F2, KC_F3, KC_LALT, KC_LGUI, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLD, KC_MUTE, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLU, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_BSPC, CTL_T(KC_ESC), KC_FN1, + // + /*-*/ KC_F15, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, + /*-*/ KC_BSLS, KC_J, KC_U, KC_R, KC_L, KC_SCLN, KC_MINS, + /*-*/ /*-*/ KC_Y, KC_N, KC_I, KC_O, KC_H, KC_ENT, + /*-*/ KC_RBRC, KC_P, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + /*-*/ /*-*/ /*-*/ KC_RGUI, KC_RALT, KC_F4, KC_F5, KC_F6, + KC_MPLY, KC_MNXT, + KC_MPRV, + KC_FN3, KC_QUOT, KC_SPC + ), + [SYMB] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, + KC_TRNS, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, + 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_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, + // + /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + /*-*/ KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, + /*-*/ /*-*/ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, 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_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS + ), + [PLVR] = KEYMAP( + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, + KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, + 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_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ KC_C, KC_V, KC_NO, + // + /*-*/ KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + /*-*/ KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NO, + /*-*/ /*-*/ 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_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_NO, KC_N, KC_M + ), + [ARRW] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, 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_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_TRNS, + /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, + /*-*/ /*-*/ KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, 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_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS + ), +}; + +const uint16_t PROGMEM fn_actions[] = { + [SYMB] = ACTION_LAYER_TAP_TOGGLE(SYMB), // FN1 - Momentary Symbols Layer + [PLVR] = ACTION_LAYER_TAP_TOGGLE(PLVR), // FN2 - Momentary Plover Layer + [ARRW] = ACTION_LAYER_TAP_TOGGLE(ARRW), // FN3 - Momentary Arrows Layer +}; + +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) { + case SYMB: + ergodox_right_led_1_on(); + break; + case PLVR: + ergodox_right_led_2_on(); + break; + case ARRW: + ergodox_right_led_3_on(); + break; + default: + break; + } +}; diff --git a/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/readme.md b/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/readme.md new file mode 100644 index 000000000..6f182d0d8 --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/readme.md @@ -0,0 +1,43 @@ +# Roman's Layout + +There are four layers: + +- **BASE** is [Norman layout](https://normanlayout.info/). +- **SYMB** for numbers and symbols. +- **PLVR** is optimized for [Plover](http://www.openstenoproject.org). +- **ARRW** for navigation. + +[![keyboard-layout](romanzolotarev-norman-plover-osx.png)](http://www.keyboard-layout-editor.com/#/gists/8ebcb701ecb763944417) + +## Switching + +- Tap `SYMB` to toggle **SYMB**. +- Tap `ARRW` to toggle **ARRW**. +- Hold `SYMB` (or `ARRW`) to activate **SYMB** (or **ARRW**) while holding. +- Tap `PLVR` to toggle **PLVR**. + +## LEDs + +- Red: SYMB is on. +- Green: PLVR is on. +- Blue: ARRW is on. + +## Functional Keys + +- Tap `F1` to mute microphone via [Shush](http://mizage.com/shush/). +- Tap `F2` to copy screenshot to the clipboard. +- Hold `SHIFT` and tap `F2` to save screenshot as a file. +- Tap `F3`, `F4`, `F5`, `F6` to resize a window via [Divvy](http://mizage.com/divvy/). +- Tap `F14`, `F15` to adjust display brightness. + +## CTRL/ESC + +Both of those keys are frequently used in Vim. + +- Tap `CTRL/ESC` to send `ESC`. +- Hold `CTRL/ESC` to use as `CTRL`. + +## Activate N-rollover + +- While in **BASE** hold left `SHIFT` and right `SHIRT` and then tap `N`. +- Then you can activate **PLVR** and use ErgoDox EZ for steno. diff --git a/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/romanzolotarev-norman-plover-osx.hex b/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/romanzolotarev-norman-plover-osx.hex new file mode 100644 index 000000000..b5eded6e6 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/romanzolotarev-norman-plover-osx.hex differ diff --git a/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/romanzolotarev-norman-plover-osx.png b/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/romanzolotarev-norman-plover-osx.png new file mode 100644 index 000000000..10b0752be Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/romanzolotarev-norman-plover-osx.png differ diff --git a/keyboard/ergodox_ez/keymaps/software_neo2/keymap.c b/keyboard/ergodox_ez/keymaps/software_neo2/keymap.c index 684ecf5e3..a734062f1 100644 --- a/keyboard/ergodox_ez/keymaps/software_neo2/keymap.c +++ b/keyboard/ergodox_ez/keymaps/software_neo2/keymap.c @@ -114,12 +114,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) }; // Runs just one time when the keyboard initializes. -void * matrix_init_user(void) { +void matrix_init_user(void) { }; // Runs constantly in the background, in a loop. -void * matrix_scan_user(void) { +void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); diff --git a/keyboard/ergodox_ez/keymaps/software_neo2/software_neo2.hex b/keyboard/ergodox_ez/keymaps/software_neo2/software_neo2.hex index 8cf730c8f..5ad6b23a7 100644 Binary files a/keyboard/ergodox_ez/keymaps/software_neo2/software_neo2.hex and b/keyboard/ergodox_ez/keymaps/software_neo2/software_neo2.hex differ diff --git a/keyboard/ergodox_ez/keymaps/tm2030/keymap.c b/keyboard/ergodox_ez/keymaps/tm2030/keymap.c index 92efd9b5e..ca8075226 100644 --- a/keyboard/ergodox_ez/keymaps/tm2030/keymap.c +++ b/keyboard/ergodox_ez/keymaps/tm2030/keymap.c @@ -215,12 +215,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) }; // Runs just one time when the keyboard initializes. -void * matrix_init_user(void) { - return NULL; +void matrix_init_user(void) { + }; // Runs constantly in the background, in a loop. -void * matrix_scan_user(void) { +void matrix_scan_user(void) { ergodox_board_led_off(); ergodox_right_led_1_off(); @@ -238,5 +238,5 @@ void * matrix_scan_user(void) { if (host_keyboard_leds() & (1< -void * matrix_init_user(void); -void * matrix_scan_user(void); +void matrix_init_user(void); +void matrix_scan_user(void); #endif diff --git a/keyboard/planck/CYGWIN_GUIDE.md b/keyboard/planck/CYGWIN_GUIDE.md new file mode 100755 index 000000000..ac13e745d --- /dev/null +++ b/keyboard/planck/CYGWIN_GUIDE.md @@ -0,0 +1,352 @@ +#Planck Advanced (but not too advanced) `cygwin` Users Guide +If you are a user of the [cygwin environment](https://cygwin.com) in Windows and want the freedom to use the latest tools available, then this is the guide for you. If compiling your own copy of the latest and greatest Gnu C Compiler makes you super happy, then this is the guide for you. If the command line make you smile, then this is the guide for you. + +This guide was written step by step as I went through the process on a `Windows 10` `x86_64` and a `Windows 7` `amd k10` based system. This should be generally applicable to to any `Windows` environment with `cygwin`. + +#####Do not skip steps. Do not move past a step until the previous step finishes successfully. + +Based on [avr-libc installation guide](http://www.nongnu.org/avr-libc/user-manual/install_tools.html) + +##Get the Required Packages +Download the `cygwin` setup ([x86_64](https://cygwin.com/setup-x86_64.exe)) and install the default system plus the following if they are not already selected: +- devel/git +- devel/gcc-core +- devel/gcc-g++ +- devel/flex +- devel/bison +- devel/make +- devel/texinfo +- devel/gettext-devel +- devel/automake +- devel/autoconfig +- devel/libtool +- text/gettext +- libs/libgcc1 +- interpreters/m4 +- web/wget +- archive/unzip + +The following sources will be required: +- [gmp](https://gmplib.org/) (6.1.0) +- [mpfr](http://www.mpfr.org/) (3.1.4) +- [mpc](http://www.multiprecision.org/) (1.0.3) +- [binutils](https://www.sourceware.org/binutils/) (2.26) +- [gcc](https://gcc.gnu.org/) (5.3.0) +- [avr-libc](http://www.nongnu.org/avr-libc/) (2.0.0) + +The `dfu-programmer` will be required to flash the new firmware +- [dfu-programmer](https://dfu-programmer.github.io/) (0.7.2) + +The set of commands below will create a directory (`~/local/avr`) for the sources you compile to be installed on the machine and a directory (`~/src`) for these source files to be stored. The commands then download the sources of the needed packages and unpack them. Note: the expand commands are different depending on if the packages are offered as a `bz2` or `gz` archive +``` +$ mkdir ~/local +$ mkdir ~/local/avr +$ mkdir ~/src +$ cd ~/src +$ wget https://gmplib.org/download/gmp/gmp-6.1.0.tar.bz2 +$ wget http://www.mpfr.org/mpfr-3.1.4/mpfr-3.1.4.tar.bz2 +$ wget ftp://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz +$ wget http://ftp.gnu.org/gnu/binutils/binutils-2.26.tar.gz +$ wget http://mirror0.babylon.network/gcc/releases/gcc-5.3.0/gcc-5.3.0.tar.gz +$ wget http://download.savannah.gnu.org/releases/avr-libc/avr-libc-2.0.0.tar.bz2 +$ tar -xjf gmp-6.1.0.tar.bz2 +$ tar -xjf mpfr-3.1.4.tar.bz2 +$ tar -zxf mpc-1.0.3.tar.gz +$ tar -zxf binutils-2.26.tar.gz +$ tar -zxf gcc-5.3.0.tar.gz +$ tar -xjf avr-libc-2.0.0.tar.bz2 +``` + +##Setup the Build Environment +These commands will set up the install directory and the `PATH` variable, which will allow you to access your installed packages. Note: if you close the `cygwin` terminal window, you will need to rerun these commands, they are not permanent. +``` +$ PREFIX=$HOME/local/avr +$ export PREFIX +$ PATH=/usr/local/bin:/usr/local/lib:/usr/local/include:/bin:/lib:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS +$ PATH=$PATH:$PREFIX/bin:$PREFIX/lib +$ export PATH +``` + +##The `gcc` Required Math Library Packages +The following packages are required to be complied and installed in order to compile `gcc`. They are not sufficiently available through the `cygwin` package system, so we have to make them ourselves. They must be complied in this order because each one depends on the previous. Verfiy that for each package, `make check` returns all passing and no fails. + +###Build and Install `gmp` +``` +$ cd ~/src/gmp-6.1.0 +$ ./configure --enable-static --disable-shared +$ make +$ make check +$ make install +``` + +###Build and Install `mpfr` +``` +$ cd ~/src/mpfr-3.1.4 +$ ./configure --with-gmp-build=../gmp-6.1.0 --enable-static --disable-shared +$ make +$ make check +$ make install +``` + +###Build and Install `mpc` +``` +$ cd ~/src/mpc-1.0.3 +$ ./configure --with-gmp=/usr/local --with-mpfr=/usr/local --enable-static --disable-shared +$ make +$ make check +$ make install +``` + +##OPTIONAL Part +You can build and install a brand new `gcc` or you can use the one supplied by `cygwin`. This will take about 4-5 hours to compile (It is a "native build", so it does the entire build **3 times**. This takes a long while). + +###Build and Install `gcc` for Your Machine +``` +$ cd ~/src/gcc-5.3.0 +$ mkdir obj-local +$ cd obj-local +$ ../configure --enable-languages=c,c++ --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local --enable-static --disable-shared +$ make +$ make install +``` +##End OPTIONAL Part + +###Build and Install `binutils` for Your Machine +``` +$ cd ~/src/binutils-2.26 +$ mkdir obj-local +$ cd obj-local +$ ../configure +$ make +$ make install +``` + +##Buliding `binutils`, `gcc`, and `avr-libc` for the AVR system +Now we can make the critical stuff for compiling our firmware: `binutils`, `gcc`, and `avr-libc` for the AVR architecture. These allow us to build and manipulate the firmware for the keyboard. + +###Build `binutils` for AVR +If you plan to build and install `avr-gdb` also, use the `gdb` install at the end of this guide as it also builds the `binutils` +``` +$ cd ~/src/binutils-2.26 +$ mkdir obj-avr +$ cd obj-avr +$ ../configure --prefix=$PREFIX --target=avr --disable-nls +$ make +$ make install +``` + +###Build `gcc` for AVR +``` +$ cd ~/src/gcc-5.3.0 +$ mkdir obj-avr +$ cd obj-avr +$ ../configure --prefix=$PREFIX --target=avr --enable-languages=c,c++ --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local --enable-static --disable-shared --disable-nls --disable-libssp --with-dwarf2 +$ make +$ make install +``` + +###Build `avr-libc` for AVR +For building the `avr-libc`, we have to specify the host build system. In my case it is `x86_64-unknown-cygwin`. You can look for build system type in the `gcc` configure notes for the proper `--build` specification to pass when you configure `avr-libc`. +``` +$ cd ~/src/avr-libc-2.0.0 +$ ./configure --prefix=$PREFIX --build=x86_64-unknown-cygwin --host=avr +$ make +$ make install +``` + +##Building 'dfu-programmer' for flashing the firmware via USB and installing the drivers +We can either build our own, or use the precomplied binaries. The precompiled binaries don't play well with `cygwin` so it is better to build them ourselves. The procedure for the precompiled binaries is included at the end of this guide. + +### Build and Install the `libusb` +The `dfu-programmer` requires `libusb` so that it can interact with the USB system. These repos must be bootstrapped in order to create an appropriate `./configure` and `Makefile` for your system. +``` +$ cd ~/src +$ git clone https://github.com/libusb/libusb.git +$ cd libusb +$ ./bootstrap.sh +$ ./configure +$ make +$ make install +``` + +### Build and Install the `dfu-programmer` +``` +$ cd ~/src +$ git clone https://github.com/dfu-programmer/dfu-programmer.git +$ cd dfu-programmer +$ ./bootstrap.sh +$ ./configure +$ make +$ make install +``` + +Verify the installation with: +``` +$ which dfu-programmer +/usr/local/bin/dfu-programmer + +$ dfu-programmer +dfu-programmer 0.7.2 +https://github.com/dfu-programmer/dfu-programmer +Type 'dfu-programmer --help' for a list of commands + 'dfu-programmer --targets' to list supported target devices +``` +If you are not getting the above result, you will not be able to flash the firmware! + +###Install the USB drivers +The drivers are included in the windows binary version of [`dfu-programmer` 0.7.2](http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip). +``` +$ cd ~/src +$ wget http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip +$ unzip dfu-programmer-win-0.7.2.zip -d dfu-programmer-win-0.7.2 +``` + +or + +The official drivers are found in [Atmel's `FLIP` installer](http://www.atmel.com/images/Flip%20Installer%20-%203.4.7.112.exe). Download and then install `FLIP`. Upon installation, the drivers will be found in `C:\Program Files (x86)\Atmel\Flip 3.4.7\usb`. + +Then, from an **administrator-privileged** `Windows` terminal, run the following command (adjust the path for username, etc. as necessary) and accept the prompt that pops up: +``` +C:\> pnputil -i -a C:\cygwin64\home\Kevin\src\dfu-programmer-win-0.7.2\dfu-prog-usb-1.2.2\atmel_usb_dfu.inf +or +C:\> pnputil -i -a "C:\Program Files (x86)\Atmel\Flip 3.4.7\usb\atmel_usb_dfu.inf" +``` + +This should be the result: +``` +Microsoft PnP Utility + +Processing inf : atmel_usb_dfu.inf +Successfully installed the driver on a device on the system. +Driver package added successfully. +Published name : oem104.inf + + +Total attempted: 1 +Number successfully imported: 1 +``` + +Alternatively, the `Windows` driver can be installed when prompted by `Windows` when the keyboard is attached. Do not let `Windows` search for a driver; specify the path to search for a driver and point it to the `atmel_usb_dfu.inf` file. + +##Building and Flashing the Planck firmware! +If you did everything else right. This part should be a snap! Grab the latest sources from `github`, make the Plank firmware, then flash it. + +###Build Planck and Load the Firmware +``` +$ cd ~/src +$ git clone https://github.com/jackhumbert/qmk_firmware.git +$ cd qmk_firmware/keyboard/planck +$ make +``` + +Make sure there are no errors. You should end up with this or something similar: +``` +Creating load file for Flash: planck.hex +avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature planck.elf planck.hex + +Creating load file for EEPROM: planck.eep +avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \ +--change-section-lma .eeprom=0 --no-change-warnings -O ihex planck.elf planck.eep || exit 0 + +Creating Extended Listing: planck.lss +avr-objdump -h -S -z planck.elf > planck.lss + +Creating Symbol Table: planck.sym +avr-nm -n planck.elf > planck.sym + +Size after: + text data bss dec hex filename + 18602 82 155 18839 4997 planck.elf + +-------- end -------- +``` + +If you do not get the above, you **did not** build the firmware, and you will have nothing to flash. If you have the fresh clone from `github`, it was probably something gone wrong in this install process, go check and see what didn't work and threw errors or what steps you might have missed. + +But if everything went OK, you are ready to flash! Press the reset button on the bottom of the Planck, wait two seconds, then: +``` +$ make dfu +``` +. +. +. +profit!!! + + + + + +##extra bits... + +###Installing Precompiled `dfu-programmer` Binaries (not recommended for `cygwin`) +To install the `dfu-programmer` from the binaries, we must get if from [the `dfu-programmer` website](https://dfu-programmer.github.io/) ([0.7.2](http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip)). + +Copy this file into your `cygwin` home\src directory. (For me, it is `C:\cygwin64\home\Kevin\src`), extract the files, move `dfu-programmer.exe` to `~/local/avr/bin`. Most obnoxiously, the `libusb0_x86.dll` and `libusb0.sys` need to be moved from `./dfu-prog-usb-1.2.2/x86/` to a directory in the `Windows` `PATH` and the `cygwin` `PATH`. This is because the `dfu-programmer` binary is `mingw` based, not `cygwin` based, so the `dlls` do not cooperate. I achieved acceptable pathing by moving the files to `C:\cygwin64\home\Kevin\local\avr\bin` Then, in a `WINDOWS` command prompt running (Adjusting your path for username, etc. as needed): +``` +C:\> set PATH=%PATH%;C:\cygwin64\home\Kevin\local\avr\bin +``` + +Then, rename `libusb0_x86.dll` to `libusb0.dll`. + +You can tell that you were successful by trying to execute 'dfu-programmer' from the 'cygwin' prompt: +``` +$ which dfu-programmer +/home/Kevin/local/avr/bin/dfu-programmer + +$ dfu-programmer +dfu-programmer 0.7.2 +https://github.com/dfu-programmer/dfu-programmer +Type 'dfu-programmer --help' for a list of commands + 'dfu-programmer --targets' to list supported target devices +``` + +If you are not getting the above result, you will not be able to flash the firmware! +- Try making sure your `PATH` variables are set correctly for both `Windows` and `cygwin`. +- Make sure the `dll` is named correctly. +- Do not extract it with `cygwin`'s `unzip` as it does not set the executable permission. If you did it anyway, do `chmod +x dfu-programmer.exe`. +- Still have problems? Try building it instead. + + +##Debugging Tools + +These tools are for debugging your firmware, etc. before flashing. Theoretically, it can save your memory from wearing out. However, these tool do not work 100% for the Planck firmware. + +### `gdb` for AVR +`gdb` has a simulator for AVR but it does not support all instructions (like WDT), so it immediately crashes when running the Planck firmware (because `lufa.c` disables the WDT in the first few lines of execution). But it can still be useful in debugging example code and test cases, if you know how to use it. + +``` +$ cd ~/src +$ git clone git://sourceware.org/git/binutils-gdb.git +$ cd binutils-gdb +$ mkdir obj-avr +$ cd obj-avr +$ ../configure --prefix=$PREFIX --target=avr --build=x86_64-unknown-cygwin --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local --disable-nls --enable-static +$ make +$ make install +``` + +### `simulavr` +`simulavr` is an AVR simulator. It runs the complied AVR elfs. `simulavr` does not support the `atmega32u4` device... it does `atmega32` but that is not good enough for the firmware (no PORTE and other things), so you cannot run the Planck firmware. I use it to simulate ideas I have for features in separate test projects. + +This one is a major pain in the butt because it has a lot of dependencies and it is buggy. I will do my best to explain it but... it was hard to figure out. A few things need to be changed in the 'Makefile' to make it work in `cygwin`. + + +``` +$ cd ~/src +$ git clone https://github.com/Traumflug/simulavr.git +$ cd simulavr +$ ./bootstrap +$ ./configure --prefix=$PREFIX --enable-static --disable-tcl --disable-doxygen-doc +``` + Edit `src/Makefile.am` now so that `-no-undefined` is included (I did this by removing the SYS_MINGW conditional surrounding `libsim_la_LDFLAGS += -no-undefined` and `libsimulavr_la_LDFLAGS += -no-undefined \ libsimulavr_la_LIBADD += $(TCL_LIB)`. Also, `$(EXEEXT)` is added after `kbdgentables` in two places. + +``` +$ make +$ make install +``` + + +TODO: +- git repos for all sources +- command line magic for cygwin setup +- better options for `dfu-drivers` diff --git a/keyboard/planck/PCB_GUIDE.md b/keyboard/planck/PCB_GUIDE.md index 3daf0e009..b36d8fb64 100644 --- a/keyboard/planck/PCB_GUIDE.md +++ b/keyboard/planck/PCB_GUIDE.md @@ -3,10 +3,12 @@ ## Setting up the environment ### Windows +1. Install [MHV AVR Tools](https://infernoembedded.com/sites/default/files/project/MHV_AVR_Tools_20131101.exe). Disable smatch, but **be sure to leave the option to add the tools to the PATH checked**. +2. Install [MinGW](https://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download). During installation, uncheck the option to install a graphical user interface. **DO NOT change the default installation folder.** The scripts depend on the default location. +3. Clone this repository. [This link will download it as a zip file, which you'll need to extract.](https://github.com/jackhumbert/qmk_firmware/archive/master.zip) Open the extracted folder in Windows Explorer. +4. Right-click on the 1-setup-path-win batch script, select "Run as administrator", and accept the User Account Control prompt. Press the spacebar to dismiss the success message in the command prompt that pops up. +5. Right-click on the 2-setup-environment-win batch script, select "Run as administrator", and accept the User Account Control prompt. This part may take a couple of minutes, and you'll need to approve a driver installation, but once it finishes, your environment is complete! -1. Install [WinAVR Tools](http://sourceforge.net/projects/winavr/) for AVR GCC compiler. -2. Install [DFU-Programmer][dfu-prog] (the -win one). -3. Start DFU bootloader on the chip first time you will see 'Found New Hardware Wizard' to install driver. If you install device driver properly you can find chip name like 'ATmega32U4' under 'LibUSB-Win32 Devices' tree on 'Device Manager'. If not you will need to update its driver on 'Device Manager' to the `dfu-programmer` driver. ### Mac @@ -52,6 +54,28 @@ Generally, the instructions to flash the PCB are as follows: 4. Press the reset button on the PCB/press the key with the `RESET` keycode 5. `make dfu` - use the necessary `KEYMAP=` and/or `COMMON=true` arguments here. +## Troubleshooting +If you see something like this + + 0 [main] sh 13384 sync_with_child: child 9716(0x178) died before initialization with status code 0xC0000142 + 440 [main] sh 13384 sync_with_child: *** child state waiting for longjmp + /usr/bin/sh: fork: Resource temporarily unavailable + +after running 'make' on Windows than you are encountering a very popular issue with WinAVR on Windows 8.1 and 10. +You can easily fix this problem by replacing msys-1.0.dll in WinAVR/utils/bin with [this one](http://www.madwizard.org/download/electronics/msys-1.0-vista64.zip). +Restart your system and everything should work fine! + + +If you see this + + dfu-programmer atmega32u4 erase + process_begin: CreateProcess(NULL, dfu-programmer atmega32u4 erase, ...) failed. + make (e=2): The system cannot find the file specified. + make: *** [dfu] Error 2 + +when trying to 'make dfu' on Windows you need to copy the dfu-programmer.exe to qmk_firmware/keyboard/planck. + + ## Quantum MK Firmware ### Keymap diff --git a/keyboard/planck/common_keymaps/keymap_mitch.c b/keyboard/planck/common_keymaps/keymap_mitch.c new file mode 100644 index 000000000..f7df7bbba --- /dev/null +++ b/keyboard/planck/common_keymaps/keymap_mitch.c @@ -0,0 +1,49 @@ +#include "keymap_common.h" + +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = KEYMAP( + TAB, Q, W, E, R, T, Y, U, I, O, P, BSPC, + LCTL, A, S, D, F, G, H, J, K, L, SCLN, QUOT, + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, FN3, + ESC, DEL, LALT, LGUI, FN2, SPC, FN1, LEFT, DOWN, UP, RGHT), +[1] = KEYMAP( + GRV, GRV, FN22, FN19, FN10, TRNS, TRNS, 7, 8, 9, 0, BSPC, + TRNS, LBRC, RBRC, FN23, FN24, TRNS, TRNS, 4, 5, 6, TRNS, BSLS, + TRNS, MINS, FN20, EQL, FN21, TRNS, TRNS, 1, 2, 3, TRNS, ENT, + TRNS, TRNS, TRNS, TRNS, TRNS, SPC, FN1, TRNS, PGDN, PGUP, TRNS), +[2] = KEYMAP( + FN26, FN10, FN11, FN12, FN13, FN14, FN15, FN17, FN18, FN19, FN10, DEL, + TRNS, TRNS, MUTE, VOLD, VOLU, TRNS, BSPC, FN14, FN15, FN16, TRNS, FN25, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN11, FN12, FN13, TRNS, ENT, + TRNS, TRNS, TRNS, TRNS, FN2, ENT, TRNS, TRNS, PGDN, PGUP, TRNS), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(1), // Switch layer raise + [2] = ACTION_LAYER_MOMENTARY(2), // Switch layer lower + + [3] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT), // Right shift serves as Enter on tap + + // Numeric shift modifiers + [10] = ACTION_MODS_KEY(MOD_LSFT, KC_0), + [11] = ACTION_MODS_KEY(MOD_LSFT, KC_1), + [12] = ACTION_MODS_KEY(MOD_LSFT, KC_2), + [13] = ACTION_MODS_KEY(MOD_LSFT, KC_3), + [14] = ACTION_MODS_KEY(MOD_LSFT, KC_4), + [15] = ACTION_MODS_KEY(MOD_LSFT, KC_5), + [16] = ACTION_MODS_KEY(MOD_LSFT, KC_6), + [17] = ACTION_MODS_KEY(MOD_LSFT, KC_7), + [18] = ACTION_MODS_KEY(MOD_LSFT, KC_8), + [19] = ACTION_MODS_KEY(MOD_LSFT, KC_9), + + // Other shift modifiers + [20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), // _ + [21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), // + + [22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // ~ + [23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), // { + [24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), // } + [25] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), // | + + // Switch windows in app + [26] = ACTION_MODS_KEY(MOD_LGUI, KC_GRV), +}; diff --git a/keyboard/planck/keymaps/lock/keymap.c b/keyboard/planck/keymaps/lock/keymap.c index 958576462..f1629492e 100644 --- a/keyboard/planck/keymaps/lock/keymap.c +++ b/keyboard/planck/keymaps/lock/keymap.c @@ -150,7 +150,7 @@ float start_up[][2] = { {440.0*pow(2.0,(64)/12.0), 1000}, }; -void * matrix_init_user(void) { +void matrix_init_user(void) { init_notes(); play_notes(&start_up, 9, false); } \ No newline at end of file diff --git a/keyboard/planck/keymaps/lucas.c b/keyboard/planck/keymaps/lucas.c new file mode 100644 index 000000000..27672e1bb --- /dev/null +++ b/keyboard/planck/keymaps/lucas.c @@ -0,0 +1,163 @@ +/* +This is the keymap of /u/deepshitgoeshere! +Layer 1 exists so I can have the symbol positions of QWERTY while having my system in german. +The second layer has all the german umlauts I need and with capital and small letters on the +same layer there is no need to press shift+lower. +This keymap is made to work with software implemented QWERTZ. +The "Gaming" layer is mainly customized for CS:GO. +If you have any question about this keymap feel free to shoot me a message on reddit! +*/ + +#include "keymap_common.h" +#include "keymap_extras/keymap_german.h" +#include "backlight.h" +#include "debug.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = { /* Colemak + * ,-----------------------------------------------------------------------. + * | Esc | q | w | f | p | g | j | l | u | y | ; | - | + * |-----------------------------------------------------------------------| + * | BS | a | r | s | t | d | h | n | e | i | o | ' | + * |-----------------------------------------------------------------------| + * | SFT | z | x | c | v | b | k | m | , | . | / | Ent | + * |-----------------------------------------------------------------------| + * | CTL | GUI | Tab | ALT |Lower| Space |Raise|Left |Down | Up |Right| + * `-----------------------------------------------------------------------' + */ + {KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Z, DE_SCLN, DE_MINS}, + {KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, DE_QUOT}, + {M(0), KC_Y, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, DE_COMM, DE_DOT, DE_SLSH, KC_ENT}, + {KC_LCTL, KC_LGUI, KC_TAB, KC_LALT, F(2), F(3), F(3), F(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, +[1] = { /* Symbols + * ,-----------------------------------------------------------------------. + * | | | | | | | | | | | : | | + * |-----------------------------------------------------------------------| + * | | | | | | | | | | | | " | + * |-----------------------------------------------------------------------| + * | | | | | | | | | < | > | ? | | + * |-----------------------------------------------------------------------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------' + */ + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DE_DOT, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DE_DQOT}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M(1), DE_MORE, DE_QST, 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} +}, +[2] = { /* Raise + * ,-----------------------------------------------------------------------. + * | | Ä | | | | | | | Ü | Ö | |Game | + * |-----------------------------------------------------------------------| + * | Del | ä | | ß | | | | | ü | ö | |FVol+| + * |-----------------------------------------------------------------------| + * | | | | | | | | |Stop | Prv | Nxt |FVol-| + * |-----------------------------------------------------------------------| + * |LCTL |LGUI | Tab |LALT |Lower| Space | |Mute |Vol- |Vol+ | P/P | + * `-----------------------------------------------------------------------' + */ + {KC_NO, S(DE_AE), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, S(DE_UE), S(DE_OE), KC_NO, F(4)}, + {KC_DEL, DE_AE, KC_NO, DE_SS, KC_NO, KC_NO, KC_NO, KC_NO, DE_UE, DE_OE, KC_NO, RALT(KC_F12)}, + {KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MSTP, KC_MPRV, KC_MNXT, RALT(KC_F11)}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY} +}, +[3] = { /* Lower + * ,-----------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | + | + * |-----------------------------------------------------------------------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | = | + * |-----------------------------------------------------------------------| + * | | | | | | [ | ] | { | } | € | | \ | Ent | + * |-----------------------------------------------------------------------| + * |LCTL |LGUI | Tab |LALT | | Space |Raise|Home |PgDn |PgUp | End | + * `-----------------------------------------------------------------------' + */ + {DE_TILD, DE_EXLM, DE_AT, DE_HASH, DE_DLR, DE_PERC, DE_CIRC, DE_AMPR, DE_ASTR, DE_LPRN, DE_RPRN, DE_PLUS}, + {DE_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, DE_EQL}, + {KC_NO, KC_NO, KC_NO, DE_PIPE, DE_LBRC, DE_RBRC, DE_LCBR, DE_RCBR, DE_EURO, KC_NO, DE_BSLS, KC_ENT}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END} +}, +[4] = { /* Function + * ,-----------------------------------------------------------------------. + * | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | F21 | F22 | F23 | F24 | + * |-----------------------------------------------------------------------| + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |-----------------------------------------------------------------------| + * | | | | | | KP- | KP+ | | | | |Reset| + * |-----------------------------------------------------------------------| + * | |Light|BL DN|BL UP| | | | |Mute |Vol- |Vol+ | P/P | + * `-----------------------------------------------------------------------' + */ + {KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24}, + {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12}, + {KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PMNS, KC_PPLS, KC_NO, KC_NO, KC_NO, RESET, KC_NO}, + {KC_NO, BL_TOGG, BL_DEC, BL_INC, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY} +}, +[5] = { /* Gaming + * ,-----------------------------------------------------------------------. + * | Buy | ESC | q | w | e | r | t | y | u | i | o | p | + * |-----------------------------------------------------------------------| + * | ENT | BS | a | s | d | f | g | h | j | k | l | ; | + * |-----------------------------------------------------------------------| + * | CTL | SFT | z | x | c | v | b | n | m | , | Up | / | + * |-----------------------------------------------------------------------| + * | | | Tab | ALT | | Space |CrJmp| GUI |Left |Down |Right| + * `-----------------------------------------------------------------------' + */ + {MO(6), KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Z, KC_U, KC_I, KC_O, F(4)}, + {KC_ENT, KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, DE_SCLN}, + {KC_LCTL, KC_LSFT, KC_Y, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, DE_DOT, KC_UP, DE_SLSH}, + {KC_NO, KC_NO, KC_TAB, KC_LALT, KC_NO, KC_SPC, KC_SPC, LCTL(KC_SPC), KC_LGUI, KC_LEFT, KC_DOWN, KC_RGHT} +}, +[6] = { /* Gaming + /* CS:GO buy binds + * ,-----------------------------------------------------------------------. + * | | | | | | | | | 7 | 8 | 9 | | + * |-----------------------------------------------------------------------| + * | BS | | | | | | | | 6 | 5 | 4 | End | + * |-----------------------------------------------------------------------| + * | CTL | SFT | | | | | | | 1 | 2 | 3 |Pgdn | + * |-----------------------------------------------------------------------| + * | | | Tab | ALT | | Space |CrJmp| | 0 | KP+ |PEnt | + * `-----------------------------------------------------------------------' + */ + {KC_TRNS, KC_NO, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_P7, KC_P8, KC_P9, KC_NO}, + {KC_BSPC, KC_NO, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_P4, KC_P5, KC_P6, KC_END}, + {KC_LCTL, KC_LSFT, KC_Y, KC_X, KC_C, KC_V, KC_B, KC_K, KC_P1, KC_P2, KC_P3, KC_PGDN}, + {KC_NO, KC_NO, KC_TAB, KC_LALT, KC_NO, KC_SPC, KC_SPC, LCTL(KC_SPC), KC_NO, KC_P0, KC_PDOT, KC_PENT} +}, +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(2), // to RAISE + [2] = ACTION_LAYER_MOMENTARY(3), // to LOWER + [3] = ACTION_LAYER_TAP_KEY(4,KC_SPC), // to Function + [4] = ACTION_LAYER_TOGGLE(5), // toggle Gaming + [5] = ACTION_MODS_TAP_KEY(KC_LSFT, KC_CAPS), //Shift on press, Caps on tap +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case 0: // M(0) + if (record->event.pressed) { + register_code(KC_LSFT); + layer_on(1); + } else { + layer_off(1); + unregister_code(KC_LSFT); + } + break; + case 1: // M(1) + if (record->event.pressed) { + unregister_code(KC_LSFT); + register_code(DE_MORE); + } else { + unregister_code(DE_MORE); + } + break; + } + return MACRO_NONE; + +}; \ No newline at end of file diff --git a/keyboard/planck/planck.c b/keyboard/planck/planck.c index 63ca54761..fe8731ec7 100644 --- a/keyboard/planck/planck.c +++ b/keyboard/planck/planck.c @@ -1,16 +1,16 @@ #include "planck.h" __attribute__ ((weak)) -void * matrix_init_user(void) { +void matrix_init_user(void) { -}; +} __attribute__ ((weak)) -void * matrix_scan_user(void) { +void matrix_scan_user(void) { -}; +} -void * matrix_init_kb(void) { +void matrix_init_kb(void) { #ifdef BACKLIGHT_ENABLE backlight_init_ports(); #endif @@ -24,13 +24,9 @@ void * matrix_init_kb(void) { DDRE |= (1<<6); PORTE |= (1<<6); - if (matrix_init_user) { - (*matrix_init_user)(); - } -}; + matrix_init_user(); +} -void * matrix_scan_kb(void) { - if (matrix_scan_user) { - (*matrix_scan_user)(); - } -}; +void matrix_scan_kb(void) { + matrix_scan_user(); +} diff --git a/keyboard/planck/planck.h b/keyboard/planck/planck.h index 00b01b54d..e9566b922 100644 --- a/keyboard/planck/planck.h +++ b/keyboard/planck/planck.h @@ -40,7 +40,7 @@ { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b } \ } -void * matrix_init_user(void); -void * matrix_scan_user(void); +void matrix_init_user(void); +void matrix_scan_user(void); #endif diff --git a/new_project.sh b/new_project.sh index 199ced411..28de9c2f9 100755 --- a/new_project.sh +++ b/new_project.sh @@ -13,10 +13,9 @@ sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/config.h > keyboard/$KEYBOARD sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/README.md > keyboard/$KEYBOARD/README.md sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/Makefile > keyboard/$KEYBOARD/Makefile sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/keymaps/default.c > keyboard/$KEYBOARD/keymaps/default.c -cp quantum/template/bootloader.hex keyboard/$KEYBOARD/bootloader.hex echo "######################################################" echo "# keyboard/$KEYBOARD project created. To start" echo "# working on things, use the following command:" echo "# cd keyboard/$KEYBOARD" -echo "######################################################" \ No newline at end of file +echo "######################################################" diff --git a/quantum/keymap_extras/keymap_bepo.h b/quantum/keymap_extras/keymap_bepo.h new file mode 100644 index 000000000..1ab2d63dd --- /dev/null +++ b/quantum/keymap_extras/keymap_bepo.h @@ -0,0 +1,311 @@ +/* Keymap macros for the French BÉPO layout - http://bepo.fr */ +#ifndef KEYMAP_BEPO_H +#define KEYMAP_BEPO_H + +#include "keymap_common.h" + +// Alt gr +#ifndef ALTGR +#define ALTGR(kc) RALT(kc) +#endif +#ifndef ALGR +#define ALGR(kc) ALTGR(kc) +#endif +#define BP_ALGR KC_RALT + +// Normal characters +// First row (on usual keyboards) +#define BP_DOLLAR KC_GRAVE // $ +#define BP_DLR BP_DOLLAR +#define BP_DOUBLE_QUOTE KC_1 // " +#define BP_DQOT BP_DOUBLE_QUOTE +#define BP_LEFT_GUILLEMET KC_2 // « +#define BP_LGIL BP_LEFT_GUILLEMET +#define BP_RIGHT_GUILLEMET KC_3 // » +#define BP_RGIL BP_RIGHT_GUILLEMET +#define BP_LEFT_PAREN KC_4 // ( +#define BP_LPRN BP_LEFT_PAREN +#define BP_RIGHT_PAREN KC_5 // ) +#define BP_RPRN BP_RIGHT_PAREN +#define BP_AT KC_6 // @ +#define BP_PLUS KC_7 // + +#define BP_MINUS KC_8 // - +#define BP_MINS BP_MINUS +#define BP_SLASH KC_9 // / +#define BP_SLSH BP_SLASH +#define BP_ASTERISK KC_0 // * +#define BP_ASTR BP_ASTERISK +#define BP_EQUAL KC_MINUS // = +#define BP_EQL BP_EQUAL +#define BP_PERCENT KC_EQUAL // % +#define BP_PERC BP_PERCENT + +// Second row +#define BP_B KC_Q +#define BP_E_ACUTE KC_W // é +#define BP_ECUT BP_E_ACUTE +#define BP_P KC_E +#define BP_O KC_R +#define BP_E_GRAVE KC_T // è +#define BP_EGRV BP_E_GRAVE +#define BP_DEAD_CIRCUMFLEX KC_Y // dead ^ +#define BP_DCRC BP_DEAD_CIRCUMFLEX +#define BP_V KC_U +#define BP_D KC_I +#define BP_L KC_O +#define BP_J KC_P +#define BP_Z KC_LBRACKET +#define BP_W KC_RBRACKET + +// Third row +#define BP_A KC_A +#define BP_U KC_S +#define BP_I KC_D +#define BP_E KC_F +#define BP_COMMA KC_G // , +#define BP_COMM BP_COMMA +#define BP_C KC_H +#define BP_T KC_J +#define BP_S KC_K +#define BP_R KC_L +#define BP_N KC_SCOLON +#define BP_M KC_QUOTE +#define BP_C_CEDILLA KC_BSLASH // ç +#define BP_CCED BP_C_CEDILLA + +// Fourth row +#define BP_E_CIRCUMFLEX KC_NONUS_BSLASH // ê +#define BP_ECRC BP_E_CIRCUMFLEX +#define BP_A_GRAVE KC_Z // à +#define BP_AGRV BP_A_GRAVE +#define BP_Y KC_X +#define BP_X KC_C +#define BP_DOT KC_V // . +#define BP_K KC_B +#define BP_APOSTROPHE KC_N +#define BP_APOS BP_APOSTROPHE // ' +#define BP_Q KC_M +#define BP_G KC_COMMA +#define BP_H KC_DOT +#define BP_F KC_SLASH + +// Shifted characters +// First row +#define BP_HASH LSFT(BP_DOLLAR) // # +#define BP_1 LSFT(KC_1) +#define BP_2 LSFT(KC_2) +#define BP_3 LSFT(KC_3) +#define BP_4 LSFT(KC_4) +#define BP_5 LSFT(KC_5) +#define BP_6 LSFT(KC_6) +#define BP_7 LSFT(KC_7) +#define BP_8 LSFT(KC_8) +#define BP_9 LSFT(KC_9) +#define BP_0 LSFT(KC_0) +#define BP_DEGREE LSFT(BP_EQUAL) // ° +#define BP_DEGR BP_DEGREE +#define BP_GRAVE LSFT(BP_PERCENT) // ` +#define BP_GRV BP_GRAVE + +// Second row +#define BP_EXCLAIM LSFT(BP_DEAD_CIRCUMFLEX) // ! +#define BP_EXLM BP_EXCLAIM + +// Third row +#define BP_SCOLON LSFT(BP_COMMA) // ; +#define BP_SCLN BP_SCOLON + +// Fourth row +#define BP_COLON LSFT(BP_DOT) // : +#define BP_COLN BP_COLON +#define BP_QUESTION LSFT(BP_QUOTE) // ? +#define BP_QEST BP_QUESTION + +// Space bar +#define BP_NON_BREAKING_SPACE LSFT(KC_SPACE) +#define BP_NBSP BP_NON_BREAKING_SPACE + +// AltGr-ed characters +// First row +#define BP_EN_DASH ALTGR(BP_DOLLAR) // – +#define BP_NDSH BP_EN_DASH +#define BP_EM_DASH ALTGR(KC_1) // — +#define BP_MDSH BP_EM_DASH +#define BP_LESS ALTGR(KC_2) // < +#define BP_GREATER ALTGR(KC_3) // > +#define BP_GRTR BP_GREATER +#define BP_LBRACKET ALTGR(KC_4) // [ +#define BP_LBRC BP_LBRACKET +#define BP_RBRACKET ALTGR(KC_5) // ] +#define BP_RBRC BP_RBRACKET +#define BP_CIRCUMFLEX ALTGR(KC_6) // ^ +#define BP_CIRC BP_CIRCUMFLEX +#define BP_PLUS_MINUS ALTGR(KC_7) // ± +#define BP_PSMS BP_PLUS_MINUS +#define BP_MATH_MINUS ALTGR(KC_8) // − +#define BP_MMNS BP_MATH_MINUS +#define BP_OBELUS ALTGR(KC_9) // ÷ +#define BP_OBEL BP_OBELUS +// more conventional name of the symbol +#define BP_DIVISION_SIGN BP_OBELUS +#define BP_DVSN BP_DIVISION_SIGN +#define BP_TIMES ALTGR(KC_0) // × +#define BP_TIMS BP_TIMES +#define BP_DIFFERENT ALTGR(BP_EQUAL) // ≠ +#define BP_DIFF BP_DIFFERENT +#define BP_PERMILLE ALTGR(BP_PERCENT) // ‰ +#define BP_PMIL BP_PERMILLE + +// Second row +#define BP_PIPE ALTGR(BP_B) // | +#define BP_DEAD_ACUTE ALTGR(BP_E_ACUTE) // dead ´ +#define BP_DACT BP_DEAD_ACUTE +#define BP_AMPERSAND ALTGR(BP_P) // & +#define BP_AMPR BP_AMPERSAND +#define BP_OE_LIGATURE ALTGR(BP_O) // œ +#define BP_OE BP_OE_LIGATURE +#define BP_DEAD_GRAVE ALTGR(BP_E_GRAVE) // ` +#define BP_DGRV BP_DEAD_GRAVE +#define BP_INVERTED_EXCLAIM ALTGR(BP_DEAD_CIRCUMFLEX) // ¡ +#define BP_IXLM BP_INVERTED_EXCLAIM +#define BP_DEAD_CARON ALTGR(BP_V) // dead ˇ +#define BP_DCAR BP_DEAD_CARON +#define BP_ETH ALTGR(BP_D) // ð +#define BP_DEAD_SLASH ALTGR(BP_L) // dead / +#define BP_DSLH BP_DEAD_SLASH +#define BP_IJ_LIGATURE ALTGR(BP_J) // ij +#define BP_IJ BP_IJ_LIGATURE +#define BP_SCHWA ALTGR(BP_Z) // ə +#define BP_SCWA BP_SCHWA +#define BP_DEAD_BREVE ALTGR(BP_W) // dead ˘ +#define BP_DBRV BP_DEAD_BREVE + +// Third row +#define BP_AE_LIGATURE ALTGR(BP_A) // æ +#define BP_AE BP_AE_LIGATURE +#define BP_U_GRAVE AGR(BP_U) // ù +#define BP_UGRV BP_U_GRAVE +#define BP_DEAD_TREMA ALTGR(BP_I) // dead ¨ (trema/umlaut/diaresis) +#define BP_DTRM BP_DEAD_TREMA +#define BP_EURO ALTGR(BP_E) // € +#define BP_TYPOGRAPHICAL_APOSTROPHE ALTGR(BP_COMMMA) // ’ +#define BP_TAPO BP_TYPOGRAPHICAL_APOSTROPHE +#define BP_COPYRIGHT ALTGR(BP_C) // © +#define BP_CPRT BP_COPYRIGHT +#define BP_THORN ALTGR(BP_T) // þ +#define BP_THRN BP_THORN +#define BP_SHARP_S ALTGR(BP_S) // ß +#define BP_SRPS BP_SHARP_S +#define BP_REGISTERED_TRADEMARK ALTGR(BP_R) // ® +#define BP_RTM BP_REGISTERED_TRADEMARK +#define BP_DEAD_TILDE ALTGR(BP_N) // dead ~ +#define BP_DTLD BP_DEAD_TILDE +#define BP_DEAD_MACRON ALTGR(BP_M) // dead ¯ +#define BP_DMCR BP_DEAD_MACRON +#define BP_DEAD_CEDILLA ALTGR(BP_C_CEDILLA) // dead ¸ +#define BP_DCED BP_DEAD_CEDILLA + +// Fourth row +#define BP_NONUS_SLASH ALTGR(BP_E_CIRCUMFLEX) // / on non-us backslash key (102nd key, ê in bépo) +#define BP_NUSL BP_NONUS_SLASH +#define BP_BACKSLASH ALTGR(BP_A_GRAVE) /* \ */ +#define BP_BSLS BP_BACKSLASH +#define BP_LEFT_CURLY_BRACE ALTGR(BP_Y) // { +#define BP_LCBR BP_LEFT_CURLY_BRACE +#define BP_RIGHT_CURLY_BRACE ALTGR(BP_X) // } +#define BP_RCBR BP_RIGHT_CURLY_BRACE +#define BP_ELLIPSIS ALTGR(BP_DOT) // … +#define BP_ELPS BP_ELLIPSIS +#define BP_TILDE ALTGR(BP_K) // ~ +#define BP_TILD BP_TILDE +#define BP_INVERTED_QUESTION ALTGR(BP_QUESTION) // ¿ +#define BP_IQST BP_INVERTED_QUESTION +#define BP_DEAD_RING ALTGR(BP_Q) // dead ° +#define BP_DRNG BP_DEAD_RING +#define BP_DEAD_GREEK ALTGR(BP_G) // dead Greek key (following key will make a Greek letter) +#define BP_DGRK BP_DEAD_GREEK +#define BP_DAGGER ALTGR(BP_H) // † +#define BP_DAGR BP_DAGGER +#define BP_DEAD_OGONEK ALTGR(BP_F) // dead ˛ +#define BP_DOGO BP_DEAD_OGONEK + +// Space bar +#define BP_UNDERSCORE ALTGR(KC_SPACE) // _ +#define BP_UNDS BP_UNDERSCORE + +// AltGr-Shifted characters (different from capitalised AltGr-ed characters) +// First row +#define BP_PARAGRAPH ALTGR(BP_HASH) // ¶ +#define BP_PARG BP_PARAGRAPH +#define BP_LOW_DOUBLE_QUOTE ALTGR(BP_1) // „ +#define BP_LWQT BP_LOW_DOUBLE_QUOTE +#define BP_LEFT_DOUBLE_QUOTE ALTGR(BP_2) // “ +#define BP_LDQT BP_LEFT_DOUBLE_QUOTE +#define BP_RIGHT_DOUBLE_QUOTE ALTGR(BP_3) // ” +#define BP_RDQT BP_RIGHT_DOUBLE_QUOTE +#define BP_LESS_OR_EQUAL ALTGR(BP_4) // ≤ +#define BP_LEQL BP_LESS_OR_EQUAL +#define BP_GREATER_OR_EQUAL ALTGR(BP_5) // ≥ +#define BP_GEQL BP_GREATER_OR_EQUAL +// nothing on ALTGR(BP_6) +#define BP_NEGATION ALTGR(BP_7) // ¬ +#define BP_NEGT BP_NEGATION +#define BP_ONE_QUARTER ALTGR(BP_8) // ¼ +#define BP_1QRT BP_ONE_QUARTER +#define BP_ONE_HALF ALTGR(BP_9) // ½ +#define BP_1HLF BP_ONE_HALF +#define BP_THREE_QUARTERS ALTGR(BP_0) // ¾ +#define BP_3QRT BP_THREE_QUARTERS +#define BP_MINUTES ALTGR(BP_DEGREE) // ′ +#define BP_MNUT BP_MINUTES +#define BP_SECONDS ALTGR(BP_GRAVE) // ″ +#define BP_SCND BP_SECONDS + +// Second row +#define BP_BROKEN_PIPE LSFT(BP_PIPE) // ¦ +#define BP_BPIP BP_BROKEN_PIPE +#define BP_DEAD_DOUBLE_ACUTE LSFT(BP_DEAD_ACUTE) // ˝ +#define BP_DDCT BP_DEAD_DOUBLE_ACUTE +#define BP_SECTION ALTGR(LSFT(BP_P)) // § +#define BP_SECT BP_SECTION +// LSFT(BP_DEAD_GRAVE) is actually the same character as LSFT(BP_PERCENT) +#define BP_GRAVE_BIS LSFT(BP_DEAD_GRAVE) // ` +#define BP_GRVB BP_GRAVE_BIS + +// Third row +#define BP_DEAD_DOT_ABOVE LSFT(BP_DEAD_TREMA) // dead ˙ +#define BP_DDTA BP_DEAD_DOT_ABOVE +#define BP_DEAD_CURRENCY LSFT(BP_EURO) // dead ¤ (next key will generate a currency code like ¥ or £) +#define BP_DCUR BP_DEAD_CURRENCY +#define BP_DEAD_HORN LSFT(ALTGR(BP_COMMA)) // dead ̛ +#define BP_DHRN BP_DEAD_HORN +#define BP_LONG_S LSFT(ALTGR(BP_C)) // ſ +#define BP_LNGS BP_LONG_S +#define BP_TRADEMARK LSFT(BP_REGISTERED_TRADEMARK) // ™ +#define BP_TM BP_TRADEMARK +#define BP_ORDINAL_INDICATOR_O LSFT(ALTGR(BP_M)) // º +#define BP_ORDO BP_ORDINAL_INDICATOR_O +#define BP_DEAD_COMMA LSFT(BP_DEAD_CEDILLA) // dead ˛ +#define BP_DCOM BP_DEAD_COMMA + +// Fourth row +#define BP_LEFT_QUOTE LSFT(ALTGR(BP_Y)) // ‘ +#define BP_LQOT BP_LEFT_QUOTE +#define BP_RIGHT_QUOTE LSFT(ALTGR(BP_X)) // ’ +#define BP_RQOT BP_RIGHT_QUOTE +#define BP_INTERPUNCT LSFT(ALTGR(BP_DOT)) // · +#define BP_IPCT BP_INTERPUNCT +#define BP_DEAD_HOOK_ABOVE LSFT(ALTGR(BP_QUESTION)) // dead ̉ +#define BP_DHKA BP_DEAD_HOOK_ABOVE +#define BP_DEAD_UNDERDOT LSFT(BP_DEAD_RING) // dead ̣ +#define BP_DUDT BP_DEAD_UNDERDOT +#define BP_DOUBLE_DAGGER LSFT(BP_DAGGER) // ‡ +#define BP_DDGR BP_DOUBLE_DAGGER +#define BP_ORDINAL_INDICATOR_A LSFT(ALTGR(BP_F)) // ª +#define BP_ORDA BP_ORDINAL_INDICATOR_A + +// Space bar +#define BP_NARROW_NON_BREAKING_SPACE ALTGR(BP_NON_BREAKING_SPACE) +#define BP_NNBS BP_NARROW_NON_BREAKING_SPACE + +#endif diff --git a/quantum/keymap_extras/keymap_german_osx.h b/quantum/keymap_extras/keymap_german_osx.h index b011561e2..da91b4bf4 100644 --- a/quantum/keymap_extras/keymap_german_osx.h +++ b/quantum/keymap_extras/keymap_german_osx.h @@ -12,7 +12,7 @@ #define DE_Z KC_Y #define DE_Y KC_Z -#define DE_A KC_A +#define DE_A KC_A #define DE_B KC_B #define DE_C KC_C #define DE_D KC_D @@ -87,7 +87,7 @@ // Alt-ed characters #define DE_SQ2 LALT(KC_2) // ² #define DE_SQ3 LALT(KC_3) // ³ -#define DE_LCBR LALT(KC_7) // { +#define DE_LCBR LALT(KC_8) // { #define DE_LBRC LALT(KC_5) // [ #define DE_RBRC LALT(KC_6) // ] #define DE_RCBR LALT(KC_9) // } diff --git a/quantum/keymap_extras/keymap_neo2.h b/quantum/keymap_extras/keymap_neo2.h index 055d7d0d1..a35ba55a5 100644 --- a/quantum/keymap_extras/keymap_neo2.h +++ b/quantum/keymap_extras/keymap_neo2.h @@ -35,6 +35,25 @@ #define NEO_UE DE_Y #define NEO_SS DE_UE +#define NEO_DOT DE_DOT +#define NEO_COMM DE_COMM + +#define NEO_1 DE_1 +#define NEO_2 DE_2 +#define NEO_3 DE_3 +#define NEO_4 DE_4 +#define NEO_5 DE_5 +#define NEO_6 DE_6 +#define NEO_7 DE_7 +#define NEO_8 DE_8 +#define NEO_9 DE_9 +#define NEO_0 DE_0 +#define NEO_MINS DE_SS + +#define NEO_ACUT DE_PLUS +#define NEO_GRV DE_ACUT +#define NEO_CIRC DE_CIRC + #define NEO_L1_L KC_CAPS #define NEO_L1_R DE_HASH diff --git a/quantum/matrix.c b/quantum/matrix.c index 95bf4c097..2dab6ae94 100644 --- a/quantum/matrix.c +++ b/quantum/matrix.c @@ -48,14 +48,14 @@ static void unselect_rows(void); static void select_row(uint8_t row); __attribute__ ((weak)) -void * matrix_init_kb(void) { +void matrix_init_kb(void) { -}; +} __attribute__ ((weak)) -void * matrix_scan_kb(void) { +void matrix_scan_kb(void) { -}; +} inline uint8_t matrix_rows(void) @@ -86,9 +86,7 @@ void matrix_init(void) matrix_debouncing[i] = 0; } - if (matrix_init_kb) { - (*matrix_init_kb)(); - } + matrix_init_kb(); } @@ -152,9 +150,7 @@ uint8_t matrix_scan(void) } #endif - if (matrix_scan_kb) { - (*matrix_scan_kb)(); - } + matrix_scan_kb(); return 1; } diff --git a/quantum/template/template.c b/quantum/template/template.c index 7be7dfc3d..7dcd67cfc 100644 --- a/quantum/template/template.c +++ b/quantum/template/template.c @@ -1,29 +1,23 @@ #include "%KEYBOARD%.h" __attribute__ ((weak)) -void * matrix_init_user(void) { +void matrix_init_user(void) { // leave these blank -}; +} __attribute__ ((weak)) -void * matrix_scan_user(void) { +void matrix_scan_user(void) { // leave these blank -}; +} -void * matrix_init_kb(void) { +void matrix_init_kb(void) { // put your keyboard start-up code here // runs once when the firmware starts up + matrix_init_user(); +} - if (matrix_init_user) { - (*matrix_init_user)(); - } -}; - -void * matrix_scan_kb(void) { +void matrix_scan_kb(void) { // put your looping keyboard code here // runs every cycle (a lot) - - if (matrix_scan_user) { - (*matrix_scan_user)(); - } -}; \ No newline at end of file + matrix_scan_user(); +} \ No newline at end of file diff --git a/quantum/template/template.h b/quantum/template/template.h index d4d78e4c9..1171dc8e0 100644 --- a/quantum/template/template.h +++ b/quantum/template/template.h @@ -12,14 +12,14 @@ // The second converts the arguments into a two-dimensional array #define KEYMAP( \ k00, k01, k02, \ - k10, k11, \ + k10, k11 \ ) \ { \ { k00, k01, k02 }, \ { k10, KC_NO, k11 }, \ } -void * matrix_init_user(void); -void * matrix_scan_user(void); +void matrix_init_user(void); +void matrix_scan_user(void); #endif \ No newline at end of file diff --git a/tmk_core/common/matrix.h b/tmk_core/common/matrix.h index 85415df71..0b013fc98 100644 --- a/tmk_core/common/matrix.h +++ b/tmk_core/common/matrix.h @@ -64,8 +64,8 @@ void matrix_power_up(void); void matrix_power_down(void); /* keyboard-specific setup/loop functionality */ -void * matrix_init_kb(void); -void * matrix_scan_kb(void); +void matrix_init_kb(void); +void matrix_scan_kb(void); #ifdef __cplusplus }