1
0
Fork 0
This commit is contained in:
Nicholas Keene 2016-05-02 21:35:58 -05:00
commit 8b0274f60a
255 changed files with 14517 additions and 3795 deletions

4
.gitignore vendored
View file

@ -16,8 +16,8 @@ build/
.vagrant/ .vagrant/
.DS_STORE .DS_STORE
# Eclipse Settings # Eclipse/PyCharm/Other IDE Settings
.cproject .cproject
.project .project
.settings/ .settings/
.idea

View file

@ -1,9 +1,77 @@
@echo off @SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
setx /M path "%PATH%;C:\MinGW\bin;C:\MinGW\msys\1.0\bin" > nul 2>&1 @ECHO OFF
if NOT ["%errorlevel%"]==["0"] ( SET CMDLINERUNSTR=%SystemRoot%\system32\cmd.exe
echo FAILED. Rerun with administrator privileges.
pause SET NEWPATH1="C:\MinGW\msys\1.0\bin"
) else ( SET NEWPATH2="C:\MinGW\bin"
echo Success!
pause :: Make sure we're running with administrator privileges
NET SESSION >nul 2>&1
IF ERRORLEVEL 1 (
ECHO FAILED. Run this script with administrator privileges.
GOTO ExitBatch
) )
:: Make sure the second path exists. The first path won't be created until the second script is run
IF NOT EXIST !NEWPATH2! (ECHO Path not found: %NEWPATH2% && GOTO ExitBatch)
:: Add paths
CALL :AddPath %NEWPATH1%
CALL :AddPath %NEWPATH2%
:: Branch to UpdateEnv if we need to update
IF DEFINED UPDATE (GOTO UpdateEnv)
GOTO ExitBatch
:: -----------------------------------------------------------------------------
:UpdateEnv
ECHO Making updated PATH go live . . .
REG delete HKCU\Environment /F /V TEMPVAR > nul 2>&1
setx TEMPVAR 1 > nul 2>&1
REG delete HKCU\Environment /F /V TEMPVAR > nul 2>&1
IF NOT !cmdcmdline! == !CMDLINERUNSTR! (CALL :KillExplorer)
GOTO ExitBatch
:: -----------------------------------------------------------------------------
:ExitBatch
ENDLOCAL
PAUSE
EXIT /b
:: -----------------------------------------------------------------------------
:AddPath <pathToAdd>
ECHO %PATH% | FINDSTR /C:"%~1" > nul
IF ERRORLEVEL 1 (
REG add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /f /v PATH /t REG_SZ /d "%PATH%;%~1" > nul 2>&1
IF ERRORLEVEL 0 (
ECHO Adding %1 . . . Success!
SET "PATH=%PATH%;%~1"
SET UPDATE=1
) ELSE (
ECHO Adding %1 . . . FAILED. Run this script with administrator privileges.
)
) ELSE (
ECHO Skipping %1 - Already in PATH
)
EXIT /b
:: -----------------------------------------------------------------------------
:KillExplorer
ECHO Your desktop is being restarted, please wait. . .
ping -n 5 127.0.0.1 > NUL 2>&1
ECHO Killing process Explorer.exe. . .
taskkill /f /im explorer.exe
ECHO.
ECHO Your desktop is now loading. . .
ping -n 5 127.0.0.1 > NUL 2>&1
ECHO.
ping -n 5 127.0.0.1 > NUL 2>&1
START explorer.exe
START explorer.exe %CD%
EXIT /b

View file

@ -1,41 +1,63 @@
@echo off @SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
setx /M test test > nul 2>&1 @ECHO OFF
if NOT ["%errorlevel%"]==["0"] (
echo FAILED. Rerun with administrator privileges. SET STARTINGDIR=%CD%
pause
exit :: Check for admin privilages
SETX /M test test > nul 2>&1
IF NOT ["%ERRORLEVEL%"]==["0"] (
ECHO FAILED. Rerun with administrator privileges.
GOTO ExitBatch
) )
echo ------------------------------------------ :: Make sure path to MinGW exists - if so, CD to it
echo Installing wget and unzip SET MINGWPATH="C:\MinGW\bin"
echo ------------------------------------------ IF NOT EXIST !MINGWPATH! (ECHO Path not found: %MINGWPATH% && GOTO ExitBatch)
mingw-get install msys-wget-bin msys-unzip-bin CD /D %MINGWPATH%
cd \MinGW\bin
mkdir temp
cd temp ECHO ------------------------------------------
echo ------------------------------------------ ECHO Installing wget and unzip
echo Installing dfu-programmer. ECHO ------------------------------------------
echo ------------------------------------------ mingw-get install msys-wget-bin msys-unzip-bin
MKDIR temp
CD temp
ECHO ------------------------------------------
ECHO Installing dfu-programmer.
ECHO ------------------------------------------
wget http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip wget http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip
unzip dfu-programmer-win-0.7.2.zip unzip dfu-programmer-win-0.7.2.zip
copy dfu-programmer.exe .. COPY dfu-programmer.exe ..
echo ------------------------------------------ ECHO ------------------------------------------
echo Downloading driver ECHO Downloading driver
echo ------------------------------------------ ECHO ------------------------------------------
wget http://iweb.dl.sourceforge.net/project/libusb-win32/libusb-win32-releases/1.2.6.0/libusb-win32-bin-1.2.6.0.zip wget http://iweb.dl.sourceforge.net/project/libusb-win32/libusb-win32-releases/1.2.6.0/libusb-win32-bin-1.2.6.0.zip
unzip libusb-win32-bin-1.2.6.0.zip unzip libusb-win32-bin-1.2.6.0.zip
cp libusb-win32-bin-1.2.6.0\bin\x86\libusb0_x86.dll ../libusb0.dll COPY libusb-win32-bin-1.2.6.0\bin\x86\libusb0_x86.dll ../libusb0.dll
echo ------------------------------------------ ECHO ------------------------------------------
echo Installing driver. Accept prompt. ECHO Installing driver. Accept prompt.
echo ------------------------------------------ ECHO ------------------------------------------
pnputil -i -a dfu-prog-usb-1.2.2\atmel_usb_dfu.inf IF EXIST "%WinDir%\System32\PnPUtil.exe" (%WinDir%\System32\PnPUtil.exe -i -a dfu-prog-usb-1.2.2\atmel_usb_dfu.inf && GOTO PNPUTILFOUND)
IF EXIST "%WinDir%\Sysnative\PnPUtil.exe" (%WinDir%\Sysnative\PnPUtil.exe -i -a dfu-prog-usb-1.2.2\atmel_usb_dfu.inf && GOTO PNPUTILFOUND)
cd .. ECHO FAILED. Could not find PnPUtil.exe in "%WinDir%\System32" or "%WinDir%\Sysnative".
rm -rf temp
echo ------------------------------------------ :PNPUTILFOUND
echo Finished!
pause :: Wait then delete directory
ping -n 5 127.0.0.1 > NUL 2>&1
CD ..
RD /s /q temp
ECHO ------------------------------------------
ECHO Finished!
:ExitBatch
CD /D %STARTINGDIR%
ENDLOCAL
PAUSE
EXIT /b

View file

@ -3,11 +3,13 @@
## Build Environment Setup ## Build Environment Setup
### Windows ### 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**. 1. If you have ever installed WinAVR, uninstall it.
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. 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. 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. 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. 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. 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 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! 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 ### Mac
If you're using [homebrew,](http://brew.sh/) you can use the following commands: 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]. 3. Install [DFU-Programmer][dfu-prog].
### Linux ### 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: Debian/Ubuntu example:
sudo apt-get update sudo apt-get update
sudo apt-get install gcc-avr dfu-programmer sudo apt-get install gcc-avr avr-libc dfu-programmer
### Vagrant ### 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). 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. 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 ## 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=<name>` after `make`. So if I've named my keymap jack.c, the full command would be `make KEYMAP=jack`. 2. To build a keymap other than the default, type `KEYMAP=<name>` 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=<name> dfu` to both build and deploy the firmware. If you're using a Teensy, you'll probably need to take the <keyboardname>.hex file that make produces in the keyboard's folder, and deploy it using the [Teensy Loader.](https://www.pjrc.com/teensy/loader.html) 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=<name> dfu` to both build and deploy the firmware. If you're using a Teensy, you'll probably need to take the <keyboardname>.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 ## Troubleshooting
1. Try running `make clean` if the make command fails. 1. Try running `make clean` if the make command fails.
WIP WIP

154
README.md
View file

@ -1,11 +1,13 @@
# Quantum MK Firmware # Quantum Mechanical Keyboard Firmware
This is a keyboard firmware based on the [tmk_keyboard firmware](http://github.com/tmk/tmk_keyboard) with some useful features for Atmel AVR controllers, and more specifically, the [OLKB product line](http://olkb.co) and the [ErgoDox EZ](http://www.ergodox-ez.com) keyboard. This is a keyboard firmware based on the [tmk_keyboard firmware](http://github.com/tmk/tmk_keyboard) with some useful features for Atmel AVR controllers, and more specifically, the [OLKB product line](http://olkb.co), the [ErgoDox EZ](http://www.ergodox-ez.com) keyboard, and the [Clueboard product line](http://clueboard.co/).
QMK is developed and maintained by Jack Humbert of OLKB with contributions from the community, and of course, TMK. QMK is developed and maintained by Jack Humbert of OLKB with contributions from the community, and of course, TMK.
This documentation is edited and maintained by Erez Zukerman of ErgoDox EZ. If you spot any typos or inaccuracies, please [open an issue](https://github.com/jackhumbert/qmk_firmware/issues/new). This documentation is edited and maintained by Erez Zukerman of ErgoDox EZ. If you spot any typos or inaccuracies, please [open an issue](https://github.com/jackhumbert/qmk_firmware/issues/new).
The OLKB product firmwares are maintained by Jack, the Ergodox EZ by Erez, and the Clueboard by [Zach White](https://github.com/skullydazed).
## Important background info: TMK documentation ## Important background info: TMK documentation
The documentation below explains QMK customizations and elaborates on some of the more useful features of TMK. To understand the base firmware, and especially what *layers* are and how they work, please see [TMK_README.md](/TMK_README.md). The documentation below explains QMK customizations and elaborates on some of the more useful features of TMK. To understand the base firmware, and especially what *layers* are and how they work, please see [TMK_README.md](/TMK_README.md).
@ -16,13 +18,21 @@ The documentation below explains QMK customizations and elaborates on some of th
* If you're looking to customize a keyboard that currently runs QMK or TMK, find your keyboard's directory under `keyboard/` and run the make commands from there. * If you're looking to customize a keyboard that currently runs QMK or TMK, find your keyboard's directory under `keyboard/` and run the make commands from there.
* If you're looking to apply this firmware to an entirely new hardware project (a new kind of keyboard), you can create your own Quantum-based project by using `./new_project.sh <project_name>`, which will create `/keyboard/<project_name>` with all the necessary components for a Quantum project. * If you're looking to apply this firmware to an entirely new hardware project (a new kind of keyboard), you can create your own Quantum-based project by using `./new_project.sh <project_name>`, which will create `/keyboard/<project_name>` with all the necessary components for a Quantum project.
### Makefile Options
You have access to a bunch of goodies! Check out the Makefile to enable/disable some of the features. Uncomment the `#` to enable them. Setting them to `no` does nothing and will only confuse future you. You have access to a bunch of goodies! Check out the Makefile to enable/disable some of the features. Uncomment the `#` to enable them. Setting them to `no` does nothing and will only confuse future you.
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
MIDI_ENABLE = yes # MIDI controls MIDI_ENABLE = yes # MIDI controls
# UNICODE_ENABLE = yes # Unicode support - this is commented out, just as an example. You have to use #, not // UNICODE_ENABLE = no # <-- This is how you disable an option, just set it to "no"
BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID
### Customizing Makefile options on a per-keymap basis
If your keymap directory has a file called `makefile.mk` (note the lowercase filename, and the `.mk` extension), any Makefile options you set in that file will take precedence over other Makefile options (those set for Quantum as a whole or for your particular keyboard).
So let's say your keyboard's makefile has `CONSOLE_ENABLE = yes` (or maybe doesn't even list the `CONSOLE_ENABLE` option, which would cause it to revert to the global Quantum default). You want your particular keymap to not have the debug console, so you make a file called `makefile.mk` and specify `CONSOLE_ENABLE = no`.
## Quick aliases to common actions ## Quick aliases to common actions
Your keymap can include shortcuts to common operations (called "function actions" in tmk). Your keymap can include shortcuts to common operations (called "function actions" in tmk).
@ -98,6 +108,27 @@ We've added shortcuts to make common modifier/tap (mod-tap) mappings more compac
`DF(layer)` - sets default layer to *layer*. The default layer is the one at the "bottom" of the layer stack - the ultimate fallback layer. This currently does not persist over power loss. When you plug the keyboard back in, layer 0 will always be the default. It is theoretically possible to work around that, but that's not what `DF` does. `DF(layer)` - sets default layer to *layer*. The default layer is the one at the "bottom" of the layer stack - the ultimate fallback layer. This currently does not persist over power loss. When you plug the keyboard back in, layer 0 will always be the default. It is theoretically possible to work around that, but that's not what `DF` does.
### Prevent stuck modifiers
Consider the following scenario:
1. Layer 0 has a key defined as Shift.
2. The same key is defined on layer 1 as the letter A.
3. User presses Shift.
4. User switches to layer 1 for whatever reason.
5. User releases Shift, or rather the letter A.
6. User switches back to layer 0.
Shift was actually never released and is still considered pressed.
If such situation bothers you add this to your `config.h`:
#define PREVENT_STUCK_MODIFIERS
This option uses 5 bytes of memory per every 8 keys on the keyboard
rounded up (5 bits per key). For example on Planck (48 keys) it uses
(48/8)\*5 = 30 bytes.
### Remember: These are just aliases ### Remember: These are just aliases
These functions work the same way that their `ACTION_*` functions do - they're just quick aliases. To dig into all of the tmk ACTION_* functions, please see the [TMK documentation](https://github.com/jackhumbert/qmk_firmware/blob/master/tmk_core/doc/keymap.md#2-action). These functions work the same way that their `ACTION_*` functions do - they're just quick aliases. To dig into all of the tmk ACTION_* functions, please see the [TMK documentation](https://github.com/jackhumbert/qmk_firmware/blob/master/tmk_core/doc/keymap.md#2-action).
@ -178,6 +209,27 @@ This will clear all mods currently pressed.
This will clear all keys besides the mods currently pressed. This will clear all keys besides the mods currently pressed.
* `update_tri_layer(layer_1, layer_2, layer_3);`
If the user attempts to activate layer 1 AND layer 2 at the same time (for example, by hitting their respective layer keys), layer 3 will be activated. Layers 1 and 2 will _also_ be activated, for the purposes of fallbacks (so a given key will fall back from 3 to 2, to 1 -- and only then to 0).
#### Naming your macros
If you have a bunch of macros you want to refer to from your keymap, while keeping the keymap easily readable, you can just name them like so:
```
#define AUD_OFF M(6)
#define AUD_ON M(7)
#define MUS_OFF M(8)
#define MUS_ON M(9)
#define VC_IN M(10)
#define VC_DE M(11)
#define PLOVER M(12)
#define EXT_PLV M(13)
```
As was done on the [Planck default keymap](/keyboard/planck/keymaps/default/keymap.c#L33-L40)
#### Timer functionality #### Timer functionality
It's possible to start timers and read values for time-specific events - here's an example: It's possible to start timers and read values for time-specific events - here's an example:
@ -194,11 +246,91 @@ if (timer_elapsed(key_timer) < 100) {
It's best to declare the `static uint16_t key_timer;` outside of the macro block (top of file, etc). It's best to declare the `static uint16_t key_timer;` outside of the macro block (top of file, etc).
#### Example 1: Single-key copy/paste (hold to copy, tap to paste)
With QMK, it's easy to make one key do two things, as long as one of those things is being a modifier. :) So if you want a key to act as Ctrl when held and send the letter R when tapped, that's easy: `CTL_T(KC_R)`. But what do you do when you want that key to send Ctrl-V (paste) when tapped, and Ctrl-C (copy) when held?
Here's what you do:
```
static uint16_t key_timer;
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
switch(id) {
case 0: {
if (record->event.pressed) {
key_timer = timer_read(); // if the key is being pressed, we start the timer.
}
else { // this means the key was just released, so we can figure out how long it was pressed for (tap or "held down").
if (timer_elapsed(key_timer) > 150) { // 150 being 150ms, the threshhold we pick for counting something as a tap.
return MACRO( D(LCTL), T(C), U(LCTL), END );
}
else {
return MACRO( D(LCTL), T(V), U(LCTL), END );
}
}
break;
}
}
return MACRO_NONE;
};
```
And then, to assign this macro to a key on your keyboard layout, you just use `M(0)` on the key you want to press for copy/paste.
#### Example 2: Space Cadet Shift (making it easy to send opening and closing parentheses)
In the [Modern Space Cadet Keyboard](http://stevelosh.com/blog/2012/10/a-modern-space-cadet/#shift-parentheses), one of cooler features is the Shift Parentheses. To quote Steve Losh:
> When held while pressing other keys, act like Shift.
> When pressed and released on their own, type an opening or closing parenthesis (left and right shift respectively).
```
static uint16_t key_timer;
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
switch(id) {
case 0: {
if (record->event.pressed) {
key_timer = timer_read(); // if the key is being pressed, we start the timer.
register_code(KC_LSFT); // we're now holding down Shift.
} else { // this means the key was just released, so we can figure out how long it was pressed for (tap or "held down").
if (timer_elapsed(key_timer) < 150) { // 150 being 150ms, the threshhold we pick for counting something as a tap.
register_code(KC_9); // sending 9 while Shift is held down gives us an opening paren
unregister_code(KC_9); // now let's let go of that key
}
unregister_code(KC_LSFT); // let's release the Shift key now.
}
break;
}
case 1: {
if (record->event.pressed) {
key_timer = timer_read(); // Now we're doing the same thing, only for the right shift/close paren key
register_code(KC_RSFT);
} else {
if (timer_elapsed(key_timer) < 150) {
register_code(KC_0);
unregister_code(KC_0);
}
unregister_code(KC_RSFT);
}
break;
}
}
return MACRO_NONE;
};
```
And then, to assign this macro to a key on your keyboard layout, you just use `M(0)` on the key you want to press for left shift/opening parens, and `M(1)` for right shift/closing parens.
## Additional keycode aliases for software-implemented layouts (Colemak, Dvorak, etc) ## Additional keycode aliases for software-implemented layouts (Colemak, Dvorak, etc)
Everything is assuming you're in Qwerty (in software) by default, but there is built-in support for using a Colemak or Dvorak layout by including this at the top of your keymap: Everything is assuming you're in Qwerty (in software) by default, but there is built-in support for using a Colemak or Dvorak layout by including this at the top of your keymap:
#include <keymap_extras/keymap_colemak.h> #include <keymap_colemak.h>
If you use Dvorak, use `keymap_dvorak.h` instead of `keymap_colemak.h` for this line. After including this line, you will get access to: If you use Dvorak, use `keymap_dvorak.h` instead of `keymap_colemak.h` for this line. After including this line, you will get access to:
@ -241,7 +373,7 @@ This requires [some hardware changes](https://www.reddit.com/r/MechanicalKeyboar
## International Characters on Windows ## International Characters on Windows
[AutoHotkey](https://autohotkey.com) allows Windows users to create custom hotkeys amont others. [AutoHotkey](https://autohotkey.com) allows Windows users to create custom hotkeys among others.
The method does not require Unicode support in the keyboard itself but depends instead of AutoHotkey running in the background. The method does not require Unicode support in the keyboard itself but depends instead of AutoHotkey running in the background.
@ -269,9 +401,9 @@ For this mod, you need an unused pin wiring to DI of WS2812 strip. After wiring
RGBLIGHT_ENABLE = yes RGBLIGHT_ENABLE = yes
Please note that the underglow is not compatible with MIDI functions. So you cannot enable both of them at the same time. Please note that the underglow is not compatible with audio output. So you cannot enable both of them at the same time.
Please add the following options into your config.h, and set them up according your hardware configuration. Please add the following options into your config.h, and set them up according your hardware configuration. These settings are for the F4 by default:
#define ws2812_PORTREG PORTF #define ws2812_PORTREG PORTF
#define ws2812_DDRREG DDRF #define ws2812_DDRREG DDRF
@ -281,6 +413,12 @@ Please add the following options into your config.h, and set them up according y
#define RGBLIGHT_SAT_STEP 17 #define RGBLIGHT_SAT_STEP 17
#define RGBLIGHT_VAL_STEP 17 #define RGBLIGHT_VAL_STEP 17
You'll need to edit `PORTF`, `DDRF`, and `PF4` on the first three lines to the port/pin you have your LED(s) wired to, eg for B3 change things to:
#define ws2812_PORTREG PORTB
#define ws2812_DDRREG DDRB
#define ws2812_pin PB3
The firmware supports 5 different light effects, and the color (hue, saturation, brightness) can be customized in most effects. To control the underglow, you need to modify your keymap file to assign those functions to some keys/key combinations. For details, please check this keymap. `keyboard/planck/keymaps/yang/keymap.c` The firmware supports 5 different light effects, and the color (hue, saturation, brightness) can be customized in most effects. To control the underglow, you need to modify your keymap file to assign those functions to some keys/key combinations. For details, please check this keymap. `keyboard/planck/keymaps/yang/keymap.c`
### WS2812 Wiring ### WS2812 Wiring
@ -309,4 +447,4 @@ what things are (and likely aren't) too risky.
- EEPROM has around a 100000 write cycle. You shouldn't rewrite the - EEPROM has around a 100000 write cycle. You shouldn't rewrite the
firmware repeatedly and continually; that'll burn the EEPROM firmware repeatedly and continually; that'll burn the EEPROM
eventually. eventually.

View file

@ -53,9 +53,9 @@ SRC = keymap_common.c \
led.c led.c
ifdef KEYMAP ifdef KEYMAP
SRC := keymap_$(KEYMAP).c $(SRC) SRC := keymaps/$(KEYMAP).c $(SRC)
else else
SRC := keymap_plain.c $(SRC) SRC := keymaps/default.c $(SRC)
endif endif
CONFIG_H = config.h CONFIG_H = config.h

View file

@ -27,7 +27,7 @@
# make flip-ee = Download the eeprom file to the device, using Atmel FLIP # make flip-ee = Download the eeprom file to the device, using Atmel FLIP
# (must have Atmel FLIP installed). # (must have Atmel FLIP installed).
# #
# make debug = Start either simulavr or avarice as specified for debugging, # make debug = Start either simulavr or avarice as specified for debugging,
# with avr-gdb or avr-insight as the front end 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.s = Just compile filename.c into the assembler code only.
@ -41,7 +41,6 @@
# Target file name (without extension). # Target file name (without extension).
TARGET = atomic TARGET = atomic
# Directory common source filess exist # Directory common source filess exist
TOP_DIR = ../.. TOP_DIR = ../..
TMK_DIR = ../../tmk_core TMK_DIR = ../../tmk_core
@ -50,14 +49,41 @@ TMK_DIR = ../../tmk_core
TARGET_DIR = . TARGET_DIR = .
# # project specific files # # project specific files
SRC = atomic.c \ SRC = atomic.c
backlight.c
ifdef keymap
KEYMAP = $(keymap)
endif
ifdef KEYMAP ifdef KEYMAP
SRC := keymaps/keymap_$(KEYMAP).c $(SRC) ifneq ("$(wildcard keymaps/$(KEYMAP).c)","")
KEYMAP_FILE = keymaps/$(KEYMAP).c
else else
SRC := keymaps/keymap_default.c $(SRC) ifneq ("$(wildcard keymaps/$(KEYMAP)/keymap.c)","")
KEYMAP_FILE = keymaps/$(KEYMAP)/keymap.c
ifneq ("$(wildcard keymaps/$(KEYMAP)/makefile.mk)","")
include keymaps/$(KEYMAP)/makefile.mk
endif endif
else
$(error Keymap file does not exist)
endif
endif
else
ifneq ("$(wildcard keymaps/default.c)","")
KEYMAP_FILE = keymaps/default.c
else
KEYMAP_FILE = keymaps/default/keymap.c
endif
ifneq ("$(wildcard keymaps/default/makefile.mk)","")
include keymaps/default/makefile.mk
endif
endif
SRC := $(KEYMAP_FILE) $(SRC)
CONFIG_H = config.h CONFIG_H = config.h
@ -78,7 +104,6 @@ MCU = atmega32u4
# software delays. # software delays.
F_CPU = 16000000 F_CPU = 16000000
# #
# LUFA specific # LUFA specific
# #
@ -110,23 +135,41 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# USBaspLoader 2048 # USBaspLoader 2048
OPT_DEFS += -DBOOTLOADER_SIZE=4096 OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options # Build Options
# comment out to disable the options. # change to "no" to disable the options, or define them in the makefile.mk in
# the appropriate keymap folder that will get included automatically
# #
BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700) MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450) EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400) CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration COMMAND_ENABLE = yes # Commands for debug and configuration
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
# SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
# NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA MIDI_ENABLE = no # MIDI controls
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality AUDIO_ENABLE = no # Audio output on port C6
# MIDI_ENABLE = YES # MIDI controls UNICODE_ENABLE = no # Unicode
# UNICODE_ENABLE = YES # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
# BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
ifdef KEYMAP
ifeq ("$(wildcard keymaps/$(KEYMAP).c)","")
ifneq ("$(wildcard keymaps/$(KEYMAP)/makefile.mk)","")
include keymaps/$(KEYMAP)/makefile.mk
endif
endif
else
ifneq ("$(wildcard keymaps/default/makefile.mk)","")
include keymaps/default/makefile.mk
endif
endif
# Optimize size but this may cause error "relocation truncated to fit" # Optimize size but this may cause error "relocation truncated to fit"
#EXTRALDFLAGS = -Wl,--relax #EXTRALDFLAGS = -Wl,--relax
@ -136,5 +179,4 @@ VPATH += $(TARGET_DIR)
VPATH += $(TOP_DIR) VPATH += $(TOP_DIR)
VPATH += $(TMK_DIR) VPATH += $(TMK_DIR)
include $(TOP_DIR)/quantum/quantum.mk include $(TOP_DIR)/quantum/quantum.mk

View file

@ -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`. To build with the default keymap, simply run `make`.
### Other Keymaps ### 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_<name>.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 `<name>.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: To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like:
``` ```
$ make KEYMAP=[default|jack|<name>] $ make KEYMAP=[default|jack|<name>]
``` ```
Keymaps follow the format **__keymap\_\<name\>.c__** and are stored in the `keymaps` folder. Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.

View file

@ -2,12 +2,22 @@
__attribute__ ((weak)) __attribute__ ((weak))
void matrix_init_user(void) { void matrix_init_user(void) {
// leave these blank // leave this function blank - it can be defined in a keymap file
} };
__attribute__ ((weak)) __attribute__ ((weak))
void matrix_scan_user(void) { void matrix_scan_user(void) {
// leave these blank // leave this function blank - it can be defined in a keymap file
}
__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) { void matrix_init_kb(void) {
@ -33,4 +43,78 @@ void matrix_scan_kb(void) {
// runs every cycle (a lot) // runs every cycle (a lot)
matrix_scan_user(); 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);
}
#ifdef BACKLIGHT_ENABLE
#define CHANNEL OCR1C
void backlight_init_ports()
{
// Setup PB7 as output and output low.
DDRB |= (1<<7);
PORTB &= ~(1<<7);
// Use full 16-bit resolution.
ICR1 = 0xFFFF;
// I could write a wall of text here to explain... but TL;DW
// Go read the ATmega32u4 datasheet.
// And this: http://blog.saikoled.com/post/43165849837/secret-konami-cheat-code-to-high-resolution-pwm-on
// Pin PB7 = OCR1C (Timer 1, Channel C)
// Compare Output Mode = Clear on compare match, Channel C = COM1C1=1 COM1C0=0
// (i.e. start high, go low when counter matches.)
// WGM Mode 14 (Fast PWM) = WGM13=1 WGM12=1 WGM11=1 WGM10=0
// Clock Select = clk/1 (no prescaling) = CS12=0 CS11=0 CS10=1
TCCR1A = _BV(COM1C1) | _BV(WGM11); // = 0b00001010;
TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001;
backlight_init();
}
void backlight_set(uint8_t level)
{
if ( level == 0 )
{
// Turn off PWM control on PB7, revert to output low.
TCCR1A &= ~(_BV(COM1C1));
CHANNEL = 0x0;
// Prevent backlight blink on lowest level
PORTB &= ~(_BV(PORTB7));
}
else if ( level == BACKLIGHT_LEVELS )
{
// Prevent backlight blink on lowest level
PORTB &= ~(_BV(PORTB7));
// Turn on PWM control of PB7
TCCR1A |= _BV(COM1C1);
// Set the brightness
CHANNEL = 0xFFFF;
}
else
{
// Prevent backlight blink on lowest level
PORTB &= ~(_BV(PORTB7));
// Turn on PWM control of PB7
TCCR1A |= _BV(COM1C1);
// Set the brightness
CHANNEL = 0xFFFF >> ((BACKLIGHT_LEVELS - level) * ((BACKLIGHT_LEVELS + 1) / 2));
}
}
#endif

View file

@ -3,8 +3,11 @@
#include "matrix.h" #include "matrix.h"
#include "keymap_common.h" #include "keymap_common.h"
#include "backlight.h" #ifdef BACKLIGHT_ENABLE
#include "backlight.h"
#endif
#include <stddef.h> #include <stddef.h>
#include <avr/io.h>
// This a shortcut to help you visually see your layout. // This a shortcut to help you visually see your layout.
// The following is an example using the Planck MIT layout // The following is an example using the Planck MIT layout
@ -26,5 +29,8 @@
void matrix_init_user(void); void matrix_init_user(void);
void matrix_scan_user(void); void matrix_scan_user(void);
void process_action_user(keyrecord_t *record);
void led_set_user(uint8_t usb_led);
void backlight_init_ports(void);
#endif #endif

View file

@ -32,36 +32,109 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MATRIX_ROWS 5 #define MATRIX_ROWS 5
#define MATRIX_COLS 15 #define MATRIX_COLS 15
// Planck PCB default pin-out /*
// Change this to how you wired your keyboard * Keyboard Matrix Assignments
// COLS: Left to right, ROWS: Top to bottom *
* 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, C7, F4, F5, F6, F7, D4, D6, B4, D7, D3, D2, D1 } #define COLS (int []){ F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7, D3, D2, D1 }
#define ROWS (int []){ D0, D5, B5, B6, C6 } #define ROWS (int []){ D0, D5, B5, B6, C6 }
/* COL2ROW or ROW2COL */ /* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW #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 //#define MATRIX_HAS_GHOST
/* number of backlight levels */ /* number of backlight levels */
/* NOTE: this is the max value of 0..BACKLIGHT_LEVELS so really 16 levels. */
#define BACKLIGHT_LEVELS 3 #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 */ /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE #define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */ /* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE #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() ( \ #define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ 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 B
//#define MAGIC_KEY_LOCK CAPS
//#define MAGIC_KEY_EEPROM E
//#define MAGIC_KEY_NKRO N
//#define MAGIC_KEY_SLEEP_LED Z
/* /*
* Feature disable options * Feature disable options

View file

@ -0,0 +1,234 @@
#include "atomic.h"
// Fillers to make layering more clear
#define _______ KC_TRNS
#define ___T___ KC_TRNS
#define XXXXXXX KC_NO
// Layer shorthand
#define _QW 0
#define _CM 1
#define _DV 2
#define _LW 3
#define _RS 4
#define _FN 5
/* ROW 1 OPTIONS
* .--------------------------------------------------------------------------------------------------------------------------------------.
* | | | | | | | | | | | | | | | |
* '--------------------------------------------------------------------------------------------------------------------------------------'
* .- 2u ------------.
* | KEY . XXXXXX |
* '-----------------'
*/
/* ROW 2 OPTIONS
* .--------------------------------------------------------------------------------------------------------------------------------------.
* | | | | | | | | | | | | | | | |
* '--------------------------------------------------------------------------------------------------------------------------------------'
* .- 2u ------------. .- 2u ------------.
* | KEY . XXXXXX | | KEY . XXXXXX |
* '-----------------' '-----------------'
*/
/* ROW 3 OPTIONS
* .--------------------------------------------------------------------------------------------------------------------------------------.
* | | | | | | | | | | | | | | | |
* '--------------------------------------------------------------------------------------------------------------------------------------'
* .- 2u ------------. .- 2u ------------.
* | KEY . XXXXXX | | X |
* '-----------------' '-----------------'
* .- 2u ------------.
* | X |
* '-----------------'
*/
/* ROW 4 OPTIONS
* .--------------------------------------------------------------------------------------------------------------------------------------.
* | | | | | | | | | | | | | | | |
* '--------------------------------------------------------------------------------------------------------------------------------------'
* .- 2u ------------.
* | KEY . XXXXXX |
* '-----------------'
* .- 2u ------------. .- 2u ------------.
* | KEY . XXXXXX | | KEY . XXXXXX |
* '-----------------' '-----------------'
* .- 2u ------------.
* | KEY . XXXXXX |
* '-----------------'
*/
/* ROW 5 OPTIONS
* .--------------------------------------------------------------------------------------------------------------------------------------.
* | | | | | | | | | | | | | | | |
* '--------------------------------------------------------------------------------------------------------------------------------------'
* .- 1.25u --+ 1.25u ------- 1.25u +--- 1.25u --- 2u -------------- 1.25u ---- 1.25u ------ 1.25u +---- 1.25u .
* | X | X | X | X | X | X | X | X | X |
* '-----------------------------------------------------------------------------------------------------------'
* .- 2u ------------.
* | X |
* '-----------------'
* .--------------------- 6.25u ----------------------------.
* | X |
* '--------------------------------------------------------'
* .----------------------- 6.25u ---------------------------- 1.25u ---- 1.25u ---- 1.25u ------ 1.25u +-- 1.25u --.
* | X | X | X | X | X | X |
* '----------------------------------------------------------------------------------------------------------------'
*/
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* QWERTY - MIT ENHANCED / GRID COMPATIBLE
* .---------------------------------------------------------------------------------------------------------------------- 2u ------------.
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | XXXXXX . BACKSP |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
* | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | DEL |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------|
* | ESC | A | S | D | F | G | H | J | K | L | ; | ' | XXXXXX . ENTER | PG UP |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------|
* | LSHIFT | Z | X | C | V | B | N | M | , | . | / | XXXXXX . RSHIFT | UP | PG DN |
* |--------+--------+--------+--------+--------+- 2u ------------+--------+--------+--------+--------+-----------------+--------+--------|
* | BRITE | LCTRL | LALT | LGUI | RAISE | XXXXXX . SPACE | LOWER | RGUI | RALT | RCTRL | FN | LEFT | DOWN | RIGHT |
* '--------------------------------------------------------------------------------------------------------------------------------------'
*/
[_QW] = { /* QWERTY */
{ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC },
{ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL },
{ 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_ENT, KC_ENT, KC_PGUP },
{ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_UP, KC_PGDN },
{ M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_RS), KC_SPC, KC_SPC, MO(_LW), KC_RGUI, KC_RALT, KC_RCTL, MO(_FN), KC_LEFT, KC_DOWN, KC_RGHT },
},
/* COLEMAK - MIT ENHANCED / GRID COMPATIBLE
* .---------------------------------------------------------------------------------------------------------------------- 2u ------------.
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | XXXXXX . BACKSP |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
* | TAB | Q | W | F | P | G | J | L | U | Y | ; | [ | ] | \ | DEL |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------|
* | ESC | A | R | S | T | D | H | N | E | I | O | ' | XXXXXX . ENTER | PG UP |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------|
* | LSHIFT | Z | X | C | V | B | K | M | , | . | / | XXXXXX . RSHIFT | UP | PG DN |
* |--------+--------+--------+--------+--------+- 2u ------------+--------+--------+--------+--------+-----------------+--------+--------|
* | BRITE | LCTRL | LALT | LGUI | RAISE | XXXXXX . SPACE | LOWER | RGUI | RALT | RCTRL | FN | LEFT | DOWN | RIGHT |
* '--------------------------------------------------------------------------------------------------------------------------------------'
*/
[_CM] = { /* COLEMAK */
{ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC },
{ KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL },
{ 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_ENT, KC_ENT, KC_PGUP },
{ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_UP, KC_PGDN },
{ M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_RS), KC_SPC, KC_SPC, MO(_LW), KC_RGUI, KC_RALT, KC_RCTL, MO(_FN), KC_LEFT, KC_DOWN, KC_RGHT },
},
/* DVORAK - MIT ENHANCED / GRID COMPATIBLE
* .---------------------------------------------------------------------------------------------------------------------- 2u ------------.
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | XXXXXX . BACKSP |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
* | TAB | ' | , | . | P | Y | F | G | C | R | L | [ | ] | \ | DEL |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------|
* | ESC | A | O | E | U | I | D | H | T | N | S | / | XXXXXX . ENTER | PG UP |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------|
* | LSHIFT | ; | Q | J | K | X | B | M | W | V | Z | XXXXXX . RSHIFT | UP | PG DN |
* |--------+--------+--------+--------+--------+- 2u ------------+--------+--------+--------+--------+-----------------+--------+--------|
* | BRITE | LCTRL | LALT | LGUI | RAISE | XXXXXX . SPACE | LOWER | RGUI | RALT | RCTRL | FN | LEFT | DOWN | RIGHT |
* '--------------------------------------------------------------------------------------------------------------------------------------'
*/
[_DV] = { /* DVORAK */
{ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC },
{ KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL },
{ 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_ENT, KC_ENT, KC_PGUP },
{ KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_RSFT, KC_UP, KC_PGDN },
{ M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_RS), KC_SPC, KC_SPC, MO(_LW), KC_RGUI, KC_RALT, KC_RCTL, MO(_FN), KC_LEFT, KC_DOWN, KC_RGHT },
},
/* LOWERED
* .---------------------------------------------------------------------------------------------------------------------- 2u ------------.
* | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | XXXXXX . |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
* | | ! | @ | # | $ | % | ^ | & | * | ( | ) | | | | INS |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------|
* | | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | XXXXXX . | |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------|
* | | F7 | F8 | F9 | F10 | F11 | F12 | | | | | XXXXXX . | | |
* |--------+--------+--------+--------+--------+- 2u ------------+--------+--------+--------+--------+-----------------+--------+--------|
* | | | | | | XXXXXX . | | | | | | | | |
* '--------------------------------------------------------------------------------------------------------------------------------------'
*/
[_LW] = { /* LOWERED */
{ _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, ___T___, ___T___ },
{ _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, _______, _______, KC_INS },
{ _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, ___T___, ___T___, _______ },
{ _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, ___T___, ___T___, _______, _______ },
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
},
/* RAISED
* .---------------------------------------------------------------------------------------------------------------------- 2u ------------.
* | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | XXXXXX . |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
* | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | | | INS |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------|
* | | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | XXXXXX . | |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------|
* | | F7 | F8 | F9 | F10 | F11 | F12 | | | | | XXXXXX . | | |
* |--------+--------+--------+--------+--------+- 2u ------------+--------+--------+--------+--------+-----------------+--------+--------|
* | | | | | | XXXXXX . | | | | | | | | |
* '--------------------------------------------------------------------------------------------------------------------------------------'
*/
[_RS] = { /* RAISED */
{ _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, ___T___, ___T___ },
{ _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, _______, KC_INS },
{ _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, ___T___, ___T___, _______ },
{ _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, ___T___, ___T___, _______, _______ },
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
},
/* FUNCTION
* .---------------------------------------------------------------------------------------------------------------------- 2u ------------.
* | NUM LK | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | XXXXXX . |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
* | SCR LK | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | F21 | F22 | F23 | F24 | PAUSE | PR SCR |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------|
* | CAP LK | MS BT5 | MS BT4 | MS BT3 | MS BT2 | SLOW M | FAST M | NEXT | VOL+ | VOL- | PLAY | | XXXXXX . | WHEEL+ |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------|
* | | | QWERTY | COLEMK | DVORAK | | | | | | | XXXXXX . | MOUS U | WHEEL- |
* |--------+--------+--------+--------+--------+- 2u ------------+--------+--------+--------+--------+-----------------+--------+--------|
* | | | | | | XXXXXX . MS BT1 | | | | | | MOUS L | MOUS D | MOUS R |
* '--------------------------------------------------------------------------------------------------------------------------------------'
*/
[_FN] = { /* FUNCTION */
{ KC_NLCK, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, ___T___, ___T___ },
{ KC_SLCK, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_PAUS, KC_PSCR },
{ KC_CAPS, KC_BTN5, KC_BTN4, KC_BTN3, KC_BTN2, KC_ACL0, KC_ACL2, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______, ___T___, ___T___, KC_WH_U },
{ _______, _______, DF(_QW), DF(_CM), DF(_DV), _______, _______, _______, _______, _______, _______, ___T___, ___T___, KC_MS_U, KC_WH_D },
{ _______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R },
},
};
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);
#ifdef BACKLIGHT_ENABLE
backlight_step();
#endif
} else {
unregister_code(KC_RSFT);
}
break;
}
return MACRO_NONE;
};

