diff --git a/1-setup-path-win.bat b/1-setup-path-win.bat index 49fb00e149..6957dbc3f4 100644 --- a/1-setup-path-win.bat +++ b/1-setup-path-win.bat @@ -1,9 +1,14 @@ @echo off -setx /M path "%PATH%;C:\MinGW\bin;C:\MinGW\msys\1.0\bin" > nul 2>&1 + +reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /f /v Path /t REG_SZ /d "%path%;C:\MinGW\bin;C:\MinGW\msys\1.0\bin" > nul +echo. + if NOT ["%errorlevel%"]==["0"] ( - echo FAILED. Rerun with administrator privileges. - pause + echo FAILED. You probably just need to run the script with administrator privileges. ) else ( echo Success! - pause + setx QMK QMK > nul ) + +echo. +pause diff --git a/BUILD_GUIDE.md b/BUILD_GUIDE.md index 81c3ec44f2..f7a57d2fc9 100644 --- a/BUILD_GUIDE.md +++ b/BUILD_GUIDE.md @@ -3,11 +3,13 @@ ## 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! +1. If you have ever installed WinAVR, uninstall it. +2. 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**. +3. 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. +4. 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. +5. 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. +6. 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! +7. Future build commands should be run from the standard Windows command prompt, which you can find by searching for "command prompt" from the start menu or start screen. Ignore the "MHV AVR Shell". ### Mac If you're using [homebrew,](http://brew.sh/) you can use the following commands: @@ -25,12 +27,12 @@ You can also try these instructions: 3. Install [DFU-Programmer][dfu-prog]. ### Linux -Install AVR GCC and dfu-progammer with your favorite package manager. +Install AVR GCC, AVR libc, and dfu-progammer with your favorite package manager. Debian/Ubuntu example: sudo apt-get update - sudo apt-get install gcc-avr dfu-programmer + sudo apt-get install gcc-avr avr-libc 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). @@ -42,7 +44,10 @@ If you have any problems building the firmware, you can try using a tool called 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. + +Note: Some keyboard folders have non-standard organizations, and may not even support specifying alternate keymaps. Until these get reorganized, you will need to edit their default keymaps directly. + +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) @@ -52,4 +57,4 @@ If you have any problems building the firmware, you can try using a tool called ## Troubleshooting 1. Try running `make clean` if the make command fails. - WIP \ No newline at end of file + WIP diff --git a/keyboard/Bantam44/Bantam44.c b/keyboard/Bantam44/Bantam44.c new file mode 100644 index 0000000000..ad91401eeb --- /dev/null +++ b/keyboard/Bantam44/Bantam44.c @@ -0,0 +1,25 @@ +#include "Bantam44.h" + +__attribute__ ((weak)) +void matrix_init_user(void) { + // leave these blank +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { + // leave these blank +} + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} \ No newline at end of file diff --git a/keyboard/Bantam44/Bantam44.h b/keyboard/Bantam44/Bantam44.h new file mode 100644 index 0000000000..fa5b9df9e4 --- /dev/null +++ b/keyboard/Bantam44/Bantam44.h @@ -0,0 +1,29 @@ +#ifndef BANTAM44_H +#define BANTAM44_H + +#include "matrix.h" +#include "keymap_common.h" +#include "backlight.h" +#include + +// This a shortcut to help you visually see your layout. +// The following is an example using the Planck MIT layout +// The first section contains all of the arguements +// The second converts the arguments into a two-dimensional array +#define KEYMAP( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38 \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, KC_NO, K2A }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B }, \ + { K30, K31, K32, KC_NO, K33, KC_NO, K34, KC_NO, K35, K36, K37, K38 }, \ +} + +void matrix_init_user(void); +void matrix_scan_user(void); + +#endif diff --git a/keyboard/Bantam44/Makefile b/keyboard/Bantam44/Makefile new file mode 100644 index 0000000000..e7dea9f602 --- /dev/null +++ b/keyboard/Bantam44/Makefile @@ -0,0 +1,139 @@ +#---------------------------------------------------------------------------- +# On command line: +# +# make all = Make software. +# +# make clean = Clean out built project files. +# +# make coff = Convert ELF to AVR COFF. +# +# make extcoff = Convert ELF to AVR Extended COFF. +# +# make program = Download the hex file to the device. +# Please customize your programmer settings(PROGRAM_CMD) +# +# make teensy = Download the hex file to the device, using teensy_loader_cli. +# (must have teensy_loader_cli installed). +# +# make dfu = Download the hex file to the device, using dfu-programmer (must +# have dfu-programmer installed). +# +# make flip = Download the hex file to the device, using Atmel FLIP (must +# have Atmel FLIP installed). +# +# make dfu-ee = Download the eeprom file to the device, using dfu-programmer +# (must have dfu-programmer installed). +# +# make flip-ee = Download the eeprom file to the device, using Atmel FLIP +# (must have Atmel FLIP installed). +# +# make debug = Start either simulavr or avarice as specified for debugging, +# with avr-gdb or avr-insight as the front end for debugging. +# +# make filename.s = Just compile filename.c into the assembler code only. +# +# make filename.i = Create a preprocessed source file for use in submitting +# bug reports to the GCC project. +# +# To rebuild project do "make clean" then "make all". +#---------------------------------------------------------------------------- + +# Target file name (without extension). +TARGET = Bantam44 + + +# Directory common source filess exist +TOP_DIR = ../.. +TMK_DIR = ../../tmk_core + +# Directory keyboard dependent files exist +TARGET_DIR = . + +# # project specific files +SRC = Bantam44.c + +ifdef KEYMAP + SRC := keymaps/$(KEYMAP).c $(SRC) +else + SRC := keymaps/default.c $(SRC) +endif + +CONFIG_H = config.h + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=512 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +# SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +# NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +# BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +# MIDI_ENABLE = YES # MIDI controls +# UNICODE_ENABLE = YES # Unicode +# BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID + + +# Optimize size but this may cause error "relocation truncated to fit" +#EXTRALDFLAGS = -Wl,--relax + +# Search Path +VPATH += $(TARGET_DIR) +VPATH += $(TOP_DIR) +VPATH += $(TMK_DIR) + +include $(TOP_DIR)/quantum/quantum.mk + diff --git a/keyboard/Bantam44/README.md b/keyboard/Bantam44/README.md new file mode 100644 index 0000000000..cd059a66c9 --- /dev/null +++ b/keyboard/Bantam44/README.md @@ -0,0 +1,24 @@ +Bantam44 keyboard firmware +====================== + +## Quantum MK Firmware + +For the full Quantum feature list, see [the parent README.md](/README.md). + +## Building + +Download or clone the whole firmware and navigate to the keyboard/Bantam44 folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file. + +Depending on which keymap you would like to use, you will have to compile slightly differently. + +### Default +To build with the default keymap, simply run `make`. + +### Other Keymaps +Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `.c` and see keymap document (you can find in top README.md) and existent keymap files. + +To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: +``` +$ make KEYMAP=[default|jack|] +``` +Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. \ No newline at end of file diff --git a/keyboard/Bantam44/config.h b/keyboard/Bantam44/config.h new file mode 100644 index 0000000000..26d680704d --- /dev/null +++ b/keyboard/Bantam44/config.h @@ -0,0 +1,81 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Bantam Keyboards +#define PRODUCT Bantam44 +#define DESCRIPTION A custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +// Planck PCB default pin-out +// Change this to how you wired your keyboard +// COLS: Left to right, ROWS: Top to bottom +#define COLS (int []){ B0, B1, B2, B3, B7, D0, B6, F7, F6, F5, F4, F1 } +#define ROWS (int []){ F0, D6, D4, D5 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#endif diff --git a/keyboard/Bantam44/keymaps/default.c b/keyboard/Bantam44/keymaps/default.c new file mode 100644 index 0000000000..17ade6241f --- /dev/null +++ b/keyboard/Bantam44/keymaps/default.c @@ -0,0 +1,30 @@ +#include "Bantam44.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = { /* Base */ + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC }, + {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_NO, KC_ENT }, + {KC_CAPS, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT }, + {KC_LCTL, KC_LGUI, KC_LALT, KC_NO, MO(1), KC_NO, KC_SPC, KC_NO, MO(2), KC_SCLN, KC_QUOT, KC_SLSH } + }, + [1] = { /* LOWER */ + {KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELT }, + {KC_TAB, KC_MPRV, KC_MPLY, KC_MNXT, KC_GRV, KC_BSLS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_NO, KC_ENT }, + {KC_CAPS, KC_LSFT, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_NO, KC_HOME, KC_PGUP, KC_RSFT }, + {KC_LCTL, KC_LGUI, KC_LALT, KC_NO, KC_TRNS, KC_NO, KC_SPC, KC_NO, KC_TRNS, KC_END, KC_PGDN, KC_EXLM } + }, + [2] = { /* RAISE */ + {KC_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DELT }, + {KC_TAB, KC_MUTE, KC_VOLD, KC_VOLU, KC_TILD, KC_PIPE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_NO, KC_ENT }, + {KC_CAPS, KC_LSFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, KC_UP, KC_RSFT }, + {KC_LCTL, KC_LGUI, KC_LALT, KC_NO, KC_TRNS, KC_NO, KC_SPC, KC_NO, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT } + } +}; + +const uint16_t PROGMEM fn_actions[] = { +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // MACRODOWN only works in this function +{ + return MACRO_NONE; +}; \ No newline at end of file diff --git a/keyboard/alps64/Makefile b/keyboard/alps64/Makefile index e90dcedb67..7634c4280e 100644 --- a/keyboard/alps64/Makefile +++ b/keyboard/alps64/Makefile @@ -53,9 +53,9 @@ SRC = keymap_common.c \ led.c ifdef KEYMAP - SRC := keymap_$(KEYMAP).c $(SRC) + SRC := keymaps/$(KEYMAP).c $(SRC) else - SRC := keymap_plain.c $(SRC) + SRC := keymaps/default.c $(SRC) endif CONFIG_H = config.h diff --git a/keyboard/alps64/keymap_plain.c b/keyboard/alps64/keymaps/default.c similarity index 100% rename from keyboard/alps64/keymap_plain.c rename to keyboard/alps64/keymaps/default.c diff --git a/keyboard/alps64/keymap_hasu.c b/keyboard/alps64/keymaps/hasu.c similarity index 100% rename from keyboard/alps64/keymap_hasu.c rename to keyboard/alps64/keymaps/hasu.c diff --git a/keyboard/atomic/Makefile b/keyboard/atomic/Makefile index e678b4efa8..da6d0ac60c 100644 --- a/keyboard/atomic/Makefile +++ b/keyboard/atomic/Makefile @@ -54,9 +54,9 @@ SRC = atomic.c \ backlight.c ifdef KEYMAP - SRC := keymaps/keymap_$(KEYMAP).c $(SRC) + SRC := keymaps/$(KEYMAP).c $(SRC) else - SRC := keymaps/keymap_default.c $(SRC) + SRC := keymaps/default.c $(SRC) endif CONFIG_H = config.h diff --git a/keyboard/atomic/README.md b/keyboard/atomic/README.md index c8e83cf55a..0e42370ba6 100644 --- a/keyboard/atomic/README.md +++ b/keyboard/atomic/README.md @@ -16,10 +16,10 @@ Depending on which keymap you would like to use, you will have to compile slight To build with the default keymap, simply run `make`. ### Other Keymaps -Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `keymap_.c` and see keymap document (you can find in top README.md) and existent keymap files. +Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a file in the keymaps folder named `.c` and see keymap document (you can find in top README.md) and existent keymap files. To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: ``` $ make KEYMAP=[default|jack|] ``` -Keymaps follow the format **__keymap\_\.c__** and are stored in the `keymaps` folder. +Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. diff --git a/keyboard/atomic/atomic.c b/keyboard/atomic/atomic.c index fa66266a4c..30e8122893 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 95982ecad1..d8574efa93 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/atomic/keymaps/keymap_abienz.c b/keyboard/atomic/keymaps/abienz.c similarity index 100% rename from keyboard/atomic/keymaps/keymap_abienz.c rename to keyboard/atomic/keymaps/abienz.c diff --git a/keyboard/atomic/keymaps/keymap_default.c b/keyboard/atomic/keymaps/default.c similarity index 100% rename from keyboard/atomic/keymaps/keymap_default.c rename to keyboard/atomic/keymaps/default.c diff --git a/keyboard/atomic/keymaps/keymap_michelle.c b/keyboard/atomic/keymaps/michelle.c similarity index 100% rename from keyboard/atomic/keymaps/keymap_michelle.c rename to keyboard/atomic/keymaps/michelle.c diff --git a/keyboard/atreus/Makefile b/keyboard/atreus/Makefile index 2e542d62ed..a6fddd70d2 100644 --- a/keyboard/atreus/Makefile +++ b/keyboard/atreus/Makefile @@ -53,9 +53,9 @@ TARGET_DIR = . SRC = atreus.c ifdef KEYMAP - SRC := keymaps/keymap_$(KEYMAP).c $(SRC) + SRC := keymaps/$(KEYMAP).c $(SRC) else - SRC := keymaps/keymap_default.c $(SRC) + SRC := keymaps/default.c $(SRC) endif ifdef TEENSY2 diff --git a/keyboard/atreus/README.md b/keyboard/atreus/README.md index 4db7ac1203..aacf2841f4 100644 --- a/keyboard/atreus/README.md +++ b/keyboard/atreus/README.md @@ -177,10 +177,10 @@ Depending on which keymap you would like to use, you will have to compile slight To build with the default keymap, simply run `make`. ### Other Keymaps -Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `keymap_.c` and see keymap document (you can find in top README.md) and existent keymap files. +Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `.c` and see keymap document (you can find in top README.md) and existent keymap files. To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: ``` $ make KEYMAP=[default|jack|] ``` -Keymaps follow the format **__keymap\_\.c__** and are stored in the `keymaps` folder. +Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. diff --git a/keyboard/atreus/atreus.c b/keyboard/atreus/atreus.c index bfc893084f..9d1de631bb 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 9dd77859f9..8d5989e442 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/atreus/keymaps/keymap_default.c b/keyboard/atreus/keymaps/default.c similarity index 100% rename from keyboard/atreus/keymaps/keymap_default.c rename to keyboard/atreus/keymaps/default.c diff --git a/keyboard/atreus/keymaps/keymap_gerb.c b/keyboard/atreus/keymaps/gerb.c similarity index 100% rename from keyboard/atreus/keymaps/keymap_gerb.c rename to keyboard/atreus/keymaps/gerb.c diff --git a/keyboard/ergodox_ez/190hotfix.sh b/keyboard/ergodox_ez/190hotfix.sh new file mode 100755 index 0000000000..bdc3adce22 --- /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 d0eaf33923..97e6de1ee3 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 aceb7ed9c3..1e446baf6f 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 e3ee9afd3e..fc0876d844 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 48f8c5d2ff..48257d23a3 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 2c7f3ec549..f14a11fb57 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 be29a1bff1..25ab0ff18d 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 cd3bf781af..0f5bba3b5f 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 ee72c42635..9601726f7b 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 ecf97c9f1c..1d87acd143 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 e29c17860a..12efef223d 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 5c4c7c7c1b..6fba568fc3 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 dbc51b79b3..b0a1c513cd 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 537b15eeac..46005b533e 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 3ceb77ecaf..96af077ade 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 767a9ca117..363e7234d8 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 a0c74ad805..3ac2842fbf 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 14f5b7c798..bd5cd43415 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 f252bf71d5..1c3bb51713 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 3a1cc4f79e..02ee975544 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 9d7364d378..81b49ceff9 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 36adaad1dc..1ca511fe10 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 d18ce73bfe..3aec8c6cf9 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 8e1ac3f21b..2568c571e9 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 53934ea345..22947327d3 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 542a4662b6..f05b3cc196 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 bdac229e5c..1d8e66a082 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 928c0ecc3f..aa08845658 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 20c95f1ee0..24ff1c6884 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 574e810666..03df475967 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 751049ac5e..572e03a1d5 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 a2f30d7cb6..ce54b54767 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 d91f1e9373..7ec8d99cc0 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 61af86e722..40fcc2ba0d 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 ddc64e55e7..b5463cb72d 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 5651572ab0..cfccb87265 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 f8f73a1afd..80bf9d535d 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 cf68f854fd..f780f648f3 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 ed8dfc731b..6b19800af0 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 f87413b56d..38be3e4689 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 fbdc25109e..a3ad2040f4 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 8c5409ac62..684e65404a 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 ecf1be8724..3982e0a19f 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 20cb53241f..5063c99f28 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 eea5130bde..c04a78512a 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 178c290660..0c4f85a3da 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 4bb17147f0..287cfcd6eb 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/msc/img/code_layer.png b/keyboard/ergodox_ez/keymaps/msc/img/code_layer.png new file mode 100644 index 0000000000..7b5efaae79 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/msc/img/code_layer.png differ diff --git a/keyboard/ergodox_ez/keymaps/msc/img/main_layer.png b/keyboard/ergodox_ez/keymaps/msc/img/main_layer.png new file mode 100644 index 0000000000..65f92dda1b Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/msc/img/main_layer.png differ diff --git a/keyboard/ergodox_ez/keymaps/msc/img/media_layer.png b/keyboard/ergodox_ez/keymaps/msc/img/media_layer.png new file mode 100644 index 0000000000..a69799b073 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/msc/img/media_layer.png differ diff --git a/keyboard/ergodox_ez/keymaps/msc/keymap.c b/keyboard/ergodox_ez/keymaps/msc/keymap.c new file mode 100644 index 0000000000..e567e513f9 --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/msc/keymap.c @@ -0,0 +1,184 @@ +#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 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Del | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | BkSp | A | S | D | F | G |------| |------| H | J | K | L | ; |' / Cmd | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | Cmd | Alt |AltShf| Left | Right| | Left | Down | Up |Right | L2 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | App | LGui | | Alt |Ctrl/Esc| + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|Backsp|------| |------| Tab |Enter | + * | |ace | End | | PgDn | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), + KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), + KC_LGUI,KC_LALT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, + ALT_T(KC_APP), KC_LGUI, + KC_HOME, + KC_SPC,KC_BSPC,KC_END, + // right hand + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, KC_SCLN,GUI_T(KC_QUOT), + MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, TG(MDIA), + KC_LALT, CTL_T(KC_ESC), + KC_PGUP, + KC_PGDN,KC_TAB, KC_ENT + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | Mute | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | Prev |VolDn |VolUp | Next | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | Lclk | Rclk |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_BTN1, KC_BTN2, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +}; + +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/msc/msc.hex b/keyboard/ergodox_ez/keymaps/msc/msc.hex new file mode 100644 index 0000000000..a466a37af7 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/msc/msc.hex differ diff --git a/keyboard/ergodox_ez/keymaps/msc/readme.md b/keyboard/ergodox_ez/keymaps/msc/readme.md new file mode 100644 index 0000000000..0d14fcbd29 --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/msc/readme.md @@ -0,0 +1,32 @@ +# MSC Configuration + +### Based mostly on the ErgoDox EZ default layout with optimizations for coding on osx. + +#### Expecting the user to rely on Coder Layer this keymap removes some of the duplicate symbol keys in the lower portions of the board and replaces them with arrow keys and modifiers. The Media Layer is also updated to match the change in the arrow keys and the left and right click buttons are moved under the thumb position. The Media layer is now reached with toggle button in the lower right. + +### Main Layer + +![Main Layer](img/main_layer.png) + +### Code Layer + +![Code Layer](img/code_layer.png) + +### Media Layer + +![Media Layer](img/media_layer.png) + +## Changelog + +Version 1.0 + +- Changed the temp code layer key in the bottom right to toggle media layer +- Changed the temp media key to only be ";" +- Changed right hand bottom row to match vim home row nav directions +- Changed media keys to match arrow key changes +- Changed media left and right click to spacebar and backspace locations +- Changed bottom left to Cmd +- Changed single quote on left bottom row to alt + +#### Coming Soon: +- A new layer for Blender editing with a focus on left hand shortcut and a righthand num pad to control the view in Blender. diff --git a/keyboard/ergodox_ez/keymaps/naps62/README.md b/keyboard/ergodox_ez/keymaps/naps62/README.md new file mode 100644 index 0000000000..14728e4cc4 --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/naps62/README.md @@ -0,0 +1,29 @@ +# ErgoDox EZ naps62 Configuration + +## Motivation + +I wanted a layout that suited my Linux & Vim usage. I also didn't like the lack of efficient access to some of the more common special characters used in programming. + +## Key features / changes + +### Base Layer (L1) + +* **No `MT(mod, kc)` keys (modifier when pressed, key when tapped).** Those keys work with a global timeout. When a key press is shorter than the timeout, it's considered a tap, otherwise it's a hold. I couldn't find any particular timeout that would work for me. I need to use mods extremely fast, but also want the confort of using them more slowly in other occasions. So I gave up on this feature altogether. +* **Direct access to `{}[]`.** When programming, these are used extremely often. I was still getting used to the coder layer, and I prefer the arrows on the home row, so I used the bottom-right keys for this. +* **Layer keys everywhere.** I either use my little finger or my index finger to go to L1, whichever is more confortable in any given situation. L2 is not used while coding/writing, so I don't need an extremely-optimized access to it. +* **Lang key.** This is nothing more than `Super-Space` combo, which in my systems (both Linux & Windows) is the shortcut to change the keyboard language. I'm Portuguese, so I often cycle between US layout for coding, and PT layout for writing. +* **Special chars on the right-most column.** I only use Ctrl & Shift keys on the left side, so I used the right keys to include some of the more useful special characters as well. + +### Coder Layer (L2) + +* The `=` and `-` signs where nowhere to be found. `-` was already on the base layer, but it's still useful to have a fully-featured NumPad on the coder layer. + +### Media Layer (L3) + +* **Better media keys**. Why was Play/Pause so far away? And where was Mute? I put all my media keys close to each other, including the missing ones +* **Arrow keys on home row.** I use vim, so I'm always on my home row. I use this sometimes to get around, but not as often as to need them on the base row. I'm fine with them here +* I don't use mouse keys. They're still set up, and I made some changes as an experiment, but I mostly forgot they exist by now. + +## Author + +[Miguel Palhas](https://github.com/naps62) diff --git a/keyboard/ergodox_ez/keymaps/naps62/ergodox_ez.hex b/keyboard/ergodox_ez/keymaps/naps62/ergodox_ez.hex new file mode 100644 index 0000000000..e5f213ba82 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/naps62/ergodox_ez.hex differ diff --git a/keyboard/ergodox_ez/keymaps/naps62/keymap.c b/keyboard/ergodox_ez/keymaps/naps62/keymap.c new file mode 100644 index 0000000000..b954a311e6 --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/naps62/keymap.c @@ -0,0 +1,187 @@ +#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 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | Esc | 1 ! | 2 @ | 3 # | 4 $ | 5 % | Lang | | Esc | 6 ^ | 7 & | 8 * | 9 ( | 0 ) | Bckspc | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | L2 | | L2 | Y | U | I | O | P | \ | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Ctrl | A | S | D | F | G |------| |------| H | J | K | L | ; : | ' " | + * |--------+------+------+------+------+------| L1 | | L1 |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | N | M | , < | . > | / ? | - _ | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | L1 | ` ~ | ' " | \ | | L2 | | { | } | [ { | ] } | L1 | + * `----------------------------------' `----------------------------------' + * ,--------------. ,---------------. + * | Home | End | | PgUp |Insert | + * ,------|-------|------| |-------+-------+------. + * | | | LGui | | Del | | | + * | Space| Alt |------| |-------| Enter |Space | + * | | | LGui | | Bcsp | | | + * `---------------------' `----------------------' + */ +// 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_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, LGUI(KC_SPC), + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, MO(2), + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, MO(1), + MO(1), KC_GRV, KC_QUOT, KC_BSLS, MO(2), + + KC_HOME, KC_END, + KC_LGUI, + KC_SPC, KC_LALT, KC_LGUI, + + // right hand + KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + MO(2), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + MO(1), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, + KC_LCBR, KC_RCBR, KC_LBRC, KC_RBRC, MO(1), + + KC_PGUP, KC_INS, + KC_DEL, + KC_BSPC, KC_ENT, KC_SPC +), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | = | . | 0 | - | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_EQL,KC_DOT, KC_0, KC_MINS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | |GuiUp | Expl | | Term | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | |GuiLft|GuiDwn|GuiRgt| | |------| |------| Left | Down | Up |Right | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | |Browsr| | | | |VolDwn|VolUp | Mute | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | | Play | Prev | Next | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | |Brwser|Brwser| + * | Lclk | Rclk |------| |------|Fwd |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +KEYMAP( + RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, LGUI(KC_W), LGUI(KC_E), KC_BTN1, LGUI(KC_T), KC_TRNS, + KC_TRNS, LGUI(KC_A), LGUI(KC_S), LGUI(KC_D), 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_BTN1, KC_BTN2, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, + KC_MPLY, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_WBAK, KC_WFWD +), +}; + +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/keymap.c b/keyboard/ergodox_ez/keymaps/ordinary/keymap.c index d44962b0dc..4dd6d883ca 100644 --- a/keyboard/ergodox_ez/keymaps/ordinary/keymap.c +++ b/keyboard/ergodox_ez/keymaps/ordinary/keymap.c @@ -7,7 +7,7 @@ #define MDIA 2 // media keys /* - * Ordinary Ergodox EZ keyboard layout, v1 + * Ordinary Ergodox EZ keyboard layout, v2 * modifications from default by Nicholas Keene ergodoxez@nicholaskeene.com * Details: http://nicholas.rinard.us/2016/03/ergodox-ez-layout.html */ @@ -16,13 +16,13 @@ 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 | - | + * | Grv | 1 | 2 | 3 | 4 | 5 | ESC | | - | 6 | 7 | 8 | 9 | 0 | = | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | \ | | / | Y | U | I | O | P | ~L2 | + * | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | MDIA \ | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | ~L1 | A | S | D | F | G |------| |------| H | J | K | L |; / L2| ~L1 | - * |--------+------+------+------+------+------| [ | | ] |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |'/Ctrl| RShift | + * | SYMB | A | S | D | F | G |------| |------| H | J | K | L | ; | SYMB ' | + * |--------+------+------+------+------+------|Shift | | Tab |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | -Tab | | | N | M | , | . | / | RShift | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * |LCtrl | Meh |Hyper | LAlt | LGui | | RGui | RAlt | Hyper| Meh |RCtrl | * `----------------------------------' `----------------------------------' @@ -37,20 +37,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // 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, + // 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_LBRC, + MO(SYMB), KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, LSFT(KC_TAB), + 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_MINS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, + KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, LT(MDIA, KC_BSLS), + KC_H, KC_J, KC_K, KC_L, KC_SCLN, LT(SYMB, KC_QUOT), + KC_TAB, KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLSH),KC_RSFT, KC_RGUI, KC_RALT, ALL_T(KC_NO),MEH_T(KC_NO), KC_RCTL, KC_LEFT, KC_RGHT, KC_UP, @@ -59,82 +60,82 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 1: Symbol Layer * * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * | Esc | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * | MDIA | ! | @ | { | } | & | < | | > | | | 7 | 8 | 9 | / | F12 | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | CAPS | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | CAPS | + * | | # | $ | ( | ) | ` |------| |------| / | 4 | 5 | 6 | * | | + * |--------+------+------+------+------+------| Tab | | Shift|------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | -Tab| \ | 1 | 2 | 3 | - | CAPS | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | + * | | | | | | | 0 | . | = | + | | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. - * | | | | | | + * | Left | Right| | Home | End | * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | + * | | | Up | | PgUp | | | + * |Space |Enter |------| |------|BackSp| Del | + * | | | Down | | PgDn | | | * `--------------------' `--------------------' */ // 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, + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + MO(MDIA), KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_AMPR,LSFT(KC_COMM), + KC_TRNS, KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS, KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TAB, + KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_LEFT,KC_RGHT, + KC_UP, + KC_SPC,KC_ENT,KC_DOWN, // 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 + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + LSFT(KC_DOT), KC_PIPE, KC_P7, KC_P8, KC_P9, KC_PSLS, KC_F12, + KC_SLSH, KC_P4, KC_P5, KC_P6, KC_PAST, KC_TRNS, + LSFT(KC_TAB), KC_BSLS, KC_P1, KC_P2, KC_P3, KC_PMNS, KC_CAPS, + KC_P0, KC_DOT, KC_PEQL, KC_PPLS, KC_PENT, + KC_HOME, KC_END, + KC_PGUP, + KC_PGDN, KC_BSPC, KC_DEL ), /* Keymap 2: Media and mouse keys * * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | Sleep| | | | | |MyComp| Mail | | + * | Esc |ShutDn| Sleep| Mute |Vol Dn|Vol Up| | | | |PrtSc | PgUp |MyComp| Mail | | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp |ScrlUp| |ScrlUp| |ScrlUp| | | | | Mute | | + * | | | | MsUp |ScrlUp| |ScrlUp| |ScrlUp| |ScrlUp| Up | | | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | | + * | | |MsLeft|MsDown|MsRght| |------| |------| Home | Left | Down | Right| End | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | |MsDown|ScrlDn| |ScrlDn| |ScrlDn| | | | | | | + * | | | |MsDown|ScrlDn| |ScrlDn| |ScrlDn| |ScrlDn| Down | | | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | | | | | | | + * | | | | Lclk | Rclk | | | PgDn | | | | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. * | Stop |Refrsh| | Prev | Next | * ,------|------|------| |------+------+------. - * |Brwser|Brwser| Home | |VolUp | | | - * |Back | Fwd |------| |------| Stop | Play | - * | | |Search| |VolDn | | | + * |Brwser|Brwser|Search| |VolUp | | | + * |Back | Fwd |------| |------| Stop | Play-| + * | | | Home | |VolDn | | Pause| * `--------------------' `--------------------' */ // 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_ESC, KC_PWR, KC_SLEP, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, + MO(MDIA), 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, + KC_WSCH, + KC_WBAK, KC_TRNS, KC_WHOM, // 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_TRNS, KC_TRNS, KC_PSCR, KC_PGUP, KC_MYCM, KC_MAIL, KC_TRNS, + KC_WH_U, KC_TRNS, KC_WH_U, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, + KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT,KC_END, KC_TRNS, + KC_WH_D, KC_TRNS, KC_WH_D, KC_DOWN, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_PGDN, KC_TRNS,KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_VOLU, KC_VOLD, KC_MSTP, KC_MPLY @@ -161,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); @@ -188,3 +189,4 @@ void * matrix_scan_user(void) { } }; + diff --git a/keyboard/ergodox_ez/keymaps/ordinary/ordinary-base.png b/keyboard/ergodox_ez/keymaps/ordinary/ordinary-base.png new file mode 100644 index 0000000000..b32b95533c Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/ordinary/ordinary-base.png differ diff --git a/keyboard/ergodox_ez/keymaps/ordinary/ordinary-base.txt b/keyboard/ergodox_ez/keymaps/ordinary/ordinary-base.txt new file mode 100644 index 0000000000..727775ea2c --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/ordinary/ordinary-base.txt @@ -0,0 +1,27 @@ +[{x:3.5},"#\n3",{x:10.5},"*\n8"], +[{y:-0.875,x:2.5},"@\n2",{x:1},"$\n4",{x:8.5},"&\n7",{x:1},"(\n9"], +[{y:-0.875,x:5.5},"%\n5",{c:"#ff4444"},"Esc",{x:4.5,c:"#cccccc"},"_\n\n\n\n\n\n-","^\n6"], +[{y:-0.875,c:"#73ab6a",w:1.5},"~\n\n\n\n\n\n`",{c:"#cccccc"},"!\n1",{x:14.5},")\n0",{t:"#000000\n\n\n\n#0000ff",w:1.5},"+\n\n\n\n\n\n="], +[{y:-0.375,x:3.5,t:"#000000"},"E",{x:10.5},"I"], +[{y:-0.875,x:2.5},"W",{x:1},"R",{x:8.5},"U",{x:1},"O"], +[{y:-0.875,x:5.5},"T",{h:1.5},"{\n\n\n\n\n\n[",{x:4.5,h:1.5},"}\n\n\n\n\n\n]","Y"], +[{y:-0.875,c:"#73ab6a",w:1.5},"Tab",{c:"#cccccc"},"Q",{x:14.5},"P",{c:"#2277ff",fa:[0,0,0,1],w:1.5},"|\n\\\nMedia\nL2"], +[{y:-0.375,x:3.5,c:"#cccccc"},"D",{x:10.5},"K"], +[{y:-0.875,x:2.5},"S",{x:1},"F",{x:8.5},"J",{x:1},"L"], +[{y:-0.875,x:5.5},"G",{x:6.5},"H"], +[{y:-0.875,c:"#2277ff",w:1.5},"Symbols\n\n\nL1",{c:"#cccccc"},"A",{x:14.5},":\n;",{c:"#2277ff",w:1.5},"\"\n'\nSymbols\nL1"], +[{y:-0.625,x:6.5,c:"#bfbf67",h:1.5},"< Tab\n\n\nShift Tab",{x:4.5,h:1.5},"Tab >\n\n\nTab"], +[{y:-0.75,x:3.5,c:"#cccccc"},"C",{x:10.5},"<\n,"], +[{y:-0.875,x:2.5},"X",{x:1},"V",{x:8.5},"M",{x:1},">\n."], +[{y:-0.875,x:5.5},"B",{x:6.5},"N"], +[{y:-0.875,c:"#2277ff",w:1.5},"Capitals\n\n\nShift",{c:"#cccccc"},"Z\n\nCtrl",{x:14.5},"?\n/\nCtrl",{c:"#2277ff",w:1.5},"\n\nCapitals\nShift"], +[{y:-0.375,x:3.5,c:"#77aaff"},"Option\n\n\nLAlt",{x:10.5},"Option\n\n\nRAlt"], +[{y:-0.875,x:2.5},"Hyper",{x:1},"Cmd\n\n\nSuper",{x:8.5},"Cmd\n\n\nSuper",{x:1},"Hyper"], +[{y:-0.75,x:0.5},"Ctrl\n\n\nLCtrl","Meh",{x:14.5},"Meh","Ctrl\n\n\nRCtrl"], +[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#bfbf67"},"Home","End"], +[{h:2},"< Del\n\n\nBackspace",{h:2},"Del >\n\n\nDelete","Page\n\n\n\n\n\nUp"], +[{x:2},"Page\n\n\n\n\n\nDown"], +[{r:-30,rx:13,y:-1,x:-3},"Left","Right"], +[{x:-3},"Up",{h:2},"Enter",{h:2},"Space"], +[{x:-3},"Down"] + diff --git a/keyboard/ergodox_ez/keymaps/ordinary/ordinary-media.png b/keyboard/ergodox_ez/keymaps/ordinary/ordinary-media.png new file mode 100644 index 0000000000..89d15e4506 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/ordinary/ordinary-media.png differ diff --git a/keyboard/ergodox_ez/keymaps/ordinary/ordinary-media.txt b/keyboard/ergodox_ez/keymaps/ordinary/ordinary-media.txt new file mode 100644 index 0000000000..4237f08201 --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/ordinary/ordinary-media.txt @@ -0,0 +1,27 @@ +[{x:3.5,c:"#9988bb"},"Vol\n\n\n\n\n\nMute",{x:10.5,c:"#ccffff"},"Page\n\n\n\n\n\nUp"], +[{y:-0.875,x:2.5,c:"#9988bb"},"Sleep",{x:1},"Vol\n\n\n\n\n\nDown",{x:8.5},"Print\n\n\n\n\n\nScreen",{x:1},"Home\n\n\n\n\n\nDir"], +[{y:-0.875,x:5.5},"Vol\n\n\n\n\n\nUp",{c:"#ff4444"},"Esc",{x:4.5,c:"#cccccc",a:7},"",""], +[{y:-0.875,c:"#ff4444",a:4,w:1.5},"Esc",{c:"#9988bb"},"Shut\n\n\n\n\n\nDown",{x:14.5},"Email",{c:"#cccccc",a:7,w:1.5},""], +[{y:-0.375,x:3.5,c:"#ccffff",a:4},"Mouse\n\n\n\n\n\nUp",{x:10.5},"Cursor\n\n\n\n\n\nUp"], +[{y:-0.875,x:2.5,c:"#cccccc",a:7},"",{x:1,c:"#99ffff",a:4},"Scroll\n\n\n\n\n\nUp",{x:8.5},"Scroll\n\n\n\n\n\nUp",{x:1,c:"#cccccc",a:7},""], +[{y:-0.875,x:5.5},"",{c:"#99ffff",a:4,h:1.5},"Scroll\n\n\n\n\n\nUp",{x:4.5,h:1.5},"Scroll\n\n\n\n\n\nUp",{c:"#cccccc",a:7},""], +[{y:-0.875,c:"#000000",t:"#ff0000",a:4,fa:[0,0,0,1],w:1.5},"Media\n\n\nL2",{c:"#cccccc",t:"#000000",a:7},"",{x:14.5},"",{c:"#000000",t:"#ff0000",a:4,w:1.5},"\n\nMedia\nL2"], +[{y:-0.375,x:3.5,c:"#ccffff",t:"#000000"},"Mouse\n\n\n\n\n\nDown",{x:10.5},"Cursor\n\n\n\n\n\nDown"], +[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nLeft",{x:1},"Mouse\n\n\n\n\n\nRight",{x:8.5},"Cursor\n\n\n\n\n\nLeft",{x:1},"Cursor\n\n\n\n\n\nRight"], +[{y:-0.875,x:5.5,c:"#cccccc",a:7},"",{x:6.5,c:"#ccffff",a:4},"Home"], +[{y:-0.875,c:"#000000",t:"#ff0000",w:1.5},"Symbols\n\n\nL1",{c:"#cccccc",t:"#000000",a:7},"",{x:14.5,c:"#ccffff",a:4},"End",{c:"#cccccc",a:7,w:1.5},""], +[{y:-0.625,x:6.5,c:"#99ffff",a:4,h:1.5},"Scroll\n\n\n\n\n\nDown",{x:4.5,h:1.5},"Scroll\n\n\n\n\n\nDown"], +[{y:-0.75,x:3.5,c:"#ccffff"},"Mouse\n\n\n\n\n\nDown",{x:10.5},"Cursor\n\n\n\n\n\nDown"], +[{y:-0.875,x:2.5,c:"#cccccc",a:7},"",{x:1,c:"#99ffff",a:4},"Scroll\n\n\n\n\n\nDown",{x:8.5},"Scroll\n\n\n\n\n\nDown",{x:1,c:"#cccccc",a:7},""], +[{y:-0.875,x:5.5},"",{x:6.5},""], +[{y:-0.875,w:1.5},"","",{x:14.5},"",{w:1.5},""], +[{y:-0.375,x:3.5,c:"#ccffff",a:4},"Left\n\n\n\n\n\nClick",{x:10.5},"Page\n\n\n\n\n\nDown"], +[{y:-0.875,x:2.5,c:"#cccccc",a:7},"",{x:1,c:"#ccffff",a:4},"Right\n\n\n\n\n\nClick",{x:8.5,c:"#cccccc",a:7},"",{x:1},""], +[{y:-0.75,x:0.5},"","",{x:14.5},"",""], +[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#bbaacc",a:4},"Stop\n\n\nBrowser","Reload\n\n\nBrowser"], +[{h:2},"< Web\n\n\nBrowser",{h:2},"Web >\n\n\nBrowser","Search\n\n\nBrowser"], +[{x:2},"Home\n\n\nBrowser"], +[{r:-30,rx:13,y:-1,x:-3},"Prev\n\n\nAudio\n\n\nTrack","Next\n\n\nAudio\n\n\nTrack"], +[{x:-3,c:"#9988bb"},"Vol\n\n\n\n\n\nUp",{c:"#bbaacc",h:2},"Stop\n\n\nAudio",{h:2},"Play\n\n\nAudio\n\n\nPause"], +[{x:-3,c:"#9988bb"},"Vol\n\n\n\n\n\nDown"] + diff --git a/keyboard/ergodox_ez/keymaps/ordinary/ordinary-symbol.png b/keyboard/ergodox_ez/keymaps/ordinary/ordinary-symbol.png new file mode 100644 index 0000000000..7522af3330 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/ordinary/ordinary-symbol.png differ diff --git a/keyboard/ergodox_ez/keymaps/ordinary/ordinary-symbol.txt b/keyboard/ergodox_ez/keymaps/ordinary/ordinary-symbol.txt new file mode 100644 index 0000000000..dda15f71be --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/ordinary/ordinary-symbol.txt @@ -0,0 +1,27 @@ +[{x:3.5,c:"#a3a3a3"},"F3",{x:10.5},"F8"], +[{y:-0.875,x:2.5},"F2",{x:1},"F4",{x:8.5},"F7",{x:1},"F9"], +[{y:-0.875,x:5.5},"F5",{c:"#ff4444"},"Esc",{x:4.5,c:"#cccccc",a:7},"",{c:"#a3a3a3",a:4},"F6"], +[{y:-0.875,c:"#ff4444",w:1.5},"Esc",{c:"#a3a3a3"},"F1",{x:14.5},"F10",{w:1.5},"F11"], +[{y:-0.375,x:3.5,c:"#bbc6ed"},"{",{x:10.5,c:"#bed4ba"},"8"], +[{y:-0.875,x:2.5,c:"#bbc6ed"},"@",{x:1},"}",{x:8.5,c:"#bed4ba"},"7",{x:1},"9"], +[{y:-0.875,x:5.5,c:"#bbc6ed"},"&",{h:1.5},"<",{x:4.5,h:1.5},">","|"], +[{y:-0.875,c:"#2277ff",fa:[0,0,0,1],w:1.5},"Media\n\n\nL2",{c:"#bbc6ed"},"!",{x:14.5,c:"#bed4ba"},"/",{c:"#a3a3a3",w:1.5},"F12"], +[{y:-0.375,x:3.5,c:"#bbc6ed"},"(",{x:10.5,c:"#bed4ba"},"5"], +[{y:-0.875,x:2.5,c:"#bbc6ed"},"$",{x:1},")",{x:8.5,c:"#bed4ba"},"4",{x:1},"6"], +[{y:-0.875,x:5.5,c:"#bbc6ed"},"`",{x:6.5},"/"], +[{y:-0.875,c:"#000000",t:"#ff0000",w:1.5},"Symbols\n\n\nL1",{c:"#bbc6ed",t:"#000000"},"#",{x:14.5,c:"#bed4ba"},"*",{c:"#000000",t:"#ff0000",w:1.5},"\n\nSymbols\nL1"], +[{y:-0.625,x:6.5,c:"#bfbf67",t:"#000000",h:1.5},"Tab >\n\n\nTab",{x:4.5,h:1.5},"< Tab\n\n\nShift Tab"], +[{y:-0.75,x:3.5,c:"#bbc6ed"},"[",{x:10.5,c:"#bed4ba"},"2"], +[{y:-0.875,x:2.5,c:"#bbc6ed"},"^",{x:1},"]",{x:8.5,c:"#bed4ba"},"1",{x:1},"3"], +[{y:-0.875,x:5.5,c:"#bbc6ed"},"~",{x:6.5},"\\"], +[{y:-0.875,c:"#cccccc",a:7,w:1.5},"",{c:"#bbc6ed",a:4},"%",{x:14.5,c:"#bed4ba"},"-",{c:"#2277ff",w:1.5},"\n\nCaps Lock"], +[{y:-0.375,x:3.5,c:"#cccccc",a:7},"",{x:10.5,c:"#bed4ba",a:4},"."], +[{y:-0.875,x:2.5,c:"#cccccc",a:7},"",{x:1},"",{x:8.5,c:"#bed4ba",a:4},"0",{x:1},"="], +[{y:-0.75,x:0.5,c:"#cccccc",a:7},"","",{x:14.5,c:"#bed4ba",a:4},"+","Enter"], +[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#bfbf67"},"Left","Right"], +[{h:2},"Space",{h:2},"Enter","Up"], +[{x:2},"Down"], +[{r:-30,rx:13,y:-1,x:-3},"Home","End"], +[{x:-3},"Page\n\n\n\n\n\nUp",{h:2},"< Del\n\n\nBackspace",{h:2},"Del >\n\n\nDelete"], +[{x:-3},"Page\n\n\n\n\n\nDown"] + diff --git a/keyboard/ergodox_ez/keymaps/ordinary/ordinary.hex b/keyboard/ergodox_ez/keymaps/ordinary/ordinary.hex index c7782d1c25..1a08598465 100644 Binary files a/keyboard/ergodox_ez/keymaps/ordinary/ordinary.hex 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 deleted file mode 100644 index c83f972cfe..0000000000 Binary files a/keyboard/ergodox_ez/keymaps/ordinary/ordinary.png and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/ordinary/readme.md b/keyboard/ergodox_ez/keymaps/ordinary/readme.md index 033e8ef4d5..1cfea06dd0 100644 --- a/keyboard/ergodox_ez/keymaps/ordinary/readme.md +++ b/keyboard/ergodox_ez/keymaps/ordinary/readme.md @@ -1,5 +1,9 @@ -# The Ordinary Layout. for users of common keyboards +# The Ordinary Layout, a familiar and powerful layout -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. +The Ordinary Layout is intended to be unremarkably mundane and remarkably useful. This layout maintains most key positions from common QWERTY keyboards and features enhanced Symbol and Media layers compared to the default Ergodox EZ layout. -![Ordinary layout](ordinary.png) +Full details about the rationale behind this layout [are available](http://nicholas.rinard.us/2016/03/ergodox-ez-layout.html). + +![Ordinary base layout](ordinary-base.png) +![Ordinary symbol layout](ordinary-symbol.png) +![Ordinary media layout](ordinary-media.png) diff --git a/keyboard/ergodox_ez/keymaps/osx_de/keymap.c b/keyboard/ergodox_ez/keymaps/osx_de/keymap.c index 0298cb7028..b31d0edcdf 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 2c83055b0d..fde7201c10 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 fb8635118b..70ac8f01f2 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 403076335a..56448283d2 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 4b59d2eb29..f1806ffffb 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 8915d9caa5..abe089a9f3 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 f71ca28ceb..1032be5491 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 bd356c47c5..a991e6082d 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 53b0747d7e..d63cbb8fab 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 0000000000..9971b834cf --- /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 0000000000..9eb4c24db3 --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/readme.md @@ -0,0 +1,47 @@ +# 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. + +**IMPORTANT**: If you have another keyboard connected via Bluetooth, then `F14` and `F15` will not work. +Turn off that Bluetooth keyboard. Re-plug you ErgoDox. Enjoy! + + +## 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 0000000000..b5eded6e66 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 0000000000..10b0752be5 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 684ecf5e33..a734062f1c 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 8cf730c8f4..5ad6b23a7e 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 92efd9b5e6..ca80752263 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<.c` and see keymap document(you can find in top README.md) and existent keymap files. +Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `.c` in the keymaps folder, and see keymap document(you can find in top README.md) and existent keymap files. To build firmware binary hex file with a certain keymap just do `make` with `KEYMAP` option like: @@ -29,8 +29,8 @@ To build firmware binary hex file with a certain keymap just do `make` with `KEY ### 1 Poker -[keymap_poker.c](keymap_poker.c) emulates original Poker layers -while both [keymap_poker_bit.c](keymap_poker_bit.c) and [keymap_poker_set.c](keymap_poker_set.c) implements same layout in different way and they fix a minor issue of original Poker and enhance arrow keys. +[poker.c](keymaps/poker.c) emulates original Poker layers +while both [poker_bit.c](keymaps/poker_bit.c) and [poker_set.c](keymaps/poker_set.c) implement the same layout in different ways and they fix a minor issue of original Poker and enhance arrow keys. Fn + Esc = ` Fn + {left, down, up, right} = {home, pgdown, pgup, end} @@ -63,7 +63,7 @@ while both [keymap_poker_bit.c](keymap_poker_bit.c) and [keymap_poker_set.c](key ### 2. Plain Without any Fn layer this will be useful if you want to use key remapping tool like AHK on host. -See [keymap_plain.c](keymap_plain.c) for detail. +See [plain.c](keymaps/plain.c) for detail. #### 1.0 Plain Default layer ,-----------------------------------------------------------. @@ -80,11 +80,11 @@ See [keymap_plain.c](keymap_plain.c) for detail. ### 3. Hasu -This is my favorite keymap with HHKB Fn, Vi cursor and Mousekey layer. See [keymap_hasu.c](keymap_hasu.c) for detail. +This is my favorite keymap with HHKB Fn, Vi cursor and Mousekey layer. See [hasu.c](keymaps/hasu.c) for detail. ### 4. SpaceFN -This layout proposed by spiceBar uses space bar to change layer with using Dual role key technique. See [keymap_spacefn.c](keymap_spacefn.c) and [SpaceFN discussion](http://geekhack.org/index.php?topic=51069.0). +This layout proposed by spiceBar uses space bar to change layer with using Dual role key technique. See [spacefn.c](keymaps/spacefn.c) and [SpaceFN discussion](http://geekhack.org/index.php?topic=51069.0). #### 4.0 Default layer ,-----------------------------------------------------------. @@ -113,7 +113,7 @@ This layout proposed by spiceBar uses space bar to change layer with using Dual ### 5. HHKB -[keymap_hhkb.c](keymap_hhkb.c) emulates original HHKB layers. +[hhkb.c](keymaps/hhkb.c) emulates original HHKB layers. #### 5.0: Default layer ,-----------------------------------------------------------. |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `| diff --git a/keyboard/gh60/keymap_hasu.c b/keyboard/gh60/keymaps/hasu.c similarity index 100% rename from keyboard/gh60/keymap_hasu.c rename to keyboard/gh60/keymaps/hasu.c diff --git a/keyboard/gh60/keymap_hhkb.c b/keyboard/gh60/keymaps/hhkb.c similarity index 100% rename from keyboard/gh60/keymap_hhkb.c rename to keyboard/gh60/keymaps/hhkb.c diff --git a/keyboard/gh60/keymap_plain.c b/keyboard/gh60/keymaps/plain.c similarity index 100% rename from keyboard/gh60/keymap_plain.c rename to keyboard/gh60/keymaps/plain.c diff --git a/keyboard/gh60/keymap_poker.c b/keyboard/gh60/keymaps/poker.c similarity index 100% rename from keyboard/gh60/keymap_poker.c rename to keyboard/gh60/keymaps/poker.c diff --git a/keyboard/gh60/keymap_poker_bit.c b/keyboard/gh60/keymaps/poker_bit.c similarity index 100% rename from keyboard/gh60/keymap_poker_bit.c rename to keyboard/gh60/keymaps/poker_bit.c diff --git a/keyboard/gh60/keymap_poker_set.c b/keyboard/gh60/keymaps/poker_set.c similarity index 100% rename from keyboard/gh60/keymap_poker_set.c rename to keyboard/gh60/keymaps/poker_set.c diff --git a/keyboard/gh60/keymap_spacefn.c b/keyboard/gh60/keymaps/spacefn.c similarity index 100% rename from keyboard/gh60/keymap_spacefn.c rename to keyboard/gh60/keymaps/spacefn.c diff --git a/keyboard/hhkb/Makefile b/keyboard/hhkb/Makefile index 5a179bd24d..d434246cef 100644 --- a/keyboard/hhkb/Makefile +++ b/keyboard/hhkb/Makefile @@ -129,17 +129,17 @@ NKRO_ENABLE = yes # USB Nkey Rollover # Keymap file # ifdef KEYMAP - SRC := keymap_$(KEYMAP).c $(SRC) + SRC := keymaps/$(KEYMAP).c $(SRC) else ifdef HHKB_JP - SRC := keymap_jp.c $(SRC) + SRC := keymaps/jp.c $(SRC) else - SRC := keymap_hhkb.c $(SRC) + SRC := keymaps/hhkb.c $(SRC) endif endif -ifneq (, $(or $(findstring keymap_jp.c, $(SRC)), $(findstring yes, $(HHKB_JP)))) +ifneq (, $(or $(findstring jp.c, $(SRC)), $(findstring yes, $(HHKB_JP)))) OPT_DEFS += -DHHKB_JP endif diff --git a/keyboard/hhkb/Makefile.pjrc b/keyboard/hhkb/Makefile.pjrc index 7d0f8c3a9c..403a8ec60a 100644 --- a/keyboard/hhkb/Makefile.pjrc +++ b/keyboard/hhkb/Makefile.pjrc @@ -18,9 +18,9 @@ SRC = keymap_common.c \ led.c ifdef KEYMAP - SRC := keymap_$(KEYMAP).c $(SRC) + SRC := keymaps/$(KEYMAP).c $(SRC) else - SRC := keymap_hasu.c $(SRC) + SRC := keymaps/hasu.c $(SRC) endif CONFIG_H = config.h diff --git a/keyboard/hhkb/Makefile.rn42 b/keyboard/hhkb/Makefile.rn42 index cbb2b744c9..a730442af0 100644 --- a/keyboard/hhkb/Makefile.rn42 +++ b/keyboard/hhkb/Makefile.rn42 @@ -122,17 +122,17 @@ COMMAND_ENABLE = yes # Commands for debug and configuration # Keymap file # ifdef KEYMAP - SRC := keymap_$(KEYMAP).c $(SRC) + SRC := keymaps/$(KEYMAP).c $(SRC) else ifdef HHKB_JP - SRC := keymap_jp.c $(SRC) + SRC := keymaps/jp.c $(SRC) else - SRC := keymap_hhkb.c $(SRC) + SRC := keymaps/hhkb.c $(SRC) endif endif -ifneq (, $(or $(findstring keymap_jp.c, $(SRC)), $(findstring yes, $(HHKB_JP)))) +ifneq (, $(or $(findstring jp.c, $(SRC)), $(findstring yes, $(HHKB_JP)))) OPT_DEFS += -DHHKB_JP endif diff --git a/keyboard/hhkb/README.md b/keyboard/hhkb/README.md index fcd72e1941..e20c23d823 100644 --- a/keyboard/hhkb/README.md +++ b/keyboard/hhkb/README.md @@ -76,7 +76,7 @@ Use [Teensy Loader] if your controller is Teensy/Teensy++. ##Keymap -To define your own keymap create file named `keymap_.c` and see [keymap document](../../doc/keymap.md) and existent keymap files. +To define your own keymap create a file in the keymaps folder named `.c` and see keymap document (you can find in top README.md) and existent keymap files. ##Hardware diff --git a/keyboard/hhkb/keymap_hasu.c b/keyboard/hhkb/keymaps/hasu.c similarity index 100% rename from keyboard/hhkb/keymap_hasu.c rename to keyboard/hhkb/keymaps/hasu.c diff --git a/keyboard/hhkb/keymap_hhkb.c b/keyboard/hhkb/keymaps/hhkb.c similarity index 100% rename from keyboard/hhkb/keymap_hhkb.c rename to keyboard/hhkb/keymaps/hhkb.c diff --git a/keyboard/hhkb/keymap_jp.c b/keyboard/hhkb/keymaps/jp.c similarity index 100% rename from keyboard/hhkb/keymap_jp.c rename to keyboard/hhkb/keymaps/jp.c diff --git a/keyboard/hhkb/keymap_spacefn.c b/keyboard/hhkb/keymaps/spacefn.c similarity index 100% rename from keyboard/hhkb/keymap_spacefn.c rename to keyboard/hhkb/keymaps/spacefn.c diff --git a/keyboard/hhkb_qmk/Makefile b/keyboard/hhkb_qmk/Makefile index 8bd44100b7..21ba261a23 100644 --- a/keyboard/hhkb_qmk/Makefile +++ b/keyboard/hhkb_qmk/Makefile @@ -54,9 +54,9 @@ SRC = hhkb_qmk.c \ matrix.c ifdef KEYMAP - SRC := keymaps/keymap_$(KEYMAP).c $(SRC) + SRC := keymaps/keymaps/$(KEYMAP).c $(SRC) else - SRC := keymaps/keymap_default.c $(SRC) + SRC := keymaps/keymaps/default.c $(SRC) endif CONFIG_H = config.h diff --git a/keyboard/hhkb_qmk/README.md b/keyboard/hhkb_qmk/README.md index 606025c411..389407b3aa 100644 --- a/keyboard/hhkb_qmk/README.md +++ b/keyboard/hhkb_qmk/README.md @@ -171,10 +171,10 @@ Depending on which keymap you would like to use, you will have to compile slight To build with the default keymap, simply run `make`. ### Other Keymaps -Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `keymap_.c` and see keymap document (you can find in top README.md) and existent keymap files. +Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a file in the keymaps folder named `.c` and see keymap document (you can find in top README.md) and existent keymap files. To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: ``` $ make KEYMAP=[default|jack|] ``` -Keymaps follow the format **__keymap\_\.c__** and are stored in the `keymaps` folder. +Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. diff --git a/keyboard/hhkb_qmk/hhkb_qmk.c b/keyboard/hhkb_qmk/hhkb_qmk.c index 9c90e6eb44..36dc3f29db 100644 --- a/keyboard/hhkb_qmk/hhkb_qmk.c +++ b/keyboard/hhkb_qmk/hhkb_qmk.c @@ -1,16 +1,16 @@ #include "hhkb_qmk.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/hhkb_qmk/hhkb_qmk.h b/keyboard/hhkb_qmk/hhkb_qmk.h index f6bf20f43b..1bac33c2de 100644 --- a/keyboard/hhkb_qmk/hhkb_qmk.h +++ b/keyboard/hhkb_qmk/hhkb_qmk.h @@ -24,7 +24,7 @@ { K70, K71, K72, K73, K74, K75, K76, KC_NO } \ } -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/hhkb_qmk/keymaps/keymap_default.c b/keyboard/hhkb_qmk/keymaps/default.c similarity index 100% rename from keyboard/hhkb_qmk/keymaps/keymap_default.c rename to keyboard/hhkb_qmk/keymaps/default.c diff --git a/keyboard/hhkb_qmk/keymaps/keymap_lxol.c b/keyboard/hhkb_qmk/keymaps/lxol.c similarity index 100% rename from keyboard/hhkb_qmk/keymaps/keymap_lxol.c rename to keyboard/hhkb_qmk/keymaps/lxol.c diff --git a/keyboard/jd45/Makefile b/keyboard/jd45/Makefile index 076dced829..f6a8d10c58 100644 --- a/keyboard/jd45/Makefile +++ b/keyboard/jd45/Makefile @@ -54,9 +54,9 @@ SRC = jd45.c \ backlight.c ifdef KEYMAP - SRC := keymaps/keymap_$(KEYMAP).c $(SRC) + SRC := keymaps/keymaps/(KEYMAP).c $(SRC) else - SRC := keymaps/keymap_default.c $(SRC) + SRC := keymaps/keymaps/default.c $(SRC) endif CONFIG_H = config.h diff --git a/keyboard/jd45/jd45.c b/keyboard/jd45/jd45.c index d05714f07b..bc3fcd3ddf 100644 --- a/keyboard/jd45/jd45.c +++ b/keyboard/jd45/jd45.c @@ -1,16 +1,16 @@ #include "jd45.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 @@ -20,7 +20,7 @@ void * matrix_init_kb(void) { } }; -void * matrix_scan_kb(void) { +void matrix_scan_kb(void) { if (matrix_scan_user) { (*matrix_scan_user)(); } diff --git a/keyboard/jd45/jd45.h b/keyboard/jd45/jd45.h index f07bd5e139..d0ca1a88d0 100644 --- a/keyboard/jd45/jd45.h +++ b/keyboard/jd45/jd45.h @@ -6,7 +6,7 @@ #include "backlight.h" #include -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/jd45/keymaps/keymap_default.c b/keyboard/jd45/keymaps/default.c similarity index 100% rename from keyboard/jd45/keymaps/keymap_default.c rename to keyboard/jd45/keymaps/default.c diff --git a/keyboard/jd45/keymaps/keymap_justin.c b/keyboard/jd45/keymaps/justin.c similarity index 100% rename from keyboard/jd45/keymaps/keymap_justin.c rename to keyboard/jd45/keymaps/justin.c diff --git a/keyboard/planck/CYGWIN_GUIDE.md b/keyboard/planck/CYGWIN_GUIDE.md index 0b08a6aa1e..ac13e745d7 100755 --- a/keyboard/planck/CYGWIN_GUIDE.md +++ b/keyboard/planck/CYGWIN_GUIDE.md @@ -17,6 +17,9 @@ Download the `cygwin` setup ([x86_64](https://cygwin.com/setup-x86_64.exe)) and - devel/make - devel/texinfo - devel/gettext-devel +- devel/automake +- devel/autoconfig +- devel/libtool - text/gettext - libs/libgcc1 - interpreters/m4 @@ -60,7 +63,7 @@ These commands will set up the install directory and the `PATH` variable, which $ 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 +$ PATH=$PATH:$PREFIX/bin:$PREFIX/lib $ export PATH ``` @@ -155,13 +158,13 @@ $ make install 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. +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 --prefix=$PREFIX +$ ./configure $ make $ make install ``` @@ -172,7 +175,7 @@ $ cd ~/src $ git clone https://github.com/dfu-programmer/dfu-programmer.git $ cd dfu-programmer $ ./bootstrap.sh -$ ./configure --prefix=$PREFIX +$ ./configure $ make $ make install ``` @@ -180,7 +183,7 @@ $ make install Verify the installation with: ``` $ which dfu-programmer -/home/Kevin/local/avr/bin/dfu-programmer +/usr/local/bin/dfu-programmer $ dfu-programmer dfu-programmer 0.7.2 @@ -315,7 +318,6 @@ These tools are for debugging your firmware, etc. before flashing. Theoretically $ cd ~/src $ git clone git://sourceware.org/git/binutils-gdb.git $ cd binutils-gdb -$ ./bootstrap $ 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 diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile index 307b0c7f4f..03d2601761 100644 --- a/keyboard/planck/Makefile +++ b/keyboard/planck/Makefile @@ -143,7 +143,7 @@ BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality # AUDIO_ENABLE = YES # Audio output on port C6 # UNICODE_ENABLE = YES # Unicode # BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID -# RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with MIDI at the same time. +# RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. ifdef BACKLIGHT_ENABLE SRC += backlight.c diff --git a/keyboard/planck/README.md b/keyboard/planck/README.md index 3ba0cc1527..d9a1e3beee 100644 --- a/keyboard/planck/README.md +++ b/keyboard/planck/README.md @@ -16,13 +16,13 @@ Depending on which keymap you would like to use, you will have to compile slight To build with the default keymap, simply run `make`. ### Other Keymaps -Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `.c` and see keymap document (you can find in top README.md) and existent keymap files. +Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `.c` in the keymaps folder, and see keymap document (you can find in top README.md) and existent keymap files. To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: ``` $ make KEYMAP=[default|jack|] ``` -Keymaps follow the format **__.c__** and are stored in the `keymaps` folder. +Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. ### Notable forks (which some of the keymap files are from) - [Shane's Fork](https://github.com/shanecelis/tmk_keyboard/tree/master/keyboard/planck) diff --git a/keyboard/planck/keymaps/default/keymap.c b/keyboard/planck/keymaps/default/keymap.c index a9c2a06813..d995eb9e58 100644 --- a/keyboard/planck/keymaps/default/keymap.c +++ b/keyboard/planck/keymaps/default/keymap.c @@ -17,31 +17,91 @@ #define _RS 4 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[_QW] = { /* Qwerty */ + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Raise | Space |Lower | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QW] = { {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, {M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, -[_CM] = { /* Colemak */ + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Raise | Space |Lower | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_CM] = { {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, {M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, -[_DV] = { /* Dvorak */ + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Raise | Space |Lower | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DV] = { {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT }, {M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, -[_RS] = { /* RAISE */ + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| F7 | F8 | F9 | F10 | F11 | F12 |Qwerty|Colemk|Dvorak| Reset|Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Raise | Space |Lower | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RS] = { {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, {KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_QW), DF(_CM), DF(_DV), RESET, KC_TRNS}, {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} }, -[_LW] = { /* LOWER */ + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| F7 | F8 | F9 | F10 | F11 | F12 |Qwerty|Colemk|Dvorak| Reset|Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Raise | Space |Lower | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LW] = { {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, {KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_QW), DF(_CM), DF(_DV), RESET, KC_TRNS}, diff --git a/keyboard/planck/keymaps/lock/keymap.c b/keyboard/planck/keymaps/lock/keymap.c index 9585764629..f1629492ef 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/old_keymap_files/common_keymaps/keymap_mitch.c b/keyboard/planck/old_keymap_files/common_keymaps/keymap_mitch.c new file mode 100644 index 0000000000..f7df7bbbaa --- /dev/null +++ b/keyboard/planck/old_keymap_files/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/planck.c b/keyboard/planck/planck.c index 63ca54761c..4b39cf1e8b 100644 --- a/keyboard/planck/planck.c +++ b/keyboard/planck/planck.c @@ -1,36 +1,34 @@ #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) {} -}; +__attribute__ ((weak)) +void process_action_user(keyrecord_t *record) {} -void * matrix_init_kb(void) { - #ifdef BACKLIGHT_ENABLE - backlight_init_ports(); - #endif +void matrix_init_kb(void) { +#ifdef BACKLIGHT_ENABLE + backlight_init_ports(); +#endif - #ifdef RGBLIGHT_ENABLE - rgblight_init(); - #endif +#ifdef RGBLIGHT_ENABLE + rgblight_init(); +#endif + // Turn status LED on + DDRE |= (1<<6); + PORTE |= (1<<6); - // Turn status LED on - DDRE |= (1<<6); - PORTE |= (1<<6); + matrix_init_user(); +} - if (matrix_init_user) { - (*matrix_init_user)(); - } -}; +void matrix_scan_kb(void) { + matrix_scan_user(); +} -void * matrix_scan_kb(void) { - if (matrix_scan_user) { - (*matrix_scan_user)(); - } -}; +void process_action_kb(keyrecord_t *record) { + process_action_user(record); +} diff --git a/keyboard/planck/planck.h b/keyboard/planck/planck.h index 00b01b54df..edcb5fbff6 100644 --- a/keyboard/planck/planck.h +++ b/keyboard/planck/planck.h @@ -40,7 +40,8 @@ { 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); +void process_action_user(keyrecord_t *record); #endif diff --git a/keyboard/retro_refit/Makefile b/keyboard/retro_refit/Makefile new file mode 100644 index 0000000000..918b430719 --- /dev/null +++ b/keyboard/retro_refit/Makefile @@ -0,0 +1,140 @@ +#---------------------------------------------------------------------------- +# On command line: +# +# make all = Make software. +# +# make clean = Clean out built project files. +# +# make coff = Convert ELF to AVR COFF. +# +# make extcoff = Convert ELF to AVR Extended COFF. +# +# make program = Download the hex file to the device. +# Please customize your programmer settings(PROGRAM_CMD) +# +# make teensy = Download the hex file to the device, using teensy_loader_cli. +# (must have teensy_loader_cli installed). +# +# make dfu = Download the hex file to the device, using dfu-programmer (must +# have dfu-programmer installed). +# +# make flip = Download the hex file to the device, using Atmel FLIP (must +# have Atmel FLIP installed). +# +# make dfu-ee = Download the eeprom file to the device, using dfu-programmer +# (must have dfu-programmer installed). +# +# make flip-ee = Download the eeprom file to the device, using Atmel FLIP +# (must have Atmel FLIP installed). +# +# make debug = Start either simulavr or avarice as specified for debugging, +# with avr-gdb or avr-insight as the front end for debugging. +# +# make filename.s = Just compile filename.c into the assembler code only. +# +# make filename.i = Create a preprocessed source file for use in submitting +# bug reports to the GCC project. +# +# To rebuild project do "make clean" then "make all". +#---------------------------------------------------------------------------- + +# Target file name (without extension). +TARGET = retro_refit + + +# Directory common source filess exist +TOP_DIR = ../.. +TMK_DIR = ../../tmk_core + +# Directory keyboard dependent files exist +TARGET_DIR = . + +# # project specific files +SRC = retro_refit.c + +ifdef KEYMAP + SRC := keymaps/$(KEYMAP).c $(SRC) +else + SRC := keymaps/default.c $(SRC) +endif + +CONFIG_H = config.h + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=512 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +KEYBOARD_LOCK_ENABLE = yes # Allow locking of keyboard via magic key +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +# SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +# BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +# MIDI_ENABLE = YES # MIDI controls +# UNICODE_ENABLE = YES # Unicode +# BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID + + +# Optimize size but this may cause error "relocation truncated to fit" +#EXTRALDFLAGS = -Wl,--relax + +# Search Path +VPATH += $(TARGET_DIR) +VPATH += $(TOP_DIR) +VPATH += $(TMK_DIR) + +include $(TOP_DIR)/quantum/quantum.mk + diff --git a/keyboard/retro_refit/README.md b/keyboard/retro_refit/README.md new file mode 100644 index 0000000000..d3c9d4197d --- /dev/null +++ b/keyboard/retro_refit/README.md @@ -0,0 +1,24 @@ +retro_refit keyboard firmware +====================== + +## Quantum MK Firmware + +For the full Quantum feature list, see [the parent README.md](/README.md). + +## Building + +Download or clone the whole firmware and navigate to the keyboard/retro_refit folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file. + +Depending on which keymap you would like to use, you will have to compile slightly differently. + +### Default +To build with the default keymap, simply run `make`. + +### Other Keymaps +Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `.c` and see keymap document (you can find in top README.md) and existent keymap files. + +To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: +``` +$ make KEYMAP=[default|jack|] +``` +Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. \ No newline at end of file diff --git a/keyboard/retro_refit/config.h b/keyboard/retro_refit/config.h new file mode 100644 index 0000000000..05fceb92b2 --- /dev/null +++ b/keyboard/retro_refit/config.h @@ -0,0 +1,122 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Nobody +#define PRODUCT retro_refit +#define DESCRIPTION Retro Refit + +/* key matrix size */ +#define MATRIX_ROWS 11 +#define MATRIX_COLS 8 + +// See note in retro_refit.h for an explanation of how this matrix is wired up +#define COLS (int []){ B0, B1, B2, B3, D2, D3, C7, D5 } +#define ROWS (int []){ D4, D7, B4, B5, B6, F7, F6, F5, F4, F1, F0 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 0 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + + +/* Force NKRO Mode - If forced on, must be disabled via magic key (default = LShift+RShift+N) */ +#define FORCE_NKRO + +/* + * Magic key options + * These options allow the magic key functionality to be changed. This is useful + * if your keyboard/keypad is missing keys and you want magic key support. + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* remap magic keys */ +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +#define MAGIC_KEY_LOCK BSLS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#endif \ No newline at end of file diff --git a/keyboard/retro_refit/keymaps/default.c b/keyboard/retro_refit/keymaps/default.c new file mode 100644 index 0000000000..405402d5e3 --- /dev/null +++ b/keyboard/retro_refit/keymaps/default.c @@ -0,0 +1,33 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include "retro_refit.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = + KEYMAP( ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, NLCK, SLCK, PSCR, PAUS, \ + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BSPC, HOME, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, PGUP, \ + BSLS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, ENT, PGDN, \ + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, UP, END, \ + LCTL, LGUI, LALT, SPC, INS, DEL, LEFT, DOWN, RGHT), +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +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; +}; diff --git a/keyboard/retro_refit/retro_refit.c b/keyboard/retro_refit/retro_refit.c new file mode 100644 index 0000000000..0b13eb8301 --- /dev/null +++ b/keyboard/retro_refit/retro_refit.c @@ -0,0 +1,68 @@ +#include "retro_refit.h" + +__attribute__ ((weak)) +void matrix_init_user(void) { + // leave this function blank - it can be defined in a keymap file +}; + +__attribute__ ((weak)) +void matrix_scan_user(void) { + // leave this function blank - it can be defined in a keymap file +}; + +__attribute__ ((weak)) +void led_set_user(uint8_t usb_led) { + // leave this function blank - it can be defined in a keymap file +}; + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + // Disable status LED on KB, enable status LED on Teensy (KB_STATUS = !TEENSY_STATUS) + DDRD |= (1<<6); + PORTD |= (1<<6); + + matrix_init_user(); +}; + +void amatrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +}; + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + if (usb_led & (1< + +// This macro is an example of using a non-standard row-column matrix. The +// keyboard in question had 11 rows and 8 columns, but the rows were not all +// horizontal, and the columns were not all vertical. For example, row 2 +// contained "Print Screen", "N", "M", ",", ".", "/", "Right Shift", and +// "Left Alt". Column 0 contained "F6", "7", "O", "'", "Q", "D", "B", +// "Left Alt", "Up Arrow", and "Down Arrow". +// +// The macro makes programming the keys easier and in a more straight-forward +// manner because it realigns the keys into a 6x15 sensible keyboard layout +// instead of the obtuse 11x8 matrix. + +#define KEYMAP( \ + K77, K05, K04, K03, K02, K01, K00, KA7, KA6, KA5, KA4, KA3, KA2, K11, K94, \ + K27, K76, K75, K74, K73, K72, K71, K70, K67, K66, K65, K64, K63, K62, KA1, \ + K61, K60, K57, K56, K55, K54, K53, K52, K51, K50, K47, K46, K45, K97, \ + K43, K42, K41, K40, K37, K36, K35, K34, K33, K32, K31, K30, K44, K87, \ + K26, K24, K23, K22, K21, K20, K17, K16, K15, K14, K13, K12, KA0, K91, \ + K10, K06, K25, K07, K86, K85, K95, K90, K93 \ +) { \ +{ KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, }, \ +{ KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, }, \ +{ KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, }, \ +{ KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, }, \ +{ KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47, }, \ +{ KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57, }, \ +{ KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67, }, \ +{ KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77, }, \ +{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_##K85, KC_##K86, KC_##K87, }, \ +{ KC_##K90, KC_##K91, KC_NO, KC_##K93, KC_##K94, KC_##K95, KC_NO, KC_##K97, }, \ +{ KC_##KA0, KC_##KA1, KC_##KA2, KC_##KA3, KC_##KA4, KC_##KA5, KC_##KA6, KC_##KA7, } \ +} + +void matrix_init_user(void); +void matrix_scan_user(void); +void led_set_user(uint8_t usb_led); + +#endif \ No newline at end of file diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c index 7068ca4f31..2eef4f15a7 100644 --- a/quantum/keymap_common.c +++ b/quantum/keymap_common.c @@ -25,6 +25,7 @@ along with this program. If not, see . #include "debug.h" #include "backlight.h" #include "keymap_midi.h" +#include "bootloader.h" #include #include diff --git a/quantum/keymap_extras/keymap_bepo.h b/quantum/keymap_extras/keymap_bepo.h new file mode 100644 index 0000000000..1ab2d63ddd --- /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 b011561e2f..da91b4bf46 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/led.c b/quantum/led.c index 2c05746607..9cdb8a5c20 100644 --- a/quantum/led.c +++ b/quantum/led.c @@ -19,9 +19,16 @@ along with this program. If not, see . #include "stdint.h" #include "led.h" +__attribute__ ((weak)) +void led_set_kb(uint8_t usb_led) { + +} void led_set(uint8_t usb_led) { + + // Example LED Code + // // // Using PE6 Caps Lock LED // if (usb_led & (1<.c` and see keymap document (you can find in top README.md) and existent keymap files. +Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `.c` in the keymaps folder, and see keymap document (you can find in top README.md) and existent keymap files. To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: ``` diff --git a/quantum/template/config.h b/quantum/template/config.h index 7d6149f436..e6fb7866c6 100644 --- a/quantum/template/config.h +++ b/quantum/template/config.h @@ -32,34 +32,110 @@ along with this program. If not, see . #define MATRIX_ROWS 2 #define MATRIX_COLS 3 -// Planck PCB default pin-out -// Change this to how you wired your keyboard -// COLS: Left to right, ROWS: Top to bottom +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ #define COLS (int []){ F1, F0, B0 } #define ROWS (int []){ D0, D5 } /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW -/* define if matrix has ghost */ +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST /* number of backlight levels */ #define BACKLIGHT_LEVELS 3 -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCE 5 - /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ #define IS_COMMAND() ( \ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/quantum/template/template.c b/quantum/template/template.c index 7be7dfc3d1..cc52e496ff 100644 --- a/quantum/template/template.c +++ b/quantum/template/template.c @@ -1,29 +1,48 @@ #include "%KEYBOARD%.h" __attribute__ ((weak)) -void * matrix_init_user(void) { - // leave these blank +void matrix_init_user(void) { + // leave this function blank - it can be defined in a keymap file }; __attribute__ ((weak)) -void * matrix_scan_user(void) { - // leave these blank -}; +void matrix_scan_user(void) { + // leave this function blank - it can be defined in a keymap file +} -void * matrix_init_kb(void) { +__attribute__ ((weak)) +void process_action_user(keyrecord_t *record) { + // leave this function blank - it can be defined in a keymap file +} + +__attribute__ ((weak)) +void led_set_user(uint8_t usb_led) { + // leave this function blank - it can be defined in a keymap file +} + +void matrix_init_kb(void) { // put your keyboard start-up code here // runs once when the firmware starts up - 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(); +} + +void process_action_kb(keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + process_action_user(record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/quantum/template/template.h b/quantum/template/template.h index a15061b267..b1c34d3cbe 100644 --- a/quantum/template/template.h +++ b/quantum/template/template.h @@ -17,9 +17,11 @@ { \ { 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); +void process_action_user(keyrecord_t *record); +void led_set_user(uint8_t usb_led); -#endif \ No newline at end of file +#endif diff --git a/teensy-sdk b/teensy-sdk deleted file mode 160000 index 19892c1968..0000000000 --- a/teensy-sdk +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 19892c196894e6676fa69c732e05a03a68d5cb07 diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index 77ea39e942..2ccc0e0b94 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -53,6 +53,9 @@ void action_exec(keyevent_t event) #endif } +__attribute__ ((weak)) +void process_action_kb(keyrecord_t *record) {} + void process_action(keyrecord_t *record) { keyevent_t event = record->event; @@ -62,6 +65,8 @@ void process_action(keyrecord_t *record) if (IS_NOEVENT(event)) { return; } + process_action_kb(record); + action_t action = layer_switch_get_action(event.key); dprint("ACTION: "); debug_action(action); #ifndef NO_ACTION_LAYER @@ -70,6 +75,10 @@ void process_action(keyrecord_t *record) #endif dprintln(); + if (event.pressed) { + // clear the potential weak mods left by previously pressed keys + clear_weak_mods(); + } switch (action.kind.id) { /* Key and Mods */ case ACT_LMODS: @@ -500,6 +509,7 @@ void clear_keyboard(void) void clear_keyboard_but_mods(void) { clear_weak_mods(); + clear_macro_mods(); clear_keys(); send_keyboard_report(); #ifdef MOUSEKEY_ENABLE diff --git a/tmk_core/common/action.h b/tmk_core/common/action.h index 8a4736d7bc..9f528af4b9 100644 --- a/tmk_core/common/action.h +++ b/tmk_core/common/action.h @@ -58,6 +58,9 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt); /* user defined special function */ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt); +/* keyboard-specific key event (pre)processing */ +void process_action_kb(keyrecord_t *record); + /* Utilities for actions. */ void process_action(keyrecord_t *record); void register_code(uint8_t code); diff --git a/tmk_core/common/action_macro.c b/tmk_core/common/action_macro.c index ffaf125c06..7726b11907 100644 --- a/tmk_core/common/action_macro.c +++ b/tmk_core/common/action_macro.c @@ -41,7 +41,7 @@ void action_macro_play(const macro_t *macro_p) MACRO_READ(); dprintf("KEY_DOWN(%02X)\n", macro); if (IS_MOD(macro)) { - add_weak_mods(MOD_BIT(macro)); + add_macro_mods(MOD_BIT(macro)); send_keyboard_report(); } else { register_code(macro); @@ -51,7 +51,7 @@ void action_macro_play(const macro_t *macro_p) MACRO_READ(); dprintf("KEY_UP(%02X)\n", macro); if (IS_MOD(macro)) { - del_weak_mods(MOD_BIT(macro)); + del_macro_mods(MOD_BIT(macro)); send_keyboard_report(); } else { unregister_code(macro); diff --git a/tmk_core/common/action_util.c b/tmk_core/common/action_util.c index f81877dd9f..a2d6577b24 100644 --- a/tmk_core/common/action_util.c +++ b/tmk_core/common/action_util.c @@ -29,6 +29,7 @@ static inline void del_key_bit(uint8_t code); static uint8_t real_mods = 0; static uint8_t weak_mods = 0; +static uint8_t macro_mods = 0; #ifdef USB_6KRO_ENABLE #define RO_ADD(a, b) ((a + b) % KEYBOARD_REPORT_KEYS) @@ -55,6 +56,7 @@ static int16_t oneshot_time = 0; void send_keyboard_report(void) { keyboard_report->mods = real_mods; keyboard_report->mods |= weak_mods; + keyboard_report->mods |= macro_mods; #ifndef NO_ACTION_ONESHOT if (oneshot_mods) { #if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0)) @@ -118,6 +120,13 @@ void del_weak_mods(uint8_t mods) { weak_mods &= ~mods; } void set_weak_mods(uint8_t mods) { weak_mods = mods; } void clear_weak_mods(void) { weak_mods = 0; } +/* macro modifier */ +uint8_t get_macro_mods(void) { return macro_mods; } +void add_macro_mods(uint8_t mods) { macro_mods |= mods; } +void del_macro_mods(uint8_t mods) { macro_mods &= ~mods; } +void set_macro_mods(uint8_t mods) { macro_mods = mods; } +void clear_macro_mods(void) { macro_mods = 0; } + /* Oneshot modifier */ #ifndef NO_ACTION_ONESHOT void set_oneshot_mods(uint8_t mods) diff --git a/tmk_core/common/action_util.h b/tmk_core/common/action_util.h index a955638b46..1a95cec10e 100644 --- a/tmk_core/common/action_util.h +++ b/tmk_core/common/action_util.h @@ -47,6 +47,13 @@ void del_weak_mods(uint8_t mods); void set_weak_mods(uint8_t mods); void clear_weak_mods(void); +/* macro modifier */ +uint8_t get_macro_mods(void); +void add_macro_mods(uint8_t mods); +void del_macro_mods(uint8_t mods); +void set_macro_mods(uint8_t mods); +void clear_macro_mods(void); + /* oneshot modifier */ void set_oneshot_mods(uint8_t mods); void clear_oneshot_mods(void); diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c index caf0b06254..c07c2801d5 100644 --- a/tmk_core/common/avr/suspend.c +++ b/tmk_core/common/avr/suspend.c @@ -66,9 +66,12 @@ static void power_down(uint8_t wdto) wdt_intr_enable(wdto); #ifdef BACKLIGHT_ENABLE -backlight_set(0); + backlight_set(0); #endif + // Turn off LED indicators + led_set(0); + // TODO: more power saving // See PicoPower application note // - I/O port input with pullup diff --git a/tmk_core/common/command.c b/tmk_core/common/command.c index d59bb01bbc..b4cd3ca56b 100644 --- a/tmk_core/common/command.c +++ b/tmk_core/common/command.c @@ -52,6 +52,8 @@ along with this program. If not, see . static bool command_common(uint8_t code); static void command_common_help(void); +static void print_version(void); +static void print_status(void); static bool command_console(uint8_t code); static void command_console_help(void); #ifdef MOUSEKEY_ENABLE @@ -112,35 +114,140 @@ bool command_console_extra(uint8_t code) ***********************************************************/ static void command_common_help(void) { - print("\n\t- Magic -\n" - "d: debug\n" - "x: debug matrix\n" - "k: debug keyboard\n" - "m: debug mouse\n" - "v: version\n" - "s: status\n" - "c: console mode\n" - "0-4: layer0-4(F10-F4)\n" - "Paus: bootloader\n" + print( "\n\t- Magic -\n" + STR(MAGIC_KEY_DEBUG ) ": Debug Message Toggle\n" + STR(MAGIC_KEY_DEBUG_MATRIX) ": Matrix Debug Mode Toggle - Show keypresses in matrix grid\n" + STR(MAGIC_KEY_DEBUG_KBD ) ": Keyboard Debug Toggle - Show keypress report\n" + STR(MAGIC_KEY_DEBUG_MOUSE ) ": Debug Mouse Toggle\n" + STR(MAGIC_KEY_VERSION ) ": Version\n" + STR(MAGIC_KEY_STATUS ) ": Status\n" + STR(MAGIC_KEY_CONSOLE ) ": Activate Console Mode\n" + +#if MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM + STR(MAGIC_KEY_LAYER0 ) ": Switch to Layer 0\n" + STR(MAGIC_KEY_LAYER1 ) ": Switch to Layer 1\n" + STR(MAGIC_KEY_LAYER2 ) ": Switch to Layer 2\n" + STR(MAGIC_KEY_LAYER3 ) ": Switch to Layer 3\n" + STR(MAGIC_KEY_LAYER4 ) ": Switch to Layer 4\n" + STR(MAGIC_KEY_LAYER5 ) ": Switch to Layer 5\n" + STR(MAGIC_KEY_LAYER6 ) ": Switch to Layer 6\n" + STR(MAGIC_KEY_LAYER7 ) ": Switch to Layer 7\n" + STR(MAGIC_KEY_LAYER8 ) ": Switch to Layer 8\n" + STR(MAGIC_KEY_LAYER9 ) ": Switch to Layer 9\n" +#endif + +#if MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS + "F1-F10: Switch to Layer 0-9 (F10 = L0)\n" +#endif + +#if MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS + "0-9: Switch to Layer 0-9\n" +#endif + + STR(MAGIC_KEY_LAYER0_ALT1 ) ": Switch to Layer 0 (alternate key 1)\n" + STR(MAGIC_KEY_LAYER0_ALT2 ) ": Switch to Layer 0 (alternate key 2)\n" + STR(MAGIC_KEY_BOOTLOADER ) ": Jump to Bootloader (Reset)\n" #ifdef KEYBOARD_LOCK_ENABLE - "Caps: Lock\n" + STR(MAGIC_KEY_LOCK ) ": Lock\n" #endif #ifdef BOOTMAGIC_ENABLE - "e: eeprom\n" + STR(MAGIC_KEY_EEPROM ) ": Print EEPROM Settings\n" #endif #ifdef NKRO_ENABLE - "n: NKRO\n" + STR(MAGIC_KEY_NKRO ) ": NKRO Toggle\n" #endif #ifdef SLEEP_LED_ENABLE - "z: sleep LED test\n" + STR(MAGIC_KEY_SLEEP_LED ) ": Sleep LED Test\n" #endif ); } +static void print_version(void) +{ + // print version & information + print("\n\t- Version -\n"); + print("DESC: " STR(DESCRIPTION) "\n"); + print("VID: " STR(VENDOR_ID) "(" STR(MANUFACTURER) ") " + "PID: " STR(PRODUCT_ID) "(" STR(PRODUCT) ") " + "VER: " STR(DEVICE_VER) "\n"); + print("BUILD: " STR(VERSION) " (" __TIME__ " " __DATE__ ")\n"); + + /* build options */ + print("OPTIONS:" + +#ifdef PROTOCOL_PJRC + " PJRC" +#endif +#ifdef PROTOCOL_LUFA + " LUFA" +#endif +#ifdef PROTOCOL_VUSB + " VUSB" +#endif +#ifdef BOOTMAGIC_ENABLE + " BOOTMAGIC" +#endif +#ifdef MOUSEKEY_ENABLE + " MOUSEKEY" +#endif +#ifdef EXTRAKEY_ENABLE + " EXTRAKEY" +#endif +#ifdef CONSOLE_ENABLE + " CONSOLE" +#endif +#ifdef COMMAND_ENABLE + " COMMAND" +#endif +#ifdef NKRO_ENABLE + " NKRO" +#endif +#ifdef KEYMAP_SECTION_ENABLE + " KEYMAP_SECTION" +#endif + + " " STR(BOOTLOADER_SIZE) "\n"); + + print("GCC: " STR(__GNUC__) "." STR(__GNUC_MINOR__) "." STR(__GNUC_PATCHLEVEL__) + " AVR-LIBC: " __AVR_LIBC_VERSION_STRING__ + " AVR_ARCH: avr" STR(__AVR_ARCH__) "\n"); + + return; +} + +static void print_status(void) +{ + + print("\n\t- Status -\n"); + + print_val_hex8(host_keyboard_leds()); + print_val_hex8(keyboard_protocol); + print_val_hex8(keyboard_idle); +#ifdef NKRO_ENABLE + print_val_hex8(keyboard_nkro); +#endif + print_val_hex32(timer_count); + +#ifdef PROTOCOL_PJRC + print_val_hex8(UDCON); + print_val_hex8(UDIEN); + print_val_hex8(UDINT); + print_val_hex8(usb_keyboard_leds); + print_val_hex8(usb_keyboard_idle_count); +#endif + +#ifdef PROTOCOL_PJRC +# if USB_COUNT_SOF + print_val_hex8(usbSofCount); +# endif +#endif + return; +} + #ifdef BOOTMAGIC_ENABLE static void print_eeconfig(void) { @@ -178,24 +285,36 @@ static void print_eeconfig(void) static bool command_common(uint8_t code) { + +#ifdef KEYBOARD_LOCK_ENABLE static host_driver_t *host_driver = 0; +#endif + switch (code) { + #ifdef SLEEP_LED_ENABLE - case KC_Z: - // test breathing sleep LED - print("Sleep LED test\n"); + + // test breathing sleep LED + case MAGIC_KC(MAGIC_KEY_SLEEP_LED): + print("Sleep LED Test\n"); sleep_led_toggle(); led_set(host_keyboard_leds()); break; #endif + #ifdef BOOTMAGIC_ENABLE - case KC_E: + + // print stored eeprom config + case MAGIC_KC(MAGIC_KEY_EEPROM): print("eeconfig:\n"); print_eeconfig(); break; #endif + #ifdef KEYBOARD_LOCK_ENABLE - case KC_CAPSLOCK: + + // lock/unlock keyboard + case MAGIC_KC(MAGIC_KEY_LOCK): if (host_get_driver()) { host_driver = host_get_driver(); clear_keyboard(); @@ -207,11 +326,15 @@ static bool command_common(uint8_t code) } break; #endif - case KC_H: - case KC_SLASH: /* ? */ + + // print help + case MAGIC_KC(MAGIC_KEY_HELP1): + case MAGIC_KC(MAGIC_KEY_HELP2): command_common_help(); break; - case KC_C: + + // activate console + case MAGIC_KC(MAGIC_KEY_CONSOLE): debug_matrix = false; debug_keyboard = false; debug_mouse = false; @@ -220,25 +343,33 @@ static bool command_common(uint8_t code) print("C> "); command_state = CONSOLE; break; - case KC_PAUSE: - clear_keyboard(); - print("\n\nbootloader... "); + + // jump to bootloader + case MAGIC_KC(MAGIC_KEY_BOOTLOADER): + clear_keyboard(); // clear to prevent stuck keys + print("\n\nJumping to bootloader... "); _delay_ms(1000); bootloader_jump(); // not return break; - case KC_D: + + // debug toggle + case MAGIC_KC(MAGIC_KEY_DEBUG): + debug_enable = !debug_enable; if (debug_enable) { + print("\ndebug: on\n"); + debug_matrix = true; + debug_keyboard = true; + debug_mouse = true; + } else { print("\ndebug: off\n"); debug_matrix = false; debug_keyboard = false; debug_mouse = false; - debug_enable = false; - } else { - print("\ndebug: on\n"); - debug_enable = true; } break; - case KC_X: // debug matrix toggle + + // debug matrix toggle + case MAGIC_KC(MAGIC_KEY_DEBUG_MATRIX): debug_matrix = !debug_matrix; if (debug_matrix) { print("\nmatrix: on\n"); @@ -247,7 +378,9 @@ static bool command_common(uint8_t code) print("\nmatrix: off\n"); } break; - case KC_K: // debug keyboard toggle + + // debug keyboard toggle + case MAGIC_KC(MAGIC_KEY_DEBUG_KBD): debug_keyboard = !debug_keyboard; if (debug_keyboard) { print("\nkeyboard: on\n"); @@ -256,87 +389,33 @@ static bool command_common(uint8_t code) print("\nkeyboard: off\n"); } break; - case KC_M: // debug mouse toggle + + // debug mouse toggle + case MAGIC_KC(MAGIC_KEY_DEBUG_MOUSE): debug_mouse = !debug_mouse; if (debug_mouse) { print("\nmouse: on\n"); debug_enable = true; } else { - print("\nmouse: off\n"); + print("\nmouse: off\n"); } break; - case KC_V: // print version & information - print("\n\t- Version -\n"); - print("DESC: " STR(DESCRIPTION) "\n"); - print("VID: " STR(VENDOR_ID) "(" STR(MANUFACTURER) ") " - "PID: " STR(PRODUCT_ID) "(" STR(PRODUCT) ") " - "VER: " STR(DEVICE_VER) "\n"); - print("BUILD: " STR(VERSION) " (" __TIME__ " " __DATE__ ")\n"); - /* build options */ - print("OPTIONS:" -#ifdef PROTOCOL_PJRC - " PJRC" -#endif -#ifdef PROTOCOL_LUFA - " LUFA" -#endif -#ifdef PROTOCOL_VUSB - " VUSB" -#endif -#ifdef BOOTMAGIC_ENABLE - " BOOTMAGIC" -#endif -#ifdef MOUSEKEY_ENABLE - " MOUSEKEY" -#endif -#ifdef EXTRAKEY_ENABLE - " EXTRAKEY" -#endif -#ifdef CONSOLE_ENABLE - " CONSOLE" -#endif -#ifdef COMMAND_ENABLE - " COMMAND" -#endif -#ifdef NKRO_ENABLE - " NKRO" -#endif -#ifdef KEYMAP_SECTION_ENABLE - " KEYMAP_SECTION" -#endif - " " STR(BOOTLOADER_SIZE) "\n"); - print("GCC: " STR(__GNUC__) "." STR(__GNUC_MINOR__) "." STR(__GNUC_PATCHLEVEL__) - " AVR-LIBC: " __AVR_LIBC_VERSION_STRING__ - " AVR_ARCH: avr" STR(__AVR_ARCH__) "\n"); + // print version + case MAGIC_KC(MAGIC_KEY_VERSION): + print_version(); + break; + + // print status + case MAGIC_KC(MAGIC_KEY_STATUS): + print_status(); break; - case KC_S: - print("\n\t- Status -\n"); - print_val_hex8(host_keyboard_leds()); - print_val_hex8(keyboard_protocol); - print_val_hex8(keyboard_idle); -#ifdef NKRO_ENABLE - print_val_hex8(keyboard_nkro); -#endif - print_val_hex32(timer_count); -#ifdef PROTOCOL_PJRC - print_val_hex8(UDCON); - print_val_hex8(UDIEN); - print_val_hex8(UDINT); - print_val_hex8(usb_keyboard_leds); - print_val_hex8(usb_keyboard_idle_count); -#endif - -#ifdef PROTOCOL_PJRC -# if USB_COUNT_SOF - print_val_hex8(usbSofCount); -# endif -#endif - break; #ifdef NKRO_ENABLE - case KC_N: - clear_keyboard(); //Prevents stuck keys. + + // NKRO toggle + case MAGIC_KC(MAGIC_KEY_NKRO): + clear_keyboard(); // clear to prevent stuck keys keyboard_nkro = !keyboard_nkro; if (keyboard_nkro) print("NKRO: on\n"); @@ -344,18 +423,78 @@ static bool command_common(uint8_t code) print("NKRO: off\n"); break; #endif - case KC_ESC: - case KC_GRV: - case KC_0: - case KC_F10: + + // switch layers + + case MAGIC_KC(MAGIC_KEY_LAYER0_ALT1): + case MAGIC_KC(MAGIC_KEY_LAYER0_ALT2): switch_default_layer(0); break; - case KC_1 ... KC_9: - switch_default_layer((code - KC_1) + 1); + +#if MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM + + case MAGIC_KC(MAGIC_KEY_LAYER0): + switch_default_layer(0); break; + + case MAGIC_KC(MAGIC_KEY_LAYER1): + switch_default_layer(1); + break; + + case MAGIC_KC(MAGIC_KEY_LAYER2): + switch_default_layer(2); + break; + + case MAGIC_KC(MAGIC_KEY_LAYER3): + switch_default_layer(3); + break; + + case MAGIC_KC(MAGIC_KEY_LAYER4): + switch_default_layer(4); + break; + + case MAGIC_KC(MAGIC_KEY_LAYER5): + switch_default_layer(5); + break; + + case MAGIC_KC(MAGIC_KEY_LAYER6): + switch_default_layer(6); + break; + + case MAGIC_KC(MAGIC_KEY_LAYER7): + switch_default_layer(7); + break; + + case MAGIC_KC(MAGIC_KEY_LAYER8): + switch_default_layer(8); + break; + + case MAGIC_KC(MAGIC_KEY_LAYER9): + switch_default_layer(9); + break; +#endif + + +#if MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS + case KC_F1 ... KC_F9: switch_default_layer((code - KC_F1) + 1); break; + case KC_F10: + switch_default_layer(0); + break; +#endif + +#if MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS + + case KC_1 ... KC_9: + switch_default_layer((code - KC_1) + 1); + break; + case KC_0: + switch_default_layer(0); + break; +#endif + default: print("?"); return false; diff --git a/tmk_core/common/command.h b/tmk_core/common/command.h index b57a6c1ced..92b18849bf 100644 --- a/tmk_core/common/command.h +++ b/tmk_core/common/command.h @@ -32,4 +32,125 @@ bool command_proc(uint8_t code); #define command_proc(code) false #endif + +#ifndef MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true #endif + +#ifndef MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +#endif + +#ifndef MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false +#endif + +#ifndef MAGIC_KEY_HELP1 +#define MAGIC_KEY_HELP1 H +#endif + +#ifndef MAGIC_KEY_HELP2 +#define MAGIC_KEY_HELP2 SLASH +#endif + +#ifndef MAGIC_KEY_DEBUG +#define MAGIC_KEY_DEBUG D +#endif + +#ifndef MAGIC_KEY_DEBUG_MATRIX +#define MAGIC_KEY_DEBUG_MATRIX X +#endif + +#ifndef MAGIC_KEY_DEBUG_KBD +#define MAGIC_KEY_DEBUG_KBD K +#endif + +#ifndef MAGIC_KEY_DEBUG_MOUSE +#define MAGIC_KEY_DEBUG_MOUSE M +#endif + +#ifndef MAGIC_KEY_VERSION +#define MAGIC_KEY_VERSION V +#endif + +#ifndef MAGIC_KEY_STATUS +#define MAGIC_KEY_STATUS S +#endif + +#ifndef MAGIC_KEY_CONSOLE +#define MAGIC_KEY_CONSOLE C +#endif + +#ifndef MAGIC_KEY_LAYER0_ALT1 +#define MAGIC_KEY_LAYER0_ALT1 ESC +#endif + +#ifndef MAGIC_KEY_LAYER0_ALT2 +#define MAGIC_KEY_LAYER0_ALT2 GRAVE +#endif + +#ifndef MAGIC_KEY_LAYER0 +#define MAGIC_KEY_LAYER0 0 +#endif + +#ifndef MAGIC_KEY_LAYER1 +#define MAGIC_KEY_LAYER1 1 +#endif + +#ifndef MAGIC_KEY_LAYER2 +#define MAGIC_KEY_LAYER2 2 +#endif + +#ifndef MAGIC_KEY_LAYER3 +#define MAGIC_KEY_LAYER3 3 +#endif + +#ifndef MAGIC_KEY_LAYER4 +#define MAGIC_KEY_LAYER4 4 +#endif + +#ifndef MAGIC_KEY_LAYER5 +#define MAGIC_KEY_LAYER5 5 +#endif + +#ifndef MAGIC_KEY_LAYER6 +#define MAGIC_KEY_LAYER6 6 +#endif + +#ifndef MAGIC_KEY_LAYER7 +#define MAGIC_KEY_LAYER7 7 +#endif + +#ifndef MAGIC_KEY_LAYER8 +#define MAGIC_KEY_LAYER8 8 +#endif + +#ifndef MAGIC_KEY_LAYER9 +#define MAGIC_KEY_LAYER9 9 +#endif + +#ifndef MAGIC_KEY_BOOTLOADER +#define MAGIC_KEY_BOOTLOADER PAUSE +#endif + +#ifndef MAGIC_KEY_LOCK +#define MAGIC_KEY_LOCK CAPS +#endif + +#ifndef MAGIC_KEY_EEPROM +#define MAGIC_KEY_EEPROM E +#endif + +#ifndef MAGIC_KEY_NKRO +#define MAGIC_KEY_NKRO N +#endif + +#ifndef MAGIC_KEY_SLEEP_LED +#define MAGIC_KEY_SLEEP_LED Z + +#endif + +#define XMAGIC_KC(key) KC_##key +#define MAGIC_KC(key) XMAGIC_KC(key) + +#endif \ No newline at end of file diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c index eb7b096bed..302b3ec87c 100644 --- a/tmk_core/common/keyboard.c +++ b/tmk_core/common/keyboard.c @@ -70,6 +70,7 @@ void keyboard_setup(void) void keyboard_init(void) { + timer_init(); matrix_init(); #ifdef PS2_MOUSE_ENABLE @@ -90,6 +91,11 @@ void keyboard_init(void) #ifdef BACKLIGHT_ENABLE backlight_init(); #endif + +#if defined(NKRO_ENABLE) && defined(FORCE_NKRO) + keyboard_nkro = true; +#endif + } /* diff --git a/tmk_core/common/led.h b/tmk_core/common/led.h index d5fc051bf5..2e18dc2afa 100644 --- a/tmk_core/common/led.h +++ b/tmk_core/common/led.h @@ -34,8 +34,11 @@ extern "C" { void led_set(uint8_t usb_led); +/* keyboard-specific LED functionality */ +void led_set_kb(uint8_t usb_led); + #ifdef __cplusplus } #endif -#endif +#endif \ No newline at end of file diff --git a/tmk_core/common/matrix.h b/tmk_core/common/matrix.h index 85415df719..0b013fc989 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 }