Merge branch 'master' of https://github.com/jackhumbert/qmk_firmware
@ -1,9 +1,77 @@
|
||||
@echo off
|
||||
setx /M path "%PATH%;C:\MinGW\bin;C:\MinGW\msys\1.0\bin" > nul 2>&1
|
||||
if NOT ["%errorlevel%"]==["0"] (
|
||||
echo FAILED. Rerun with administrator privileges.
|
||||
pause
|
||||
) else (
|
||||
echo Success!
|
||||
pause
|
||||
@SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
|
||||
@ECHO OFF
|
||||
SET CMDLINERUNSTR=%SystemRoot%\system32\cmd.exe
|
||||
|
||||
SET NEWPATH1="C:\MinGW\msys\1.0\bin"
|
||||
SET NEWPATH2="C:\MinGW\bin"
|
||||
|
||||
:: 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
|
@ -1,41 +1,63 @@
|
||||
@echo off
|
||||
setx /M test test > nul 2>&1
|
||||
if NOT ["%errorlevel%"]==["0"] (
|
||||
echo FAILED. Rerun with administrator privileges.
|
||||
pause
|
||||
exit
|
||||
@SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
|
||||
@ECHO OFF
|
||||
|
||||
SET STARTINGDIR=%CD%
|
||||
|
||||
:: Check for admin privilages
|
||||
SETX /M test test > nul 2>&1
|
||||
IF NOT ["%ERRORLEVEL%"]==["0"] (
|
||||
ECHO FAILED. Rerun with administrator privileges.
|
||||
GOTO ExitBatch
|
||||
)
|
||||
|
||||
echo ------------------------------------------
|
||||
echo Installing wget and unzip
|
||||
echo ------------------------------------------
|
||||
:: Make sure path to MinGW exists - if so, CD to it
|
||||
SET MINGWPATH="C:\MinGW\bin"
|
||||
IF NOT EXIST !MINGWPATH! (ECHO Path not found: %MINGWPATH% && GOTO ExitBatch)
|
||||
CD /D %MINGWPATH%
|
||||
|
||||
|
||||
ECHO ------------------------------------------
|
||||
ECHO Installing wget and unzip
|
||||
ECHO ------------------------------------------
|
||||
mingw-get install msys-wget-bin msys-unzip-bin
|
||||
cd \MinGW\bin
|
||||
|
||||
mkdir temp
|
||||
cd temp
|
||||
echo ------------------------------------------
|
||||
echo Installing dfu-programmer.
|
||||
echo ------------------------------------------
|
||||
MKDIR temp
|
||||
CD temp
|
||||
|
||||
ECHO ------------------------------------------
|
||||
ECHO Installing dfu-programmer.
|
||||
ECHO ------------------------------------------
|
||||
wget http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip
|
||||
unzip dfu-programmer-win-0.7.2.zip
|
||||
copy dfu-programmer.exe ..
|
||||
COPY dfu-programmer.exe ..
|
||||
|
||||
echo ------------------------------------------
|
||||
echo Downloading driver
|
||||
echo ------------------------------------------
|
||||
ECHO ------------------------------------------
|
||||
ECHO Downloading driver
|
||||
ECHO ------------------------------------------
|
||||
wget http://iweb.dl.sourceforge.net/project/libusb-win32/libusb-win32-releases/1.2.6.0/libusb-win32-bin-1.2.6.0.zip
|
||||
unzip libusb-win32-bin-1.2.6.0.zip
|
||||
cp libusb-win32-bin-1.2.6.0\bin\x86\libusb0_x86.dll ../libusb0.dll
|
||||
COPY libusb-win32-bin-1.2.6.0\bin\x86\libusb0_x86.dll ../libusb0.dll
|
||||
|
||||
ECHO ------------------------------------------
|
||||
ECHO Installing driver. Accept prompt.
|
||||
ECHO ------------------------------------------
|
||||
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)
|
||||
|
||||
ECHO FAILED. Could not find PnPUtil.exe in "%WinDir%\System32" or "%WinDir%\Sysnative".
|
||||
|
||||
:PNPUTILFOUND
|
||||
|
||||
echo ------------------------------------------
|
||||
echo Installing driver. Accept prompt.
|
||||
echo ------------------------------------------
|
||||
pnputil -i -a dfu-prog-usb-1.2.2\atmel_usb_dfu.inf
|
||||
:: Wait then delete directory
|
||||
ping -n 5 127.0.0.1 > NUL 2>&1
|
||||
CD ..
|
||||
RD /s /q temp
|
||||
|
||||
cd ..
|
||||
rm -rf temp
|
||||
ECHO ------------------------------------------
|
||||
ECHO Finished!
|
||||
|
||||
echo ------------------------------------------
|
||||
echo Finished!
|
||||
pause
|
||||
:ExitBatch
|
||||
CD /D %STARTINGDIR%
|
||||
ENDLOCAL
|
||||
PAUSE
|
||||
EXIT /b
|
@ -1,61 +0,0 @@
|
||||
|
||||
#include <avr/io.h>
|
||||
#include "backlight.h"
|
||||
|
||||
#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));
|
||||
}
|
||||
}
|
@ -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;
|
||||
};
|
@ -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;
|
||||
};
|
@ -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
|
@ -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 */
|
@ -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
|
@ -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
|
@ -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();
|
||||
}
|
@ -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
|
@ -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
|
@ -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
|
||||
}
|
||||
}
|
@ -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
|
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -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)();
|
||||
}
|
||||
};
|
@ -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
|
@ -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
|
@ -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
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -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
|
@ -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;
|
||||
}
|
@ -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)();
|
||||
}
|
||||
};
|
@ -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
|
@ -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
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
},
|
||||
"}"
|
||||
]
|
||||
]
|
After Width: | Height: | Size: 78 KiB |
@ -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;
|
||||
}
|
||||
|
||||
};
|
@ -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.
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
};
|
@ -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).
|
After Width: | Height: | Size: 814 KiB |
@ -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
|
After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 58 KiB |
After Width: | Height: | Size: 52 KiB |
@ -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;
|
||||
}
|
||||
|
||||
};
|
@ -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())
|
After Width: | Height: | Size: 70 KiB |
After Width: | Height: | Size: 88 KiB |
After Width: | Height: | Size: 74 KiB |
@ -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;
|
||||
}
|
||||
|
||||
};
|
@ -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.
|
Before Width: | Height: | Size: 732 KiB After Width: | Height: | Size: 292 KiB |
After Width: | Height: | Size: 180 KiB |
@ -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;
|
||||
}
|
||||
|
||||
};
|
||||
|
After Width: | Height: | Size: 282 KiB |
@ -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;
|
||||
}
|
||||
|
||||
};
|
After Width: | Height: | Size: 218 KiB |
@ -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)
|
@ -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) {
|
||||
};
|
@ -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`.
|
After Width: | Height: | Size: 95 KiB |
@ -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;
|
||||
}
|
||||
};
|
@ -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.
|
After Width: | Height: | Size: 128 KiB |
@ -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;
|
||||
}
|
||||
};
|
@ -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`.
|