View file

@ -1,79 +0,0 @@
#include "atomic.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = { /* Qwerty */
{ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL },
// ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐
// │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
// └────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┘
// ┌─ 2u ────────────┐
// │ X │
// └─────────────────┘
{ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL },
// ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐
// │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
// └────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┘
// ┌─ 2u ────────────┐ ┌─ 2u ────────────┐
// │ X │ │ X │
// └─────────────────┘ └─────────────────┘
{ 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_ENT, KC_ENT, KC_PGUP },
// ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐
// │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
// └────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┘
// ┌─ 2u ────────────┐ ┌─ 2u ────────────┐
// │ X │ │ X │
// └─────────────────┘ └─────────────────┘
// ┌─ 2u ────────────┐
// │ X │
// └─────────────────┘
{ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_UP, KC_PGDN },
// ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐
// │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
// └────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┘
// ┌─ 2u ────────────┐
// │ X │
// └─────────────────┘
// ┌─ 2u ────────────┐ ┌─ 2u ────────────┐
// │ X │ │ X │
// └─────────────────┘ └─────────────────┘
// ┌─ 2u ────────────┐
// │ X │
// └─────────────────┘
{ BL_STEP, KC_LCTL, KC_LALT, KC_LGUI, KC_LGUI, KC_SPC, KC_SPC, KC_RGUI, KC_RGUI, KC_RALT, KC_RCTL, BL_STEP, KC_LEFT, KC_DOWN, KC_RGHT },
// ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐
// │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
// └────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┘
// ┌─ 1.25u ──┬ 1.25u ───┬─── 1.25u ┬─── 1.25u ─┬─ 2u ────────────┬─ 1.25u ──┬─ 1.25u ──┬─── 1.25u ┬──── 1.25u ┐
// │ X │ X │ X │ X │ X │ X │ X │ X │ X │
// └──────────┴──────────┴──────────┴───────────┴─────────────────┴──────────┴──────────┴──────────┴───────────┘
// ┌─ 2u ────────────┐
// │ X │
// └─────────────────┘
// ┌───────────────────── 6.25u ────────────────────────────┐
// │ X │
// └────────────────────────────────────────────────────────┘
// ┌─────────────────────── 6.25u ──────────────────────────┬─ 1.25u ──┬─ 1.25u ──┬─ 1.25u ──┬─── 1.25u ┬── 1.25u ──┐
// │ X │ X │ X │ X │ X │ X │
// └────────────────────────────────────────────────────────┴──────────┴──────────┴──────────┴──────────┴───────────┘
}
};
const uint16_t PROGMEM fn_actions[] = {
[1] = ACTION_LAYER_MOMENTARY(2), // to RAISE
[2] = ACTION_LAYER_MOMENTARY(3), // to LOWER
[3] = ACTION_DEFAULT_LAYER_SET(0),
[4] = ACTION_DEFAULT_LAYER_SET(1),
};
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:
return MACRODOWN(TYPE(KC_T), END);
break;
}
return MACRO_NONE;
};

View file

@ -0,0 +1,161 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
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 <http://www.gnu.org/licenses/>.
*/
#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 Ortholinear Keyboards
#define PRODUCT The Atomic Keyboard
#define DESCRIPTION A compact ortholinear keyboard
/* key matrix size */
#define MATRIX_ROWS 5
#define MATRIX_COLS 15
/*
* 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, C7, F4, F5, F6, F7, D4, D6, B4, D7, D3, D2, D1 }
#define ROWS (int []){ D0, D5, B5, B6, B3 }
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
/* 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
/* 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
// Enable Keyboard Locking via magic key
#define KEYBOARD_LOCK_ENABLE
/*
* 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 B
//#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.
*/
/* 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

View file

@ -0,0 +1,517 @@
#include "atomic.h"
#include "action_layer.h"
#include "eeconfig.h"
#include "led.h"
#ifdef AUDIO_ENABLE
#include "audio.h"
#include "song_list.h"
#endif
#define LAYER_QWERTY 0
#define LAYER_COLEMAK 1
#define LAYER_DVORAK 2
#define LAYER_LOWER 3
#define LAYER_RAISE 4
#define LAYER_FUNCTION 5
#define LAYER_MOUSE 6
#define LAYER_MUSIC 7
#define LAYER_ADJUST 8
#define MACRO_QWERTY 0
#define MACRO_COLEMAK 1
#define MACRO_DVORAK 2
#define MACRO_LOWER 3
#define MACRO_RAISE 4
#define MACRO_FUNCTION 5
#define MACRO_MOUSE 6
#define MACRO_TIMBRE_1 7
#define MACRO_TIMBRE_2 8
#define MACRO_TIMBRE_3 9
#define MACRO_TIMBRE_4 10
#define MACRO_TEMPO_U 11
#define MACRO_TEMPO_D 12
#define MACRO_TONE_DEFAULT 13
#define MACRO_MUSIC_ON 14
#define MACRO_MUSIC_OFF 15
#define MACRO_AUDIO_ON 16
#define MACRO_AUDIO_OFF 17
#define MACRO_INC_VOICE 18
#define MACRO_DEC_VOICE 19
#define M_QWRTY M(MACRO_QWERTY)
#define M_COLMK M(MACRO_COLEMAK)
#define M_DVORK M(MACRO_DVORAK)
#define M_LOWER M(MACRO_LOWER)
#define M_RAISE M(MACRO_RAISE)
#define M_FUNCT M(MACRO_FUNCTION)
#define M_MOUSE M(MACRO_MOUSE)
#define TIMBR_1 M(MACRO_TIMBRE_1)
#define TIMBR_2 M(MACRO_TIMBRE_2)
#define TIMBR_3 M(MACRO_TIMBRE_3)
#define TIMBR_4 M(MACRO_TIMBRE_4)
#define TMPO_UP M(MACRO_TEMPO_U)
#define TMPO_DN M(MACRO_TEMPO_D)
#define TMPO_DF M(MACRO_TONE_DEFAULT)
#define MUS_ON M(MACRO_MUSIC_ON)
#define MUS_OFF M(MACRO_MUSIC_OFF)
#define AUD_OFF M(MACRO_AUDIO_OFF)
#define AUD_ON M(MACRO_AUDIO_ON)
#define VC_UP M(MACRO_INC_VOICE)
#define VC_DOWN M(MACRO_DEC_VOICE)
#define SC_UNDO LCTL(KC_Z)
#define SC_REDO LCTL(KC_Y)
#define SC_CUT LCTL(KC_X)
#define SC_COPY LCTL(KC_C)
#define SC_PSTE LCTL(KC_V)
#define SC_SELA LCTL(KC_A)
#define SC_SAVE LCTL(KC_S)
#define SC_OPEN LCTL(KC_O)
#define SC_ACLS LALT(KC_F4)
#define SC_CCLS LCTL(KC_F4)
#define _______ KC_TRNS
#define XXXXXXX KC_NO
#define ________________ _______, _______
#define XXXXXXXXXXXXXXXX XXXXXXX, XXXXXXX
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* QWERTY
* .---------------------------------------------------------------------------------------------------------------------- 2u ------------.
* | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | XXXXXX . BACKSP |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
* | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | DEL |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------|
* | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | XXXXXX . ENTER | PG UP |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------|
* | LSHIFT | Z | X | C | V | B | N | M | , | . | / | XXXXXX . RSHIFT | UP | PG DN |
* |--------+--------+--------+--------+--------+- 2u ------------+--------+--------+--------+--------+-----------------+--------+--------|
* | LCTRL | LWIN | FN | LALT | RAISE | XXXXXX . SPACE | LOWER | RALT | RWIN | MENU | RCTRL | LEFT | DOWN | RIGHT |
* '--------------------------------------------------------------------------------------------------------------------------------------'
*/
[LAYER_QWERTY] = { /* QWERTY */
{ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC },
{ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL },
{ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_ENT, KC_PGUP },
{ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_UP, KC_PGDN },
{ KC_LCTL, KC_LGUI, M_FUNCT, KC_LALT, M_RAISE, KC_SPC, KC_SPC, M_LOWER, KC_RALT, KC_RGUI, KC_MENU, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT },
},
/* COLEMAK
* .---------------------------------------------------------------------------------------------------------------------- 2u ------------.
* | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | XXXXXX . BACKSP |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
* | TAB | Q | W | F | P | G | J | L | U | Y | ; | [ | ] | \ | DEL |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------|
* | BACKSP | A | R | S | T | D | H | N | E | I | O | ' | XXXXXX . ENTER | PG UP |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------|
* | LSHIFT | Z | X | C | V | B | K | M | , | . | / | XXXXXX . RSHIFT | UP | PG DN |
* |--------+--------+--------+--------+--------+- 2u ------------+--------+--------+--------+--------+-----------------+--------+--------|
* | LCTRL | LWIN | FN | LALT | RAISE | XXXXXX . SPACE | LOWER | RALT | RWIN | MENU | RCTRL | LEFT | DOWN | RIGHT |
* '--------------------------------------------------------------------------------------------------------------------------------------'
*/
[LAYER_COLEMAK] = { /* COLEMAK */
{ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC },
{ KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL },
{ KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, KC_ENT, KC_PGUP },
{ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_UP, KC_PGDN },
{ KC_LCTL, KC_LGUI, M_FUNCT, KC_LALT, M_RAISE, KC_SPC, KC_SPC, M_LOWER, KC_RALT, KC_RGUI, KC_MENU, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT },
},
/* DVORAK
* .---------------------------------------------------------------------------------------------------------------------- 2u ------------.
* | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | [ | ] | XXXXXX . BACKSP |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
* | TAB | ' | , | . | P | Y | F | G | C | R | L | / | = | \ | DEL |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------|
* | CAPS | A | O | E | U | I | D | H | T | N | S | - | XXXXXX . ENTER | PG UP |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------|
* | LSHIFT | ; | Q | J | K | X | B | M | W | V | Z | XXXXXX . RSHIFT | UP | PG DN |
* |--------+--------+--------+--------+--------+- 2u ------------+--------+--------+--------+--------+-----------------+--------+--------|
* | LCTRL | LWIN | FN | LALT | RAISE | XXXXXX . SPACE | LOWER | RALT | RWIN | MENU | RCTRL | LEFT | DOWN | RIGHT |
* '--------------------------------------------------------------------------------------------------------------------------------------'
*/
[LAYER_DVORAK] = { /* DVORAK */
{ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSPC, KC_BSPC },
{ KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, KC_DEL },
{ KC_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, KC_ENT, KC_PGUP },
{ KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_RSFT, KC_UP, KC_PGDN },
{ KC_LCTL, KC_LGUI, M_FUNCT, KC_LALT, M_RAISE, KC_SPC, KC_SPC, M_LOWER, KC_RALT, KC_RGUI, KC_MENU, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT },
},
[LAYER_LOWER] = { /* LOWERED */
{ KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, ________________ },
{ _______, _______, _______, _______, SC_CCLS, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS },
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ________________, KC_HOME },
{ _______, SC_REDO, _______, _______, _______, _______, _______, _______, _______, _______, _______, ________________, _______, KC_END },
{ _______, _______, _______, _______, _______, KC_BSPC, KC_BSPC, _______, _______, _______, _______, _______, _______, _______, _______ },
},
[LAYER_RAISE] = { /* RAISED */
{ KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, ________________ },
{ _______, _______, _______, _______, SC_ACLS, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS },
{ _______, SC_SELA, SC_SAVE, _______, _______, _______, _______, _______, _______, _______, _______, _______, ________________, KC_HOME },
{ _______, SC_UNDO, SC_CUT, SC_COPY, SC_PSTE, _______, _______, _______, _______, _______, _______, ________________, _______, KC_END },
{ _______, _______, _______, _______, _______, ________________, _______, _______, _______, _______, _______, _______, _______, _______ },
},
[LAYER_FUNCTION] = { /* FUNCTION */
{ KC_NLCK, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, ________________ },
{ KC_SLCK, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, _______, KC_PAUS },
{ KC_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ________________, KC_PSCR },
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ________________, KC_VOLU, KC_MUTE },
{ _______, _______, _______, _______, _______, KC_MPLY, KC_MPLY, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT },
},
#ifdef MOUSEKEY_ENABLE
[LAYER_MOUSE] = { /* MOUSE */
{ _______, KC_ACL0, KC_ACL1, KC_ACL2, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXXXXXXXXXXX },
{ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX },
{ XXXXXXX, KC_BTN5, KC_BTN4, KC_BTN3, KC_BTN2, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXXXXXXXXXXX, KC_WH_U },
{ _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, ________________, KC_MS_U, KC_WH_D },
{ _______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R },
},
#endif
[LAYER_MUSIC] = { /* MUSIC */
{ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX },
{ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX },
{ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX },
{ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX },
{ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, M_RAISE, XXXXXXX, XXXXXXX, M_LOWER, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX },
},
[LAYER_ADJUST] = { /* ADJUST */
{ _______, TIMBR_1, TIMBR_2, TIMBR_3, TIMBR_4, TMPO_UP, TMPO_DN, TMPO_DF, _______, MUS_ON, MUS_OFF, AUD_ON, AUD_OFF, ________________ },
{ _______, M_QWRTY, M_COLMK, M_DVORK, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ________________, _______ },
{ _______, _______, _______, _______, _______, RESET, _______, M_MOUSE, _______, _______, _______, ________________, VC_UP, _______ },
{ _______, _______, _______, _______, _______, ________________, _______, _______, _______, _______, _______, _______, VC_DOWN, _______ },
},
/*
[LAYER_EMPTY] = {
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ________________ },
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ________________, _______ },
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ________________, _______, _______ },
{ _______, _______, _______, _______, _______, ________________, _______, _______, _______, _______, _______, _______, _______, _______ },
},
*/
};
#ifdef AUDIO_ENABLE
float tone_my_startup[][2] = SONG(ODE_TO_JOY);
float tone_my_goodbye[][2] = SONG(ROCK_A_BYE_BABY);
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
float tone_dvorak[][2] = SONG(DVORAK_SOUND);
float tone_colemak[][2] = SONG(COLEMAK_SOUND);
float tone_audio_on[][2] = SONG(CLOSE_ENCOUNTERS_5_NOTE);
float tone_music_on[][2] = SONG(DOE_A_DEER);
float tone_caps_on[][2] = SONG(CAPS_LOCK_ON_SOUND);
float tone_caps_off[][2] = SONG(CAPS_LOCK_OFF_SOUND);
float tone_numlk_on[][2] = SONG(NUM_LOCK_ON_SOUND);
float tone_numlk_off[][2] = SONG(NUM_LOCK_OFF_SOUND);
float tone_scroll_on[][2] = SONG(SCROLL_LOCK_ON_SOUND);
float tone_scroll_off[][2] = SONG(SCROLL_LOCK_OFF_SOUND);
float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
#endif /* AUDIO_ENABLE */
void persistant_default_layer_set(uint16_t default_layer)
{
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
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 MACRO_QWERTY:
if (record->event.pressed)
{
persistant_default_layer_set(1UL<<LAYER_QWERTY);
#ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, STACCATO);
#endif /* AUDIO_ENABLE */
}
break;
case MACRO_COLEMAK:
if (record->event.pressed)
{
persistant_default_layer_set(1UL<<LAYER_COLEMAK);
#ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_colemak, false, STACCATO);
#endif /* AUDIO_ENABLE */
}
break;
case MACRO_DVORAK:
if (record->event.pressed)
{
persistant_default_layer_set(1UL<<LAYER_DVORAK);
#ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_dvorak, false, STACCATO);
#endif /* AUDIO_ENABLE */
}
break;
case MACRO_LOWER:
if (record->event.pressed)
{
layer_on(LAYER_LOWER);
update_tri_layer(LAYER_LOWER, LAYER_RAISE, LAYER_ADJUST);
}
else
{
layer_off(LAYER_LOWER);
update_tri_layer(LAYER_LOWER, LAYER_RAISE, LAYER_ADJUST);
}
break;
case MACRO_RAISE:
if (record->event.pressed)
{
layer_on(LAYER_RAISE);
update_tri_layer(LAYER_LOWER, LAYER_RAISE, LAYER_ADJUST);
}
else
{
layer_off(LAYER_RAISE);
update_tri_layer(LAYER_LOWER, LAYER_RAISE, LAYER_ADJUST);
}
break;
case MACRO_FUNCTION:
if (record->event.pressed)
{
layer_on(LAYER_FUNCTION);
}
else
{
layer_off(LAYER_FUNCTION);
}
break;
#ifdef MOUSEKEY_ENABLE
case MACRO_MOUSE:
if (record->event.pressed)
{
layer_invert(LAYER_MOUSE);
}
break;
#endif /* MOUSEKEY_ENABLE */
#ifdef AUDIO_ENABLE
case MACRO_TIMBRE_1:
if (record->event.pressed) set_timbre(TIMBRE_12);
break;
case MACRO_TIMBRE_2:
if (record->event.pressed) set_timbre(TIMBRE_25);
break;
case MACRO_TIMBRE_3:
if (record->event.pressed) set_timbre(TIMBRE_50);
break;
case MACRO_TIMBRE_4:
if (record->event.pressed) set_timbre(TIMBRE_75);
break;
case MACRO_TEMPO_U:
if (record->event.pressed) increase_tempo(10);
break;
case MACRO_TEMPO_D:
if (record->event.pressed) decrease_tempo(10);
break;
case MACRO_TONE_DEFAULT:
if (record->event.pressed)
{
set_timbre(TIMBRE_DEFAULT);
set_tempo(TEMPO_DEFAULT);
}
break;
case MACRO_AUDIO_OFF:
if (record->event.pressed)
{
#ifdef AUDIO_ENABLE
audio_off();
#endif
}
break;
case MACRO_AUDIO_ON:
if (record->event.pressed)
{
#ifdef AUDIO_ENABLE
audio_on();
PLAY_NOTE_ARRAY(tone_audio_on, false, STACCATO);
#endif
}
break;
case MACRO_MUSIC_ON:
if (record->event.pressed)
{
#ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_music_on, false, STACCATO);
layer_on(LAYER_MUSIC);
#endif
}
break;
case MACRO_MUSIC_OFF:
if (record->event.pressed)
{
#ifdef AUDIO_ENABLE
layer_off(LAYER_MUSIC);
stop_all_notes();
#endif
}
break;
case MACRO_INC_VOICE:
if (record->event.pressed)
{
#ifdef AUDIO_ENABLE
voice_iterate();
PLAY_NOTE_ARRAY(music_scale, false, STACCATO);
#endif
}
break;
case MACRO_DEC_VOICE:
if (record->event.pressed)
{
#ifdef AUDIO_ENABLE
voice_deiterate();
PLAY_NOTE_ARRAY(music_scale, false, STACCATO);
#endif
}
break;
#endif /* AUDIO_ENABLE */
default:
break;
}
return MACRO_NONE;
};
#ifdef AUDIO_ENABLE
void process_action_user(keyrecord_t *record)
{
uint8_t starting_note = 0x0C;
int offset = 7;
if (IS_LAYER_ON(LAYER_MUSIC))
{
if (record->event.pressed)
{
play_note(((double)220.0)*pow(2.0, -4.0)*pow(2.0,(starting_note + SCALE[record->event.key.col + offset])/12.0+(MATRIX_ROWS - record->event.key.row)), 0xF);
}
else
{
stop_note(((double)220.0)*pow(2.0, -4.0)*pow(2.0,(starting_note + SCALE[record->event.key.col + offset])/12.0+(MATRIX_ROWS - record->event.key.row)));
}
}
}
void matrix_init_user(void)
{
set_voice(default_voice);
play_startup_tone();
println("Matrix Init");
}
void led_set_user(uint8_t usb_led)
{
static uint8_t old_usb_led = 0;
_delay_ms(10); // gets rid of tick
if ((usb_led & (1<<USB_LED_CAPS_LOCK)) && !(old_usb_led & (1<<USB_LED_CAPS_LOCK)))
{
// If CAPS LK LED is turning on...
PLAY_NOTE_ARRAY(tone_caps_on, false, LEGATO);
}
else if (!(usb_led & (1<<USB_LED_CAPS_LOCK)) && (old_usb_led & (1<<USB_LED_CAPS_LOCK)))
{
// If CAPS LK LED is turning off...
PLAY_NOTE_ARRAY(tone_caps_off, false, LEGATO);
}
else if ((usb_led & (1<<USB_LED_NUM_LOCK)) && !(old_usb_led & (1<<USB_LED_NUM_LOCK)))
{
// If NUM LK LED is turning on...
PLAY_NOTE_ARRAY(tone_numlk_on, false, LEGATO);
}
else if (!(usb_led & (1<<USB_LED_NUM_LOCK)) && (old_usb_led & (1<<USB_LED_NUM_LOCK)))
{
// If NUM LED is turning off...
PLAY_NOTE_ARRAY(tone_numlk_off, false, LEGATO);
}
else if ((usb_led & (1<<USB_LED_SCROLL_LOCK)) && !(old_usb_led & (1<<USB_LED_SCROLL_LOCK)))
{
// If SCROLL LK LED is turning on...
PLAY_NOTE_ARRAY(tone_scroll_on, false, LEGATO);
}
else if (!(usb_led & (1<<USB_LED_SCROLL_LOCK)) && (old_usb_led & (1<<USB_LED_SCROLL_LOCK)))
{
// If SCROLL LED is turning off...
PLAY_NOTE_ARRAY(tone_scroll_off, false, LEGATO);
}
old_usb_led = usb_led;
}
void play_startup_tone()
{
_delay_ms(10); // gets rid of tick
PLAY_NOTE_ARRAY(tone_my_startup, false, STACCATO);
}
void play_goodbye_tone()
{
PLAY_NOTE_ARRAY(tone_my_goodbye, false, STACCATO);
_delay_ms(1000);
}
#endif /* AUDIO_ENABLE */

View file

@ -0,0 +1,17 @@
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 = no # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
MIDI_ENABLE = no # MIDI controls
AUDIO_ENABLE = yes # Audio output on port C6
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
CONFIG_H = keymaps/$(KEYMAP)/config.h

View file

@ -53,9 +53,9 @@ TARGET_DIR = .
SRC = atreus.c SRC = atreus.c
ifdef KEYMAP ifdef KEYMAP
SRC := keymaps/keymap_$(KEYMAP).c $(SRC) SRC := keymaps/$(KEYMAP).c $(SRC)
else else
SRC := keymaps/keymap_default.c $(SRC) SRC := keymaps/default.c $(SRC)
endif endif
ifdef TEENSY2 ifdef TEENSY2

View file

@ -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`. To build with the default keymap, simply run `make`.
### Other Keymaps ### 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_<name>.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 `<name>.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: To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like:
``` ```
$ make KEYMAP=[default|jack|<name>] $ make KEYMAP=[default|jack|<name>]
``` ```
Keymaps follow the format **__keymap\_\<name\>.c__** and are stored in the `keymaps` folder. Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.

View file

@ -0,0 +1,137 @@
#----------------------------------------------------------------------------
# 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 = clueboard1
# Directory common source filess exist
TOP_DIR = ../..
TMK_DIR = ../../tmk_core
# Directory keyboard dependent files exist
TARGET_DIR = .
# # project specific files
SRC = clueboard1.c \
led.c
ifdef KEYMAP
SRC := keymaps/keymap_$(KEYMAP).c $(SRC)
else
SRC := keymaps/keymap_default.c $(SRC)
endif
CONFIG_H = config.h
# MCU name
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=4096
# Build Options
# comment out to disable the options.
#
BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = no # 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
NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
AUDIO_ENABLE = no
RGBLIGHT_ENABLE = no # Enable keyboard underlight functionality
MIDI_ENABLE = no # MIDI controls
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # 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

View file

@ -0,0 +1,23 @@
#include "clueboard1.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) {
#ifdef RGBLIGHT_ENABLE
rgblight_init();
#endif
matrix_init_user();
}
void matrix_scan_kb(void) {
matrix_scan_user();
}

View file

@ -0,0 +1,52 @@
#ifndef CLUEBOARD1_H
#define CLUEBOARD1_H
#include "matrix.h"
#include "keymap_common.h"
#include <stddef.h>
/* Clueboard matrix layout
* ,-----------------------------------------------------------. ,---.
* | 00| 01| 02| 03| 04| 05| 06| 07| 08| 09| 0A| 0B| 0C| 0D| 0E| | 0F|
* |-----------------------------------------------------------| |---|
* | 10| 11| 12| 13| 14| 15| 16| 17| 18| 19| 1A| 1B| 1C| 1D| | 1F|
* |-----------------------------------------------------------| `---'
* | 20| 21| 22| 23| 24| 25| 26| 27| 28| 29| 2A| 2B| 2C| 2D|
* |------------------------------------------------------------.
* | 30| 31| 32| 33| 34| 35| 36| 37| 38| 39| 3A| 3B| 3C| 3D|3E|
* |------------------------------------------------------------------.
* | 40| 41| 42| 43| 45| 46| 49| 4A| 4B| 4C| 4D| 4E| 4F|
* `------------------------------------------------------------------'
* ,-----------------------------------------------------------. ,---.
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Yen| BS| |Ins|
* |-----------------------------------------------------------| |---|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|
* |-----------------------------------------------------------| `---'
* |Caps | A| S| D| F| G| H| J| k| L| ;| '| # | Ent|
* |--------------------------------------------------------------.
* |Shift| \| Z| X| C| V| B| N| M| ,| .| /| \|Shift| Up|
* |------------------------------------------------------------------.
* |Ctrl|Alt|Gui |MHen| Space| Space|Henk|Gui |Ctrl| Fn|Left|Down|Rgt|
* `------------------------------------------------------------------'
*/
// 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, k0C, k0D, k0E, k0F, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1F, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E, \
k40, k41, k42, k43, k45, k46, k49, k4A, k4B, k4C, k4D, k4E, k4F \
) { \
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F }, \
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, KC_NO, k1F }, \
{ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D }, \
{ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E }, \
{ k40, k41, k42, k43, KC_NO, k45, k46, KC_NO, KC_NO, k49, k4A, k4B, k4C, k4D, k4E, k4F } \
}
void matrix_init_user(void);
void matrix_scan_user(void);
#endif

View file

@ -0,0 +1,96 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
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 <http://www.gnu.org/licenses/>.
*/
#ifndef CONFIG_H
#define CONFIG_H
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0xC1ED
#define PRODUCT_ID 0x2301
#define DEVICE_VER 0x0003
#define MANUFACTURER Clueboard
#define PRODUCT Clueboard
#define DESCRIPTION QMK keyboard firmware for Clueboard
/* key matrix size */
#define MATRIX_ROWS 5
#define MATRIX_COLS 16
// COLS: Left to right, ROWS: Top to bottom
/* Column pin configuration
* col: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
* pin: B3 F1 F4 F5 F6 C7 C6 B6 B5 B4 D7 D6 D4 F7 B0 B1
*/
#define COLS (int []){ B3, F1, F4, F5, F6, C7, C6, B6, B5, B4, D7, D6, D4, F7, B0, B1 }
/* Row pin configuration
* row: 0 1 2 3 4
* pin: D1 D0 D2 D5 D3
*/
#define ROWS (int []){ D1, D0, D2, D5, D3 }
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST
/* 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)) \
)
/* Underlight configuration
*/
#define ws2812_PORTREG PORTB
#define ws2812_DDRREG DDRB
#define ws2812_pin 2
#define RGBLED_NUM 14 // Number of LEDs
#define RGBLIGHT_HUE_STEP 10
#define RGBLIGHT_SAT_STEP 17
#define RGBLIGHT_VAL_STEP 17
/*
* 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

View file

@ -0,0 +1,184 @@
#include "clueboard1.h"
#ifdef RGBLIGHT_ENABLE
#include "rgblight.h"
#endif
// Used for SHIFT_ESC
#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
#define _BL 0
#define _FL 1
#define _RS 2
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap _BL: (Base Layer) Default Layer
* ,--------------------------------------------------------------------------. ,----.
* |Esc~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| BS| |PGUP|
* |--------------------------------------------------------------------------| |----|
* | Tab| Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |PGDN|
* |--------------------------------------------------------------------------| `----'
* |Capslck| A| S| D| F| G| H| J| K| L| ;| '| # | Ent|
* |-----------------------------------------------------------------------------.
* |Shift| BS| Z| X| C| V| B| N| M| ,| .| /| BS|Shift| UP|
* |------------------------------------------------------------------------|----|----.
* | Ctrl| Gui| Alt| MHen| Space| Space| Hen| Alt| Ctrl| _FL|LEFT|DOWN|RGHT|
* `----------------------------------------------------------------------------------'
*/
[_BL] = KEYMAP(
F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, KC_PGUP, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGDN, \
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_RSFT, KC_UP, \
KC_LCTL, KC_LGUI, KC_LALT, KC_MHEN, KC_SPC,KC_SPC, KC_HENK, KC_RALT, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT),
/* Keymap _FL: Function Layer
* ,--------------------------------------------------------------------------. ,----.
* | `| F1| F2| F3| F4| F5| F6| F7| F8| F9| F10| F11| F12| | Del| |BLIN|
* |--------------------------------------------------------------------------| |----|
* | | | | | | | | |PScr|SLck|Paus| | | | |BLDE|
* |--------------------------------------------------------------------------| `----'
* | | | _RS| | | | | | | | | | | |
* |-----------------------------------------------------------------------------.
* | | | | | | | | | | | | | | |PGUP|
* |------------------------------------------------------------------------|----|----.
* | | | | | | | | | | _FL|HOME|PGDN| END|
* `----------------------------------------------------------------------------------'
*/
[_FL] = KEYMAP(
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_DEL, BL_STEP, \
KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PSCR,KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, MO(_RS),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_PGUP, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(_FL), KC_HOME, KC_PGDN, KC_END),
/* Keymap _RS: Reset layer
* ,--------------------------------------------------------------------------. ,----.
* | | | | | | | | | | | | | | | | | |
* |--------------------------------------------------------------------------| |----|
* | | | | |RESET| | | | | | | | | | | |
* |--------------------------------------------------------------------------| `----'
* | | | _RS| | | | | | | | | | | |
* |-----------------------------------------------------------------------------.
* | | | | | | | | | | | | | | | |
* |------------------------------------------------------------------------|----|----.
* | | | | | | | | | | _FL| | | |
* `----------------------------------------------------------------------------------'
*/
[_RS] = KEYMAP(
#ifdef RGBLIGHT_ENABLE
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, F(1), F(7), \
KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,RESET, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, F(8), \
KC_TRNS, KC_TRNS, MO(_RS),KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
MO(_FL), KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(_FL), F(5), \
KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, F(2), F(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, F(4), F(6), F(3)),
#else
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,RESET, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, MO(_RS),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_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(_FL), KC_TRNS, KC_TRNS, KC_TRNS),
#endif
};
enum function_id {
SHIFT_ESC,
#ifdef RGBLIGHT_ENABLE
RGBLED_TOGGLE,
RGBLED_STEP_MODE,
RGBLED_INCREASE_HUE,
RGBLED_DECREASE_HUE,
RGBLED_INCREASE_SAT,
RGBLED_DECREASE_SAT,
RGBLED_INCREASE_VAL,
RGBLED_DECREASE_VAL
#endif
};
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_FUNCTION(SHIFT_ESC),
#ifdef RGBLIGHT_ENABLE
[1] = ACTION_FUNCTION(RGBLED_TOGGLE),
[2] = ACTION_FUNCTION(RGBLED_STEP_MODE),
[3] = ACTION_FUNCTION(RGBLED_INCREASE_HUE),
[4] = ACTION_FUNCTION(RGBLED_DECREASE_HUE),
[5] = ACTION_FUNCTION(RGBLED_INCREASE_SAT),
[6] = ACTION_FUNCTION(RGBLED_DECREASE_SAT),
[7] = ACTION_FUNCTION(RGBLED_INCREASE_VAL),
[8] = ACTION_FUNCTION(RGBLED_DECREASE_VAL),
#endif
};
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
static uint8_t shift_esc_shift_mask;
switch (id) {
case SHIFT_ESC:
shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK;
if (record->event.pressed) {
if (shift_esc_shift_mask) {
add_key(KC_GRV);
send_keyboard_report();
} else {
add_key(KC_ESC);
send_keyboard_report();
}
} else {
if (shift_esc_shift_mask) {
del_key(KC_GRV);
send_keyboard_report();
} else {
del_key(KC_ESC);
send_keyboard_report();
}
}
break;
//led operations
#ifdef RGBLIGHT_ENABLE
case RGBLED_TOGGLE:
if (record->event.pressed) {
rgblight_toggle();
}
break;
case RGBLED_INCREASE_HUE:
if (record->event.pressed) {
rgblight_increase_hue();
}
break;
case RGBLED_DECREASE_HUE:
if (record->event.pressed) {
rgblight_decrease_hue();
}
break;
case RGBLED_INCREASE_SAT:
if (record->event.pressed) {
rgblight_increase_sat();
}
break;
case RGBLED_DECREASE_SAT:
if (record->event.pressed) {
rgblight_decrease_sat();
}
break;
case RGBLED_INCREASE_VAL:
if (record->event.pressed) {
rgblight_increase_val();
}
break;
case RGBLED_DECREASE_VAL:
if (record->event.pressed) {
rgblight_decrease_val();
}
break;
case RGBLED_STEP_MODE:
if (record->event.pressed) {
rgblight_step();
}
break;
#endif
}
}

View file

@ -1,4 +1,4 @@
/* /*
Copyright 2012 Jun Wako <wakojun@gmail.com> Copyright 2012 Jun Wako <wakojun@gmail.com>
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@ -20,19 +20,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "led.h" #include "led.h"
void led_set(uint8_t usb_led) void led_set_kb(uint8_t usb_led) {
{ DDRF |= (1<<0);
// // Using PE6 Caps Lock LED if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
// if (usb_led & (1<<USB_LED_CAPS_LOCK)) // Turn capslock on
// { PORTF |= (1<<0);
// // Output high. } else {
// DDRE |= (1<<6); // Turn capslock off
// PORTE |= (1<<6); PORTF &= ~(1<<0);
// } }
// else
// {
// // Output low.
// DDRE &= ~(1<<6);
// PORTE &= ~(1<<6);
// }
} }

View file

@ -0,0 +1,141 @@
#----------------------------------------------------------------------------
# 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 = clueboard2
# Directory common source filess exist
TOP_DIR = ../..
TMK_DIR = ../../tmk_core
# Directory keyboard dependent files exist
TARGET_DIR = .
# # project specific files
SRC = clueboard2.c led.c
ifdef KEYMAP
SRC := keymaps/keymap_$(KEYMAP).c $(SRC)
else
SRC := keymaps/keymap_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=4096
# Build Options
# comment out to disable the options.
#
BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = no # 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
NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
RGBLIGHT_ENABLE = no # Enable keyboard underlight functionality (+4870)
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality (+1150)
MIDI_ENABLE = no # MIDI controls
AUDIO_ENABLE = no
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
#ifdef BACKLIGHT_ENABLE
SRC := backlight.c $(SRC)
#endif
# 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

View file

@ -0,0 +1,41 @@
#include <avr/io.h>
#include "backlight.h"
#include "print.h"
/* Clueboard 2.0 LED locations:
*
* Capslock: B4, pull high to turn on
* LCtrl: Shared with Capslock, DO NOT INSTALL LED'S IN BOTH
* Page Up: B7, pull high to turn on
* Escape: D6, pull high to turn on
* Arrows: D4, pull high to turn on
*/
void init_backlight_pin(void) {
print("init_backlight_pin()\n");
// Set our LED pins as output
DDRD |= (1<<6); // Esc
DDRB |= (1<<7); // Page Up
DDRD |= (1<<4); // Arrows
// Set our LED pins low
PORTD &= ~(1<<6); // Esc
PORTB &= ~(1<<7); // Page Up
PORTD &= ~(1<<4); // Arrows
}
void backlight_set(uint8_t level) {
if ( level == 0 ) {
// Turn off light
PORTD |= (1<<6); // Esc
PORTB |= (1<<7); // Page Up
PORTD |= (1<<4); // Arrows
} else {
// Turn on light
PORTD &= ~(1<<6); // Esc
PORTB &= ~(1<<7); // Page Up
PORTD &= ~(1<<4); // Arrows
}
}

View file

@ -0,0 +1,44 @@
#include "clueboard2.h"
#ifdef BACKLIGHT_ENABLE
#include "backlight.h"
#endif
__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
if (matrix_init_user) {
(*matrix_init_user)();
}
led_init_ports();
#ifdef BACKLIGHT_ENABLE
init_backlight_pin();
#endif
#ifdef RGBLIGHT_ENABLE
rgblight_init();
#endif
// JTAG disable for PORT F. write JTD bit twice within four cycles.
MCUCR |= (1<<JTD);
MCUCR |= (1<<JTD);
};
void matrix_scan_kb(void) {
// put your looping keyboard code here
// runs every cycle (a lot)
if (matrix_scan_user) {
(*matrix_scan_user)();
}
};

View file

@ -0,0 +1,57 @@
#ifndef CLUEBOARD2_H
#define CLUEBOARD2_H
#include "matrix.h"
#include "keymap_common.h"
#include <stddef.h>
/* Clueboard matrix layout
* ,-----------------------------------------------------------. ,---.
* | 00| 01| 02| 03| 04| 05| 06| 07| 50| 51| 52| 53| 54| 55| 56| | 57|
* |-----------------------------------------------------------| |---|
* | 10| 11| 12| 13| 14| 15| 16| 17| 60| 61| 62| 63| 64| 65| | 67|
* |-----------------------------------------------------------| `---'
* | 20| 21| 22| 23| 24| 25| 26| 27| 70| 71| 72| 73| 74| 75|
* |------------------------------------------------------------.
* | 30| 31| 32| 33| 34| 35| 36| 37| 80| 81| 82| 83| 84| 85|86|
* |------------------------------------------------------------------.
* | 40| 41| 42| 43| 45| 46| 90| 91| 92| 93| 94| 95| 96|
* `------------------------------------------------------------------'
* ,-----------------------------------------------------------. ,---.
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Yen| BS| |Ins|
* |-----------------------------------------------------------| |---|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|
* |-----------------------------------------------------------| `---'
* |Caps | A| S| D| F| G| H| J| k| L| ;| '| # | Ent|
* |--------------------------------------------------------------.
* |Shift| \| Z| X| C| V| B| N| M| ,| .| /| \|Shift| Up|
* |------------------------------------------------------------------.
* |Ctrl|Alt|Gui |MHen| Space| Space|Henk|Gui |Ctrl| Fn|Left|Down|Rgt|
* `------------------------------------------------------------------'
*/
// The first section contains all of the arguments
// The second converts the arguments into a two-dimensional array
#define KEYMAP( \
k00, k01, k02, k03, k04, k05, k06, k07, k50, k51, k52, k53, k54, k55, k56, k57, \
k10, k11, k12, k13, k14, k15, k16, k17, k60, k61, k62, k63, k64, k65, k67, \
k20, k21, k22, k23, k24, k25, k26, k27, k70, k71, k72, k73, k74, k75, \
k30, k31, k32, k33, k34, k35, k36, k37, k80, k81, k82, k83, k84, k85, k86, \
k40, k41, k42, k43, k45, k46, k90, k92, k93, k94, k95, k96, k97 \
) { \
{ k00, k01, k02, k03, k04, k05, k06, k07 }, \
{ k10, k11, k12, k13, k14, k15, k16, k17 }, \
{ k20, k21, k22, k23, k24, k25, k26, k27 }, \
{ k30, k31, k32, k33, k34, k35, k36, k37 }, \
{ k40, k41, k42, k43, KC_NO, k45, k46, KC_NO }, \
{ k50, k51, k52, k53, k54, k55, k56, k57 }, \
{ k60, k61, k62, k63, k64, k65, KC_NO, k67 }, \
{ k70, k71, k72, k73, k74, k75, KC_NO, KC_NO }, \
{ k80, k81, k82, k83, k84, k85, k86, KC_NO }, \
{ k90, KC_NO, k92, k93, k94, k95, k96, k97 } \
}
void matrix_init_user(void);
void matrix_scan_user(void);
#endif

View file

@ -0,0 +1,100 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
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 <http://www.gnu.org/licenses/>.
*/
#ifndef CONFIG_H
#define CONFIG_H
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0xC1ED
#define PRODUCT_ID 0x2320
#define DEVICE_VER 0x0001
#define MANUFACTURER Clueboard
#define PRODUCT Clueboard with RGB Underlighting
#define DESCRIPTION QMK keyboard firmware for Clueboard
/* key matrix size */
#define MATRIX_ROWS 10
#define MATRIX_COLS 8
// COLS: Left to right, ROWS: Top to bottom
/* Column pin configuration
* col: 0 1 2 3 4 5 6 7
* pin: F0 F1 F4 F5 F6 F7 E6 B1
*/
#define COLS (int []){ F0, F1, F4, F5, F6, F7, E6, B1 }
/* Row pin configuration
* row: 0 1 2 3 4 5 6 7 8 9
* pin: B2 C7 C6 B6 B5 B0 B3 D5 D3 D2
*/
#define ROWS (int []){ B2, C7, C6, B6, B5, B0, B3, D5, D3, D2 }
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST
/* 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)) \
)
/* Backlight configuration
*/
#define BACKLIGHT_LEVELS 1
/* Underlight configuration
*/
#define ws2812_PORTREG PORTD
#define ws2812_DDRREG DDRD
#define ws2812_pin 7
#define RGBLED_NUM 14 // Number of LEDs
#define RGBLIGHT_HUE_STEP 10
#define RGBLIGHT_SAT_STEP 17
#define RGBLIGHT_VAL_STEP 17
/*
* 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

View file

@ -0,0 +1,183 @@
#include "clueboard2.h"
#ifdef RGBLIGHT_ENABLE
#include "rgblight.h"
#endif
// Used for SHIFT_ESC
#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
#define _BL 0
#define _FL 1
#define _RS 2
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap _BL: (Base Layer) Default Layer
* ,--------------------------------------------------------------------------. ,----.
* |Esc~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| BS| |PGUP|
* |--------------------------------------------------------------------------| |----|
* | Tab| Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |PGDN|
* |--------------------------------------------------------------------------| `----'
* |Capslck| A| S| D| F| G| H| J| K| L| ;| '| # | Ent|
* |-----------------------------------------------------------------------------.
* |Shift| BS| Z| X| C| V| B| N| M| ,| .| /| BS|Shift| UP|
* |------------------------------------------------------------------------|----|----.
* | Ctrl| Gui| Alt| MHen| Space| Space| Hen| Alt| Ctrl| _FL|LEFT|DOWN|RGHT|
* `----------------------------------------------------------------------------------'
*/
[_BL] = KEYMAP(
F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, KC_PGUP, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGDN, \
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_RSFT, KC_UP, \
KC_LCTL, KC_LGUI, KC_LALT, KC_MHEN, KC_SPC,KC_SPC, KC_HENK, KC_RALT, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT),
/* Keymap _FL: Function Layer
* ,--------------------------------------------------------------------------. ,----.
* | `| F1| F2| F3| F4| F5| F6| F7| F8| F9| F10| F11| F12| | Del| |BLIN|
* |--------------------------------------------------------------------------| |----|
* | | | | | | | | |PScr|SLck|Paus| | | | |BLDE|
* |--------------------------------------------------------------------------| `----'
* | | | _RS| | | | | | | | | | | |
* |-----------------------------------------------------------------------------.
* | | | | | | | | | | | | | | |PGUP|
* |------------------------------------------------------------------------|----|----.
* | | | | | | | | | | _FL|HOME|PGDN| END|
* `----------------------------------------------------------------------------------'
*/
[_FL] = KEYMAP(
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_DEL, BL_STEP, \
KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PSCR,KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, MO(_RS),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_PGUP, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(_FL), KC_HOME, KC_PGDN, KC_END),
/* Keymap _RS: Reset layer
* ,--------------------------------------------------------------------------. ,----.
* | | | | | | | | | | | | | | | | | |
* |--------------------------------------------------------------------------| |----|
* | | | | |RESET| | | | | | | | | | | |
* |--------------------------------------------------------------------------| `----'
* | | | _RS| | | | | | | | | | | |
* |-----------------------------------------------------------------------------.
* | | | | | | | | | | | | | | | |
* |------------------------------------------------------------------------|----|----.
* | | | | | | | | | | _FL| | | |
* `----------------------------------------------------------------------------------'
*/
[_RS] = KEYMAP(
#ifdef RGBLIGHT_ENABLE
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, F(1), F(7), \
KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,RESET, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, F(8), \
KC_TRNS, KC_TRNS, MO(_RS),KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
MO(_FL), KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(_FL), F(5), \
KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, F(2), F(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, F(4), F(6), F(3)),
#else
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,RESET, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, MO(_RS),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_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(_FL), KC_TRNS, KC_TRNS, KC_TRNS),
#endif
};
enum function_id {
SHIFT_ESC,
#ifdef RGBLIGHT_ENABLE
RGBLED_TOGGLE,
RGBLED_STEP_MODE,
RGBLED_INCREASE_HUE,
RGBLED_DECREASE_HUE,
RGBLED_INCREASE_SAT,
RGBLED_DECREASE_SAT,
RGBLED_INCREASE_VAL,
RGBLED_DECREASE_VAL
#endif
};
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_FUNCTION(SHIFT_ESC),
#ifdef RGBLIGHT_ENABLE
[1] = ACTION_FUNCTION(RGBLED_TOGGLE),
[2] = ACTION_FUNCTION(RGBLED_STEP_MODE),
[3] = ACTION_FUNCTION(RGBLED_INCREASE_HUE),
[4] = ACTION_FUNCTION(RGBLED_DECREASE_HUE),
[5] = ACTION_FUNCTION(RGBLED_INCREASE_SAT),
[6] = ACTION_FUNCTION(RGBLED_DECREASE_SAT),
[7] = ACTION_FUNCTION(RGBLED_INCREASE_VAL),
[8] = ACTION_FUNCTION(RGBLED_DECREASE_VAL),
#endif
};
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
static uint8_t shift_esc_shift_mask;
switch (id) {
case SHIFT_ESC:
shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK;
if (record->event.pressed) {
if (shift_esc_shift_mask) {
add_key(KC_GRV);
send_keyboard_report();
} else {
add_key(KC_ESC);
send_keyboard_report();
}
} else {
if (shift_esc_shift_mask) {
del_key(KC_GRV);
send_keyboard_report();
} else {
del_key(KC_ESC);
send_keyboard_report();
}
}
break;
//led operations
#ifdef RGBLIGHT_ENABLE
case RGBLED_TOGGLE:
if (record->event.pressed) {
rgblight_toggle();
}
break;
case RGBLED_INCREASE_HUE:
if (record->event.pressed) {
rgblight_increase_hue();
}
break;
case RGBLED_DECREASE_HUE:
if (record->event.pressed) {
rgblight_decrease_hue();
}
break;
case RGBLED_INCREASE_SAT:
if (record->event.pressed) {
rgblight_increase_sat();
}
break;
case RGBLED_DECREASE_SAT:
if (record->event.pressed) {
rgblight_decrease_sat();
}
break;
case RGBLED_INCREASE_VAL:
if (record->event.pressed) {
rgblight_increase_val();
}
break;
case RGBLED_DECREASE_VAL:
if (record->event.pressed) {
rgblight_decrease_val();
}
break;
case RGBLED_STEP_MODE:
if (record->event.pressed) {
rgblight_step();
}
break;
#endif
}
}

View file

@ -0,0 +1,147 @@
#include "clueboard2.h"
#ifdef ENABLE_RGBLIGHT
#include "rgblight.h"
#endif
// Used for SHIFT_ESC
#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
#define _BL 0
#define _FL 1
#define _RS 2
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap _BL: (Base Layer) Default Layer
* ,--------------------------------------------------------------------------. ,----.
* | Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| ~| BS| |PgUp|
* |--------------------------------------------------------------------------| |----|
* | Tab| Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |PgDn|
* |--------------------------------------------------------------------------| `----'
* |Capslck| A| S| D| F| G| H| J| K| L| ;| '| # | Ent|
* |-----------------------------------------------------------------------------.
* |Shift| BS| Z| X| C| V| B| N| M| ,| .| /| BS|Shift| Up|
* |------------------------------------------------------------------------|----|----.
* | Ctrl| Alt| Gui| MHen| Space| Space| Hen| Gui| Alt| Ctrl|Left|Down|Rght|
* `----------------------------------------------------------------------------------'
*/
[_BL] = KEYMAP(
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, KC_PGUP, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGDN, \
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \
MO(_FL), KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FL), KC_UP, \
KC_LCTL, KC_LALT, KC_LGUI,KC_MHEN, KC_SPC, KC_SPC, KC_HENK, KC_RGUI, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
/* Keymap _FL: Function Layer
* ,--------------------------------------------------------------------------. ,----.
* | `| F1| F2| F3| F4| F5| F6| F7| F8| F9| F10| F11| F12| | Del| |BLIN|
* |--------------------------------------------------------------------------| |----|
* | | | | | | | | |PScr|SLck|Paus| | | | |BLDE|
* |--------------------------------------------------------------------------| `----'
* | | | _RS| | | | | | | | | | | |
* |-----------------------------------------------------------------------------.
* | | | | | | | | | | | | | | |PGUP|
* |------------------------------------------------------------------------|----|----.
* | | | | | | | | | | _FL|HOME|PGDN| END|
* `----------------------------------------------------------------------------------'
*/
[_FL] = KEYMAP(
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_DEL, BL_STEP, \
KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, MO(_RS),KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
MO(_FL), KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(_FL), KC_PGUP, \
KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END),
/* Keymap _RS: Reset/Underlight layer
* ,--------------------------------------------------------------------------. ,----.
* | | | | | | | | | | | | | | | | | |
* |--------------------------------------------------------------------------| |----|
* | | | | |RESET| | | | | | | | | | | |
* |--------------------------------------------------------------------------| `----'
* | | | _RS| | | | | | | | | | | |
* |-----------------------------------------------------------------------------.
* | | | | | | | | | | | | | | | |
* |------------------------------------------------------------------------|----|----.
* | | | | | | | | | | _FL| | | |
* `----------------------------------------------------------------------------------'
*/
[_RS] = KEYMAP(
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, F(0), F(6), \
KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,RESET, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, F(7), \
KC_TRNS, KC_TRNS, MO(_RS),KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
MO(_FL), KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(_FL), F(4), \
KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, F(1), F(1), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, F(3), F(5), F(2)),
};
enum function_id {
RGBLED_TOGGLE,
RGBLED_STEP_MODE,
RGBLED_INCREASE_HUE,
RGBLED_DECREASE_HUE,
RGBLED_INCREASE_SAT,
RGBLED_DECREASE_SAT,
RGBLED_INCREASE_VAL,
RGBLED_DECREASE_VAL,
};
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_FUNCTION(RGBLED_TOGGLE),
[1] = ACTION_FUNCTION(RGBLED_STEP_MODE),
[2] = ACTION_FUNCTION(RGBLED_INCREASE_HUE),
[3] = ACTION_FUNCTION(RGBLED_DECREASE_HUE),
[4] = ACTION_FUNCTION(RGBLED_INCREASE_SAT),
[5] = ACTION_FUNCTION(RGBLED_DECREASE_SAT),
[6] = ACTION_FUNCTION(RGBLED_INCREASE_VAL),
[7] = ACTION_FUNCTION(RGBLED_DECREASE_VAL),
};
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
switch (id) {
case RGBLED_TOGGLE:
//led operations
if (record->event.pressed) {
rgblight_toggle();
}
break;
case RGBLED_INCREASE_HUE:
if (record->event.pressed) {
rgblight_increase_hue();
}
break;
case RGBLED_DECREASE_HUE:
if (record->event.pressed) {
rgblight_decrease_hue();
}
break;
case RGBLED_INCREASE_SAT:
if (record->event.pressed) {
rgblight_increase_sat();
}
break;
case RGBLED_DECREASE_SAT:
if (record->event.pressed) {
rgblight_decrease_sat();
}
break;
case RGBLED_INCREASE_VAL:
if (record->event.pressed) {
rgblight_increase_val();
}
break;
case RGBLED_DECREASE_VAL:
if (record->event.pressed) {
rgblight_decrease_val();
}
break;
case RGBLED_STEP_MODE:
if (record->event.pressed) {
rgblight_step();
}
break;
}
}

View file

@ -0,0 +1,108 @@
#include "clueboard2.h"
// Used for SHIFT_ESC
#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
#define _BL 0
#define _FL 1
#define _RS 2
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap _BL: (Base Layer) Default Layer
* ,--------------------------------------------------------------------------. ,----.
* |Esc~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| BS| |PGUP|
* |--------------------------------------------------------------------------| |----|
* | Tab| Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |PGDN|
* |--------------------------------------------------------------------------| `----'
* |Capslck| A| S| D| F| G| H| J| K| L| ;| '| # | Ent|
* |-----------------------------------------------------------------------------.
* |Shift| BS| Z| X| C| V| B| N| M| ,| .| /| BS|Shift| UP|
* |------------------------------------------------------------------------|----|----.
* | Ctrl| Gui| Alt| MHen| Space| Space| Hen| Alt| Ctrl| _FL|LEFT|DOWN|RGHT|
* `----------------------------------------------------------------------------------'
*/
[_BL] = KEYMAP(
F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, KC_PGUP, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGDN, \
KC_LCTL,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \
KC_LSFT,KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_RSFT, KC_UP, \
KC_LCTL,KC_LALT,KC_LGUI,MO(_FL), KC_SPC, KC_SPC, MO(_FL), KC_RGUI, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT),
/* Keymap _FL: Function Layer
* ,--------------------------------------------------------------------------. ,----.
* | `| F1| F2| F3| F4| F5| F6| F7| F8| F9| F10| F11| F12| | Del| |BLIN|
* |--------------------------------------------------------------------------| |----|
* | | | | | | | | |PScr|SLck|Paus| | | | |BLDE|
* |--------------------------------------------------------------------------| `----'
* | | | _RS| | | | | | | | | | | |
* |-----------------------------------------------------------------------------.
* | | | | | | | | | | | | | | |PGUP|
* |------------------------------------------------------------------------|----|----.
* | | | | | | | | | | _FL|HOME|PGDN| END|
* `----------------------------------------------------------------------------------'
*/
[_FL] = KEYMAP(
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS,KC_DEL, BL_STEP, \
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PSCR,KC_SLCK,KC_PAUS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, \
KC_TRNS,KC_TRNS,MO(_RS),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_PGUP, \
KC_TRNS,KC_TRNS,KC_TRNS,MO(_FL), KC_TRNS,KC_TRNS, MO(_FL),KC_TRNS,KC_TRNS,MO(_FL),KC_HOME,KC_PGDN,KC_END),
/* Keymap _RS: Reset layer
* ,--------------------------------------------------------------------------. ,----.
* | | | | | | | | | | | | | | | | | |
* |--------------------------------------------------------------------------| |----|
* | | | | |RESET| | | | | | | | | | | |
* |--------------------------------------------------------------------------| `----'
* | | | _RS| | | | | | | | | | | |
* |-----------------------------------------------------------------------------.
* | | | | | | | | | | | | | | | |
* |------------------------------------------------------------------------|----|----.
* | | | | | | | | | | _FL| | | |
* `----------------------------------------------------------------------------------'
*/
[_RS] = KEYMAP(
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,RESET, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, \
KC_TRNS,KC_TRNS,MO(_RS),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_TRNS, KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,MO(_FL),KC_TRNS, KC_TRNS, KC_TRNS),
};
enum function_id {
SHIFT_ESC,
};
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_FUNCTION(SHIFT_ESC),
};
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
static uint8_t shift_esc_shift_mask;
switch (id) {
case SHIFT_ESC:
shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK;
if (record->event.pressed) {
if (shift_esc_shift_mask) {
add_key(KC_GRV);
send_keyboard_report();
} else {
add_key(KC_ESC);
send_keyboard_report();
}
} else {
if (shift_esc_shift_mask) {
del_key(KC_GRV);
send_keyboard_report();
} else {
del_key(KC_ESC);
send_keyboard_report();
}
}
break;
}
}

36
keyboard/clueboard2/led.c Normal file
View file

@ -0,0 +1,36 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
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 <http://www.gnu.org/licenses/>.
*/
#include <avr/io.h>
#include "stdint.h"
#include "led.h"
void led_init_ports() {
// * Set our LED pins as output
DDRB |= (1<<4);
}
void led_set_kb(uint8_t usb_led) {
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
// Turn capslock on
PORTB |= (1<<4);
} else {
// Turn capslock off
PORTB &= ~(1<<4);
}
}

136
keyboard/cluepad/Makefile Normal file
View file

@ -0,0 +1,136 @@
#----------------------------------------------------------------------------
# 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 = cluepad
# Directory common source filess exist
TOP_DIR = ../..
TMK_DIR = ../../tmk_core
# Directory keyboard dependent files exist
TARGET_DIR = .
# # project specific files
SRC = cluepad.c backlight.c
ifdef KEYMAP
SRC := keymaps/keymap_$(KEYMAP).c $(SRC)
else
SRC := keymaps/keymap_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=4096
# 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
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 numpad's backlight functionality
RGBLIGHT_ENABLE = yes
# 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

View file

@ -0,0 +1,54 @@
#include <avr/io.h>
#include "backlight.h"
#include "led.h"
#include "print.h"
int pwm_level;
void led_set_kb(uint8_t usb_led)
{
print("led_set\n");
}
void init_backlight_pin(void)
{
// Set C7 to output
DDRC |= (1<<7);
// Initialize the timer
TC4H = 0x03;
OCR4C = 0xFF;
TCCR4A = 0b10000010;
TCCR4B = 0b00000001;
}
void backlight_set(uint8_t level)
{
// Determine the PWM level
switch (level)
{
case 0:
// 33%
pwm_level = 0x54;
break;
case 1:
// 66%
pwm_level = 0xA8;
break;
case 2:
// 100%
pwm_level = 0xFF;
break;
case 3:
// 0%
pwm_level = 0x00;
break;
default:
xprintf("Unknown level: %d\n", level);
}
// Write the PWM level to the timer
TC4H = pwm_level >> 8;
OCR4A = 0xFF & pwm_level;
}

View file

@ -0,0 +1,39 @@
#include "cluepad.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
if (matrix_init_user) {
(*matrix_init_user)();
}
#ifdef BACKLIGHT_ENABLE
init_backlight_pin();
#endif
#ifdef RGBLIGHT_ENABLE
rgblight_init();
#endif
// JTAG disable for PORT F. write JTD bit twice within four cycles.
MCUCR |= (1<<JTD);
MCUCR |= (1<<JTD);
};
void matrix_scan_kb(void) {
// put your looping keyboard code here
// runs every cycle (a lot)
if (matrix_scan_user) {
(*matrix_scan_user)();
}
};

View file

@ -0,0 +1,41 @@
#ifndef CLUEPAD_H
#define CLUEPAD_H
#include "matrix.h"
#include "keymap_common.h"
#include <stddef.h>
/* Cluepad matrix layout
* .-------------------.
* |NLCK| /| *| -|
* |-------------------|
* | 7| 8| 9| |
* |--------------| |
* | 4| 5| 6| +|
* |-------------------|
* | 1| 2| 3| |
* |--------------| |
* | 0| .| Ent|
* '-------------------'
*/
// The first section contains all of the arguments
// The second converts the arguments into a two-dimensional array
#define KEYMAP( \
k00, k01, k02, k03, \
k10, k11, k12, k13, \
k20, k21, k22, \
k30, k31, k32, k33, \
k40, k42 \
) { \
{ k00, k01, k02, k03, }, \
{ k10, k11, k12, k13, }, \
{ k20, k21, k22, KC_NO, }, \
{ k30, k31, k32, k33, }, \
{ k40, KC_NO, k42, KC_NO } \
}
void matrix_init_user(void);
void matrix_scan_user(void);
#endif

102
keyboard/cluepad/config.h Normal file
View file

@ -0,0 +1,102 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
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 <http://www.gnu.org/licenses/>.
*/
#ifndef CONFIG_H
#define CONFIG_H
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0xC1ED
#define PRODUCT_ID 0x2312
#define DEVICE_VER 0x0001
#define MANUFACTURER Clueboard
#define PRODUCT Cluepad with RGB Underlighting
#define DESCRIPTION QMK keyboard firmware for Cluepad
/* key matrix size */
#define MATRIX_ROWS 5
#define MATRIX_COLS 4
// COLS: Left to right, ROWS: Top to bottom
/* Column pin configuration
* col: 0 1 2 3
* pin: F4 E6 B1 D2
*/
#define COLS (int []){ F4, E6, B1, D2 }
/* Row pin configuration
* row: 0 1 2 3 4
* pin:
*/
#define ROWS (int []){ B0, D3, D5, D4, D6 }
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST
/* Set 0 if debouncing isn't needed */
#define DEBOUNCE 5
/* Number of backlighting levels */
#define BACKLIGHT_LEVELS 3
/* 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)) \
)
/* Underlight configuration
*/
#define ws2812_PORTREG PORTF
#define ws2812_DDRREG DDRF
#define ws2812_pin 6
#define RGBLED_NUM 4 // Number of LEDs
#define RGBLIGHT_HUE_STEP 10
#define RGBLIGHT_SAT_STEP 17
#define RGBLIGHT_VAL_STEP 17
/*
* Feature disable options
* These options are also useful to firmware size reduction.
*/
/* disable debug print */
//#define NO_DEBUG
/* Debug forcibly enabled */
#define ALWAYS_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

View file

@ -0,0 +1,122 @@
#include "cluepad.h"
#include "backlight.h"
#include "rgblight.h"
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
#define _BL 0
#define _FL 1
#define _RS 2
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap _BL: (Base Layer) Default Layer
* .-------------------.
* |NL F| /| *| -|
* |-------------------|
* | 7| 8| 9| |
* |--------------| |
* | 4| 5| 6| +|
* |-------------------|
* | 1| 2| 3| |
* |--------------| |
* | 0| .| Ent|
* '-------------------'
*/
[_BL] = KEYMAP(
LT(_FL, KC_NLCK), KC_PSLS, KC_PAST, KC_PMNS, \
KC_P7, KC_P8, KC_P9, KC_PPLS, \
KC_P4, KC_P5, KC_P6, \
KC_P1, KC_P2, KC_P3, KC_PENT, \
KC_P0, KC_PDOT),
/* Keymap _FL: Function Layer
* .-------------------.
* |NL F| | | Fn0|
* |-------------------|
* | | Fn4| | |
* |--------------| |
* | Fn3|BL_S| Fn2| Fn6|
* |-------------------|
* | | Fn5| | |
* |--------------| |
* | Fn1| | Fn7|
* '-------------------'
*/
[_FL] = KEYMAP(
LT(_FL, KC_NLCK), KC_TRNS, KC_TRNS, F(0), \
KC_TRNS, F(4), KC_TRNS, F(6), \
F(3), BL_STEP, F(2), \
KC_TRNS, F(5), KC_TRNS, F(7), \
F(1), KC_TRNS)
};
enum function_id {
RGBLED_TOGGLE,
RGBLED_STEP_MODE,
RGBLED_INCREASE_HUE,
RGBLED_DECREASE_HUE,
RGBLED_INCREASE_SAT,
RGBLED_DECREASE_SAT,
RGBLED_INCREASE_VAL,
RGBLED_DECREASE_VAL,
};
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_FUNCTION(RGBLED_TOGGLE),
[1] = ACTION_FUNCTION(RGBLED_STEP_MODE),
[2] = ACTION_FUNCTION(RGBLED_INCREASE_HUE),
[3] = ACTION_FUNCTION(RGBLED_DECREASE_HUE),
[4] = ACTION_FUNCTION(RGBLED_INCREASE_SAT),
[5] = ACTION_FUNCTION(RGBLED_DECREASE_SAT),
[6] = ACTION_FUNCTION(RGBLED_INCREASE_VAL),
[7] = ACTION_FUNCTION(RGBLED_DECREASE_VAL),
};
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
switch (id) {
case RGBLED_TOGGLE:
if (record->event.pressed) {
rgblight_toggle();
}
break;
case RGBLED_INCREASE_HUE:
if (record->event.pressed) {
rgblight_increase_hue();
}
break;
case RGBLED_DECREASE_HUE:
if (record->event.pressed) {
rgblight_decrease_hue();
}
break;
case RGBLED_INCREASE_SAT:
if (record->event.pressed) {
rgblight_increase_sat();
}
break;
case RGBLED_DECREASE_SAT:
if (record->event.pressed) {
rgblight_decrease_sat();
}
break;
case RGBLED_INCREASE_VAL:
if (record->event.pressed) {
rgblight_increase_val();
}
break;
case RGBLED_DECREASE_VAL:
if (record->event.pressed) {
rgblight_decrease_val();
}
break;
case RGBLED_STEP_MODE:
if (record->event.pressed) {
rgblight_step();
}
break;
}
}

Binary file not shown.

View file

@ -0,0 +1,385 @@
[
{
"name": "Beginner's Keymap for Ergodox-EZ",
"author": "Anand Babu Periasamy"
},
[
{
"x": 3.5
},
"#\n3\n\n\nF3",
{
"x": 10.5
},
")\n0\n\n\nF10"
],
[
{
"y": -0.875,
"x": 2.5
},
"@\n2\n\n\nF2",
{
"x": 1
},
"$\n4\n\n\nF4",
{
"x": 8.5
},
"(\n9\n\n\nF9",
{
"x": 1
},
"_\n-\n\n\nF11"
],
[
{
"y": -0.875,
"x": 5.5
},
"%\n5\n\n\nF5",
"^\n6\n\n\nF6",
{
"x": 4.5
},
"&\n7\n\n\nF7",
"*\n8\n\n\nF8"
],
[
{
"y": -0.875,
"w": 1.5
},
"~\n`\n\n\nEsc",
"!\n1\n\n\nF1",
{
"x": 14.5
},
"+\n=\n\n\nF12",
{
"a": 7,
"w": 1.5
},
"Backspace\n\n\n\nBackspace"
],
[
{
"y": -0.375,
"x": 3.5
},
"E\n\n\n\n<i class=\"fa fa-caret-up\" aria-hidden=\"true\"></i>",
{
"x": 10.5
},
"I"
],
[
{
"y": -0.8799999999999999,
"x": 2.5
},
"W"
],
[
{
"y": -0.9950000000000001,
"x": 4.5,
"a": 4
},
"R",
{
"x": 8.5,
"a": 7
},
"U",
{
"x": 1
},
"O"
],
[
{
"y": -0.875,
"x": 5.5
},
"T",
{
"h": 1.5
},
"<i class=\"fa fa-chevron-circle-left\" aria-hidden=\"true\"></i>",
{
"x": 4.5,
"h": 1.5
},
"<i class=\"fa fa-chevron-circle-right\" aria-hidden=\"true\"></i>",
"Y"
],
[
{
"y": -0.875,
"a": 6,
"w": 1.5
},
"Tab",
{
"a": 7
},
"Q",
{
"x": 14.5
},
"P",
{
"a": 4,
"w": 1.5
},
"|\n\\"
],
[
{
"y": -0.375,
"x": 3.5,
"a": 7
},
"D\n\n\n\n<i class=\"fa fa-caret-down\" aria-hidden=\"true\"></i>",
{
"x": 10.5
},
"K"
],
[
{
"y": -0.875,
"x": 2.5
},
"S\n\n\n\n<i class=\"fa fa-caret-left\" aria-hidden=\"true\"></i>",
{
"x": 1
},
"F\n\n\n\n<i class=\"fa fa-caret-right\" aria-hidden=\"true\"></i>",
{
"x": 8.5
},
"J",
{
"x": 1
},
"L"
],
[
{
"y": -0.875,
"x": 5.5
},
"G",
{
"x": 6.5
},
"H"
],
[
{
"y": -0.875,
"a": 4,
"fa": [
0,
0,
0,
2
],
"w": 1.5
},
"\n\n\nCtrl\n\n\nCaps",
{
"a": 7
},
"A",
{
"x": 14.5,
"a": 4
},
":\n;",
{
"a": 7,
"w": 1.5
},
"Enter"
],
[
{
"y": -0.625,
"x": 6.5,
"h": 1.5
},
"PgUp",
{
"x": 4.5,
"h": 1.5
},
"PgDn"
],
[
{
"y": -0.75,
"x": 3.5
},
"C",
{
"x": 10.5,
"a": 4
},
"<\n,"
],
[
{
"y": -0.875,
"x": 2.5,
"a": 7
},
"X",
{
"x": 1
},
"V",
{
"x": 8.5
},
"M",
{
"x": 1,
"a": 4
},
">\n."
],
[
{
"y": -0.875,
"x": 5.5,
"a": 7
},
"B",
{
"x": 6.5
},
"N"
],
[
{
"y": -0.875,
"w": 1.5
},
"Shift",
"Z",
{
"x": 14.5,
"a": 4
},
"?\n/",
{
"w": 1.5
},
"\"\n'"
],
[
{
"y": -0.375,
"x": 3.5,
"a": 7
},
"Alt\n\n\n\n<i class=\"fa fa-hand-o-left\" aria-hidden=\"true\"></i>",
{
"x": 10.5
},
"<i class=\"fa fa-long-arrow-down\" aria-hidden=\"true\"></i>\n\n\n\n<i class='fa fa-volume-down'></i>"
],
[
{
"y": -0.875,
"x": 2.5
},
"<i class='fa fa-linux'></i>",
{
"x": 1
},
"Alt\n\n\n\n<i class=\"fa fa-hand-o-right\" aria-hidden=\"true\"></i>",
{
"x": 8.5
},
"<i class=\"fa fa-long-arrow-left\" aria-hidden=\"true\"></i>",
{
"x": 1
},
"<i class=\"fa fa-long-arrow-up\" aria-hidden=\"true\"></i>\n\n\n\n<i class='fa fa-volume-up'></i>"
],
[
{
"y": -0.75,
"x": 0.5
},
"Ctrl\n\n\n\n<i class='fa fa-download'></i>",
"Esc",
{
"x": 14.5
},
"<i class=\"fa fa-long-arrow-right\" aria-hidden=\"true\"></i>\n\n\n\n<i class='fa fa-volume-off'></i>",
"Fn"
],
[
{
"r": 30,
"rx": 6.5,
"ry": 4.25,
"y": -1,
"x": 1
},
"<i class=\"fa fa-clone\" aria-hidden=\"true\"></i>",
"("
],
[
{
"h": 2
},
"Space",
{
"h": 2
},
"Del",
"["
],
[
{
"x": 2
},
"{"
],
[
{
"r": -30,
"rx": 13,
"y": -1,
"x": -3
},
")",
"<i class=\"fa fa-paste\" aria-hidden=\"true\"></i>"
],
[
{
"x": -3
},
"]",
{
"h": 2
},
"Enter",
{
"h": 2
},
"<i class=\"fa fa-chevron-left\" aria-hidden=\"true\"></i>"
],
[
{
"x": -3
},
"}"
]
]

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

View file

@ -0,0 +1,140 @@
#include "ergodox_ez.h"
#include "debug.h"
#include "action_layer.h"
#define BASE 0 // default layer
#define FN1 1 // media layer
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap 0: Basic layer
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 0 | - | = | BSpace |
* |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------|
* | Tab | Q | W | E | R | T | Fwd | | Back | Y | U | I | O | P | \ |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* |Caps/Ctl| A | S | D | F | G |------| |------| H | J | K | L | ; | Enter |
* |--------+------+------+------+------+------| PgUp | | PgDn |------+------+------+------+------+--------|
* | LShift | Z | X | C | V | B | | | | N | M | , | . | / | ' |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | Ctrl | Esc | LGui | Alt | Alt | | Left | Up | Dn | Right| Fn |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | Copy | ( | | ) | Paste|
* ,------|------+------| |------+------+------.
* | | | [ | | ] | | |
* |Space | Del |------| |------| Enter|BSpace|
* | | | { | | } | | |
* `--------------------' `--------------------'
*/
// 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_6,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_WBAK,
CTL_T(KC_CAPS), KC_A, KC_S, KC_D, KC_F, KC_G,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_PGUP,
KC_LCTL, KC_ESC, KC_LGUI, KC_LALT, KC_LALT,
LCTL(KC_C), KC_LCBR,
KC_LPRN,
KC_SPC, KC_DEL, KC_LBRC,
// right hand
KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,
KC_WFWD, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT,
KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT,
KC_UP, KC_LEFT, KC_RIGHT,KC_DOWN, TG(FN1),
KC_RCBR, LCTL(KC_V),
KC_RPRN,
KC_RBRC, KC_ENT, KC_BSPC
),
/* Keymap 1: Fn Keys, media and mouse keys
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | Esc | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | BSpace |
* |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------|
* | | | | MsUp | | | | | | | | | | | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | | | | | | | | | | | | | | |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* |Teensy| | | Lclk | Rclk | | |VolUp |VolDn | Mute | |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | | | | | |
* ,------|------+------| |------+------+------.
* | | | | | | | |
* | | |------| |------| | |
* | | | | | | | |
* `--------------------' `--------------------'
*/
// FN1 Layer
[FN1] = KEYMAP(
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6,
KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2,
KC_TRNS, KC_TRNS,
KC_TRNS,
RESET, KC_TRNS, KC_TRNS,
// right hand
KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_BSPC,
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_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS
),
};
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;
};
// 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;
}
};

View file

@ -0,0 +1,21 @@
# Beginner's keymap for Ergodox-EZ
Beginner's keymap emulates standard QWERTY keyboard for beginners. Once you get comfortable with the Ergodox-EZ, you may fork this keymap and customize it for your own needs or find a suitable one from the community contributed keymaps.
![Beginner's Keymap](keyboard-layout.png)
#### Pros
* Easier to switch between regular keyboards and Ergodox-EZ.
* Easy on beginners. It has everything you need for your day to day usage.
#### Cons
* Keys are not ergonomically placed to take full advantage of Ergodox-EZ. Take a look at this [Default Keymap](https://github.com/jackhumbert/qmk_firmware/blob/master/keyboard/ergodox_ez/keymaps/default/readme.md)
* While multiple layers are possible, beginner's keymap only uses one additional layer for mouse, function and volume keys.
#### Notes
* Ideally number key [6] should have started from the right-hand side of the keyboard. Doing so breaks the familiar QWERTY layout.
* Quote key ['] should have been placed between [:] and [Enter]. Due to lack of key space, it is placed below [Enter].
* Double [Alt] keys are placed adjacent to each other for convenience.
* [CapsLock] also acts as [Ctrl] key when you press and hold. It is convenient for GNU Emacs users.
* Additional bracket keys are placed in the center of the keyboard for programmer's convenience.

View file

@ -0,0 +1,238 @@
#include "ergodox_ez.h"
#include "debug.h"
#include "action_layer.h"
#define BASE 0 // default layer
#define SYMB 1 // symbols
#define MDIA 2 // media keys
#define UNIC 3 // unicode entry layer
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap 0: Basic layer
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | ESC | 1! | 2@ | 3# | 4$ | 5% | 6^ | | 7& | 8* | 9( | 0) | -_ | += | BkSp |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | Tab | Q | W | E | R | T | { | | } | Y | U | I | O | P | |\ |
* |--------+------+------+------+------+------| [ | | ] |------+------+------+------+------+--------|
* | Win | A | S | D | F | G |------| |------| H | J | K | L | :; | '" |
* |--------+------+------+------+------+------| Home | | End |------+------+------+------+------+--------|
* | LShift |Z/Alt | X | C | V | B | | | | N | M | , | . | Alt | RShift |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* |LCtrl | COPY | PASTE| Left | Right| | Down | Up |Hyper | `~ | RCtrl |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* Hyper = Ctrl+Super+Alt+Shift | ~L3 | F5 | | F2 | ~L2 |
* ,------|------|------| |------+------+------.
* | | | PgUp | | Ins | | |
* | Enter| BkSp |------| |------| ~L1 |Space |
* | | | PgDn | | Del | | |
* `--------------------' `--------------------'
*/
// 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, KC_6,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC,
KC_LGUI, KC_A, KC_S, KC_D, KC_F, KC_G,
KC_LSFT, ALT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_HOME,
KC_LCTRL, LCTL(KC_C), LCTL(KC_V), KC_LEFT,KC_RGHT,
KC_FN3, KC_F5,
KC_PGUP,
KC_ENT,KC_BSPC,KC_PGDN,
// right hand
KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,
KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,
KC_END, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT,
KC_DOWN,KC_UP, ALL_T(KC_NO),KC_GRV, KC_RCTRL,
KC_F2, KC_FN2,
KC_INS,
KC_DELT,KC_FN1, KC_SPC
),
/* Keymap 1: Symbol Layer
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 |PrintScr|
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | £ | | | | | | . | 0 | = |Alt+F4|
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* THERE! | | | | | |
* ,------|------|------| |------+------+------.
* CAD = Ctrl + Alt + Delete | | | | | | | |
* | | |------| |------| | |
* | | | | | CAD | | |
* `--------------------' `--------------------'
*/
// SYMBOLS
[SYMB] = KEYMAP(
// left hand
KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6,
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,M(3),KC_TRNS,KC_TRNS,KC_TRNS,
KC_TRNS,KC_TRNS,
KC_TRNS,
KC_TRNS,KC_TRNS,KC_TRNS,
// right hand
KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR,
KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_TRNS,
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, LALT(KC_F4),
KC_TRNS, KC_TRNS,
KC_TRNS,
LCTL(LALT(KC_DEL)), KC_TRNS, KC_TRNS
),
/* Keymap 2: Media and mouse keys
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | TEENSY | | | | | | | | | | | | | | |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | | | | MsUp | | | | | | | | | | | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | | | | | | | | | | | Prev | Next | | |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | | | Lclk | Rclk | |VolDn |VolUp | Mute | | |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | | | | | |
* ,------|------|------| |------+------+------.
* | | | | | | |Brwser|
* | | |------| |------| |Back |
* | | | | | | | |
* `--------------------' `--------------------'
*/
// MEDIA AND MOUSE
[MDIA] = KEYMAP(
RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, 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_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS,
KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_WBAK
),
/* Keymap 3: Unicode Entry
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | Alt | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 0 | + | + | |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | Alt | | | E | | | | | | | 7 | 8 | 9 | + | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | Alt | A | | D | F | |------| |------| | 4 | 5 | 6 | + | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | Alt | | | C | | B | | | | | 1 | 2 | 3 | + | |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | Alt | Alt | Alt | | | | 0 | 0 | 0 | + | |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* WINDOWS ONLY SETUP!! | ~L3 | | | | |
* ,------|------|------| |------+------+------.
* | | | | | | | |
* | Alt | Alt |------| |------| Alt | Alt |
* | | | | | | | |
* `--------------------' `--------------------'
*/
// If it accepts an argument (i.e, is a function), it doesn't need KC_.
// Otherwise, it needs KC_*
[UNIC] = KEYMAP( // layer 3 : Unicode Entry
// left hand
KC_LALT, KC_P1, KC_P2, KC_P3, KC_P4, KC_P5, KC_P6,
KC_LALT, KC_TRNS, KC_TRNS, KC_E, KC_TRNS, KC_TRNS, KC_TRNS,
KC_LALT, KC_A, KC_TRNS, KC_D, KC_F, KC_TRNS,
KC_LALT, KC_TRNS, KC_TRNS, KC_C, KC_TRNS, KC_B, KC_TRNS,
KC_LALT, KC_LALT, KC_LALT, KC_TRNS,KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_LALT,KC_LALT, KC_TRNS,
// right hand
KC_P7, KC_P8, KC_P9, KC_P0, KC_PPLS,KC_PPLS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_TRNS,
KC_TRNS, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_PPLS, KC_TRNS,
KC_P0, KC_P0, KC_P0, KC_PPLS, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS,KC_LALT, KC_LALT
),
};
const uint16_t PROGMEM fn_actions[] = {
[1] = ACTION_LAYER_TAP_TOGGLE(SYMB), // FN1 - Momentary Layer 1 (Symbols)
[2] = ACTION_LAYER_TAP_TOGGLE(MDIA), // FN2 - Momentary Layer 2 (Media)
[3] = ACTION_LAYER_TAP_TOGGLE(UNIC) // FN3 - Momentary Layer 3 (Unicode entry)
};
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);
}
case 3: // this would trigger when you hit a key mapped as M(3)
if (record->event.pressed) {
return MACRO( I(255), D(LALT), T(P1), T(P5), T(P6), U(LALT), END );
}
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;
case 3:
ergodox_right_led_3_on();
break;
default:
// none
break;
}
};

Binary file not shown.

View file

@ -0,0 +1,179 @@
Englishman in New York
===========================
:microphone: :tea:
About
------
After using the massdrop configurator to get the basics, I wanted to add a
little extra to my ergodox. Notably the Hyper hotkey, the press and hold,
and a way to have my beloved £ :pound: symbol available<sup>[1](#unicode)</sup>. Why not switch to a GB
layout? Well the computers I use are US keymap'd and I can't always change
that. Plus I've got used to 2/@ and 3/# and moving to the ergodox was hard
enough. :sweat_smile:
I started from the default and edited from there as I needed. It's somewhat
similar to a regular layout, particularly R1 and shift/controls. I ended up
with a few keys that were blank, so I'm testing out some shortcuts. Alt+F4 for
quitting things in Windows, is one example, but I felt it was better placed on
the 1st layer - in case of fat fingers.
Layout
-------
![Layout](rl-layout.jpg "Isn't it lovely")
### Base Layer
```
,--------------------------------------------------. ,--------------------------------------------------.
| ESC | 1! | 2@ | 3# | 4$ | 5% | 6^ | | 7& | 8* | 9( | 0) | -_ | += | BkSp |
|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
| Tab | Q | W | E | R | T | { | | } | Y | U | I | O | P | |\ |
|--------+------+------+------+------+------| [ | | ] |------+------+------+------+------+--------|
| Win | A | S | D | F | G |------| |------| H | J | K | L | :; | '" |
|--------+------+------+------+------+------| Home | | End |------+------+------+------+------+--------|
| LShift |Z/Alt | X | C | V | B | | | | N | M | , | . | Alt | RShift |
`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|LCtrl | COPY | PASTE| Left | Right| | Down | Up |Hyper | `~ | RCtrl |
`----------------------------------' `----------------------------------'
,-------------. ,-------------.
Hyper = Ctrl+Super+Alt+Shift | ~L3 | F5 | | F2 | ~L2 |
,------|------|------| |------+------+------.
| | | PgUp | | Ins | | |
| Enter| BkSp |------| |------| ~L1 |Space |
| | | PgDn | | Del | | |
`--------------------' `--------------------'
```
### Symbol Layer
```
,--------------------------------------------------. ,--------------------------------------------------.
| | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 |PrintScr|
|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
| | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | |
|--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
| | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | |
|--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
| | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | |
`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
| | £ | | | | | | . | 0 | = |Alt+F4|
`----------------------------------' `----------------------------------'
↑ ,-------------. ,-------------.
THERE! | | | | | |
,------|------|------| |------+------+------.
CAD = Ctrl + Alt + Delete | | | | | | | |
| | |------| |------| | |
| | | | | CAD | | |
`--------------------' `--------------------'
```
### Media Layer
Not touched this, not used either.
```
,--------------------------------------------------. ,--------------------------------------------------.
| TEENSY | | | | | | | | | | | | | | |
|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
| | | | MsUp | | | | | | | | | | | |
|--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
| | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play |
|--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
| | | | | | | | | | | | Prev | Next | | |
`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
| | | | Lclk | Rclk | |VolDn |VolUp | Mute | | |
`----------------------------------' `----------------------------------'
,-------------. ,-------------.
| | | | | |
,------|------|------| |------+------+------.
| | | | | | |Brwser|
| | |------| |------| |Back |
| | | | | | | |
`--------------------' `--------------------'
```
### Unicode Layer
Used to enter/test unicode input on Windows. All numbers are numpad keys.
```
,--------------------------------------------------. ,--------------------------------------------------.
| Alt | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 0 | + | + | |
|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
| Alt | | | E | | | | | | | 7 | 8 | 9 | + | |
|--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
| Alt | A | | D | F | |------| |------| | 4 | 5 | 6 | + | |
|--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
| Alt | | | C | | B | | | | | 1 | 2 | 3 | + | |
`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
| Alt | Alt | Alt | | | | 0 | 0 | 0 | + | |
`----------------------------------' `----------------------------------'
,-------------. ,-------------.
WINDOWS ONLY SETUP!! | ~L3 | | | | |
,------|------|------| |------+------+------.
| | | | | | | |
| Alt | Alt |------| |------| Alt | Alt |
| | | | | | | |
`--------------------' `--------------------'
```
Usage
------
~L1 / L2 / L3 will momentarily switch to a layer if held and another key is pressed.
If pressed and released will remain on layer until pressed again.
### Unicode
This layout is for Windows only. To enter a character Press and Hold Alt, type + and hex code then release Alt.
Changelog
-----------
### [0.2.1] - 2016-04-05
* Changed £ to alt code in Windows. Windows sucks at unicode.
### [0.2.0] - 2016-03-27
* Added unicode layer
* Moved Copy/Paste to left hand side
* Switched Enter and Space (again)
* Added L3 (unicode layer) toggle
* Removed Press and Hold for Alt on right hand size (/)
* Swapped Volume Up/Down to match arrows
* Tried fixing £ macro
* Removed * in the matrix function things (upstream change)
### [0.1.1] - 2016-03-23
* Changed £ input to a macro
### [0.1.0] - 2016-03-22
After actually using the keyboard, I've made some changes:
* Swapped Enter and Space
* Moved backspace to thumb keys (top right still remains)
* Added Ctrl+Alt+Delete
* Added Teensy Reset on 2nd layer
* Switched Up and Down
* Changed copy/paste to be Ctrl+c and Ctrl+v as KC_COPY/PASTE didn't work (in Windows)
* Moved ~L2 to replace +L1 after learning how the function works (notes above)
* Hopefully fixed GBP symbol (unicode enabled in MakeFile)
### [0.0.1] - 2016-03-21
First version
Issues
-------
Space for feedback and notes for future improvements
----
<sup><a name="unicode">1</a></sup>: For Windows only, and you have to edit the [registry](https://en.wikipedia.org/wiki/Unicode_input#Hexadecimal_code_input).

Binary file not shown.

After

Width:  |  Height:  |  Size: 814 KiB

View file

@ -0,0 +1,29 @@
# ErgoDox EZ Dvorak International Squisher
Dvorak layout adjusted with several (linux) applications in mind:
* Easier Escape for VIM
* Windows/Super key for awesome WM
* Alt+Shift for international characters
* PrintScreen for sys-rq
* Insert for the X11 clip-board
Major layer changes:
* Common multimedia keys are integrated into layer 0, less common into layer 1
* No mouse keys
* Layer 2 is qwerty (for easier gaming & less fortunate keyboard users)
Known issues:
* Alt+Shift does not work reliably (depends on the X11 kb layout? Not
entirely clear...)
![layer0](keyboard-layout0.png)
![layer1](keyboard-layout1.png)
![layer2](keyboard-layout2.png)
## Changelog
* 2016-03-29
* Initial release

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

View file

@ -0,0 +1,185 @@
#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 | BrBck| | Play | 6 | 7 | 8 | 9 | 0 | \ / L2 |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | Esc | ' | , | . | P | Y | Del | | Ins | F | G | C | R | L | / |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | BkSp | A | O | E | U | I |------| |------| D | H | T | N | S | - |
* |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------|
* | LShift |:/Ctrl| Q | J | K | X | | | | B | M | W | V |Z/Ctrl| RShift |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* |Grv/L1| LAlt | LGui | Left | Right| | Up | Down | [ | ] | ~L1 |
* `----------------------------------' `----------------------------------'
* ,-------------. ,---------------.
* | App | L1 | | L2 |PrntScr |
* ,------|------|------| |------+--------+------.
* | | | Home | | PgUp | | |
* | Space| Tab |------| |------| AltShf |Enter |
* | | | 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_WBAK,
KC_ESC, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_DELT,
KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I,
KC_LSFT, CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, ALL_T(KC_NO),
LT(SYMB,KC_GRV),KC_LALT, KC_LGUI, KC_LEFT,KC_RGHT,
CTL_T(KC_APP), TG(1),
KC_HOME,
KC_SPC,KC_TAB,KC_END,
// right hand
KC_MPLY, KC_6, KC_7, KC_8, KC_9, KC_0, LT(MDIA, KC_BSLS),
KC_INS, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH,
KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS,
MEH_T(KC_NO),KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_RSFT,
KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1,
TG(2), KC_PSCREEN,
KC_PGUP,
KC_PGDN,RALT(KC_RSFT), KC_ENT
),
/* Keymap 1: Symbol & Media Layer
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | | | Prev | Next | | | . | 0 | = | |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | | | | | |
* ,------|------|------| |------+------+------.
* | | | | |VolUp | | |
* | | |------| |------| Mute | |
* | | | | |VolDn | | |
* `--------------------' `--------------------'
*/
// 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_MPRV,KC_MNXT,
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_VOLU,
KC_VOLD, KC_MUTE, KC_TRNS
),
/* Keymap 2: QWERTY Layer
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | | | | | | | | | | | | | | | |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | | Q | W | E | R | T | | | | Y | U | I | O | P | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | A | S | D | F | G |------| |------| H | J | K | L | ; | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | | | | | | | | | | |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | | | | | |
* ,------|------|------| |------+------+------.
* | | | | | | | |
* | | |------| |------| | |
* | | | | | | | |
* `--------------------' `--------------------'
*/
// MEDIA AND MOUSE
KEYMAP( // layer 0 : default
// left hand
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
KC_TRNS, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_TRNS,
KC_TRNS, KC_A, KC_S, KC_D, KC_F, KC_G,
KC_TRNS, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, 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_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,
KC_TRNS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_TRNS,
KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_TRNS,
KC_TRNS, KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), 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[] = {
[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;
}
};

View file

@ -7,6 +7,9 @@
#define SYMB 1 // symbols #define SYMB 1 // symbols
#define MDIA 2 // media keys #define MDIA 2 // media keys
#define LSFTO M(0) // Left shift, open parens when tapped
#define RSFTC M(1) // Right shift, close parens when tapped
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap 0: Basic layer /* Keymap 0: Basic layer
* *
@ -17,9 +20,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | BkSp | A | S | D | F | G |------| |------| H | Alt/J| K | L |; / L2| LGui/' | * | BkSp | A | S | D | F | G |------| |------| H | Alt/J| K | L |; / L2| LGui/' |
* |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------|
* | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | * |LShift/(|Z/Ctrl| X | C | V | B | [ | | ] | N | M | , | . |//Ctrl|RShift/)|
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | - |
* `----------------------------------' `----------------------------------' * `----------------------------------' `----------------------------------'
* ,-------------. ,-------------. * ,-------------. ,-------------.
* | App | LGui | | Alt |Ctrl/Esc| * | App | LGui | | Alt |Ctrl/Esc|
@ -36,18 +39,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, 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_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_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), LSFTO, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_LBRC),
LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT, KC_RGHT, LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT, KC_RGHT,
ALT_T(KC_APP), KC_LGUI, ALT_T(KC_APP), KC_LGUI,
KC_HOME, KC_HOME,
KC_SPC,KC_FN1,KC_END, KC_SPC,KC_FN1,KC_END,
// right hand // right hand
KC_RGHT, KC_6,KC_7, KC_8, KC_9, KC_0, KC_MINS, 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, TG(SYMB), KC_Y,KC_U, KC_I, KC_O, KC_P, KC_BSLS,
KC_H,ALT_T(KC_J),KC_K, KC_L, LT(MDIA,KC_SCLN),GUI_T(KC_QUOT), KC_H,ALT_T(KC_J),KC_K, KC_L, LT(MDIA,KC_SCLN),GUI_T(KC_QUOT),
MEH_T(KC_NO),KC_N,KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, MEH_T(KC_RBRC),KC_N,KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), RSFTC,
KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_MINS,
KC_LALT, CTL_T(KC_ESC), KC_LALT, CTL_T(KC_ESC),
KC_PGUP, KC_PGUP,
KC_PGDN,LT(SYMB, KC_TAB), KC_ENT KC_PGDN,LT(SYMB, KC_TAB), KC_ENT
), ),
@ -140,17 +143,37 @@ const uint16_t PROGMEM fn_actions[] = {
[1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols)
}; };
static uint16_t key_timer;
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{ {
// MACRODOWN only works in this function
switch(id) { switch(id) {
case 0: case 0: {
if (record->event.pressed) { if (record->event.pressed) {
register_code(KC_RSFT); key_timer = timer_read(); // if the key is being pressed, we start the timer.
} else { register_code(KC_LSFT); // we're now holding down Shift.
unregister_code(KC_RSFT); } else { // this means the key was just released, so we can figure out how long it was pressed for (tap or "held down").
if (timer_elapsed(key_timer) < 70) { // the threshhold we pick for counting something as a tap.
register_code(KC_9); // sending 9 while Shift is held down gives us an opening paren
unregister_code(KC_9); // now let's let go of that key
}
unregister_code(KC_LSFT); // let's release the Shift key now.
}
break;
}
case 1: {
if (record->event.pressed) {
key_timer = timer_read(); // Now we're doing the same thing, only for the right shift/close paren key
register_code(KC_RSFT);
} else {
if (timer_elapsed(key_timer) < 70) {
register_code(KC_0);
unregister_code(KC_0);
}
unregister_code(KC_RSFT);
}
break;
} }
break;
} }
return MACRO_NONE; return MACRO_NONE;
}; };
@ -183,3 +206,5 @@ void matrix_scan_user(void) {
} }
}; };

View file

@ -4,6 +4,15 @@ This is my personal layout which I use to test out ideas which may or may not ma
Changelog: Changelog:
## Apr 29, 2016:
* Tweaks the Hyper and Meh key to send brackets when tapped
* Turns bottom-right key into a minus/underscore (easy to reach with the right pinky)
## Apr 25, 2016:
* Made it so that the right and left Shift keys send opening and closing parens ( ) when tapped
## Feb 11, 2016: ## Feb 11, 2016:
* Updated ASCII legend for thumb clusters * Updated ASCII legend for thumb clusters

View file

@ -0,0 +1,710 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Compiler for keymap.c files
This scrip will generate a keymap.c file from a simple
markdown file with a specific layout.
Usage:
python compile_keymap.py INPUT_PATH [OUTPUT_PATH]
"""
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import os
import io
import re
import sys
import json
import unicodedata
import collections
import itertools as it
PY2 = sys.version_info.major == 2
if PY2:
chr = unichr
KEYBOARD_LAYOUTS = {
# These map positions in the parsed layout to
# positions in the KEYMAP MATRIX
'ergodox_ez': [
[ 0, 1, 2, 3, 4, 5, 6], [38, 39, 40, 41, 42, 43, 44],
[ 7, 8, 9, 10, 11, 12, 13], [45, 46, 47, 48, 49, 50, 51],
[14, 15, 16, 17, 18, 19 ], [ 52, 53, 54, 55, 56, 57],
[20, 21, 22, 23, 24, 25, 26], [58, 59, 60, 61, 62, 63, 64],
[27, 28, 29, 30, 31 ], [ 65, 66, 67, 68, 69],
[ 32, 33], [70, 71 ],
[ 34], [72 ],
[ 35, 36, 37], [73, 74, 75 ],
]
}
ROW_INDENTS = {
'ergodox_ez': [0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 5, 0, 6, 0, 4, 0]
}
BLANK_LAYOUTS = [
# Compact Layout
"""
.------------------------------------.------------------------------------.
| | | | | | | | | | | | | | |
!-----+----+----+----+----+----------!-----+----+----+----+----+----+-----!
| | | | | | | | | | | | | | |
!-----+----+----+----x----x----! ! !----x----x----+----+----+-----!
| | | | | | |-----!-----! | | | | | |
!-----+----+----+----x----x----! ! !----x----x----+----+----+-----!
| | | | | | | | | | | | | | |
'-----+----+----+----+----+----------'----------+----+----+----+----+-----'
| | | | | | ! | | | | |
'------------------------' '------------------------'
.-----------. .-----------.
| | | ! | |
.-----+-----+-----! !-----+-----+-----.
! ! | | ! | ! !
! ! !-----! !-----! ! !
| | | | ! | | |
'-----------------' '-----------------'
""",
# Wide Layout
"""
.---------------------------------------------. .---------------------------------------------.
| | | | | | | | ! | | | | | | |
!-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------!
| | | | | | | | ! | | | | | | |
!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------!
| | | | | | |-------! !-------! | | | | | |
!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------!
| | | | | | | | ! | | | | | | |
'-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------'
| | | | | | ! | | | | |
'------------------------------' '------------------------------'
.---------------. .---------------.
| | | ! | |
.-------+-------+-------! !-------+-------+-------.
! ! | | ! | ! !
! ! !-------! !-------! ! !
| | | | ! | | |
'-----------------------' '-----------------------'
""",
]
DEFAULT_CONFIG = {
"keymaps_includes": [
"keymap_common.h",
],
'filler': "-+.'!:x",
'separator': "|",
'default_key_prefix': ["KC_"],
}
SECTIONS = [
'layout_config',
'layers',
]
# Markdown Parsing
ONELINE_COMMENT_RE = re.compile(r"""
^ # comment must be at the start of the line
\s* # arbitrary whitespace
// # start of the comment
(.*) # the comment
$ # until the end of line
""", re.MULTILINE | re.VERBOSE
)
INLINE_COMMENT_RE = re.compile(r"""
([\,\"\[\]\{\}\d]) # anythig that might end a expression
\s+ # comment must be preceded by whitespace
// # start of the comment
\s # and succeded by whitespace
(?:[^\"\]\}\{\[]*) # the comment (except things which might be json)
$ # until the end of line
""", re.MULTILINE | re.VERBOSE)
TRAILING_COMMA_RE = re.compile(r"""
, # the comma
(?:\s*) # arbitrary whitespace
$ # only works if the trailing comma is followed by newline
(\s*) # arbitrary whitespace
([\]\}]) # end of an array or object
""", re.MULTILINE | re.VERBOSE)
def loads(raw_data):
if isinstance(raw_data, bytes):
raw_data = raw_data.decode('utf-8')
raw_data = ONELINE_COMMENT_RE.sub(r"", raw_data)
raw_data = INLINE_COMMENT_RE.sub(r"\1", raw_data)
raw_data = TRAILING_COMMA_RE.sub(r"\1\2", raw_data)
return json.loads(raw_data)
def parse_config(path):
def reset_section():
section.update({
'name': section.get('name', ""),
'sub_name': "",
'start_line': -1,
'end_line': -1,
'code_lines': [],
})
def start_section(line_index, line):
end_section()
if line.startswith("# "):
name = line[2:]
elif line.startswith("## "):
name = line[3:]
else:
name = ""
name = name.strip().replace(" ", "_").lower()
if name in SECTIONS:
section['name'] = name
else:
section['sub_name'] = name
section['start_line'] = line_index
def end_section():
if section['start_line'] >= 0:
if section['name'] == 'layout_config':
config.update(loads("\n".join(
section['code_lines']
)))
elif section['sub_name'].startswith('layer'):
layer_name = section['sub_name']
config['layer_lines'][layer_name] = section['code_lines']
reset_section()
def amend_section(line_index, line):
section['end_line'] = line_index
section['code_lines'].append(line)
config = DEFAULT_CONFIG.copy()
config.update({
'layer_lines': collections.OrderedDict(),
'macro_ids': {'UM'},
'unicode_macros': {},
})
section = {}
reset_section()
with io.open(path, encoding="utf-8") as fh:
for i, line in enumerate(fh):
if line.startswith("#"):
start_section(i, line)
elif line.startswith(" "):
amend_section(i, line[4:])
else:
# TODO: maybe parse description
pass
end_section()
assert 'layout' in config
return config
# header file parsing
IF0_RE = re.compile(r"""
^
#if 0
$.*?
#endif
""", re.MULTILINE | re.DOTALL | re.VERBOSE)
COMMENT_RE = re.compile(r"""
/\*
.*?
\*/"
""", re.MULTILINE | re.DOTALL | re.VERBOSE)
def read_header_file(path):
with io.open(path, encoding="utf-8") as fh:
data = fh.read()
data, _ = COMMENT_RE.subn("", data)
data, _ = IF0_RE.subn("", data)
return data
def regex_partial(re_str_fmt, flags):
def partial(*args, **kwargs):
re_str = re_str_fmt.format(*args, **kwargs)
return re.compile(re_str, flags)
return partial
KEYDEF_REP = regex_partial(r"""
#define
\s
(
(?:{}) # the prefixes
(?:\w+) # the key name
) # capture group end
""", re.MULTILINE | re.DOTALL | re.VERBOSE)
ENUM_RE = re.compile(r"""
(
enum
\s\w+\s
\{
.*? # the enum content
\}
;
) # capture group end
""", re.MULTILINE | re.DOTALL | re.VERBOSE)
ENUM_KEY_REP = regex_partial(r"""
(
{} # the prefixes
\w+ # the key name
) # capture group end
""", re.MULTILINE | re.DOTALL | re.VERBOSE)
def parse_keydefs(config, data):
prefix_options = "|".join(config['key_prefixes'])
keydef_re = KEYDEF_REP(prefix_options)
enum_key_re = ENUM_KEY_REP(prefix_options)
for match in keydef_re.finditer(data):
yield match.groups()[0]
for enum_match in ENUM_RE.finditer(data):
enum = enum_match.groups()[0]
for key_match in enum_key_re.finditer(enum):
yield key_match.groups()[0]
def parse_valid_keys(config, out_path):
basepath = os.path.abspath(os.path.join(os.path.dirname(out_path)))
dirpaths = []
subpaths = []
while len(subpaths) < 6:
path = os.path.join(basepath, *subpaths)
dirpaths.append(path)
dirpaths.append(os.path.join(path, "tmk_core", "common"))
dirpaths.append(os.path.join(path, "quantum"))
subpaths.append('..')
includes = set(config['keymaps_includes'])
includes.add("keycode.h")
valid_keycodes = set()
for dirpath, include in it.product(dirpaths, includes):
include_path = os.path.join(dirpath, include)
if os.path.exists(include_path):
header_data = read_header_file(include_path)
valid_keycodes.update(
parse_keydefs(config, header_data)
)
return valid_keycodes
# Keymap Parsing
def iter_raw_codes(layer_lines, filler, separator):
filler_re = re.compile("[" + filler + " ]")
for line in layer_lines:
line, _ = filler_re.subn("", line.strip())
if not line:
continue
codes = line.split(separator)
for code in codes[1:-1]:
yield code
def iter_indexed_codes(raw_codes, key_indexes):
key_rows = {}
key_indexes_flat = []
for row_index, key_indexes in enumerate(key_indexes):
for key_index in key_indexes:
key_rows[key_index] = row_index
key_indexes_flat.extend(key_indexes)
assert len(raw_codes) == len(key_indexes_flat)
for raw_code, key_index in zip(raw_codes, key_indexes_flat):
# we keep track of the row mostly for layout purposes
yield raw_code, key_index, key_rows[key_index]
LAYER_CHANGE_RE = re.compile(r"""
(DF|TG|MO)\(\d+\)
""", re.VERBOSE)
MACRO_RE = re.compile(r"""
M\(\w+\)
""", re.VERBOSE)
UNICODE_RE = re.compile(r"""
U[0-9A-F]{4}
""", re.VERBOSE)
NON_CODE = re.compile(r"""
^[^A-Z0-9_]$
""", re.VERBOSE)
def parse_uni_code(raw_code):
macro_id = "UC_" + (
unicodedata.name(raw_code)
.replace(" ", "_")
.replace("-", "_")
)
code = "M({})".format(macro_id)
uc_hex = "{:04X}".format(ord(raw_code))
return code, macro_id, uc_hex
def parse_key_code(raw_code, key_prefixes, valid_keycodes):
if raw_code in valid_keycodes:
return raw_code
for prefix in key_prefixes:
code = prefix + raw_code
if code in valid_keycodes:
return code
def parse_code(raw_code, key_prefixes, valid_keycodes):
if not raw_code:
return 'KC_TRNS', None, None
if LAYER_CHANGE_RE.match(raw_code):
return raw_code, None, None
if MACRO_RE.match(raw_code):
macro_id = raw_code[2:-1]
return raw_code, macro_id, None
if UNICODE_RE.match(raw_code):
hex_code = raw_code[1:]
return parse_uni_code(chr(int(hex_code, 16)))
if NON_CODE.match(raw_code):
return parse_uni_code(raw_code)
code = parse_key_code(raw_code, key_prefixes, valid_keycodes)
return code, None, None
def parse_keymap(config, key_indexes, layer_lines, valid_keycodes):
keymap = {}
raw_codes = list(iter_raw_codes(
layer_lines, config['filler'], config['separator']
))
indexed_codes = iter_indexed_codes(raw_codes, key_indexes)
key_prefixes = config['key_prefixes']
for raw_code, key_index, row_index in indexed_codes:
code, macro_id, uc_hex = parse_code(
raw_code, key_prefixes, valid_keycodes
)
# TODO: line numbers for invalid codes
err_msg = "Could not parse key '{}' on row {}".format(
raw_code, row_index
)
assert code is not None, err_msg
# print(repr(raw_code), repr(code), macro_id, uc_hex)
if macro_id:
config['macro_ids'].add(macro_id)
if uc_hex:
config['unicode_macros'][macro_id] = uc_hex
keymap[key_index] = (code, row_index)
return keymap
def parse_keymaps(config, valid_keycodes):
keymaps = collections.OrderedDict()
key_indexes = config.get(
'key_indexes', KEYBOARD_LAYOUTS[config['layout']]
)
# TODO: maybe validate key_indexes
for layer_name, layer_lines, in config['layer_lines'].items():
keymaps[layer_name] = parse_keymap(
config, key_indexes, layer_lines, valid_keycodes
)
return keymaps
# keymap.c output
USERCODE = """
// 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 L1:
ergodox_right_led_1_on();
break;
case L2:
ergodox_right_led_2_on();
break;
case L3:
ergodox_right_led_3_on();
break;
case L4:
ergodox_right_led_1_on();
ergodox_right_led_2_on();
break;
case L5:
ergodox_right_led_1_on();
ergodox_right_led_3_on();
break;
// case L6:
// ergodox_right_led_2_on();
// ergodox_right_led_3_on();
// break;
// case L7:
// ergodox_right_led_1_on();
// ergodox_right_led_2_on();
// ergodox_right_led_3_on();
// break;
default:
ergodox_board_led_off();
break;
}
};
"""
MACROCODE = """
#define UC_MODE_WIN 0
#define UC_MODE_LINUX 1
#define UC_MODE_OSX 2
// TODO: allow default mode to be configured
static uint16_t unicode_mode = UC_MODE_WIN;
uint16_t hextokeycode(uint8_t hex) {{
if (hex == 0x0) {{
return KC_P0;
}}
if (hex < 0xA) {{
return KC_P1 + (hex - 0x1);
}}
return KC_A + (hex - 0xA);
}}
void unicode_action_function(uint16_t hi, uint16_t lo) {{
switch (unicode_mode) {{
case UC_MODE_WIN:
register_code(KC_LALT);
register_code(KC_PPLS);
unregister_code(KC_PPLS);
register_code(hextokeycode((hi & 0xF0) >> 4));
unregister_code(hextokeycode((hi & 0xF0) >> 4));
register_code(hextokeycode((hi & 0x0F)));
unregister_code(hextokeycode((hi & 0x0F)));
register_code(hextokeycode((lo & 0xF0) >> 4));
unregister_code(hextokeycode((lo & 0xF0) >> 4));
register_code(hextokeycode((lo & 0x0F)));
unregister_code(hextokeycode((lo & 0x0F)));
unregister_code(KC_LALT);
break;
case UC_MODE_LINUX:
register_code(KC_LCTL);
register_code(KC_LSFT);
register_code(KC_U);
unregister_code(KC_U);
register_code(hextokeycode((hi & 0xF0) >> 4));
unregister_code(hextokeycode((hi & 0xF0) >> 4));
register_code(hextokeycode((hi & 0x0F)));
unregister_code(hextokeycode((hi & 0x0F)));
register_code(hextokeycode((lo & 0xF0) >> 4));
unregister_code(hextokeycode((lo & 0xF0) >> 4));
register_code(hextokeycode((lo & 0x0F)));
unregister_code(hextokeycode((lo & 0x0F)));
unregister_code(KC_LCTL);
unregister_code(KC_LSFT);
break;
case UC_MODE_OSX:
break;
}}
}}
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {{
if (!record->event.pressed) {{
return MACRO_NONE;
}}
// MACRODOWN only works in this function
switch(id) {{
case UM:
unicode_mode = (unicode_mode + 1) % 2;
break;
{macro_cases}
{unicode_macro_cases}
default:
break;
}}
return MACRO_NONE;
}};
"""
UNICODE_MACRO_TEMPLATE = """
case {macro_id}:
unicode_action_function(0x{hi:02x}, 0x{lo:02x});
break;
""".strip()
def unicode_macro_cases(config):
for macro_id, uc_hex in config['unicode_macros'].items():
hi = int(uc_hex, 16) >> 8
lo = int(uc_hex, 16) & 0xFF
unimacro_keys = ", ".join(
"T({})".format(
"KP_" + digit if digit.isdigit() else digit
) for digit in uc_hex
)
yield UNICODE_MACRO_TEMPLATE.format(
macro_id=macro_id, hi=hi, lo=lo
)
def iter_keymap_lines(keymap, row_indents=None):
col_widths = {}
col = 0
# first pass, figure out the column widths
prev_row_index = None
for code, row_index in keymap.values():
if row_index != prev_row_index:
col = 0
if row_indents:
col = row_indents[row_index]
col_widths[col] = max(len(code), col_widths.get(col, 0))
prev_row_index = row_index
col += 1
# second pass, yield the cell values
col = 0
prev_row_index = None
for key_index in sorted(keymap):
code, row_index = keymap[key_index]
if row_index != prev_row_index:
col = 0
yield "\n"
if row_indents:
for indent_col in range(row_indents[row_index]):
pad = " " * (col_widths[indent_col] - 4)
yield (" /*-*/" + pad)
col = row_indents[row_index]
else:
yield pad
yield " {}".format(code)
if key_index < len(keymap) - 1:
yield ","
# This will be yielded on the next iteration when
# we know that we're not at the end of a line.
pad = " " * (col_widths[col] - len(code))
prev_row_index = row_index
col += 1
def iter_keymap_parts(config, keymaps):
# includes
for include_path in config['keymaps_includes']:
yield '#include "{}"\n'.format(include_path)
yield "\n"
# definitions
for i, macro_id in enumerate(sorted(config['macro_ids'])):
yield "#define {} {}\n".format(macro_id, i)
yield "\n"
for i, layer_name in enumerate(config['layer_lines']):
yield '#define L{0:<3} {0:<5} // {1}\n'.format(i, layer_name)
yield "\n"
# keymaps
yield "const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {\n"
for i, layer_name in enumerate(config['layer_lines']):
# comment
layer_lines = config['layer_lines'][layer_name]
prefixed_lines = " * " + " * ".join(layer_lines)
yield "/*\n{} */\n".format(prefixed_lines)
# keymap codes
keymap = keymaps[layer_name]
row_indents = ROW_INDENTS.get(config['layout'])
keymap_lines = "".join(iter_keymap_lines(keymap, row_indents))
yield "[L{0}] = KEYMAP({1}\n),\n".format(i, keymap_lines)
yield "};\n\n"
# no idea what this is for
yield "const uint16_t PROGMEM fn_actions[] = {};\n"
# macros
yield MACROCODE.format(
macro_cases="",
unicode_macro_cases="\n".join(unicode_macro_cases(config)),
)
# TODO: dynamically create blinking lights
yield USERCODE
def main(argv=sys.argv[1:]):
if not argv or '-h' in argv or '--help' in argv:
print(__doc__)
return 0
in_path = os.path.abspath(argv[0])
if not os.path.exists(in_path):
print("No such file '{}'".format(in_path))
return 1
if len(argv) > 1:
out_path = os.path.abspath(argv[1])
else:
dirname = os.path.dirname(in_path)
out_path = os.path.join(dirname, "keymap.c")
config = parse_config(in_path)
valid_keys = parse_valid_keys(config, out_path)
keymaps = parse_keymaps(config, valid_keys)
with io.open(out_path, mode="w", encoding="utf-8") as fh:
for part in iter_keymap_parts(config, keymaps):
fh.write(part)
if __name__ == '__main__':
sys.exit(main())

View file

@ -0,0 +1,783 @@
#include "ergodox_ez.h"
#include "action_layer.h"
#include "keymap_common.h"
#include "keymap_extras/keymap_german.h"
#define UC_ASYMPTOTICALLY_EQUAL_TO 0
#define UC_DIVISION_SIGN 1
#define UC_DOWNWARDS_ARROW 2
#define UC_ELEMENT_OF 3
#define UC_EMPTY_SET 4
#define UC_FOR_ALL 5
#define UC_GREEK_CAPITAL_LETTER_ALPHA 6
#define UC_GREEK_CAPITAL_LETTER_BETA 7
#define UC_GREEK_CAPITAL_LETTER_CHI 8
#define UC_GREEK_CAPITAL_LETTER_DELTA 9
#define UC_GREEK_CAPITAL_LETTER_EPSILON 10
#define UC_GREEK_CAPITAL_LETTER_ETA 11
#define UC_GREEK_CAPITAL_LETTER_GAMMA 12
#define UC_GREEK_CAPITAL_LETTER_IOTA 13
#define UC_GREEK_CAPITAL_LETTER_KAPPA 14
#define UC_GREEK_CAPITAL_LETTER_LAMDA 15
#define UC_GREEK_CAPITAL_LETTER_MU 16
#define UC_GREEK_CAPITAL_LETTER_NU 17
#define UC_GREEK_CAPITAL_LETTER_OMEGA 18
#define UC_GREEK_CAPITAL_LETTER_OMICRON 19
#define UC_GREEK_CAPITAL_LETTER_PHI 20
#define UC_GREEK_CAPITAL_LETTER_PI 21
#define UC_GREEK_CAPITAL_LETTER_PSI 22
#define UC_GREEK_CAPITAL_LETTER_RHO 23
#define UC_GREEK_CAPITAL_LETTER_SIGMA 24
#define UC_GREEK_CAPITAL_LETTER_TAU 25
#define UC_GREEK_CAPITAL_LETTER_THETA 26
#define UC_GREEK_CAPITAL_LETTER_UPSILON 27
#define UC_GREEK_CAPITAL_LETTER_XI 28
#define UC_GREEK_CAPITAL_LETTER_ZETA 29
#define UC_GREEK_SMALL_LETTER_ALPHA 30
#define UC_GREEK_SMALL_LETTER_BETA 31
#define UC_GREEK_SMALL_LETTER_CHI 32
#define UC_GREEK_SMALL_LETTER_DELTA 33
#define UC_GREEK_SMALL_LETTER_EPSILON 34
#define UC_GREEK_SMALL_LETTER_ETA 35
#define UC_GREEK_SMALL_LETTER_FINAL_SIGMA 36
#define UC_GREEK_SMALL_LETTER_GAMMA 37
#define UC_GREEK_SMALL_LETTER_IOTA 38
#define UC_GREEK_SMALL_LETTER_KAPPA 39
#define UC_GREEK_SMALL_LETTER_LAMDA 40
#define UC_GREEK_SMALL_LETTER_MU 41
#define UC_GREEK_SMALL_LETTER_NU 42
#define UC_GREEK_SMALL_LETTER_OMEGA 43
#define UC_GREEK_SMALL_LETTER_OMICRON 44
#define UC_GREEK_SMALL_LETTER_PHI 45
#define UC_GREEK_SMALL_LETTER_PI 46
#define UC_GREEK_SMALL_LETTER_PSI 47
#define UC_GREEK_SMALL_LETTER_RHO 48
#define UC_GREEK_SMALL_LETTER_SIGMA 49
#define UC_GREEK_SMALL_LETTER_TAU 50
#define UC_GREEK_SMALL_LETTER_THETA 51
#define UC_GREEK_SMALL_LETTER_UPSILON 52
#define UC_GREEK_SMALL_LETTER_XI 53
#define UC_GREEK_SMALL_LETTER_ZETA 54
#define UC_INFINITY 55
#define UC_LEFTWARDS_ARROW 56
#define UC_MULTIPLICATION_SIGN 57
#define UC_NOT_AN_ELEMENT_OF 58
#define UC_NOT_EQUAL_TO 59
#define UC_PLUS_MINUS_SIGN 60
#define UC_RIGHTWARDS_ARROW 61
#define UC_SUBSCRIPT_EIGHT 62
#define UC_SUBSCRIPT_FIVE 63
#define UC_SUBSCRIPT_FOUR 64
#define UC_SUBSCRIPT_NINE 65
#define UC_SUBSCRIPT_ONE 66
#define UC_SUBSCRIPT_SEVEN 67
#define UC_SUBSCRIPT_SIX 68
#define UC_SUBSCRIPT_THREE 69
#define UC_SUBSCRIPT_TWO 70
#define UC_SUBSCRIPT_ZERO 71
#define UC_SUPERSCRIPT_EIGHT 72
#define UC_SUPERSCRIPT_FIVE 73
#define UC_SUPERSCRIPT_FOUR 74
#define UC_SUPERSCRIPT_LATIN_SMALL_LETTER_N 75
#define UC_SUPERSCRIPT_NINE 76
#define UC_SUPERSCRIPT_ONE 77
#define UC_SUPERSCRIPT_SEVEN 78
#define UC_SUPERSCRIPT_SIX 79
#define UC_SUPERSCRIPT_THREE 80
#define UC_SUPERSCRIPT_TWO 81
#define UC_SUPERSCRIPT_ZERO 82
#define UC_THERE_DOES_NOT_EXIST 83
#define UC_THERE_EXISTS 84
#define UC_UPWARDS_ARROW 85
#define UC_VULGAR_FRACTION_ONE_EIGHTH 86
#define UC_VULGAR_FRACTION_ONE_FIFTH 87
#define UC_VULGAR_FRACTION_ONE_HALF 88
#define UC_VULGAR_FRACTION_ONE_QUARTER 89
#define UC_VULGAR_FRACTION_ONE_SIXTH 90
#define UC_VULGAR_FRACTION_ONE_THIRD 91
#define UC_VULGAR_FRACTION_THREE_QUARTERS 92
#define UC_VULGAR_FRACTION_TWO_THIRDS 93
#define UM 94
#define L0 0 // layer_0
#define L1 1 // layer_1
#define L2 2 // layer_2
#define L3 3 // layer_3
#define L4 4 // layer_4
#define L5 5 // layer_5
#define L6 6 // layer_6
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
* .------------------------------------.------------------------------------.
* |MO(5)| 1 | 2 | 3 | 4 | 5 |ACUT | GRV | 6 | 7 | 8 | 9 | 0 |CIRC |
* !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----!
* |MO(4)| X | P | F | W | G |HOME |TG(2)| H | J | K | L | Q | Z |
* !-----+----+----+----x----x----! ! !----x----x----+----+----+-----!
* |MO(1)| U | I | A | E | O |-----!-----! S | N | R | T | D | SS |
* !-----+----+----+----x----x----! ! !----x----x----+----+----+-----!
* |MO(3)| UE | OE | AE | C | V |END | TAB | B | M |COMM| DOT| UP | Y |
* '-----+----+----+----+----+----------'----------+----+----+----+----+-----'
* | | |LGUI|LALT|LCTL| !RCTL|RALT|LEFT|DOWN|RGHT|
* '------------------------' '------------------------'
* .-----------. .-----------.
* |INS |TG(2)| !M(UM)|DELT |
* .-----+-----+-----! !-----+-----+-----.
* ! ! | APP | ! PGUP| ! !
* ! ! !-----! !-----! ! !
* |BSPC |LSFT | ESC | ! PGDN|ENTER|SPACE|
* '-----------------' '-----------------'
*/
[L0] = KEYMAP(
MO(5), DE_1, DE_2, DE_3, DE_4, DE_5, DE_ACUT,
MO(4), DE_X, DE_P, DE_F, DE_W, DE_G, KC_HOME,
MO(1), DE_U, DE_I, DE_A, DE_E, DE_O,
MO(3), DE_UE, DE_OE, DE_AE, DE_C, DE_V, KC_END,
KC_TRNS, KC_TRNS, KC_LGUI, KC_LALT, KC_LCTL,
/*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_INS, TG(2),
/*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_APP,
/*-*/ /*-*/ /*-*/ /*-*/ KC_BSPC, KC_LSFT, KC_ESC,
DE_GRV, DE_6, DE_7, DE_8, DE_9, DE_0, DE_CIRC,
TG(2), DE_H, DE_J, DE_K, DE_L, DE_Q, DE_Z,
/*-*/ DE_S, DE_N, DE_R, DE_T, DE_D, DE_SS,
KC_TAB, DE_B, DE_M, DE_COMM, DE_DOT, KC_UP, DE_Y,
/*-*/ /*-*/ KC_RCTL, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT,
M(UM), KC_DELT,
KC_PGUP,
KC_PGDN, KC_ENTER, KC_SPACE
),
/*
* .------------------------------------.------------------------------------.
* | |EXLM|DQOT|PARA| | | | | | | | |RING| |
* !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----!
* | |ASTR|PIPE|SLSH|LCBR|RCBR| | |HASH|LESS|MORE| |DQOT| |
* !-----+----+----+----x----x----! ! !----x----x----+----+----+-----!
* | |UNDS|MINS|AMPR|LBRC|RBRC|-----!-----!DLR |LPRN|RPRN|TILD|QUOT| QST |
* !-----+----+----+----x----x----! ! !----x----x----+----+----+-----!
* | | |PLUS|EQL | | | | |BSLS|PERC|SCLN|COLN| | |
* '-----+----+----+----+----+----------'----------+----+----+----+----+-----'
* | | | | | | ! | | | | |
* '------------------------' '------------------------'
* .-----------. .-----------.
* | | | ! | |
* .-----+-----+-----! !-----+-----+-----.
* ! ! | | ! | ! !
* ! ! !-----! !-----! ! !
* | | | | ! | | |
* '-----------------' '-----------------'
*/
[L1] = KEYMAP(
KC_TRNS, DE_EXLM, DE_DQOT, DE_PARA, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, DE_ASTR, DE_PIPE, DE_SLSH, DE_LCBR, DE_RCBR, KC_TRNS,
KC_TRNS, DE_UNDS, DE_MINS, DE_AMPR, DE_LBRC, DE_RBRC,
KC_TRNS, KC_TRNS, DE_PLUS, DE_EQL, 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, DE_RING, KC_TRNS,
KC_TRNS, DE_HASH, DE_LESS, DE_MORE, KC_TRNS, DE_DQOT, KC_TRNS,
/*-*/ DE_DLR, DE_LPRN, DE_RPRN, DE_TILD, DE_QUOT, DE_QST,
KC_TRNS, DE_BSLS, DE_PERC, DE_SCLN, DE_COLN, M(UC_UPWARDS_ARROW), KC_TRNS,
/*-*/ /*-*/ KC_TRNS, KC_TRNS, M(UC_LEFTWARDS_ARROW), M(UC_DOWNWARDS_ARROW), M(UC_RIGHTWARDS_ARROW),
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS
),
/*
* .------------------------------------.------------------------------------.
* | | F1 | F2 | F3 | F4 | F5 | F11 | F12 | F6 | F7 | F8 | F9 |F10 |PEQL |
* !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----!
* | | | | | | | | | | P7 | P8 | P9 |PAST|PSLS |
* !-----+----+----+----x----x----! ! !----x----x----+----+----+-----!
* | | | | | | |-----!-----! | P4 | P5 | P6 |PMNS|PMNS |
* !-----+----+----+----x----x----! ! !----x----x----+----+----+-----!
* | | | | | | | | NLCK| | P1 | P2 | P3 |PPLS|PPLS |
* '-----+----+----+----+----+----------'----------+----+----+----+----+-----'
* | | | | | | ! P0 |PCMM|PDOT|PENT|PENT|
* '------------------------' '------------------------'
* .-----------. .-----------.
* | | | ! | |
* .-----+-----+-----! !-----+-----+-----.
* ! ! | | ! | ! !
* ! ! !-----! !-----! ! !
* | | | | ! | | |
* '-----------------' '-----------------'
*/
[L2] = KEYMAP(
KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11,
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_TRNS, KC_TRNS,
KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_PEQL,
KC_TRNS, KC_TRNS, KC_P7, KC_P8, KC_P9, KC_PAST, KC_PSLS,
/*-*/ KC_TRNS, KC_P4, KC_P5, KC_P6, KC_PMNS, KC_PMNS,
KC_NLCK, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_PPLS, KC_PPLS,
/*-*/ /*-*/ KC_P0, KC_PCMM, KC_PDOT, KC_PENT, KC_PENT,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS
),
/*
* .------------------------------------.------------------------------------.
* | | ¹ | ² | ³ | | | | | | | | | | |
* !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----!
* | | × | ½ | ÷ | ¼ | | | | | | | | | |
* !-----+----+----+----x----x----! ! !----x----x----+----+----+-----!
* | | | ± | AT |EURO| |-----!-----! | | | | | |
* !-----+----+----+----x----x----! ! !----x----x----+----+----+-----!
* | | | | | ¾ | | | |EXLM| | | | | |
* '-----+----+----+----+----+----------'----------+----+----+----+----+-----'
* | | | | | | ! | | | | |
* '------------------------' '------------------------'
* .-----------. .-----------.
* | | | ! | |
* .-----+-----+-----! !-----+-----+-----.
* ! ! | | ! | ! !
* ! ! !-----! !-----! ! !
* | | | | ! | | |
* '-----------------' '-----------------'
*/
[L3] = KEYMAP(
KC_TRNS, M(UC_SUPERSCRIPT_ONE), M(UC_SUPERSCRIPT_TWO), M(UC_SUPERSCRIPT_THREE), M(UC_SUPERSCRIPT_FOUR), M(UC_SUPERSCRIPT_FIVE), M(UC_FOR_ALL),
KC_TRNS, M(UC_MULTIPLICATION_SIGN), M(UC_VULGAR_FRACTION_ONE_HALF), M(UC_DIVISION_SIGN), M(UC_VULGAR_FRACTION_ONE_QUARTER), M(UC_VULGAR_FRACTION_ONE_FIFTH), KC_TRNS,
KC_TRNS, KC_TRNS, M(UC_PLUS_MINUS_SIGN), DE_AT, DE_EURO, M(UC_EMPTY_SET),
KC_TRNS, M(UC_VULGAR_FRACTION_ONE_THIRD), M(UC_NOT_EQUAL_TO), M(UC_VULGAR_FRACTION_TWO_THIRDS), M(UC_VULGAR_FRACTION_THREE_QUARTERS), M(UC_ASYMPTOTICALLY_EQUAL_TO), 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, M(UC_SUPERSCRIPT_SIX), M(UC_SUPERSCRIPT_SEVEN), M(UC_SUPERSCRIPT_EIGHT), M(UC_SUPERSCRIPT_NINE), M(UC_SUPERSCRIPT_ZERO), KC_TRNS,
KC_TRNS, M(UC_VULGAR_FRACTION_ONE_SIXTH), KC_TRNS, M(UC_VULGAR_FRACTION_ONE_EIGHTH), KC_TRNS, KC_TRNS, KC_TRNS,
/*-*/ M(UC_INFINITY), M(UC_SUPERSCRIPT_LATIN_SMALL_LETTER_N), M(UC_THERE_EXISTS), M(UC_ELEMENT_OF), KC_TRNS, KC_TRNS,
KC_TRNS, DE_EXLM, KC_TRNS, M(UC_THERE_DOES_NOT_EXIST), M(UC_NOT_AN_ELEMENT_OF), 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
),
/*
* .------------------------------------.------------------------------------.
* | | | | | | | | | | | | | | |
* !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----!
* | | χ | π | φ | ω | γ | | | η | ξ | κ | λ | | ζ |
* !-----+----+----+----x----x----! ! !----x----x----+----+----+-----!
* | | υ | ι | α | ε | ο |-----!-----! σ | ν | ρ | τ | δ | ς |
* !-----+----+----+----x----x----! ! !----x----x----+----+----+-----!
* | | | θ | | | | | | β | μ | | | | ψ |
* '-----+----+----+----+----+----------'----------+----+----+----+----+-----'
* | | | | | | ! | | | | |
* '------------------------' '------------------------'
* .-----------. .-----------.
* | | | ! | |
* .-----+-----+-----! !-----+-----+-----.
* ! ! | | ! | ! !
* ! ! !-----! !-----! ! !
* | | | | ! | | |
* '-----------------' '-----------------'
*/
[L4] = KEYMAP(
KC_TRNS, M(UC_SUBSCRIPT_ONE), M(UC_SUBSCRIPT_TWO), M(UC_SUBSCRIPT_THREE), M(UC_SUBSCRIPT_FOUR), M(UC_SUBSCRIPT_FIVE), KC_TRNS,
KC_TRNS, M(UC_GREEK_SMALL_LETTER_CHI), M(UC_GREEK_SMALL_LETTER_PI), M(UC_GREEK_SMALL_LETTER_PHI), M(UC_GREEK_SMALL_LETTER_OMEGA), M(UC_GREEK_SMALL_LETTER_GAMMA), KC_TRNS,
KC_TRNS, M(UC_GREEK_SMALL_LETTER_UPSILON), M(UC_GREEK_SMALL_LETTER_IOTA), M(UC_GREEK_SMALL_LETTER_ALPHA), M(UC_GREEK_SMALL_LETTER_EPSILON), M(UC_GREEK_SMALL_LETTER_OMICRON),
KC_TRNS, KC_TRNS, M(UC_GREEK_SMALL_LETTER_THETA), 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, M(UC_SUBSCRIPT_SIX), M(UC_SUBSCRIPT_SEVEN), M(UC_SUBSCRIPT_EIGHT), M(UC_SUBSCRIPT_NINE), M(UC_SUBSCRIPT_ZERO), KC_TRNS,
KC_TRNS, M(UC_GREEK_SMALL_LETTER_ETA), M(UC_GREEK_SMALL_LETTER_XI), M(UC_GREEK_SMALL_LETTER_KAPPA), M(UC_GREEK_SMALL_LETTER_LAMDA), KC_TRNS, M(UC_GREEK_SMALL_LETTER_ZETA),
/*-*/ M(UC_GREEK_SMALL_LETTER_SIGMA), M(UC_GREEK_SMALL_LETTER_NU), M(UC_GREEK_SMALL_LETTER_RHO), M(UC_GREEK_SMALL_LETTER_TAU), M(UC_GREEK_SMALL_LETTER_DELTA), M(UC_GREEK_SMALL_LETTER_FINAL_SIGMA),
KC_TRNS, M(UC_GREEK_SMALL_LETTER_BETA), M(UC_GREEK_SMALL_LETTER_MU), KC_TRNS, KC_TRNS, KC_TRNS, M(UC_GREEK_SMALL_LETTER_PSI),
/*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS
),
/*
* .------------------------------------.------------------------------------.
* | | | | | | | | | | | | | | |
* !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----!
* | | Χ | Π | Φ | Ω | Γ | | | Η | Ξ | Κ | Λ | | Ζ |
* !-----+----+----+----x----x----! ! !----x----x----+----+----+-----!
* | | Υ | Ι | Α | Ε | Ο |-----!-----! Σ | Ν | Ρ | Τ | Δ | |
* !-----+----+----+----x----x----! ! !----x----x----+----+----+-----!
* | | | Θ | | | | | | Β | Μ | | | | Ψ |
* '-----+----+----+----+----+----------'----------+----+----+----+----+-----'
* | | | | | | ! | | | | |
* '------------------------' '------------------------'
* .-----------. .-----------.
* | | | ! | |
* .-----+-----+-----! !-----+-----+-----.
* ! ! | | ! | ! !
* ! ! !-----! !-----! ! !
* | | | | ! | | |
* '-----------------' '-----------------'
*/
[L5] = KEYMAP(
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, M(UC_GREEK_CAPITAL_LETTER_CHI), M(UC_GREEK_CAPITAL_LETTER_PI), M(UC_GREEK_CAPITAL_LETTER_PHI), M(UC_GREEK_CAPITAL_LETTER_OMEGA), M(UC_GREEK_CAPITAL_LETTER_GAMMA), KC_TRNS,
KC_TRNS, M(UC_GREEK_CAPITAL_LETTER_UPSILON), M(UC_GREEK_CAPITAL_LETTER_IOTA), M(UC_GREEK_CAPITAL_LETTER_ALPHA), M(UC_GREEK_CAPITAL_LETTER_EPSILON), M(UC_GREEK_CAPITAL_LETTER_OMICRON),
KC_TRNS, KC_TRNS, M(UC_GREEK_CAPITAL_LETTER_THETA), 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, M(UC_GREEK_CAPITAL_LETTER_ETA), M(UC_GREEK_CAPITAL_LETTER_XI), M(UC_GREEK_CAPITAL_LETTER_KAPPA), M(UC_GREEK_CAPITAL_LETTER_LAMDA), KC_TRNS, M(UC_GREEK_CAPITAL_LETTER_ZETA),
/*-*/ M(UC_GREEK_CAPITAL_LETTER_SIGMA), M(UC_GREEK_CAPITAL_LETTER_NU), M(UC_GREEK_CAPITAL_LETTER_RHO), M(UC_GREEK_CAPITAL_LETTER_TAU), M(UC_GREEK_CAPITAL_LETTER_DELTA), KC_TRNS,
KC_TRNS, M(UC_GREEK_CAPITAL_LETTER_BETA), M(UC_GREEK_CAPITAL_LETTER_MU), KC_TRNS, KC_TRNS, KC_TRNS, M(UC_GREEK_CAPITAL_LETTER_PSI),
/*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS
),
/*
* .------------------------------------.------------------------------------.
* | | | | | | | | | | | | | | |
* !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----!
* | | | | | | | | | | | | | | |
* !-----+----+----+----x----x----! ! !----x----x----+----+----+-----!
* | | | | | | |-----!-----! | | | | | |
* !-----+----+----+----x----x----! ! !----x----x----+----+----+-----!
* | | | | | | | | | | | | | | |
* '-----+----+----+----+----+----------'----------+----+----+----+----+-----'
* | | | | | | ! | | | | |
* '------------------------' '------------------------'
* .-----------. .-----------.
* | | | ! | |
* .-----+-----+-----! !-----+-----+-----.
* ! ! | | ! | ! !
* ! ! !-----! !-----! ! !
* | | | | ! | | |
* '-----------------' '-----------------'
*/
[L6] = KEYMAP(
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_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_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[] = {};
#define UC_MODE_WIN 0
#define UC_MODE_LINUX 1
#define UC_MODE_OSX 2
// TODO: allow default mode to be configured
static uint16_t unicode_mode = UC_MODE_WIN;
uint16_t hextokeycode(uint8_t hex) {
if (hex == 0x0) {
return KC_P0;
}
if (hex < 0xA) {
return KC_P1 + (hex - 0x1);
}
return KC_A + (hex - 0xA);
}
void unicode_action_function(uint16_t hi, uint16_t lo) {
switch (unicode_mode) {
case UC_MODE_WIN:
register_code(KC_LALT);
register_code(KC_PPLS);
unregister_code(KC_PPLS);
register_code(hextokeycode((hi & 0xF0) >> 4));
unregister_code(hextokeycode((hi & 0xF0) >> 4));
register_code(hextokeycode((hi & 0x0F)));
unregister_code(hextokeycode((hi & 0x0F)));
register_code(hextokeycode((lo & 0xF0) >> 4));
unregister_code(hextokeycode((lo & 0xF0) >> 4));
register_code(hextokeycode((lo & 0x0F)));
unregister_code(hextokeycode((lo & 0x0F)));
unregister_code(KC_LALT);
break;
case UC_MODE_LINUX:
register_code(KC_LCTL);
register_code(KC_LSFT);
register_code(KC_U);
unregister_code(KC_U);
register_code(hextokeycode((hi & 0xF0) >> 4));
unregister_code(hextokeycode((hi & 0xF0) >> 4));
register_code(hextokeycode((hi & 0x0F)));
unregister_code(hextokeycode((hi & 0x0F)));
register_code(hextokeycode((lo & 0xF0) >> 4));
unregister_code(hextokeycode((lo & 0xF0) >> 4));
register_code(hextokeycode((lo & 0x0F)));
unregister_code(hextokeycode((lo & 0x0F)));
unregister_code(KC_LCTL);
unregister_code(KC_LSFT);
break;
case UC_MODE_OSX:
break;
}
}
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
if (!record->event.pressed) {
return MACRO_NONE;
}
// MACRODOWN only works in this function
switch(id) {
case UM:
unicode_mode = (unicode_mode + 1) % 2;
break;
case UC_GREEK_SMALL_LETTER_OMICRON:
unicode_action_function(0x03, 0xbf);
break;
case UC_LEFTWARDS_ARROW:
unicode_action_function(0x21, 0x90);
break;
case UC_GREEK_CAPITAL_LETTER_RHO:
unicode_action_function(0x03, 0xa1);
break;
case UC_SUBSCRIPT_THREE:
unicode_action_function(0x20, 0x83);
break;
case UC_VULGAR_FRACTION_ONE_EIGHTH:
unicode_action_function(0x21, 0x5b);
break;
case UC_GREEK_SMALL_LETTER_LAMDA:
unicode_action_function(0x03, 0xbb);
break;
case UC_VULGAR_FRACTION_ONE_THIRD:
unicode_action_function(0x21, 0x53);
break;
case UC_GREEK_SMALL_LETTER_XI:
unicode_action_function(0x03, 0xbe);
break;
case UC_THERE_DOES_NOT_EXIST:
unicode_action_function(0x22, 0x04);
break;
case UC_SUPERSCRIPT_ONE:
unicode_action_function(0x00, 0xb9);
break;
case UC_GREEK_SMALL_LETTER_BETA:
unicode_action_function(0x03, 0xb2);
break;
case UC_SUBSCRIPT_FIVE:
unicode_action_function(0x20, 0x85);
break;
case UC_GREEK_CAPITAL_LETTER_IOTA:
unicode_action_function(0x03, 0x99);
break;
case UC_VULGAR_FRACTION_ONE_FIFTH:
unicode_action_function(0x21, 0x55);
break;
case UC_GREEK_SMALL_LETTER_PSI:
unicode_action_function(0x03, 0xc8);
break;
case UC_SUBSCRIPT_NINE:
unicode_action_function(0x20, 0x89);
break;
case UC_SUPERSCRIPT_FOUR:
unicode_action_function(0x20, 0x74);
break;
case UC_RIGHTWARDS_ARROW:
unicode_action_function(0x21, 0x92);
break;
case UC_SUPERSCRIPT_SIX:
unicode_action_function(0x20, 0x76);
break;
case UC_DOWNWARDS_ARROW:
unicode_action_function(0x21, 0x93);
break;
case UC_GREEK_SMALL_LETTER_PI:
unicode_action_function(0x03, 0xc0);
break;
case UC_SUPERSCRIPT_TWO:
unicode_action_function(0x00, 0xb2);
break;
case UC_GREEK_CAPITAL_LETTER_OMEGA:
unicode_action_function(0x03, 0xa9);
break;
case UC_GREEK_CAPITAL_LETTER_PSI:
unicode_action_function(0x03, 0xa8);
break;
case UC_SUBSCRIPT_FOUR:
unicode_action_function(0x20, 0x84);
break;
case UC_GREEK_CAPITAL_LETTER_NU:
unicode_action_function(0x03, 0x9d);
break;
case UC_DIVISION_SIGN:
unicode_action_function(0x00, 0xf7);
break;
case UC_GREEK_SMALL_LETTER_SIGMA:
unicode_action_function(0x03, 0xc3);
break;
case UC_GREEK_SMALL_LETTER_RHO:
unicode_action_function(0x03, 0xc1);
break;
case UC_VULGAR_FRACTION_ONE_SIXTH:
unicode_action_function(0x21, 0x59);
break;
case UC_GREEK_SMALL_LETTER_GAMMA:
unicode_action_function(0x03, 0xb3);
break;
case UC_VULGAR_FRACTION_TWO_THIRDS:
unicode_action_function(0x21, 0x54);
break;
case UC_GREEK_SMALL_LETTER_NU:
unicode_action_function(0x03, 0xbd);
break;
case UC_GREEK_SMALL_LETTER_ZETA:
unicode_action_function(0x03, 0xb6);
break;
case UC_GREEK_SMALL_LETTER_EPSILON:
unicode_action_function(0x03, 0xb5);
break;
case UC_GREEK_SMALL_LETTER_KAPPA:
unicode_action_function(0x03, 0xba);
break;
case UC_SUPERSCRIPT_SEVEN:
unicode_action_function(0x20, 0x77);
break;
case UC_GREEK_CAPITAL_LETTER_PI:
unicode_action_function(0x03, 0xa0);
break;
case UC_GREEK_SMALL_LETTER_FINAL_SIGMA:
unicode_action_function(0x03, 0xc2);
break;
case UC_GREEK_CAPITAL_LETTER_XI:
unicode_action_function(0x03, 0x9e);
break;
case UC_GREEK_SMALL_LETTER_THETA:
unicode_action_function(0x03, 0xb8);
break;
case UC_GREEK_SMALL_LETTER_ETA:
unicode_action_function(0x03, 0xb7);
break;
case UC_SUBSCRIPT_TWO:
unicode_action_function(0x20, 0x82);
break;
case UC_ASYMPTOTICALLY_EQUAL_TO:
unicode_action_function(0x22, 0x43);
break;
case UC_GREEK_SMALL_LETTER_ALPHA:
unicode_action_function(0x03, 0xb1);
break;
case UC_GREEK_CAPITAL_LETTER_PHI:
unicode_action_function(0x03, 0xa6);
break;
case UC_GREEK_SMALL_LETTER_PHI:
unicode_action_function(0x03, 0xc6);
break;
case UC_INFINITY:
unicode_action_function(0x22, 0x1e);
break;
case UC_GREEK_CAPITAL_LETTER_OMICRON:
unicode_action_function(0x03, 0x9f);
break;
case UC_ELEMENT_OF:
unicode_action_function(0x22, 0x08);
break;
case UC_MULTIPLICATION_SIGN:
unicode_action_function(0x00, 0xd7);
break;
case UC_SUBSCRIPT_ZERO:
unicode_action_function(0x20, 0x80);
break;
case UC_GREEK_CAPITAL_LETTER_SIGMA:
unicode_action_function(0x03, 0xa3);
break;
case UC_GREEK_SMALL_LETTER_OMEGA:
unicode_action_function(0x03, 0xc9);
break;
case UC_SUBSCRIPT_ONE:
unicode_action_function(0x20, 0x81);
break;
case UC_GREEK_CAPITAL_LETTER_ZETA:
unicode_action_function(0x03, 0x96);
break;
case UC_GREEK_SMALL_LETTER_TAU:
unicode_action_function(0x03, 0xc4);
break;
case UC_SUPERSCRIPT_FIVE:
unicode_action_function(0x20, 0x75);
break;
case UC_THERE_EXISTS:
unicode_action_function(0x22, 0x03);
break;
case UC_PLUS_MINUS_SIGN:
unicode_action_function(0x00, 0xb1);
break;
case UC_VULGAR_FRACTION_THREE_QUARTERS:
unicode_action_function(0x00, 0xbe);
break;
case UC_SUPERSCRIPT_THREE:
unicode_action_function(0x00, 0xb3);
break;
case UC_EMPTY_SET:
unicode_action_function(0x22, 0x05);
break;
case UC_UPWARDS_ARROW:
unicode_action_function(0x21, 0x91);
break;
case UC_SUPERSCRIPT_NINE:
unicode_action_function(0x20, 0x79);
break;
case UC_GREEK_SMALL_LETTER_DELTA:
unicode_action_function(0x03, 0xb4);
break;
case UC_GREEK_SMALL_LETTER_MU:
unicode_action_function(0x03, 0xbc);
break;
case UC_GREEK_CAPITAL_LETTER_KAPPA:
unicode_action_function(0x03, 0x9a);
break;
case UC_SUBSCRIPT_EIGHT:
unicode_action_function(0x20, 0x88);
break;
case UC_GREEK_CAPITAL_LETTER_ALPHA:
unicode_action_function(0x03, 0x91);
break;
case UC_SUBSCRIPT_SEVEN:
unicode_action_function(0x20, 0x87);
break;
case UC_GREEK_CAPITAL_LETTER_BETA:
unicode_action_function(0x03, 0x92);
break;
case UC_GREEK_CAPITAL_LETTER_ETA:
unicode_action_function(0x03, 0x97);
break;
case UC_SUPERSCRIPT_EIGHT:
unicode_action_function(0x20, 0x78);
break;
case UC_SUPERSCRIPT_ZERO:
unicode_action_function(0x20, 0x70);
break;
case UC_NOT_AN_ELEMENT_OF:
unicode_action_function(0x22, 0x09);
break;
case UC_GREEK_SMALL_LETTER_UPSILON:
unicode_action_function(0x03, 0xc5);
break;
case UC_NOT_EQUAL_TO:
unicode_action_function(0x22, 0x60);
break;
case UC_GREEK_CAPITAL_LETTER_CHI:
unicode_action_function(0x03, 0xa7);
break;
case UC_FOR_ALL:
unicode_action_function(0x22, 0x00);
break;
case UC_GREEK_CAPITAL_LETTER_TAU:
unicode_action_function(0x03, 0xa4);
break;
case UC_VULGAR_FRACTION_ONE_QUARTER:
unicode_action_function(0x00, 0xbc);
break;
case UC_GREEK_SMALL_LETTER_CHI:
unicode_action_function(0x03, 0xc7);
break;
case UC_GREEK_CAPITAL_LETTER_THETA:
unicode_action_function(0x03, 0x98);
break;
case UC_GREEK_SMALL_LETTER_IOTA:
unicode_action_function(0x03, 0xb9);
break;
case UC_GREEK_CAPITAL_LETTER_LAMDA:
unicode_action_function(0x03, 0x9b);
break;
case UC_SUPERSCRIPT_LATIN_SMALL_LETTER_N:
unicode_action_function(0x20, 0x7f);
break;
case UC_GREEK_CAPITAL_LETTER_UPSILON:
unicode_action_function(0x03, 0xa5);
break;
case UC_GREEK_CAPITAL_LETTER_MU:
unicode_action_function(0x03, 0x9c);
break;
case UC_GREEK_CAPITAL_LETTER_EPSILON:
unicode_action_function(0x03, 0x95);
break;
case UC_GREEK_CAPITAL_LETTER_GAMMA:
unicode_action_function(0x03, 0x93);
break;
case UC_SUBSCRIPT_SIX:
unicode_action_function(0x20, 0x86);
break;
case UC_GREEK_CAPITAL_LETTER_DELTA:
unicode_action_function(0x03, 0x94);
break;
case UC_VULGAR_FRACTION_ONE_HALF:
unicode_action_function(0x00, 0xbd);
break;
default:
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 L1:
ergodox_right_led_1_on();
break;
case L2:
ergodox_right_led_2_on();
break;
case L3:
ergodox_right_led_3_on();
break;
case L4:
ergodox_right_led_1_on();
ergodox_right_led_2_on();
break;
case L5:
ergodox_right_led_1_on();
ergodox_right_led_3_on();
break;
// case L6:
// ergodox_right_led_2_on();
// ergodox_right_led_3_on();
// break;
// case L7:
// ergodox_right_led_1_on();
// ergodox_right_led_2_on();
// ergodox_right_led_3_on();
// break;
default:
ergodox_board_led_off();
break;
}
};

View file

@ -0,0 +1,188 @@
# ManuNeo Ergodox Keyboard Layout
Compile this file to a `keymap.c` file using `compile_keymap.py`
python compile_keymap.py keymaps/german-manuneo/keymap.md
Tested with python 2.7 and python 3.4
# Layout Config
{
"layout": "ergodox_ez",
"keymaps_includes": [
"ergodox_ez.h",
"action_layer.h",
"keymap_common.h",
"keymap_extras/keymap_german.h",
],
"key_prefixes": ["DE_", "KC_"],
"macros": {
// TODO: implement macros
// "MUC": "",
},
// TODO: implement default unicode mode
}
# Layers
## Layer 0
.------------------------------------.------------------------------------.
|MO(5)| 1 | 2 | 3 | 4 | 5 |ACUT | GRV | 6 | 7 | 8 | 9 | 0 |CIRC |
!-----+----+----+----+----+----------!-----+----+----+----+----+----+-----!
|MO(4)| X | P | F | W | G |HOME |TG(2)| H | J | K | L | Q | Z |
!-----+----+----+----x----x----! ! !----x----x----+----+----+-----!
|MO(1)| U | I | A | E | O |-----!-----! S | N | R | T | D | SS |
!-----+----+----+----x----x----! ! !----x----x----+----+----+-----!
|MO(3)| UE | OE | AE | C | V |END | TAB | B | M |COMM| DOT| UP | Y |
'-----+----+----+----+----+----------'----------+----+----+----+----+-----'
| | |LGUI|LALT|LCTL| !RCTL|RALT|LEFT|DOWN|RGHT|
'------------------------' '------------------------'
.-----------. .-----------.
|INS |TG(2)| !M(UM)|DELT |
.-----+-----+-----! !-----+-----+-----.
! ! | APP | ! PGUP| ! !
! ! !-----! !-----! ! !
|BSPC |LSFT | ESC | ! PGDN|ENTER|SPACE|
'-----------------' '-----------------'
## Layer 1
.------------------------------------.------------------------------------.
| |EXLM|DQOT|PARA| | | | | | | | |RING| |
!-----+----+----+----+----+----------!-----+----+----+----+----+----+-----!
| |ASTR|PIPE|SLSH|LCBR|RCBR| | |HASH|LESS|MORE| |DQOT| |
!-----+----+----+----x----x----! ! !----x----x----+----+----+-----!
| |UNDS|MINS|AMPR|LBRC|RBRC|-----!-----!DLR |LPRN|RPRN|TILD|QUOT| QST |
!-----+----+----+----x----x----! ! !----x----x----+----+----+-----!
| | |PLUS|EQL | | | | |BSLS|PERC|SCLN|COLN| ↑ | |
'-----+----+----+----+----+----------'----------+----+----+----+----+-----'
| | | | | | ! | | ← | ↓ | → |
'------------------------' '------------------------'
.-----------. .-----------.
| | | ! | |
.-----+-----+-----! !-----+-----+-----.
! ! | | ! | ! !
! ! !-----! !-----! ! !
| | | | ! | | |
'-----------------' '-----------------'
## Layer 2
.------------------------------------.------------------------------------.
| | F1 | F2 | F3 | F4 | F5 | F11 | F12 | F6 | F7 | F8 | F9 |F10 |PEQL |
!-----+----+----+----+----+----------!-----+----+----+----+----+----+-----!
| | | | | | | | | | P7 | P8 | P9 |PAST|PSLS |
!-----+----+----+----x----x----! ! !----x----x----+----+----+-----!
| | | | | | |-----!-----! | P4 | P5 | P6 |PMNS|PMNS |
!-----+----+----+----x----x----! ! !----x----x----+----+----+-----!
| | | | | | | | NLCK| | P1 | P2 | P3 |PPLS|PPLS |
'-----+----+----+----+----+----------'----------+----+----+----+----+-----'
| | | | | | ! P0 |PCMM|PDOT|PENT|PENT|
'------------------------' '------------------------'
.-----------. .-----------.
| | | ! | |
.-----+-----+-----! !-----+-----+-----.
! ! | | ! | ! !
! ! !-----! !-----! ! !
| | | | ! | | |
'-----------------' '-----------------'
## Layer 3
http://symbolcodes.tlt.psu.edu/bylanguage/mathchart.html
.------------------------------------.------------------------------------.
| | ¹ | ² | ³ | ⁴ | ⁵ | ∀ | | ⁶ | ⁷ | ⁸ | ⁹ | ⁰ | |
!-----+----+----+----+----+----------!-----+----+----+----+----+----+-----!
| | × | ½ | ÷ | ¼ | ⅕ | | | ⅙ | | ⅛ | | | |
!-----+----+----+----x----x----! ! !----x----x----+----+----+-----!
| | | ± | AT |EURO| ∅ |-----!-----! ∞ | ⁿ | ∃ | ∈ | | |
!-----+----+----+----x----x----! ! !----x----x----+----+----+-----!
| | ⅓ | ≠ | ⅔ | ¾ | ≃ | | |EXLM| | ∄ | ∉ | | |
'-----+----+----+----+----+----------'----------+----+----+----+----+-----'
| | | | | | ! | | | | |
'------------------------' '------------------------'
.-----------. .-----------.
| | | ! | |
.-----+-----+-----! !-----+-----+-----.
! ! | | ! | ! !
! ! !-----! !-----! ! !
| | | | ! | | |
'-----------------' '-----------------'
## Layer 4
.------------------------------------.------------------------------------.
| | ₁ | ₂ | ₃ | ₄ | ₅ | | | ₆ | ₇ | ₈ | ₉ | ₀ | |
!-----+----+----+----+----+----------!-----+----+----+----+----+----+-----!
| | χ | π | φ | ω | γ | | | η | ξ | κ | λ | | ζ |
!-----+----+----+----x----x----! ! !----x----x----+----+----+-----!
| | υ | ι | α | ε | ο |-----!-----! σ | ν | ρ | τ | δ | ς |
!-----+----+----+----x----x----! ! !----x----x----+----+----+-----!
| | | θ | | | | | | β | μ | | | | ψ |
'-----+----+----+----+----+----------'----------+----+----+----+----+-----'
| | | | | | ! | | | | |
'------------------------' '------------------------'
.-----------. .-----------.
| | | ! | |
.-----+-----+-----! !-----+-----+-----.
! ! | | ! | ! !
! ! !-----! !-----! ! !
| | | | ! | | |
'-----------------' '-----------------'
## Layer 5
.------------------------------------.------------------------------------.
| | | | | | | | | | | | | | |
!-----+----+----+----+----+----------!-----+----+----+----+----+----+-----!
| | Χ | Π | Φ | Ω | Γ | | | Η | Ξ | Κ | Λ | | Ζ |
!-----+----+----+----x----x----! ! !----x----x----+----+----+-----!
| | Υ | Ι | Α | Ε | Ο |-----!-----! Σ | Ν | Ρ | Τ | Δ | |
!-----+----+----+----x----x----! ! !----x----x----+----+----+-----!
| | | Θ | | | | | | Β | Μ | | | | Ψ |
'-----+----+----+----+----+----------'----------+----+----+----+----+-----'
| | | | | | ! | | | | |
'------------------------' '------------------------'
.-----------. .-----------.
| | | ! | |
.-----+-----+-----! !-----+-----+-----.
! ! | | ! | ! !
! ! !-----! !-----! ! !
| | | | ! | | |
'-----------------' '-----------------'
## Layer 6
.------------------------------------.------------------------------------.
| | | | | | | | | | | | | | |
!-----+----+----+----+----+----------!-----+----+----+----+----+----+-----!
| | | | | | | | | | | | | | |
!-----+----+----+----x----x----! ! !----x----x----+----+----+-----!
| | | | | | |-----!-----! | | | | | |
!-----+----+----+----x----x----! ! !----x----x----+----+----+-----!
| | | | | | | | | | | | | | |
'-----+----+----+----+----+----------'----------+----+----+----+----+-----'
| | | | | | ! | | | | |
'------------------------' '------------------------'
.-----------. .-----------.
| | | ! | |
.-----+-----+-----! !-----+-----+-----.
! ! | | ! | ! !
! ! !-----! !-----! ! !
| | | | ! | | |
'-----------------' '-----------------'

View file

@ -14,11 +14,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | Tab | Q | W | E | R | T | - | | = | Y | U | I | O | P | \ | * | Tab | Q | W | E | R | T | - | | = | Y | U | I | O | P | \ |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* |Ctrl/Esc| A | S | D | F | G |------| |------| H | J | K | L |; / L2| ' | * |Ctrl/Esc|A / L2| S | D | F | G |------| |------| H | J | K | L | ; | ' |
* |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------|
* | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | ~L1 | '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | * | ~L1 | ~L2 |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 |
* `----------------------------------' `----------------------------------' * `----------------------------------' `----------------------------------'
* ,-------------. ,-------------. * ,-------------. ,-------------.
* | App | Home | | PgUp |Ctrl/Esc| * | App | Home | | PgUp |Ctrl/Esc|
@ -34,9 +34,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// left hand // left hand
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LBRC, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LBRC,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_MINS, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_MINS,
CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, CTL_T(KC_ESC), LT(MDIA, 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_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO),
KC_FN1, KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, KC_FN1, KC_FN2, LALT(KC_LSFT), KC_LEFT,KC_RGHT,
ALT_T(KC_APP), KC_HOME, ALT_T(KC_APP), KC_HOME,
KC_END, KC_END,
@ -44,7 +44,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// right hand // right hand
KC_RBRC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, KC_RBRC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
KC_EQL, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_EQL, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_QUOT, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT,
KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1,
@ -99,13 +99,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* ,--------------------------------------------------. ,--------------------------------------------------. * ,--------------------------------------------------. ,--------------------------------------------------.
* | | | | | | | | | | | | | | | | * | | | | | | | | | | | | | | | |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | | | | MsUp | | | | | | | | | | | | * | | | | | | | | | | | | Lclk | Rclk | | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | * | | | | | | |------| |------|MsLeft|MsDown| MsUp |MsRght| | Play |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | | | | | | | | | | | Prev | Next | | | * | | | | | | | | | | | | Prev | Next | | |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | * | | | | | | |VolUp |VolDn | Mute | | |
* `----------------------------------' `----------------------------------' * `----------------------------------' `----------------------------------'
* ,-------------. ,-------------. * ,-------------. ,-------------.
* | | | | | | * | | | | | |
@ -116,19 +116,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `--------------------' `--------------------' * `--------------------' `--------------------'
*/ */
// MEDIA AND MOUSE // MEDIA AND MOUSE
KEYMAP( [MDIA] = KEYMAP(
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_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_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, 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_TRNS,
// right hand // 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_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_TRNS, KC_MPLY,
KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS,
KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
@ -138,7 +138,8 @@ KEYMAP(
}; };
const uint16_t PROGMEM fn_actions[] = { const uint16_t PROGMEM fn_actions[] = {
[1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) [1] = ACTION_LAYER_TAP_TOGGLE(SYMB), // FN1 - Momentary Layer 1 (Symbols)
[2] = ACTION_LAYER_TAP_TOGGLE(MDIA) // FN2 - Momentary Layer 2 (Media)
}; };
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)

View file

@ -1,10 +1,10 @@
# J3RN's Mac-centric Ergodox EZ keymap # J3RN's Mac-centric ErgoDox EZ keymap
## Motivation ## Motivation
Essentially, I wanted to switch to a layout that was less jarring than the default Ergodox EZ layout, and did not require finger gymnastics to perform common OS X shortcuts (most of which involve the CMD (LGui) key). Essentially, I wanted to switch to a layout that was less jarring than the default ErgoDox EZ layout, and did not require finger gymnastics to perform common OS X shortcuts (most of which involve the CMD (LGui) key).
## How is it different from the default Ergodox EZ layout? ## How is it different from the default ErgoDox EZ layout?
This layout more closely resembles that of the Mac keyboard, and has some other goodness baked in. Here is a rundown of what that means: This layout more closely resembles that of the Mac keyboard, and has some other goodness baked in. Here is a rundown of what that means:
@ -18,6 +18,7 @@ This layout more closely resembles that of the Mac keyboard, and has some other
### Other changes ### Other changes
- **The button to the left of "A" is Ctrl/Esc instead of Backspace.** This is actually how I have the keyboard on my Macbook set up to be, since it's loads more convenient than a CAPS LOCK key. This is the Ctrl key I find myself using most. - **The button to the left of "A" is Ctrl/Esc instead of Backspace.** This is actually how I have the keyboard on my Macbook set up to be, since it's loads more convenient than a CAPS LOCK key. This is the Ctrl key I find myself using most.
- **Mouse uses Vim-style navigation**. To activate "Media mode," hold the 'a' key. This allows you to move the mouse around with hjkl just like in Vim. Additionally, right and left click are the conveniently placed 'i' and 'o' keys.
- **The key to the right of "5" and the key to left of "6" are "[" and "]", respectively, instead of Left and Right.** There is a more convenient set of Left and Right already present. Truth be told, I don't really use these keys, as they are a stretch to reach. - **The key to the right of "5" and the key to left of "6" are "[" and "]", respectively, instead of Left and Right.** There is a more convenient set of Left and Right already present. Truth be told, I don't really use these keys, as they are a stretch to reach.
- **The Toggle L1 keys have been replaced by the otherwise displaced "-" and "=".** They are laid out, left-to-right, in the same order as on the Mac keyboard. Honestly, they are not terribly conveniently placed, and their placement might change in a later version. I found that I did not toggle L1 frequently at all, and found using the momentary keys to access L1 to fit my workflow better. - **The Toggle L1 keys have been replaced by the otherwise displaced "-" and "=".** They are laid out, left-to-right, in the same order as on the Mac keyboard. Honestly, they are not terribly conveniently placed, and their placement might change in a later version. I found that I did not toggle L1 frequently at all, and found using the momentary keys to access L1 to fit my workflow better.
- **The "~"/L1 key in the bottom-left is now just momentary L1.** The "~" key was moved to the top-left as mentioned before, and I like to keep my multi-use keys to a minimum due to the latency for them to switch from "press" to "hold." - **The "~"/L1 key in the bottom-left is now just momentary L1.** The "~" key was moved to the top-left as mentioned before, and I like to keep my multi-use keys to a minimum due to the latency for them to switch from "press" to "hold."

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

View file

@ -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;
}
};

Binary file not shown.

View file

@ -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.

View file

@ -1,392 +1,329 @@
#include "ergodox_ez.h" #include "ergodox_ez.h"
#include "debug.h" #include "debug.h"
#include "action_layer.h" #include "action_layer.h"
#include "keymap_extras/keymap_french.h"
#include "keymap_extras/keymap_neo2.h"
#include "keymap_extras/keymap_uk.h"
#include "keymap_extras/keymap_colemak.h"
#include "keymap_extras/keymap_french_osx.h"
#include "keymap_extras/keymap_nordic.h"
#include "keymap_extras/keymap_dvorak.h"
#include "keymap_extras/keymap_german.h"
#include "keymap_extras/keymap_norwegian.c"
#include "keymap_extras/keymap_fr_ch.h"
#include "keymap_extras/keymap_german_osx.h" #include "keymap_extras/keymap_german_osx.h"
#include "keymap_extras/keymap_spanish.h"
#include "keymap_extras/keymap_bepo.h"
#define BASE 0 // default layer #define BASE 0
#define SYMB 1 // symbols #define SYMB 1
#define MDIA 2 // media keys #define MDIA 2
#define SMLY 3 // media keys #define SMLY 3
#define NUMB 4 // number keys #define NUMB 4
#define EGOS 5 // Egoshooter layer #define EGOS 5
#define M_CTRL_CMDV 1
#define M_CTRL_CMDC 2
#define M_MEH_SH_ACUT 3
#define M_DE_PLUS_CTRLALT 12
#define M_DE_CIRC_CTRLCMD 13
#define M_TOGGLE_5 14
#define SM_SMILE 4
#define SM_SMIRK 5
#define SM_FROWN 6
#define SM_CRY 7
#define SM_KISS 8
#define SM_HEART 9
#define SM_LAUGH 10
#define SM_SAD 11
#define M_CTRL_CMDV 0
#define M_CTRL_CMDC 1
#define M_MEH_SH_ACUT 2
#define M_LGUI_SHFT 3
#define M_CTL_SFT_HASH 4
#define M_DE_OSX_CIRC_CTRLCMD 5
#define M_DE_OSX_PLUS_CTRLALT 6
#define SM_SMILE 7
#define SM_SMIRK 8
#define SM_CRY 9
#define SM_SAD 10
#define SM_HEART 11
#define SM_LAUGH 12
#define SM_KISS 13
#define SM_FROWN 14
#define M_TOGGLE_5 15
//Layout keymap.c generated with ErgodoxLayoutGenerator V1.0BETA1
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap 0: Basic layer [BASE]=KEYMAP(
* //left half
* ,--------------------------------------------------. ,--------------------------------------------------. KC_ESC, DE_OSX_1, DE_OSX_2, DE_OSX_3, DE_OSX_4, DE_OSX_5, M(M_CTL_SFT_HASH),
* | ESC | 1 | 2 | 3 | 4 | 5 |CMD-V | |CMD-C | 6 | 7 | 8 | 9 | 0 | ß | KC_TAB, DE_OSX_Q, DE_OSX_W, DE_OSX_E, DE_OSX_R, DE_OSX_T, KC_LGUI,
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| KC_LALT, DE_OSX_A, DE_OSX_S, DE_OSX_D, DE_OSX_F, DE_OSX_G,
* | TAB | Q | W | E | R | T | CMD | | CMD | Z | U | I | O | P | ü | KC_LSFT, CTL_T(DE_OSX_Y), DE_OSX_X, DE_OSX_C, DE_OSX_V, DE_OSX_B, KC_LALT,
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| LT(SYMB,DE_OSX_LESS), M(M_DE_OSX_CIRC_CTRLCMD), M(M_DE_OSX_PLUS_CTRLALT), KC_UP, KC_DOWN,
* | LALT | A | S | D | F | G |------| |------| H | J | K | L | ö | ä/RALT| M(M_MEH_SH_ACUT), TG(MDIA),
* |--------+------+------+------+------+------| LALT | | RALT |------+------+------+------+------+--------| KC_HOME,
* | LShift |Y/Ctrl| X | C | V | B | | | | N | M | , | . |-/Ctrl| RShift | KC_BSPC, KC_DEL, LT(SMLY,KC_END),
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' //right half
* |</L1| ^° |AltShf| Left | Right| | Up | Down | CMD-SHIFT | + | #/L1 | M(M_CTL_SFT_HASH), DE_OSX_6, DE_OSX_7, DE_OSX_8, DE_OSX_9, DE_OSX_0, DE_OSX_SS,
* `----------------------------------' `----------------------------------' KC_RGUI, DE_OSX_Z, DE_OSX_U, DE_OSX_I, DE_OSX_O, DE_OSX_P, DE_OSX_UE,
* ,-------------. ,---------------. DE_OSX_H, DE_OSX_J, DE_OSX_K, DE_OSX_L, DE_OSX_OE, ALT_T(DE_OSX_AE),
* | MDIA | Meh | | Hyper| NUM | KC_RALT, DE_OSX_N, DE_OSX_M, DE_OSX_COMM, DE_OSX_DOT, CTL_T(DE_OSX_MINS), KC_RSFT,
* ,------|------|------| |------+--------+------. KC_LEFT, KC_RIGHT, LGUI(KC_LSFT), LALT(KC_LSFT), LT(SYMB,DE_OSX_PLUS),
* | | | Home | | PgUp | | | TG(NUMB), ALL_T(DE_OSX_ACUT),
* | Back-| Del |------| |------| Enter | Space| KC_PGUP,
* | Space| | End | | PgDn | | | KC_PGDN, KC_ENT, KC_SPC),
* `--------------------' `----------------------' [SYMB]=KEYMAP(
*/ //left half
// If it accepts an argument (i.e, is a function), it doesn't need KC_. KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS,
// Otherwise, it needs KC_* KC_TRNS, DE_OSX_LESS, DE_OSX_MORE, DE_OSX_EXLM, DE_OSX_QST, KC_TRNS, KC_TRNS,
[BASE] = KEYMAP( // layer 0 : default KC_TRNS, DE_OSX_HASH, DE_OSX_DLR, DE_OSX_BSLS, DE_OSX_SLSH, KC_DOT,
// left hand KC_TRNS, KC_TRNS, DE_OSX_LESS, DE_OSX_PERC, DE_OSX_PIPE, DE_OSX_TILD, KC_TRNS,
KC_ESC, DE_1, DE_2, DE_3, DE_4, DE_5, M(M_CTRL_CMDV), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TAB, DE_Q, DE_W, DE_E, DE_R, DE_T, KC_LGUI, KC_TRNS, KC_TRNS,
KC_LALT, DE_A, DE_S, DE_D, DE_F, DE_G, KC_TRNS,
KC_LSFT, CTL_T(DE_Y), DE_X, DE_C, DE_V, DE_B, KC_LALT, KC_TRNS, KC_DEL, KC_TRNS,
LT(SYMB,DE_LESS), M(M_DE_CIRC_CTRLCMD), M(M_DE_PLUS_CTRLALT), LALT(KC_LSFT), LGUI(KC_LSFT), //right half
M(M_MEH_SH_ACUT), TG(2), M(M_TOGGLE_5), KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
KC_HOME, KC_TRNS, LALT(LSFT(KC_7)), LALT(KC_5), LALT(KC_6), DE_OSX_LESS, DE_OSX_MORE, DE_OSX_EXLM,
KC_BSPC,KC_DEL, LT(SMLY,KC_END), DE_OSX_SLSH, DE_OSX_LPRN, DE_OSX_RPRN, LALT(KC_8), LALT(KC_9), DE_OSX_HASH,
// right hand KC_TRNS, DE_OSX_PIPE, DE_OSX_TILD, DE_OSX_CIRC, KC_UP, DE_OSX_MINS, LSFT(KC_4),
M(M_CTRL_CMDC), DE_6, DE_7, DE_8, DE_9, DE_0, DE_SS, DE_OSX_QUOT, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS,
KC_RGUI, DE_Z, DE_U, DE_I, DE_O, DE_P, DE_UE, KC_F13, KC_F12,
DE_H, DE_J, DE_K, DE_L, DE_OE, ALT_T(DE_AE), KC_F14,
KC_RALT, DE_N, DE_M, DE_COMM,DE_DOT, CTL_T(DE_MINS), KC_RSFT, KC_F15, KC_TRNS, KC_TRNS),
KC_LEFT, KC_UP,KC_DOWN,KC_RIGHT, LT(SYMB,DE_HASH), [MDIA]=KEYMAP(
TG(4), ALL_T(DE_ACUT), //left half
KC_PGUP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_PGDN,KC_ENT, KC_SPC KC_TRNS, KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_WH_U, KC_TRNS,
), KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D,
/* Keymap 1: Symbol Layer KC_TRNS, KC_TRNS, KC_WH_L, KC_WH_D, KC_WH_R, KC_BTN3, KC_TRNS,
* KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
* ,--------------------------------------------------. ,--------------------------------------------------. KC_TRNS, KC_TRNS,
* | | F1 | F2 | F3 | F4 | F5 | | | L5 | F6 | F7 | F8 | F9 | F10 | F11 | KC_TRNS,
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| KC_TRNS, KC_TRNS, KC_TRNS,
* | | < | > | ! | ? | | | | | \ | [ | ] | | | # | F12 | //right half
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY,
* | | # | $ | \ | / | . |------| |------| / | ( | ) | { | } | | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
* | | | ^ | % | | | ~ | | | | & | < | > | " | ' | ? | KC_TRNS, KC_VOLD, KC_TRNS, KC_MPRV, KC_MNXT, KC_UP, KC_TRNS,
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT,
* | | | | | | | | | . | ! | | KC_TRNS, KC_TRNS,
* `----------------------------------' `----------------------------------' KC_TRNS,
* ,-------------. ,-------------. KC_TRNS, KC_TRNS, KC_WBAK),
* | | | | | | [SMLY]=KEYMAP(
* ,------|------|------| |------+------+------. //left half
* | | | | | | | | 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_TRNS, KC_TRNS, KC_TRNS,
// SYMBOLS KC_TRNS, KC_TRNS,
[SYMB] = KEYMAP( KC_TRNS,
// left hand KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, //right half
KC_TRNS,DE_LESS,DE_MORE,DE_EXLM,DE_QST, KC_TRNS,KC_TRNS, M(SM_SMILE), M(SM_SMIRK), M(SM_LAUGH), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS,DE_HASH,DE_DLR, DE_BSLS,DE_SLSH,KC_DOT, KC_TRNS, M(SM_FROWN), M(SM_SAD), M(SM_CRY), KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS,KC_TRNS,DE_LESS,DE_PERC,DE_PIPE,DE_TILD,KC_TRNS, M(SM_HEART), M(SM_KISS), 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_DEL,KC_TRNS, KC_TRNS,
// right hand KC_TRNS, KC_TRNS, KC_TRNS),
M(M_TOGGLE_5), KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, [NUMB]=KEYMAP(
KC_TRNS, LALT(LSFT(KC_7)), LALT(KC_5), LALT(KC_6), LALT(KC_7), DE_HASH, KC_F12, //left half
DE_SLSH, DE_LPRN, DE_RPRN, LALT(KC_8), LALT(KC_9), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, DE_AMPR, KC_GRV, LSFT(KC_GRV), DE_DQOT, DE_QUOT, DE_QST, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS,KC_DOT, KC_EXLM, 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, KC_TRNS,
), KC_TRNS,
/* Keymap 2: Media and mouse keys KC_TRNS, KC_TRNS, KC_TRNS,
* //right half
* ,--------------------------------------------------. ,--------------------------------------------------. KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
* | | | | | | | | | Mute | | | | | | EGOS | KC_TRNS, KC_UP, KC_7, KC_8, KC_9, LSFT(KC_RBRC), KC_F12,
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| KC_DOWN, KC_4, KC_5, KC_6, KC_RBRC, DE_OSX_MINS,
* | | | Lclk | MsUp | Rclk | WlUp | | | | | | | | | | KC_TRNS, LSFT(KC_6), KC_1, KC_2, KC_3, LSFT(KC_7), KC_TRNS,
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| KC_0, KC_DOT, KC_COMM, DE_OSX_EQL, KC_TRNS,
* | | |MsLeft|MsDown|MsRght| WlDw |------| |------|VolUp | | | | | | KC_TRNS, KC_TRNS,
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| KC_TRNS,
* | | | | | | MClk | | | |VolDn | | Prev | Next | Up | | KC_TRNS, KC_TRNS, KC_TRNS),
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' [EGOS]=KEYMAP(
* | | | | | | | | | Left | Down | Right | //left half
* `----------------------------------' `----------------------------------' 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_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
* ,------|------|------| |------+------+------. KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
* | | | | | | |Brwser| KC_LCTL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
* | | |------| |------| |Back | KC_F1, KC_F2,
* | | | | | | | | KC_F3,
* `--------------------' `--------------------' KC_SPC, KC_LCTL, KC_F4,
*/ //right half
// MEDIA AND MOUSE M(M_TOGGLE_5), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KEYMAP( 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_BTN1, KC_MS_U, KC_BTN2, KC_WH_U, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_WH_L, KC_WH_D, KC_WH_R, KC_BTN3, 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,
// right hand
KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_VOLD, KC_TRNS, KC_MPRV, KC_MNXT, KC_UP, KC_TRNS,
KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_WBAK
),
/* Keymap 3: Smiley layer
* making it easier to type smileys... tipp: on osx you can easily replace those smileys with the UTF-8 character using
* keyboard short commands...
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | | | | | | | | | :-) | ;-) | :-D | | | | |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | | | | | | | | | | :-{ | :-( | | | | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | | | | | |------| |------| <3 | :-* | | | | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | | | | | | | | | | | | | | |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | | | | | | | | | | r|
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | | | | | |
* ,------|------|------| |------+--------+------.
* | | | | | | | |
* | | |------| |------| | |
* | | | | | | | |
* `--------------------' `----------------------'
*/
KEYMAP(
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_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS,
// right hand
M(SM_SMILE), M(SM_SMIRK), M(SM_LAUGH), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, M(SM_FROWN), M(SM_SAD), M(SM_CRY), KC_TRNS, KC_TRNS, KC_TRNS,
M(SM_HEART), M(SM_KISS), 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
),
//number pad
KEYMAP(
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_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,
// 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, LSFT(KC_RBRC), KC_F12,
KC_DOWN, KC_4, KC_5, KC_6, KC_RBRC, DE_MINS,
KC_TRNS, LSFT(KC_6), KC_1, KC_2, KC_3, LSFT(KC_7), KC_TRNS,
KC_0,KC_DOT, KC_0, DE_EQL, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS
),
/* Keymap 3: Egoshooter layer
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | | | | | | | | | L5 | | | | | | |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | | | | | | | | | | | | | | | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | SHIFT | | | | | |------| |------| | | | | | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | | | | | | | | | | | | | | |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | CTRL | | | | | | | | | | |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | F1 | F2 | | | |
* ,------|------|------| |------+--------+------.
* | | | F3 | | | | |
* | SPACE| CTRL|------| |------| | |
* | | | F4 | | | | |
* `--------------------' `----------------------'
*/
KEYMAP(
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_LSFT, 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_LCTL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_F1, KC_F2,
KC_F3,
KC_SPC, KC_LCTL, KC_F4,
// right hand
M(M_TOGGLE_5), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
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
),
}; };
const uint16_t PROGMEM fn_actions[] = { const uint16_t PROGMEM fn_actions[] = {
[1] = ACTION_LAYER_TAP_TOGGLE(SYMB), // FN1 - Momentary Layer 1 (Symbols)
[2] = ACTION_LAYER_TAP_TOGGLE(SMLY) // FN2 - Momentary Layer 2 (Smiley)
}; };
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{ {
static uint16_t start; static uint16_t start;
// MACRODOWN only works in this function switch(id) {
switch(id) { case M_TOGGLE_5:
case 0: //Macro: M_TOGGLE_5//-----------------------
if (record->event.pressed) { if (record->event.pressed){
register_code(KC_RSFT); layer_state ^= (1<<5);
} else { layer_state &= (1<<5);
unregister_code(KC_RSFT); }
}
break; break;
case 1: case M_CTRL_CMDC:
if (record->event.pressed) { //Macro: M_CTRL_CMDC//-----------------------
start = timer_read(); if (record->event.pressed) {
return MACRO(D(LCTRL), END);
} else {
if (timer_elapsed(start) > 150) {
return MACRO(U(LCTRL), END);
} else {
return MACRO(U(LCTRL), D(LGUI), T(V), U(LGUI), END);
}
}
break;
case 2:
if (record->event.pressed) {
start = timer_read(); start = timer_read();
return MACRO(D(LCTRL),END); return MACRO(D(LCTRL),END);
} else { } else {
if (timer_elapsed(start) > 150){ if (timer_elapsed(start) >150) {
return MACRO(U(LCTRL),END); return MACRO(U(LCTRL),END);
} else { } else {
return MACRO(U(LCTRL),D(LGUI),T(C),U(LGUI),END); return MACRO(U(LCTRL),D(LGUI),T(C),U(LGUI),END);
} }
} }
break;
case 3: break;
if (record->event.pressed) { case M_DE_OSX_PLUS_CTRLALT:
start = timer_read(); //Macro: M_DE_OSX_PLUS_CTRLALT//-----------------------
return MACRO(D(LCTRL),D(LSFT),D(LALT),END); if (record->event.pressed) {
} else {
if (timer_elapsed(start) > 150){
return MACRO(U(LCTRL),U(LSFT),U(LALT),END);
} else {
return MACRO(U(LCTRL),U(LALT),T(EQL),U(LSFT),END); //cannot use DE_ACUT here, as macro needs KC_ prefix
}
}
break;
case M_DE_CIRC_CTRLCMD:
if (record->event.pressed) {
start = timer_read();
return MACRO(D(LCTRL),D(LGUI),END);
} else {
if (timer_elapsed(start) > 150){
return MACRO(U(LCTRL),U(LGUI),END);
} else {
return MACRO(U(LCTRL),U(LGUI),T(NUBS),END);
}
}
break;
case M_DE_PLUS_CTRLALT:
if (record->event.pressed) {
start = timer_read(); start = timer_read();
return MACRO(D(LCTRL),D(LALT),END); return MACRO(D(LCTRL),D(LALT),END);
} else { } else {
if (timer_elapsed(start) > 150){ if (timer_elapsed(start) >150) {
return MACRO(U(LCTRL),U(LALT),END); return MACRO(U(LCTRL),U(LALT),END);
} else { } else {
return MACRO(U(LCTRL),U(LALT),T(RBRC),END); return MACRO(U(LCTRL),U(LALT),T(RBRC),END);
} }
} }
break;
case SM_SMILE:
if (record->event.pressed) {
return MACRO(D(LSFT),T(DOT),U(LSFT),T(SLSH),D(LSFT),T(9),U(LSFT),END);
}
break;
case SM_SMIRK: break;
if (record->event.pressed) { case SM_KISS:
return MACRO(D(LSFT),T(COMM),U(LSFT),T(SLSH),D(LSFT),T(9),U(LSFT),END); //Macro: SM_KISS//-----------------------
} if (record->event.pressed) {
break;
case SM_CRY:
if (record->event.pressed) {
return MACRO(D(LSFT),T(COMM),U(LSFT),T(SLSH),D(LSFT),T(8),U(LSFT),END);
}
break;
case SM_SAD:
if (record->event.pressed) {
return MACRO(D(LSFT),T(DOT),U(LSFT),T(SLSH),D(LSFT),T(8),U(LSFT),END);
}
break;
case SM_HEART:
if (record->event.pressed) {
return MACRO(T(GRV),T(3),END);
}
break;
case SM_LAUGH:
if (record->event.pressed) {
return MACRO(D(LSFT),T(DOT),U(LSFT),T(SLSH),D(LSFT),T(D),U(LSFT),END);
}
break;
case SM_KISS:
if (record->event.pressed) {
return MACRO(D(LSFT),T(DOT),U(LSFT),T(SLSH),D(LSFT),T(RBRC),U(LSFT),END); return MACRO(D(LSFT),T(DOT),U(LSFT),T(SLSH),D(LSFT),T(RBRC),U(LSFT),END);
} }
break;
case SM_FROWN: break;
if (record->event.pressed) { case SM_FROWN:
//Macro: SM_FROWN//-----------------------
if (record->event.pressed) {
return MACRO(D(LSFT),T(DOT),U(LSFT),T(SLSH),D(LALT),T(8),U(LALT),END); return MACRO(D(LSFT),T(DOT),U(LSFT),T(SLSH),D(LALT),T(8),U(LALT),END);
} }
break;
case M_TOGGLE_5: break;
if (record->event.pressed){ case SM_CRY:
layer_state ^= (1<<5); //Macro: SM_CRY//-----------------------
layer_state &= (1<<5); if (record->event.pressed) {
} return MACRO(D(LSFT),T(COMM),U(LSFT),T(SLSH),D(LSFT),T(8),U(LSFT),END);
break; }
}
return MACRO_NONE; break;
case SM_SMILE:
//Macro: SM_SMILE//-----------------------
if (record->event.pressed) {
return MACRO(D(LSFT),T(DOT),U(LSFT),T(SLSH),D(LSFT),T(9),U(LSFT),END);
}
break;
case SM_SMIRK:
//Macro: SM_SMIRK//-----------------------
if (record->event.pressed) {
return MACRO(D(LSFT),T(COMM),U(LSFT),T(SLSH),D(LSFT),T(9),U(LSFT),END);
}
break;
case M_LGUI_SHFT:
//Macro: M_LGUI_SHFT//-----------------------
if (record->event.pressed){
return MACRO(D(LGUI),D(LSFT),END);
}else{
return MACRO(U(LGUI),U(LSFT),END);
}
break;
case SM_HEART:
//Macro: SM_HEART//-----------------------
if (record->event.pressed) {
return MACRO(T(GRV),T(3),END);
}
break;
case SM_LAUGH:
//Macro: SM_LAUGH//-----------------------
if (record->event.pressed) {
return MACRO(D(LSFT),T(DOT),U(LSFT),T(SLSH),D(LSFT),T(D),U(LSFT),END);
}
break;
case M_CTL_SFT_HASH:
//Macro: M_CTL_SFT_HASH//-----------------------
if (record->event.pressed) {
start = timer_read();
return MACRO(D(LCTRL),D(LSFT),END);
} else {
if (timer_elapsed(start) >150) {
return MACRO(U(LCTRL),U(LSFT),END);
} else {
return MACRO(U(LCTRL),U(LSFT),T(BSLS),END);
}
}
break;
case SM_SAD:
//Macro: SM_SAD//-----------------------
if (record->event.pressed) {
return MACRO(D(LSFT),T(DOT),U(LSFT),T(SLSH),D(LSFT),T(8),U(LSFT),END);
}
break;
case M_DE_OSX_CIRC_CTRLCMD:
//Macro: M_DE_OSX_CIRC_CTRLCMD//-----------------------
if (record->event.pressed) {
start = timer_read();
return MACRO(D(LCTRL),D(LGUI),END);
} else {
if (timer_elapsed(start) >150) {
return MACRO(U(LCTRL),U(LGUI),END);
} else {
return MACRO(U(LCTRL),U(LGUI),T(NUBS),END);
}
}
break;
case M_CTRL_CMDV:
//Macro: M_CTRL_CMDV//-----------------------
if (record->event.pressed) {
start = timer_read();
return MACRO(D(LCTRL),END);
} else {
if (timer_elapsed(start) >150) {
return MACRO(U(LCTRL),END);
} else {
return MACRO(U(LCTRL),D(LGUI),T(V),U(LGUI),END);
}
}
break;
case M_MEH_SH_ACUT:
//Macro: M_MEH_SH_ACUT//-----------------------
if (record->event.pressed) {
start = timer_read();
return MACRO(D(LCTRL),D(LSFT),D(LALT),END);
} else {
if (timer_elapsed(start) >150) {
return MACRO(U(LCTRL),U(LSFT),U(LALT),END);
} else {
return MACRO(U(LCTRL),U(LALT),T(EQL),U(LSFT),END);
}
}
break;
}
return MACRO_NONE;
}; };
// Runs just one time when the keyboard initializes. // Runs just one time when the keyboard initializes.
@ -397,36 +334,43 @@ void matrix_init_user(void) {
// Runs constantly in the background, in a loop. // Runs constantly in the background, in a loop.
void matrix_scan_user(void) { void matrix_scan_user(void) {
uint8_t layer = biton32(layer_state); uint8_t layer = biton32(layer_state);
ergodox_board_led_off(); ergodox_board_led_off();
ergodox_right_led_1_off(); ergodox_right_led_1_off();
ergodox_right_led_2_off(); ergodox_right_led_2_off();
ergodox_right_led_3_off(); ergodox_right_led_3_off();
switch (layer) { switch (layer) {
// TODO: Make this relevant to the ErgoDox EZ.
case 1: case SYMB:
ergodox_right_led_1_on(); ergodox_right_led_1_on();
break;
case 2:
ergodox_right_led_2_on(); break;
break; case MDIA:
case 3:
ergodox_right_led_3_on(); ergodox_right_led_2_on();
break;
case 4: break;
ergodox_right_led_1_on(); case SMLY:
ergodox_right_led_3_on();
//ergodox_board_led_on();
break; ergodox_right_led_3_on();
case 5: break;
ergodox_right_led_1_on(); case NUMB:
ergodox_right_led_2_on(); ergodox_right_led_1_on();
ergodox_right_led_3_on();
break; ergodox_right_led_3_on();
default: break;
// none case EGOS:
break; ergodox_right_led_1_on();
} ergodox_right_led_2_on();
ergodox_right_led_3_on();
break;
default:
// none
break;
}
}; };

Binary file not shown.

Before

Width:  |  Height:  |  Size: 732 KiB

After

Width:  |  Height:  |  Size: 292 KiB

View file

@ -11,6 +11,12 @@ Dies ist nur ein kleiner Tweak der bestehenden firmware für das ErgoDox-EZ-Keyb
- der Zehnerblock wurde in eine eigene Layer umgezogen - der Zehnerblock wurde in eine eigene Layer umgezogen
- die Meh und Hyper-Tasten wurden in die Daumenblöcke umgezogen - die Meh und Hyper-Tasten wurden in die Daumenblöcke umgezogen
# Erstellt Mit Dem ErgodoxLayoutGenerator
Der ErgodoxLayoutGenerator ist ein kleines Werkzeug, welches die Erstellung und Pflege der eigenen Keymaps erleichtern soll. Es ist in java geschrieben und kann [hier](https://github.com/sboesebeck/ErgodoxLayoutGenerator/releases) heruntergeladen werden. Damit das Tool funktioniert sollte das offizielle Oracle JDK in aktueller Version installiert sein.
Die Dokumentation für den ELG kann man [hier](https://boesebeck.name/2016/04/16/ergodoxlayoutgenerator-documentation/) nachlesen (momentan leider nur in Englisch verfügbar).
------------------------------ ------------------------------
@ -26,3 +32,10 @@ This is only a little tweak of the existing default layout for the ErgoDox keyb
- the symbollayer now has only symbols - the symbollayer now has only symbols
- the number block was moved to a special layer - the number block was moved to a special layer
- meh and hyper went down to the thumb block - meh and hyper went down to the thumb block
# Created Using the ErgodoxLayoutGenerator
The ErgodoxLayoutGenerator (ELG) is a little tool, which makes the creation and maintenance of keycaps a lot easier. It was written in Java and can be downloaded [here](https://github.com/sboesebeck/ErgodoxLayoutGenerator/releases). To use the tool, you need to have a current version of Oracles JDK installed.
The documentation of the ELG can be viewed [here](https://boesebeck.name/2016/04/16/ergodoxlayoutgenerator-documentation/).

View file

@ -1,229 +1,153 @@
// Netable differences vs. the default firmware for the ErgoDox EZ:
// 1. The Cmd key is now on the right side, making Cmd+Space easier.
// 2. The media keys work on OSX (But not on Windows).
#include "ergodox_ez.h" #include "ergodox_ez.h"
#include "debug.h" #include "debug.h"
#include "action_layer.h" #include "action_layer.h"
#include "keymap_extras/keymap_french.h"
#include "keymap_extras/keymap_neo2.h"
#include "keymap_extras/keymap_uk.h"
#include "keymap_extras/keymap_colemak.h"
#include "keymap_extras/keymap_french_osx.h"
#include "keymap_extras/keymap_nordic.h"
#include "keymap_extras/keymap_dvorak.h"
#include "keymap_extras/keymap_german.h" #include "keymap_extras/keymap_german.h"
#include "keymap_extras/keymap_norwegian.c"
#include "keymap_extras/keymap_fr_ch.h"
#include "keymap_extras/keymap_german_osx.h"
#include "keymap_extras/keymap_spanish.h"
#include "keymap_extras/keymap_bepo.h"
#define BASE 0 // default layer #define BASE 0
#define SYMB 1 // symbols #define SYMB 1
#define MDIA 2 // media keys #define MDIA 2
#define ADNW 3 // media keys #define QWERTZ 3
#define NUMB 4 // number keys #define NUMB 4
#define UNUSED 0
//Layout keymap.c generated with ErgodoxLayoutGenerator V1.0BETA1
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// If it accepts an argument (i.e, is a function), it doesn't need KC_. [BASE]=KEYMAP(
// Otherwise, it needs KC_* //left half
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LCTL,
/* Keymap 0: ADNW-Koy layer KC_TAB, KC_K, KC_DOT, KC_O, KC_COMM, KC_Z, KC_LGUI,
* ADNW-Koy is a special layout designed to be ergonomic. Was created using software to determine the most ergonomic way to type German and English texts. TG(QWERTZ), KC_H, KC_A, KC_E, KC_I, KC_U,
* KC_LSFT, CTL_T(KC_X), KC_Q, DE_AE, DE_UE, DE_OE, KC_LALT,
* ,--------------------------------------------------. ,--------------------------------------------------. LT(SYMB,KC_GRV), DE_LESS, LALT(KC_LSFT), KC_LEFT, KC_RGHT,
* | ESC | 1 | 2 | 3 | 4 | 5 |Lctrl | |Rctrl | 6 | 7 | 8 | 9 | 0 | - | TG(MDIA), MEH_T(LSFT(DE_ACUT)),
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| KC_HOME,
* | TAB | K | . | O | , | Y | CMD | | CMD | V | G | C | L | ß | Z | KC_BSPC, KC_DEL, KC_END,
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| //right half
* | ADNW | H | A | E | I | U |------| |------| D | T | R | N | S | F/L2 | KC_RCTL, KC_6, KC_7, KC_8, KC_9, KC_0, DE_OSX_MINS,
* |--------+------+------+------+------+------| LALT | | RALT |------+------+------+------+------+--------| KC_RGUI, KC_V, KC_G, KC_C, KC_L, KC_MINS, KC_Y,
* | LShift |X/Ctrl| Q | Ä | Ü | Ö | | | | B | P | W | M |J/Ctrl| RShift | KC_D, KC_T, KC_R, KC_N, KC_S, LT(MDIA,KC_F),
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' KC_RALT, KC_B, KC_P, KC_W, KC_M, CTL_T(KC_J), KC_RSFT,
* |</L1| ^ |AltShf| Left | Right| | Up | Down | CMD-SHIFT | ´ | //L1 | KC_UP, KC_DOWN, LGUI(KC_LSFT), KC_RBRC, LT(SYMB,KC_BSLS),
* `----------------------------------' `----------------------------------' ALL_T(DE_ACUT), TG(NUMB),
* ,-------------. ,-------------. KC_PGUP,
* | L1 | LGui | | Alt |Ctrl/Esc| KC_PGDN, KC_ENT, KC_SPC),
* ,------|------|------| |------+--------+------. [SYMB]=KEYMAP(
* | | | Home | | PgUp | | | //left half
* | Space|Backsp|------| |------| Enter | Space| KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS,
* | |ace | End | | PgDn | | | KC_TRNS, KC_GRV, LSFT(KC_GRV), DE_EXLM, DE_QST, KC_TRNS, KC_TRNS,
* `--------------------' `----------------------' KC_TRNS, DE_HASH, DE_DLR, LALT(LSFT(KC_7)), DE_SLSH, KC_DOT,
*/ KC_TRNS, KC_TRNS, DE_LESS, DE_PERC, LALT(KC_7), LALT(KC_N), KC_TRNS,
KEYMAP( 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_K, KC_DOT, KC_O, KC_COMM, KC_Z, KC_TRNS, KC_TRNS,
KC_TRNS, KC_H, KC_A, KC_E, KC_I, KC_U, KC_TRNS, KC_DEL, KC_TRNS,
KC_TRNS, CTL_T(KC_X),KC_Q, DE_AE, DE_UE, DE_OE, KC_TRNS, //right half
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
KC_TRNS, KC_TRNS, KC_TRNS, LALT(LSFT(KC_7)), LALT(KC_5), LALT(KC_6), LALT(KC_7), DE_HASH, KC_F12,
KC_TRNS, DE_SLSH, DE_LPRN, DE_RPRN, LALT(KC_8), LALT(KC_9), KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DE_AMPR, KC_GRV, LSFT(KC_GRV), DE_DQOT, DE_QUOT, DE_QST,
// right hand KC_TRNS, KC_DOT, KC_EXLM, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SLSH, KC_TRNS, KC_TRNS,
KC_TRNS, KC_V, KC_G, KC_C, KC_L, KC_MINS, KC_Y, KC_TRNS,
KC_D, KC_T, KC_R, KC_N, KC_S, LT(MDIA,KC_F), KC_TRNS, KC_TRNS, KC_TRNS),
KC_TRNS, KC_B, KC_P, KC_W, KC_M, CTL_T(KC_J), KC_TRNS, [MDIA]=KEYMAP(
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, //left half
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS,
), KC_TRNS, KC_WH_L, KC_WH_U, KC_WH_D, KC_WH_R, KC_BTN3, KC_TRNS,
/* Keymap 1: Symbol Layer KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2,
* KC_TRNS, KC_TRNS,
* ,--------------------------------------------------. ,--------------------------------------------------. KC_TRNS,
* | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | KC_TRNS, KC_TRNS, KC_TRNS,
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| //right half
* | | | | ! | ? | | | | | \ | [ | ] | | | # | F12 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY,
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| 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_MUTE, KC_MPRV, KC_MNXT, KC_UP, KC_TRNS,
* | | | ^ | % | | | ~ | | | | & | < | > | " | ' | ? | KC_VOLU, KC_VOLD, KC_LEFT, KC_DOWN, KC_RIGHT,
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' KC_TRNS, KC_TRNS,
* | | | | | | | | | . | ! | | KC_TRNS,
* `----------------------------------' `----------------------------------' KC_TRNS, KC_TRNS, KC_WBAK),
* ,-------------. ,-------------. [QWERTZ]=KEYMAP(
* | | | | | | //left half
* ,------|------|------| |------+------+------. KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, LGUI(KC_V),
* | | | | | | | | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LGUI,
* | | |------| |------| | | KC_TRNS, 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_LALT,
* `--------------------' `--------------------' LT(SYMB,KC_GRV), DE_LESS, LALT(KC_LSFT), KC_LEFT, KC_RGHT,
*/ KC_TRNS, MEH_T(LSFT(DE_ACUT)),
// SYMBOLS KC_HOME,
[SYMB] = KEYMAP( KC_BSPC, KC_DEL, KC_END,
// left hand //right half
KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, LGUI(KC_C), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
KC_TRNS,KC_GRV,LSFT(KC_GRV),DE_EXLM,DE_QST,KC_TRNS,KC_TRNS, KC_RGUI, KC_Y, KC_U, KC_I, KC_O, KC_P, DE_UE,
KC_TRNS,DE_HASH,DE_DLR, LALT(LSFT(KC_7)),DE_SLSH,KC_DOT, KC_H, KC_J, KC_K, KC_L, KC_SCLN, LT(MDIA,DE_AE),
KC_TRNS,KC_TRNS,DE_LESS,DE_PERC,LALT(KC_7),LALT(KC_N),KC_TRNS, KC_RALT, KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLSH), KC_RSFT,
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_UP, KC_DOWN, LGUI(KC_LSFT), KC_RBRC, LT(SYMB,KC_BSLS),
KC_TRNS,KC_TRNS, ALL_T(DE_ACUT), KC_TRNS,
KC_TRNS, KC_PGUP,
KC_TRNS,KC_DEL,KC_TRNS, KC_PGDN, KC_ENT, KC_SPC),
// right hand [NUMB]=KEYMAP(
KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, //left half
KC_TRNS, LALT(LSFT(KC_7)), LALT(KC_5), LALT(KC_6), LALT(KC_7), DE_HASH, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
DE_SLSH, DE_LPRN, DE_RPRN, LALT(KC_8), LALT(KC_9), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, DE_AMPR, KC_GRV, LSFT(KC_GRV), DE_DQOT, DE_QUOT, DE_QST, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS,
KC_TRNS,KC_DOT, KC_EXLM, 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,
/* Keymap 2: Media and mouse keys //right half
* KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
* ,--------------------------------------------------. ,--------------------------------------------------. KC_TRNS, KC_UP, KC_7, KC_8, KC_9, LSFT(KC_RBRC), KC_F12,
* | | | | | | | | | | | | | | | Play | KC_DOWN, KC_4, KC_5, KC_6, KC_RBRC, KC_TRNS,
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| KC_TRNS, LSFT(KC_6), KC_1, KC_2, KC_3, LSFT(KC_7), KC_TRNS,
* | | | | MsUp | | | | | | | | | | | | KC_0, KC_DOT, KC_0, KC_EQL, KC_TRNS,
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| KC_TRNS, KC_TRNS,
* | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | | KC_TRNS,
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| KC_TRNS, KC_TRNS, KC_TRNS),
* | | | | | | | | | | | | Prev | Next | | |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | | | | | |
* ,------|------|------| |------+------+------.
* | | | | | | |Brwser|
* | | |------| |------| |Back |
* | | | | | | | |
* `--------------------' `--------------------'
*/
// MEDIA AND MOUSE
KEYMAP(
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS,
KC_TRNS, KC_WH_L, KC_WH_U, KC_WH_D, KC_WH_R, KC_BTN3, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS,
// right hand
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY,
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_MUTE, KC_MPRV, KC_MNXT, KC_UP, KC_TRNS,
KC_VOLU, KC_VOLD, KC_LEFT, KC_DOWN, KC_RIGHT,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_WBAK
),
/* Keymap 3: qwertz layer
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | ESC | 1 | 2 | 3 | 4 | 5 |CMD-V | |CMD-C | 6 | 7 | 8 | 9 | 0 | ß |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | TAB | Q | W | E | R | T | CMD | | CMD | Z | U | I | O | P | ü |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | ADNW | A | S | D | F | G |------| |------| H | J | K | L | ö | ä/L2 |
* |--------+------+------+------+------+------| LALT | | RALT |------+------+------+------+------+--------|
* | LShift |Y/Ctrl| X | C | V | B | | | | N | M | , | . |-/Ctrl| RShift |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* |</L1| ^° |AltShf| Left | Right| | Up | Down | CMD-SHIFT | + | #/L1 |
* `----------------------------------' `----------------------------------'
* ,-------------. ,---------------.
* | MDIA | Meh | | Hyper| NUM |
* ,------|------|------| |------+--------+------.
* | | | Home | | PgUp | | |
* | Back-| Del |------| |------| Enter | Space|
* | Space| | End | | PgDn | | |
* `--------------------' `----------------------'
*/
[BASE] = KEYMAP( // layer 3 : default qwertz layout
// left hand
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, LGUI(KC_V),
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LGUI,
TG(3), 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_LALT,
LT(SYMB,KC_GRV), DE_LESS, LALT(KC_LSFT), KC_LEFT,KC_RGHT,
TG(2), MEH_T(LSFT(DE_ACUT)),
KC_HOME,
KC_BSPC,KC_DEL,KC_END,
// right hand
LGUI(KC_C), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
KC_RGUI, KC_Y, KC_U, KC_I, KC_O, KC_P, DE_UE,
KC_H, KC_J, KC_K, KC_L, KC_SCLN,LT(MDIA,DE_AE),
KC_RALT,KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT,
KC_UP, KC_DOWN,LGUI(KC_LSFT),KC_RBRC, LT(SYMB,KC_BSLS),
ALL_T(DE_ACUT), TG(4),
KC_PGUP,
KC_PGDN,KC_ENT, KC_SPC
),
//numblock
KEYMAP(
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_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,
// 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, LSFT(KC_RBRC), KC_F12,
KC_DOWN, KC_4, KC_5, KC_6, KC_RBRC, KC_TRNS,
KC_TRNS, LSFT(KC_6), KC_1, KC_2, KC_3, LSFT(KC_7), KC_TRNS,
KC_0,KC_DOT, KC_0, KC_EQL, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS
),
}; };
const uint16_t PROGMEM fn_actions[] = { const uint16_t PROGMEM fn_actions[] = {
[1] = ACTION_LAYER_TAP_TOGGLE(SYMB), // FN1 - Momentary Layer 1 (Symbols)
[2] = ACTION_LAYER_TAP_TOGGLE(ADNW) // FN2 - Momentary Layer 2 (ADNW)
}; };
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{ {
// MACRODOWN only works in this function static uint16_t start;
switch(id) { switch(id) {
case 0: case UNUSED:
//Macro: UNUSED//-----------------------
if (record->event.pressed) { if (record->event.pressed) {
register_code(KC_RSFT); register_code(KC_RSFT);
} else { } else {
unregister_code(KC_RSFT); unregister_code(KC_RSFT);
} }
break;
}
return MACRO_NONE;
break;
}
return MACRO_NONE;
}; };
// Runs just one time when the keyboard initializes. // Runs just one time when the keyboard initializes.
@ -234,31 +158,18 @@ void matrix_init_user(void) {
// Runs constantly in the background, in a loop. // Runs constantly in the background, in a loop.
void matrix_scan_user(void) { void matrix_scan_user(void) {
uint8_t layer = biton32(layer_state); uint8_t layer = biton32(layer_state);
ergodox_board_led_off(); ergodox_board_led_off();
ergodox_right_led_1_off(); ergodox_right_led_1_off();
ergodox_right_led_2_off(); ergodox_right_led_2_off();
ergodox_right_led_3_off(); ergodox_right_led_3_off();
switch (layer) { switch (layer) {
// TODO: Make this relevant to the ErgoDox EZ.
case 1: default:
ergodox_right_led_1_on(); // none
break; break;
case 2: }
ergodox_right_led_2_on();
break;
case 3:
ergodox_right_led_3_on();
break;
case 4:
ergodox_right_led_1_on();
ergodox_right_led_3_on();
//ergodox_board_led_on();
break;
default:
// none
break;
}
}; };

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 KiB

View file

@ -0,0 +1,376 @@
#include "ergodox_ez.h"
#include "debug.h"
#include "action_layer.h"
#include "keymap_extras/keymap_french.h"
#include "keymap_extras/keymap_neo2.h"
#include "keymap_extras/keymap_uk.h"
#include "keymap_extras/keymap_colemak.h"
#include "keymap_extras/keymap_french_osx.h"
#include "keymap_extras/keymap_nordic.h"
#include "keymap_extras/keymap_dvorak.h"
#include "keymap_extras/keymap_german.h"
#include "keymap_extras/keymap_norwegian.c"
#include "keymap_extras/keymap_fr_ch.h"
#include "keymap_extras/keymap_german_osx.h"
#include "keymap_extras/keymap_spanish.h"
#include "keymap_extras/keymap_bepo.h"
#define BASE 0
#define SYMB 1
#define MDIA 2
#define SMLY 3
#define NUMB 4
#define EGOS 5
#define SMLY_TOG_QUOT 0
#define M_TOGGLE_5 1
#define TGH_NUM 2
#define M_DE_OSX_PLUS_CTRLALT 3
#define SM_KISS 4
#define SM_FROWN 5
#define SM_CRY 6
#define SM_SMILE 7
#define SM_SMIRK 8
#define M_LGUI_SHFT 9
#define SM_HEART 10
#define TOG_HLD_MDIA 11
#define SM_LAUGH 12
#define SM_SAD 13
#define M_DE_OSX_CIRC_CTRLCMD 14
#define M_MEH_SH_ACUT 15
//Layout keymap.c generated with ErgodoxLayoutGenerator V1.0BETA1
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[BASE]=KEYMAP(
//left half
KC_ESC, DE_OSX_1, DE_OSX_2, DE_OSX_3, DE_OSX_4, DE_OSX_5, M(TGH_NUM),
KC_TAB, DE_OSX_Q, DE_OSX_W, DE_OSX_E, DE_OSX_R, DE_OSX_T, KC_LGUI,
KC_LALT, DE_OSX_A, DE_OSX_S, DE_OSX_D, DE_OSX_F, DE_OSX_G,
KC_LSFT, CTL_T(DE_OSX_Y), DE_OSX_X, DE_OSX_C, DE_OSX_V, DE_OSX_B, KC_LALT,
LT(SYMB,DE_OSX_LESS), M(M_DE_OSX_CIRC_CTRLCMD), M(M_DE_OSX_PLUS_CTRLALT), LSFT(KC_LCTRL), M(SMLY_TOG_QUOT),
KC_HOME, KC_END,
KC_PGUP,
KC_BSPC, KC_DEL, KC_PGDN,
//right half
M(TOG_HLD_MDIA), DE_OSX_6, DE_OSX_7, DE_OSX_8, DE_OSX_9, DE_OSX_0, DE_OSX_SS,
KC_RGUI, DE_OSX_Z, DE_OSX_U, DE_OSX_I, DE_OSX_O, DE_OSX_P, DE_OSX_UE,
DE_OSX_H, DE_OSX_J, DE_OSX_K, DE_OSX_L, DE_OSX_OE, ALT_T(DE_OSX_AE),
KC_RALT, DE_OSX_N, DE_OSX_M, DE_OSX_COMM, DE_OSX_DOT, CTL_T(DE_OSX_MINS), KC_RSFT,
MEH_T(DE_OSX_HASH), ALL_T(DE_OSX_ACUT), LGUI(KC_LSFT), LALT(KC_LSFT), LT(SYMB,DE_OSX_PLUS),
KC_LEFT, KC_RIGHT,
KC_UP,
KC_DOWN, KC_ENT, KC_SPC),
[SYMB]=KEYMAP(
//left half
KC_APPLICATION, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F5,
KC_TRNS, DE_OSX_LESS, DE_OSX_MORE, DE_OSX_EXLM, DE_OSX_QST, KC_TRNS, KC_TRNS,
KC_TRNS, DE_OSX_HASH, DE_OSX_DLR, DE_OSX_BSLS, DE_OSX_SLSH, KC_DOT,
KC_TRNS, KC_TRNS, DE_OSX_LESS, DE_OSX_PERC, DE_OSX_PIPE, DE_OSX_TILD, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_DEL, KC_TRNS,
//right half
KC_F6, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
KC_TRNS, DE_OSX_BSLS, DE_OSX_LBRC, DE_OSX_RBRC, DE_OSX_LESS, DE_OSX_MORE, DE_OSX_EXLM,
DE_OSX_SLSH, DE_OSX_LPRN, DE_OSX_RPRN, DE_OSX_LCBR, DE_OSX_RCBR, DE_OSX_HASH,
KC_TRNS, DE_OSX_PIPE, DE_OSX_TILD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
DE_OSX_QUOT, DE_OSX_DQOT, KC_TRNS, M(M_TOGGLE_5), KC_TRNS,
KC_F13, KC_F12,
KC_F14,
KC_F15, KC_TRNS, KC_TRNS),
[MDIA]=KEYMAP(
//left half
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_WH_U, KC_TRNS,
KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D,
KC_TRNS, KC_TRNS, KC_WH_L, KC_WH_D, KC_WH_R, KC_BTN3, 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 half
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_VOLD, KC_TRNS, KC_MPRV, KC_MNXT, KC_UP, KC_TRNS,
KC_MUTE, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_WBAK),
[SMLY]=KEYMAP(
//left half
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_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS,
//right half
M(SM_SMILE), M(SM_SMIRK), M(SM_LAUGH), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, M(SM_FROWN), M(SM_SAD), M(SM_CRY), KC_TRNS, KC_TRNS, KC_TRNS,
M(SM_HEART), M(SM_KISS), 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),
[NUMB]=KEYMAP(
//left half
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_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,
//right half
KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
KC_TRNS, DE_OSX_SLSH, KC_7, KC_8, KC_9, DE_OSX_ASTR, KC_F12,
DE_OSX_SLSH, KC_4, KC_5, KC_6, DE_OSX_PLUS, DE_OSX_MINS,
KC_TRNS, DE_OSX_PERC, KC_1, KC_2, KC_3, KC_TRNS, KC_TRNS,
KC_0, KC_DOT, KC_COMM, DE_OSX_EQL, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS),
[EGOS]=KEYMAP(
//left half
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_LSFT, 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_LCTL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_F1, KC_F2,
KC_F3,
KC_SPC, KC_LCTL, KC_F4,
//right half
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_TRNS, M(M_TOGGLE_5), KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS),
};
const uint16_t PROGMEM fn_actions[] = {
};
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
static uint16_t start;
switch(id) {
case SMLY_TOG_QUOT:
//Macro: SMLY_TOG_QUOT//-----------------------
if (record->event.pressed) {
start = timer_read();
layer_state ^= (1<<SMLY);
layer_state &= (1<<SMLY);
return MACRO_NONE; } else {
layer_state ^= (1<<SMLY);
layer_state &= (1<<SMLY);
if (timer_elapsed(start) >150) {
return MACRO_NONE;
} else {
return MACRO(DOWN(KC_LSFT),TYPE(DE_OSX_HASH),UP(KC_LSFT),END);
}
}
break;
case M_TOGGLE_5:
//Macro: M_TOGGLE_5//-----------------------
if (record->event.pressed){
layer_state ^= (1<<5);
layer_state &= (1<<5);
}
break;
case TGH_NUM:
//Macro: TGH_NUM//-----------------------
if (record->event.pressed){
start = timer_read();
layer_state ^=(1<<NUMB);
layer_state &=(1<<NUMB);
} else {
if (timer_elapsed(start) > 150) {
layer_state^=(1<<NUMB);
layer_state&=(1<<NUMB);
}
}
return MACRO_NONE;
break;
case M_DE_OSX_PLUS_CTRLALT:
//Macro: M_DE_OSX_PLUS_CTRLALT//-----------------------
if (record->event.pressed) {
start = timer_read();
return MACRO(DOWN(KC_LCTRL),DOWN(KC_LALT),END);
} else {
if (timer_elapsed(start) >150) {
return MACRO(U(LCTRL),U(LALT),END);
} else {
return MACRO(UP(KC_LCTRL),UP(KC_LALT),TYPE(KC_RBRC),END);
}
}
break;
case SM_KISS:
//Macro: SM_KISS//-----------------------
if (record->event.pressed) {
return MACRO(DOWN(KC_LSFT),TYPE(KC_DOT),UP(KC_LSFT),TYPE(KC_SLSH),DOWN(KC_LSFT),TYPE(KC_RBRC),UP(KC_LSFT),END);
}
break;
case SM_FROWN:
//Macro: SM_FROWN//-----------------------
if (record->event.pressed) {
return MACRO(DOWN(KC_LSFT),TYPE(KC_DOT),UP(KC_LSFT),TYPE(KC_SLSH),DOWN(KC_LALT),TYPE(KC_8),UP(KC_LALT),END);
}
break;
case SM_CRY:
//Macro: SM_CRY//-----------------------
if (record->event.pressed) {
return MACRO(DOWN(KC_LSFT),TYPE(KC_COMM),UP(KC_LSFT),TYPE(KC_SLSH),DOWN(KC_LSFT),TYPE(KC_8),UP(KC_LSFT),END);
}
break;
case SM_SMILE:
//Macro: SM_SMILE//-----------------------
if (record->event.pressed) {
return MACRO(DOWN(KC_LSFT),TYPE(KC_DOT),UP(KC_LSFT),TYPE(KC_SLSH),DOWN(KC_LSFT),TYPE(KC_9),UP(KC_LSFT),END);
}
break;
case SM_SMIRK:
//Macro: SM_SMIRK//-----------------------
if (record->event.pressed) {
return MACRO(DOWN(KC_LSFT),TYPE(KC_COMM),UP(KC_LSFT),TYPE(KC_SLSH),DOWN(KC_LSFT),TYPE(KC_9),UP(KC_LSFT),END);
}
break;
case M_LGUI_SHFT:
//Macro: M_LGUI_SHFT//-----------------------
if (record->event.pressed){
return MACRO(DOWN(KC_LGUI),DOWN(KC_LSFT),END);
}else{
return MACRO(UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),U(LGUI),U(LSFT),END);
}
break;
case SM_HEART:
//Macro: SM_HEART//-----------------------
if (record->event.pressed) {
return MACRO(TYPE(KC_GRV),TYPE(KC_3),END);
}
break;
case TOG_HLD_MDIA:
//Macro: TOG_HLD_MDIA//-----------------------
if (record->event.pressed){
start = timer_read();
layer_state ^=(1<<MDIA);
layer_state &=(1<<MDIA);
} else {
if (timer_elapsed(start) > 150) {
layer_state^=(1<<MDIA);
layer_state&=(1<<MDIA);
}
}
return MACRO_NONE;
break;
case SM_LAUGH:
//Macro: SM_LAUGH//-----------------------
if (record->event.pressed) {
return MACRO(DOWN(KC_LSFT),TYPE(KC_DOT),UP(KC_LSFT),TYPE(KC_SLSH),DOWN(KC_LSFT),TYPE(KC_D),UP(KC_LSFT),END);
}
break;
case SM_SAD:
//Macro: SM_SAD//-----------------------
if (record->event.pressed) {
return MACRO(DOWN(KC_LSFT),TYPE(KC_DOT),UP(KC_LSFT),TYPE(KC_SLSH),DOWN(KC_LSFT),TYPE(KC_8),UP(KC_LSFT),END);
}
break;
case M_DE_OSX_CIRC_CTRLCMD:
//Macro: M_DE_OSX_CIRC_CTRLCMD//-----------------------
if (record->event.pressed) {
start = timer_read();
return MACRO(DOWN(KC_LCTRL),DOWN(KC_LGUI),END);
} else {
if (timer_elapsed(start) >150) {
return MACRO(U(LCTRL),U(LGUI),END);
} else {
return MACRO(UP(KC_LCTRL),UP(KC_LGUI),TYPE(KC_NUBS),END);
}
}
break;
case M_MEH_SH_ACUT:
//Macro: M_MEH_SH_ACUT//-----------------------
if (record->event.pressed) {
start = timer_read();
return MACRO(DOWN(KC_LCTRL),DOWN(KC_LSFT),DOWN(KC_LALT),END);
} else {
if (timer_elapsed(start) >150) {
return MACRO(U(LCTRL),U(LSFT),U(LALT),END);
} else {
return MACRO(UP(KC_LCTRL),UP(KC_LALT),TYPE(DE_OSX_ACUT),UP(KC_LSFT),END);
}
}
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 MDIA:
ergodox_right_led_2_on();
break;
case NUMB:
ergodox_right_led_3_on();
break;
case EGOS:
ergodox_right_led_1_on();
ergodox_right_led_2_on();
ergodox_right_led_3_on();
break;
default:
// none
break;
}
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 KiB

View file

@ -0,0 +1,229 @@
#include "ergodox_ez.h"
#include "debug.h"
#include "action_layer.h"
#define BASE 0 // default layer
#define SYMB 1 // symbols
#define MDIA 2 // media keys
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap 0: Basic layer
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | F5 | |Hypr+M| 6 | 7 | 8 | 9 | 0 | Mute |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | \ |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | LGui | A | S | D | F | G |------| |------| H | J | K | L | ; | ' |
* |--------+------+------+------+------+------| SYMB | | MDIA |------+------+------+------+------+--------|
* | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* |Ca/Ctl| { | ( | | | : | | - | = | ) | } |C`/Ctl|
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | LGA | LAlt | | RAlt | Play |
* ,------|------|------| |------+------+------.
* | | | Home | | PgUp | | |
* |Backsp| Esc |------| |------|Enter |Space |
* |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_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F5,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC,
KC_LGUI, KC_A, KC_S, KC_D, KC_F, KC_G,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, TG(SYMB),
F(0), KC_LCBR, KC_LPRN,KC_PIPE,KC_COLN,
LGUI(KC_LALT), KC_LALT,
KC_HOME,
KC_BSPC, KC_ESC, KC_END,
// right hand
HYPR(KC_M), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MUTE,
KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
TG(MDIA), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
KC_MINS, KC_EQL, KC_RPRN, KC_RCBR, F(1),
KC_RALT, KC_MPLY,
KC_PGUP,
KC_PGDN, KC_ENT, KC_SPC
),
/* Keymap 1: Symbol Layer
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | | ! | @ | { | } | | | | | | | | | | | F12 |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | # | $ | ( | ) | ` |------| |------| Left | Down | Up | Right| | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | % | ^ | [ | ] | ~ | | | | | | | | | |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | | | | | | | | | | |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | | | | | |
* ,------|------|------| |------+------+------.
* | | | | | | | |
* | | |------| |------| | |
* | | | | | | | |
* `--------------------' `--------------------'
*/
// 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_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F12,
KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, 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
),
/* Keymap 2: Media and mouse keys
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | | | | | | | | | | | | | | | |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | | | | | | | | | | | | | | | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | | | | | |------| |------|MsLeft|MsDown| MsUp |MsRght| | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | | | | | | | | | | | | | | |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* |VolUp |VolDn | Prev | Next | | | LClk | RClk | | | |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | | | | | |
* ,------|------|------| |------+------+------.
* | | | | | | | |
* | | |------| |------| | |
* | | | | | | | |
* `--------------------' `--------------------'
*/
// 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_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_VOLU, KC_VOLD, KC_MPRV, KC_MNXT, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS,
// right hand
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_BTN1, KC_BTN2, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_WBAK
),
};
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_MACRO_TAP(0), // FN0 - Ctrl + a (For screen/tmux)
[1] = ACTION_MACRO_TAP(1) // FN1 - Ctrl + ` (For quake style console)
};
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // this is the function signature -- just copy/paste it into your keymap file as it is.
{
switch(id) {
case 0:
if (record->event.pressed) {
if (record->tap.count) {
if (record->tap.interrupted) {
record->tap.count = 0;
// hold press action
register_code(KC_LCTL);
} else {
// tap press action
return MACRO( D(LCTL), T(A), U(LCTL), END );
}
} else {
// hold press action
register_code(KC_LCTL);
}
} else {
if (record->tap.count) {
// tap release action
} else {
// hold release action
unregister_code(KC_LCTL);
}
record->tap.count = 0;
}
break;
case 1:
if (record->event.pressed) {
if (record->tap.count) {
if (record->tap.interrupted) {
record->tap.count = 0;
// hold press action
register_code(KC_RCTL);
} else {
// tap press action
return MACRO( DOWN(KC_RCTL), TYPE(KC_GRV), UP(KC_RCTL), END );
}
} else {
// hold press action
register_code(KC_RCTL);
}
} else {
if (record->tap.count) {
// tap release action
} else {
// hold release action
unregister_code(KC_RCTL);
}
record->tap.count = 0;
}
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;
}
};

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

View file

@ -0,0 +1,11 @@
# ErgoDox EZ Plums Configuration
## Changelog
* Apr 23, 2016 (v0.1.0):
* Shortcut for iTerm2 quake style dropdown (Ctrl+`)
* Shortcut for screen/tmux (Ctrl+a)
* Shortcut for shush (Hyper+m)
* Combo modifier for LGUI + LALT
![Plums](plums.png)

View file

@ -0,0 +1,45 @@
#include "ergodox_ez.h"
#include "debug.h"
#include "action_layer.h"
#define BASE 0
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[BASE] = KEYMAP(
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F5,
KC_TAB, KC_Q, KC_W, KC_D, KC_F, KC_K, KC_BSLS,
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_F4, KC_LGUI,
/*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLD, KC_MUTE,
/*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLU,
/*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_BSPC, CTL_T(KC_ESC), KC_LALT,
//
/*-*/ KC_F6, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL,
/*-*/ KC_NO, 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_LEFT, KC_DOWN, KC_UP, KC_RGHT,
KC_MPLY, KC_MNXT,
KC_MPRV,
KC_RALT, KC_QUOT, KC_SPC
)
};
const uint16_t PROGMEM fn_actions[] = {
};
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) {
ergodox_board_led_off();
ergodox_right_led_1_off();
ergodox_right_led_2_off();
ergodox_right_led_3_off();
};
// Runs constantly in the background, in a loop.
void matrix_scan_user(void) {
};

View file

@ -0,0 +1,28 @@
# Roman's Layout
There is only one layer based on [Norman layout](https://normanlayout.info/).
Looking for multiple-layer layouts?
- [Symbols, arrows, plover, HJKL arrows](../romanzolotarev-norman-plover-osx-hjkl/)
- [Same with IJKL arrows](../romanzolotarev-norman-plover-osx/)
[![keyboard-layout](romanzolotarev-norman-osx.png)](http://www.keyboard-layout-editor.com/#/gists/9e89d54f1ea6eeeb7dab1b2d19d28195)
## 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/).
## CTRL/ESC
CTRL and ESC are frequently used in Vim.
- Tap `CTRL/ESC` to send `ESC`.
- Hold `CTRL/ESC` to use as `CTRL`.
## Activate N-rollover
- Hold left `SHIFT` and right `SHIRT` and then tap `N`.

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

View file

@ -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_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_U, KC_MS_D, KC_MS_R,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, 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_LEFT, KC_DOWN, KC_UP, 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;
}
};

View file

@ -0,0 +1,50 @@
# 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 (same fingers for arrows as HJKL on QWERTY).
Looking for IJKL arrows? [Here we
go](../romanzolotarev-norman-plover-osx/).
[![keyboard-layout](romanzolotarev-norman-plover-osx-hjkl.png)](rttp://www.keyboard-layout-editor.com/#/gists/56ffedceb0668dda47c993e7271563e0)
## 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.

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

View file

@ -5,7 +5,10 @@ There are four layers:
- **BASE** is [Norman layout](https://normanlayout.info/). - **BASE** is [Norman layout](https://normanlayout.info/).
- **SYMB** for numbers and symbols. - **SYMB** for numbers and symbols.
- **PLVR** is optimized for [Plover](http://www.openstenoproject.org). - **PLVR** is optimized for [Plover](http://www.openstenoproject.org).
- **ARRW** for navigation. - **ARRW** for navigation (same fingers for arrows as IJKL on QWERTY).
Looking for HJKL arrows? [Here we
go](../romanzolotarev-norman-plover-osx-hjkl/).
[![keyboard-layout](romanzolotarev-norman-plover-osx.png)](http://www.keyboard-layout-editor.com/#/gists/8ebcb701ecb763944417) [![keyboard-layout](romanzolotarev-norman-plover-osx.png)](http://www.keyboard-layout-editor.com/#/gists/8ebcb701ecb763944417)
@ -28,11 +31,11 @@ There are four layers:
- Tap `F2` to copy screenshot to the clipboard. - Tap `F2` to copy screenshot to the clipboard.
- Hold `SHIFT` and tap `F2` to save screenshot as a file. - 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 `F3`, `F4`, `F5`, `F6` to resize a window via [Divvy](http://mizage.com/divvy/).
- Tap `F14`, `F15` to adjust display brightness. - 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!
**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 ## CTRL/ESC

View file

@ -0,0 +1,73 @@
#include "ergodox_ez.h"
#include "debug.h"
#include "action_layer.h"
#define BASE 0
#define QWRT 1
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[BASE] = KEYMAP(
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F5,
KC_TAB, KC_Q, KC_W, KC_D, KC_F, KC_K, KC_BSLS,
KC_LCTL, 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_F4, KC_LGUI,
/*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLD, KC_MUTE,
/*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLU,
/*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_BSPC, CTL_T(KC_ESC), KC_LALT,
//
/*-*/ KC_F6, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL,
/*-*/ TG(QWRT), 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_LEFT, KC_DOWN, KC_UP, KC_RGHT,
KC_MPLY, KC_MNXT,
KC_MPRV,
KC_RALT, KC_QUOT, KC_SPC
),
[QWRT] = KEYMAP(
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_E, KC_R, KC_T, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_D, KC_F, 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_Y, KC_U, KC_I, KC_O, KC_P, KC_TRNS,
/*-*/ /*-*/ KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_TRNS,
/*-*/ KC_TRNS, KC_N, 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[] = {
};
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) {
};
// 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 QWRT:
ergodox_right_led_1_on();
break;
default:
break;
}
};

View file

@ -0,0 +1,34 @@
# Roman's Layout
There are two layers:
- **BASE** is [Norman layout](https://normanlayout.info/).
- **QWRT** is QWERTY.
[![keyboard-layout](romanzolotarev-norman-qwerty-osx.png)](http://www.keyboard-layout-editor.com/#/gists/3b236f450da474dc506a5a80390c3cc7)
## Switching
- Tap `QWRT` to toggle **QWRT**.
## LEDs
- Red: QWRT 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/).
## CTRL/ESC
Both CTRL and ESC are frequently used in Vim.
- Tap `CTRL/ESC` to send `ESC`.
- Hold `CTRL/ESC` to use as `CTRL`.
## Activate N-rollover
- Hold left `SHIFT` and right `SHIRT` and then tap `N`.

Some files were not shown because too many files have changed in this diff Show more