mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-05-29 20:43:21 +00:00
Merge branch 'master' of https://github.com/qmk/qmk_firmware
This commit is contained in:
commit
09787798bc
@ -11,8 +11,8 @@ Keycodes are actually defined in [common/keycode.h](https://github.com/qmk/qmk_f
|
||||
|
||||
There are 3 standard keyboard layouts in use around the world- ANSI, ISO, and JIS. North America primarily uses ANSI, Europe and Africa primarily use ISO, and Japan uses JIS. Regions not mentioned typically use either ANSI or ISO. The keycodes corresponding to these layouts are shown here:
|
||||
|
||||
<!-- Source for this image: http://www.keyboard-layout-editor.com/#/gists/9ce023dc6caadc0cf11c88c782350a8c -->
|
||||

|
||||
<!-- Source for this image: http://www.keyboard-layout-editor.com/#/gists/070a530eedaed36a2d77f3f6fd455677 -->
|
||||

|
||||
|
||||
## Some Of My Keys Are Swapped Or Not Working
|
||||
|
||||
|
103
drivers/arm/i2c_master.c
Normal file
103
drivers/arm/i2c_master.c
Normal file
@ -0,0 +1,103 @@
|
||||
/* Copyright 2018 Jack Humbert
|
||||
* Copyright 2018 Yiancar
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
/* This library follows the convention of the AVR i2c_master library.
|
||||
* As a result addresses are expected to be already shifted (addr << 1).
|
||||
* I2CD1 is the default driver which corresponds to pins B6 and B7. This
|
||||
* can be changed.
|
||||
* Please ensure that HAL_USE_I2C is TRUE in the halconf.h file and that
|
||||
* STM32_I2C_USE_I2C1 is TRUE in the mcuconf.h file.
|
||||
*/
|
||||
|
||||
#include "i2c_master.h"
|
||||
#include <string.h>
|
||||
#include <hal.h>
|
||||
|
||||
static uint8_t i2c_address;
|
||||
|
||||
// This configures the I2C clock to 400Mhz assuming a 72Mhz clock
|
||||
// For more info : https://www.st.com/en/embedded-software/stsw-stm32126.html
|
||||
static const I2CConfig i2cconfig = {
|
||||
STM32_TIMINGR_PRESC(15U) |
|
||||
STM32_TIMINGR_SCLDEL(4U) | STM32_TIMINGR_SDADEL(2U) |
|
||||
STM32_TIMINGR_SCLH(15U) | STM32_TIMINGR_SCLL(21U),
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
void i2c_init(void)
|
||||
{
|
||||
palSetGroupMode(GPIOB,6,7, PAL_MODE_INPUT); // Try releasing special pins for a short time
|
||||
chThdSleepMilliseconds(10);
|
||||
|
||||
palSetPadMode(GPIOB, 6, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP);
|
||||
palSetPadMode(GPIOB, 7, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP);
|
||||
|
||||
//i2cInit(); //This is invoked by halInit() so no need to redo it.
|
||||
}
|
||||
|
||||
// This is usually not needed
|
||||
uint8_t i2c_start(uint8_t address)
|
||||
{
|
||||
i2c_address = address;
|
||||
i2cStart(&I2C_DRIVER, &i2cconfig);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout)
|
||||
{
|
||||
i2c_address = address;
|
||||
i2cStart(&I2C_DRIVER, &i2cconfig);
|
||||
return i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, 0, 0, MS2ST(timeout));
|
||||
}
|
||||
|
||||
uint8_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout)
|
||||
{
|
||||
i2c_address = address;
|
||||
i2cStart(&I2C_DRIVER, &i2cconfig);
|
||||
return i2cMasterReceiveTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, MS2ST(timeout));
|
||||
}
|
||||
|
||||
uint8_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)
|
||||
{
|
||||
i2c_address = devaddr;
|
||||
i2cStart(&I2C_DRIVER, &i2cconfig);
|
||||
|
||||
uint8_t complete_packet[length + 1];
|
||||
for(uint8_t i = 0; i < length; i++)
|
||||
{
|
||||
complete_packet[i+1] = data[i];
|
||||
}
|
||||
complete_packet[0] = regaddr
|
||||
|
||||
return i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), complete_packet, length + 1, 0, 0, MS2ST(timeout));
|
||||
}
|
||||
|
||||
uint8_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)
|
||||
{
|
||||
i2c_address = devaddr;
|
||||
i2cStart(&I2C_DRIVER, &i2cconfig);
|
||||
return i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), regaddr, 1, data, length, MS2ST(timeout));
|
||||
}
|
||||
|
||||
// This is usually not needed. It releases the driver to allow pins to become GPIO again.
|
||||
uint8_t i2c_stop(uint16_t timeout)
|
||||
{
|
||||
i2c_address = address;
|
||||
i2cStop(&I2C_DRIVER);
|
||||
return 0;
|
||||
}
|
39
drivers/arm/i2c_master.h
Normal file
39
drivers/arm/i2c_master.h
Normal file
@ -0,0 +1,39 @@
|
||||
/* Copyright 2018 Jack Humbert
|
||||
* Copyright 2018 Yiancar
|
||||
*
|
||||
* This program is free sofare: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Sofare 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/>.
|
||||
*/
|
||||
|
||||
/* This library follows the convention of the AVR i2c_master library.
|
||||
* As a result addresses are expected to be already shifted (addr << 1).
|
||||
* I2CD1 is the default driver which corresponds to pins B6 and B7. This
|
||||
* can be changed.
|
||||
* Please ensure that HAL_USE_I2C is TRUE in the halconf.h file and that
|
||||
* STM32_I2C_USE_I2C1 is TRUE in the mcuconf.h file.
|
||||
*/
|
||||
|
||||
#include "ch.h"
|
||||
#include <hal.h>
|
||||
|
||||
#ifndef I2C_DRIVER
|
||||
#define I2C_DRIVER I2CD1
|
||||
#endif
|
||||
|
||||
void i2c_init(void);
|
||||
uint8_t i2c_start(uint8_t address);
|
||||
uint8_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);
|
||||
uint8_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);
|
||||
uint8_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);
|
||||
uint8_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);
|
||||
void i2c_stop(void);
|
@ -1,262 +0,0 @@
|
||||
/* Copyright 2017 Jason Williams
|
||||
* Copyright 2018 Jack Humbert
|
||||
*
|
||||
* 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 "is31fl3731.h"
|
||||
#include <avr/interrupt.h>
|
||||
#include <avr/io.h>
|
||||
#include <util/delay.h>
|
||||
#include <string.h>
|
||||
#include "i2c_master.h"
|
||||
#include "progmem.h"
|
||||
|
||||
// This is a 7-bit address, that gets left-shifted and bit 0
|
||||
// set to 0 for write, 1 for read (as per I2C protocol)
|
||||
// The address will vary depending on your wiring:
|
||||
// 0b1110100 AD <-> GND
|
||||
// 0b1110111 AD <-> VCC
|
||||
// 0b1110101 AD <-> SCL
|
||||
// 0b1110110 AD <-> SDA
|
||||
#define ISSI_ADDR_DEFAULT 0x74
|
||||
|
||||
#define ISSI_REG_CONFIG 0x00
|
||||
#define ISSI_REG_CONFIG_PICTUREMODE 0x00
|
||||
#define ISSI_REG_CONFIG_AUTOPLAYMODE 0x08
|
||||
#define ISSI_REG_CONFIG_AUDIOPLAYMODE 0x18
|
||||
|
||||
#define ISSI_CONF_PICTUREMODE 0x00
|
||||
#define ISSI_CONF_AUTOFRAMEMODE 0x04
|
||||
#define ISSI_CONF_AUDIOMODE 0x08
|
||||
|
||||
#define ISSI_REG_PICTUREFRAME 0x01
|
||||
|
||||
#define ISSI_REG_SHUTDOWN 0x0A
|
||||
#define ISSI_REG_AUDIOSYNC 0x06
|
||||
|
||||
#define ISSI_COMMANDREGISTER 0xFD
|
||||
#define ISSI_BANK_FUNCTIONREG 0x0B // helpfully called 'page nine'
|
||||
|
||||
#ifndef ISSI_TIMEOUT
|
||||
#define ISSI_TIMEOUT 100
|
||||
#endif
|
||||
|
||||
#ifndef ISSI_PERSISTENCE
|
||||
#define ISSI_PERSISTENCE 0
|
||||
#endif
|
||||
|
||||
// Transfer buffer for TWITransmitData()
|
||||
uint8_t g_twi_transfer_buffer[20];
|
||||
|
||||
// These buffers match the IS31FL3731 PWM registers 0x24-0xB3.
|
||||
// Storing them like this is optimal for I2C transfers to the registers.
|
||||
// We could optimize this and take out the unused registers from these
|
||||
// buffers and the transfers in IS31FL3731_write_pwm_buffer() but it's
|
||||
// probably not worth the extra complexity.
|
||||
uint8_t g_pwm_buffer[DRIVER_COUNT][144];
|
||||
bool g_pwm_buffer_update_required = false;
|
||||
|
||||
uint8_t g_led_control_registers[DRIVER_COUNT][18] = { { 0 }, { 0 } };
|
||||
bool g_led_control_registers_update_required = false;
|
||||
|
||||
// This is the bit pattern in the LED control registers
|
||||
// (for matrix A, add one to register for matrix B)
|
||||
//
|
||||
// reg - b7 b6 b5 b4 b3 b2 b1 b0
|
||||
// 0x00 - R08,R07,R06,R05,R04,R03,R02,R01
|
||||
// 0x02 - G08,G07,G06,G05,G04,G03,G02,R00
|
||||
// 0x04 - B08,B07,B06,B05,B04,B03,G01,G00
|
||||
// 0x06 - - , - , - , - , - ,B02,B01,B00
|
||||
// 0x08 - - , - , - , - , - , - , - , -
|
||||
// 0x0A - B17,B16,B15, - , - , - , - , -
|
||||
// 0x0C - G17,G16,B14,B13,B12,B11,B10,B09
|
||||
// 0x0E - R17,G15,G14,G13,G12,G11,G10,G09
|
||||
// 0x10 - R16,R15,R14,R13,R12,R11,R10,R09
|
||||
|
||||
|
||||
void IS31FL3731_write_register( uint8_t addr, uint8_t reg, uint8_t data )
|
||||
{
|
||||
g_twi_transfer_buffer[0] = reg;
|
||||
g_twi_transfer_buffer[1] = data;
|
||||
|
||||
#if ISSI_PERSISTENCE > 0
|
||||
for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) {
|
||||
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) == 0)
|
||||
break;
|
||||
}
|
||||
#else
|
||||
i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT);
|
||||
#endif
|
||||
}
|
||||
|
||||
void IS31FL3731_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer )
|
||||
{
|
||||
// assumes bank is already selected
|
||||
|
||||
// transmit PWM registers in 9 transfers of 16 bytes
|
||||
// g_twi_transfer_buffer[] is 20 bytes
|
||||
|
||||
// iterate over the pwm_buffer contents at 16 byte intervals
|
||||
for ( int i = 0; i < 144; i += 16 ) {
|
||||
// set the first register, e.g. 0x24, 0x34, 0x44, etc.
|
||||
g_twi_transfer_buffer[0] = 0x24 + i;
|
||||
// copy the data from i to i+15
|
||||
// device will auto-increment register for data after the first byte
|
||||
// thus this sets registers 0x24-0x33, 0x34-0x43, etc. in one transfer
|
||||
for ( int j = 0; j < 16; j++ ) {
|
||||
g_twi_transfer_buffer[1 + j] = pwm_buffer[i + j];
|
||||
}
|
||||
|
||||
#if ISSI_PERSISTENCE > 0
|
||||
for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) {
|
||||
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) == 0)
|
||||
break;
|
||||
}
|
||||
#else
|
||||
i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void IS31FL3731_init( uint8_t addr )
|
||||
{
|
||||
// In order to avoid the LEDs being driven with garbage data
|
||||
// in the LED driver's PWM registers, first enable software shutdown,
|
||||
// then set up the mode and other settings, clear the PWM registers,
|
||||
// then disable software shutdown.
|
||||
|
||||
// select "function register" bank
|
||||
IS31FL3731_write_register( addr, ISSI_COMMANDREGISTER, ISSI_BANK_FUNCTIONREG );
|
||||
|
||||
// enable software shutdown
|
||||
IS31FL3731_write_register( addr, ISSI_REG_SHUTDOWN, 0x00 );
|
||||
// this delay was copied from other drivers, might not be needed
|
||||
_delay_ms( 10 );
|
||||
|
||||
// picture mode
|
||||
IS31FL3731_write_register( addr, ISSI_REG_CONFIG, ISSI_REG_CONFIG_PICTUREMODE );
|
||||
// display frame 0
|
||||
IS31FL3731_write_register( addr, ISSI_REG_PICTUREFRAME, 0x00 );
|
||||
// audio sync off
|
||||
IS31FL3731_write_register( addr, ISSI_REG_AUDIOSYNC, 0x00 );
|
||||
|
||||
// select bank 0
|
||||
IS31FL3731_write_register( addr, ISSI_COMMANDREGISTER, 0 );
|
||||
|
||||
// turn off all LEDs in the LED control register
|
||||
for ( int i = 0x00; i <= 0x11; i++ )
|
||||
{
|
||||
IS31FL3731_write_register( addr, i, 0x00 );
|
||||
}
|
||||
|
||||
// turn off all LEDs in the blink control register (not really needed)
|
||||
for ( int i = 0x12; i <= 0x23; i++ )
|
||||
{
|
||||
IS31FL3731_write_register( addr, i, 0x00 );
|
||||
}
|
||||
|
||||
// set PWM on all LEDs to 0
|
||||
for ( int i = 0x24; i <= 0xB3; i++ )
|
||||
{
|
||||
IS31FL3731_write_register( addr, i, 0x00 );
|
||||
}
|
||||
|
||||
// select "function register" bank
|
||||
IS31FL3731_write_register( addr, ISSI_COMMANDREGISTER, ISSI_BANK_FUNCTIONREG );
|
||||
|
||||
// disable software shutdown
|
||||
IS31FL3731_write_register( addr, ISSI_REG_SHUTDOWN, 0x01 );
|
||||
|
||||
// select bank 0 and leave it selected.
|
||||
// most usage after initialization is just writing PWM buffers in bank 0
|
||||
// as there's not much point in double-buffering
|
||||
IS31FL3731_write_register( addr, ISSI_COMMANDREGISTER, 0 );
|
||||
|
||||
}
|
||||
|
||||
void IS31FL3731_set_color( int index, uint8_t red, uint8_t green, uint8_t blue )
|
||||
{
|
||||
if ( index >= 0 && index < DRIVER_LED_TOTAL ) {
|
||||
is31_led led = g_is31_leds[index];
|
||||
|
||||
// Subtract 0x24 to get the second index of g_pwm_buffer
|
||||
g_pwm_buffer[led.driver][led.r - 0x24] = red;
|
||||
g_pwm_buffer[led.driver][led.g - 0x24] = green;
|
||||
g_pwm_buffer[led.driver][led.b - 0x24] = blue;
|
||||
g_pwm_buffer_update_required = true;
|
||||
}
|
||||
}
|
||||
|
||||
void IS31FL3731_set_color_all( uint8_t red, uint8_t green, uint8_t blue )
|
||||
{
|
||||
for ( int i = 0; i < DRIVER_LED_TOTAL; i++ )
|
||||
{
|
||||
IS31FL3731_set_color( i, red, green, blue );
|
||||
}
|
||||
}
|
||||
|
||||
void IS31FL3731_set_led_control_register( uint8_t index, bool red, bool green, bool blue )
|
||||
{
|
||||
is31_led led = g_is31_leds[index];
|
||||
|
||||
uint8_t control_register_r = (led.r - 0x24) / 8;
|
||||
uint8_t control_register_g = (led.g - 0x24) / 8;
|
||||
uint8_t control_register_b = (led.b - 0x24) / 8;
|
||||
uint8_t bit_r = (led.r - 0x24) % 8;
|
||||
uint8_t bit_g = (led.g - 0x24) % 8;
|
||||
uint8_t bit_b = (led.b - 0x24) % 8;
|
||||
|
||||
if ( red ) {
|
||||
g_led_control_registers[led.driver][control_register_r] |= (1 << bit_r);
|
||||
} else {
|
||||
g_led_control_registers[led.driver][control_register_r] &= ~(1 << bit_r);
|
||||
}
|
||||
if ( green ) {
|
||||
g_led_control_registers[led.driver][control_register_g] |= (1 << bit_g);
|
||||
} else {
|
||||
g_led_control_registers[led.driver][control_register_g] &= ~(1 << bit_g);
|
||||
}
|
||||
if ( blue ) {
|
||||
g_led_control_registers[led.driver][control_register_b] |= (1 << bit_b);
|
||||
} else {
|
||||
g_led_control_registers[led.driver][control_register_b] &= ~(1 << bit_b);
|
||||
}
|
||||
|
||||
g_led_control_registers_update_required = true;
|
||||
|
||||
}
|
||||
|
||||
void IS31FL3731_update_pwm_buffers( uint8_t addr1, uint8_t addr2 )
|
||||
{
|
||||
if ( g_pwm_buffer_update_required )
|
||||
{
|
||||
IS31FL3731_write_pwm_buffer( addr1, g_pwm_buffer[0] );
|
||||
IS31FL3731_write_pwm_buffer( addr2, g_pwm_buffer[1] );
|
||||
}
|
||||
g_pwm_buffer_update_required = false;
|
||||
}
|
||||
|
||||
void IS31FL3731_update_led_control_registers( uint8_t addr1, uint8_t addr2 )
|
||||
{
|
||||
if ( g_led_control_registers_update_required )
|
||||
{
|
||||
for ( int i=0; i<18; i++ )
|
||||
{
|
||||
IS31FL3731_write_register(addr1, i, g_led_control_registers[0][i] );
|
||||
IS31FL3731_write_register(addr2, i, g_led_control_registers[1][i] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
271
drivers/is31fl3731.c
Normal file
271
drivers/is31fl3731.c
Normal file
@ -0,0 +1,271 @@
|
||||
/* Copyright 2017 Jason Williams
|
||||
* Copyright 2018 Jack Humbert
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#ifdef __AVR__
|
||||
#include <avr/interrupt.h>
|
||||
#include <avr/io.h>
|
||||
#include <util/delay.h>
|
||||
#else
|
||||
#include "wait.h"
|
||||
#endif
|
||||
|
||||
#include "is31fl3731.h"
|
||||
#include <string.h>
|
||||
#include "i2c_master.h"
|
||||
#include "progmem.h"
|
||||
|
||||
// This is a 7-bit address, that gets left-shifted and bit 0
|
||||
// set to 0 for write, 1 for read (as per I2C protocol)
|
||||
// The address will vary depending on your wiring:
|
||||
// 0b1110100 AD <-> GND
|
||||
// 0b1110111 AD <-> VCC
|
||||
// 0b1110101 AD <-> SCL
|
||||
// 0b1110110 AD <-> SDA
|
||||
#define ISSI_ADDR_DEFAULT 0x74
|
||||
|
||||
#define ISSI_REG_CONFIG 0x00
|
||||
#define ISSI_REG_CONFIG_PICTUREMODE 0x00
|
||||
#define ISSI_REG_CONFIG_AUTOPLAYMODE 0x08
|
||||
#define ISSI_REG_CONFIG_AUDIOPLAYMODE 0x18
|
||||
|
||||
#define ISSI_CONF_PICTUREMODE 0x00
|
||||
#define ISSI_CONF_AUTOFRAMEMODE 0x04
|
||||
#define ISSI_CONF_AUDIOMODE 0x08
|
||||
|
||||
#define ISSI_REG_PICTUREFRAME 0x01
|
||||
|
||||
#define ISSI_REG_SHUTDOWN 0x0A
|
||||
#define ISSI_REG_AUDIOSYNC 0x06
|
||||
|
||||
#define ISSI_COMMANDREGISTER 0xFD
|
||||
#define ISSI_BANK_FUNCTIONREG 0x0B // helpfully called 'page nine'
|
||||
|
||||
#ifndef ISSI_TIMEOUT
|
||||
#define ISSI_TIMEOUT 100
|
||||
#endif
|
||||
|
||||
#ifndef ISSI_PERSISTENCE
|
||||
#define ISSI_PERSISTENCE 0
|
||||
#endif
|
||||
|
||||
// Transfer buffer for TWITransmitData()
|
||||
uint8_t g_twi_transfer_buffer[20];
|
||||
|
||||
// These buffers match the IS31FL3731 PWM registers 0x24-0xB3.
|
||||
// Storing them like this is optimal for I2C transfers to the registers.
|
||||
// We could optimize this and take out the unused registers from these
|
||||
// buffers and the transfers in IS31FL3731_write_pwm_buffer() but it's
|
||||
// probably not worth the extra complexity.
|
||||
uint8_t g_pwm_buffer[DRIVER_COUNT][144];
|
||||
bool g_pwm_buffer_update_required = false;
|
||||
|
||||
uint8_t g_led_control_registers[DRIVER_COUNT][18] = { { 0 }, { 0 } };
|
||||
bool g_led_control_registers_update_required = false;
|
||||
|
||||
// This is the bit pattern in the LED control registers
|
||||
// (for matrix A, add one to register for matrix B)
|
||||
//
|
||||
// reg - b7 b6 b5 b4 b3 b2 b1 b0
|
||||
// 0x00 - R08,R07,R06,R05,R04,R03,R02,R01
|
||||
// 0x02 - G08,G07,G06,G05,G04,G03,G02,R00
|
||||
// 0x04 - B08,B07,B06,B05,B04,B03,G01,G00
|
||||
// 0x06 - - , - , - , - , - ,B02,B01,B00
|
||||
// 0x08 - - , - , - , - , - , - , - , -
|
||||
// 0x0A - B17,B16,B15, - , - , - , - , -
|
||||
// 0x0C - G17,G16,B14,B13,B12,B11,B10,B09
|
||||
// 0x0E - R17,G15,G14,G13,G12,G11,G10,G09
|
||||
// 0x10 - R16,R15,R14,R13,R12,R11,R10,R09
|
||||
|
||||
|
||||
void IS31_write_register( uint8_t addr, uint8_t reg, uint8_t data )
|
||||
{
|
||||
g_twi_transfer_buffer[0] = reg;
|
||||
g_twi_transfer_buffer[1] = data;
|
||||
|
||||
#if ISSI_PERSISTENCE > 0
|
||||
for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) {
|
||||
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) == 0)
|
||||
break;
|
||||
}
|
||||
#else
|
||||
i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT);
|
||||
#endif
|
||||
}
|
||||
|
||||
void IS31_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer )
|
||||
{
|
||||
// assumes bank is already selected
|
||||
|
||||
// transmit PWM registers in 9 transfers of 16 bytes
|
||||
// g_twi_transfer_buffer[] is 20 bytes
|
||||
|
||||
// iterate over the pwm_buffer contents at 16 byte intervals
|
||||
for ( int i = 0; i < 144; i += 16 ) {
|
||||
// set the first register, e.g. 0x24, 0x34, 0x44, etc.
|
||||
g_twi_transfer_buffer[0] = 0x24 + i;
|
||||
// copy the data from i to i+15
|
||||
// device will auto-increment register for data after the first byte
|
||||
// thus this sets registers 0x24-0x33, 0x34-0x43, etc. in one transfer
|
||||
for ( int j = 0; j < 16; j++ ) {
|
||||
g_twi_transfer_buffer[1 + j] = pwm_buffer[i + j];
|
||||
}
|
||||
|
||||
#if ISSI_PERSISTENCE > 0
|
||||
for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) {
|
||||
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) == 0)
|
||||
break;
|
||||
}
|
||||
#else
|
||||
i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void IS31_init( uint8_t addr )
|
||||
{
|
||||
// In order to avoid the LEDs being driven with garbage data
|
||||
// in the LED driver's PWM registers, first enable software shutdown,
|
||||
// then set up the mode and other settings, clear the PWM registers,
|
||||
// then disable software shutdown.
|
||||
|
||||
// select "function register" bank
|
||||
IS31_write_register( addr, ISSI_COMMANDREGISTER, ISSI_BANK_FUNCTIONREG );
|
||||
|
||||
// enable software shutdown
|
||||
IS31_write_register( addr, ISSI_REG_SHUTDOWN, 0x00 );
|
||||
// this delay was copied from other drivers, might not be needed
|
||||
#ifdef __AVR__
|
||||
_delay_ms( 10 );
|
||||
#else
|
||||
wait_ms(10);
|
||||
#endif
|
||||
|
||||
// picture mode
|
||||
IS31_write_register( addr, ISSI_REG_CONFIG, ISSI_REG_CONFIG_PICTUREMODE );
|
||||
// display frame 0
|
||||
IS31_write_register( addr, ISSI_REG_PICTUREFRAME, 0x00 );
|
||||
// audio sync off
|
||||
IS31_write_register( addr, ISSI_REG_AUDIOSYNC, 0x00 );
|
||||
|
||||
// select bank 0
|
||||
IS31_write_register( addr, ISSI_COMMANDREGISTER, 0 );
|
||||
|
||||
// turn off all LEDs in the LED control register
|
||||
for ( int i = 0x00; i <= 0x11; i++ )
|
||||
{
|
||||
IS31_write_register( addr, i, 0x00 );
|
||||
}
|
||||
|
||||
// turn off all LEDs in the blink control register (not really needed)
|
||||
for ( int i = 0x12; i <= 0x23; i++ )
|
||||
{
|
||||
IS31_write_register( addr, i, 0x00 );
|
||||
}
|
||||
|
||||
// set PWM on all LEDs to 0
|
||||
for ( int i = 0x24; i <= 0xB3; i++ )
|
||||
{
|
||||
IS31_write_register( addr, i, 0x00 );
|
||||
}
|
||||
|
||||
// select "function register" bank
|
||||
IS31_write_register( addr, ISSI_COMMANDREGISTER, ISSI_BANK_FUNCTIONREG );
|
||||
|
||||
// disable software shutdown
|
||||
IS31_write_register( addr, ISSI_REG_SHUTDOWN, 0x01 );
|
||||
|
||||
// select bank 0 and leave it selected.
|
||||
// most usage after initialization is just writing PWM buffers in bank 0
|
||||
// as there's not much point in double-buffering
|
||||
IS31_write_register( addr, ISSI_COMMANDREGISTER, 0 );
|
||||
|
||||
}
|
||||
|
||||
void IS31_set_color( int index, uint8_t red, uint8_t green, uint8_t blue )
|
||||
{
|
||||
if ( index >= 0 && index < DRIVER_LED_TOTAL ) {
|
||||
is31_led led = g_is31_leds[index];
|
||||
|
||||
// Subtract 0x24 to get the second index of g_pwm_buffer
|
||||
g_pwm_buffer[led.driver][led.r - 0x24] = red;
|
||||
g_pwm_buffer[led.driver][led.g - 0x24] = green;
|
||||
g_pwm_buffer[led.driver][led.b - 0x24] = blue;
|
||||
g_pwm_buffer_update_required = true;
|
||||
}
|
||||
}
|
||||
|
||||
void IS31_set_color_all( uint8_t red, uint8_t green, uint8_t blue )
|
||||
{
|
||||
for ( int i = 0; i < DRIVER_LED_TOTAL; i++ )
|
||||
{
|
||||
IS31_set_color( i, red, green, blue );
|
||||
}
|
||||
}
|
||||
|
||||
void IS31_set_led_control_register( uint8_t index, bool red, bool green, bool blue )
|
||||
{
|
||||
is31_led led = g_is31_leds[index];
|
||||
|
||||
uint8_t control_register_r = (led.r - 0x24) / 8;
|
||||
uint8_t control_register_g = (led.g - 0x24) / 8;
|
||||
uint8_t control_register_b = (led.b - 0x24) / 8;
|
||||
uint8_t bit_r = (led.r - 0x24) % 8;
|
||||
uint8_t bit_g = (led.g - 0x24) % 8;
|
||||
uint8_t bit_b = (led.b - 0x24) % 8;
|
||||
|
||||
if ( red ) {
|
||||
g_led_control_registers[led.driver][control_register_r] |= (1 << bit_r);
|
||||
} else {
|
||||
g_led_control_registers[led.driver][control_register_r] &= ~(1 << bit_r);
|
||||
}
|
||||
if ( green ) {
|
||||
g_led_control_registers[led.driver][control_register_g] |= (1 << bit_g);
|
||||
} else {
|
||||
g_led_control_registers[led.driver][control_register_g] &= ~(1 << bit_g);
|
||||
}
|
||||
if ( blue ) {
|
||||
g_led_control_registers[led.driver][control_register_b] |= (1 << bit_b);
|
||||
} else {
|
||||
g_led_control_registers[led.driver][control_register_b] &= ~(1 << bit_b);
|
||||
}
|
||||
|
||||
g_led_control_registers_update_required = true;
|
||||
|
||||
}
|
||||
|
||||
void IS31_update_pwm_buffers( uint8_t addr1, uint8_t addr2 )
|
||||
{
|
||||
if ( g_pwm_buffer_update_required )
|
||||
{
|
||||
IS31_write_pwm_buffer( addr1, g_pwm_buffer[0] );
|
||||
IS31_write_pwm_buffer( addr2, g_pwm_buffer[1] );
|
||||
}
|
||||
g_pwm_buffer_update_required = false;
|
||||
}
|
||||
|
||||
void IS31_update_led_control_registers( uint8_t addr1, uint8_t addr2 )
|
||||
{
|
||||
if ( g_led_control_registers_update_required )
|
||||
{
|
||||
for ( int i=0; i<18; i++ )
|
||||
{
|
||||
IS31_write_register(addr1, i, g_led_control_registers[0][i] );
|
||||
IS31_write_register(addr2, i, g_led_control_registers[1][i] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include <stdbool.h>
|
||||
|
||||
typedef struct is31_led {
|
||||
uint8_t driver:2;
|
||||
uint8_t driver:2;
|
||||
uint8_t r;
|
||||
uint8_t g;
|
||||
uint8_t b;
|
||||
@ -31,21 +31,21 @@ typedef struct is31_led {
|
||||
|
||||
extern const is31_led g_is31_leds[DRIVER_LED_TOTAL];
|
||||
|
||||
void IS31FL3731_init( uint8_t addr );
|
||||
void IS31FL3731_write_register( uint8_t addr, uint8_t reg, uint8_t data );
|
||||
void IS31FL3731_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer );
|
||||
void IS31_init( uint8_t addr );
|
||||
void IS31_write_register( uint8_t addr, uint8_t reg, uint8_t data );
|
||||
void IS31_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer );
|
||||
|
||||
void IS31FL3731_set_color( int index, uint8_t red, uint8_t green, uint8_t blue );
|
||||
void IS31FL3731_set_color_all( uint8_t red, uint8_t green, uint8_t blue );
|
||||
void IS31_set_color( int index, uint8_t red, uint8_t green, uint8_t blue );
|
||||
void IS31_set_color_all( uint8_t red, uint8_t green, uint8_t blue );
|
||||
|
||||
void IS31FL3731_set_led_control_register( uint8_t index, bool red, bool green, bool blue );
|
||||
void IS31_set_led_control_register( uint8_t index, bool red, bool green, bool blue );
|
||||
|
||||
// This should not be called from an interrupt
|
||||
// (eg. from a timer interrupt).
|
||||
// Call this while idle (in between matrix scans).
|
||||
// If the buffer is dirty, it will update the driver with the buffer.
|
||||
void IS31FL3731_update_pwm_buffers( uint8_t addr1, uint8_t addr2 );
|
||||
void IS31FL3731_update_led_control_registers( uint8_t addr1, uint8_t addr2 );
|
||||
void IS31_update_pwm_buffers( uint8_t addr1, uint8_t addr2 );
|
||||
void IS31_update_led_control_registers( uint8_t addr1, uint8_t addr2 );
|
||||
|
||||
#define C1_1 0x24
|
||||
#define C1_2 0x25
|
@ -1,94 +1,11 @@
|
||||
/*
|
||||
Config file - Atreus QMK with replicaJunction layout
|
||||
#pragma once
|
||||
|
||||
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.
|
||||
// Layer definitions
|
||||
|
||||
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 Technomancy
|
||||
#define PRODUCT Atreus
|
||||
#define DESCRIPTION q.m.k. keyboard firmware for Atreus
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 4
|
||||
#define MATRIX_COLS 11
|
||||
|
||||
// Change this to how you wired your keyboard
|
||||
// COLS: Left to right, ROWS: Top to bottom
|
||||
#if defined(ATREUS_ASTAR)
|
||||
# define MATRIX_ROW_PINS { D0, D1, D3, D2 }
|
||||
# define MATRIX_COL_PINS { D7, C6, B5, B4, E6, D4, B6, F6, F7, D6, B7 }
|
||||
# define UNUSED_PINS
|
||||
#elif defined(ATREUS_TEENSY2)
|
||||
# define MATRIX_ROW_PINS { D0, D1, D2, D3 }
|
||||
# define MATRIX_COL_PINS { F6, F5, F4, B7, B6, B5, B4, B3, B2, B1, B0 }
|
||||
# define UNUSED_PINS
|
||||
#endif
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
/* define if matrix has ghost */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* number of backlight levels */
|
||||
//#define BACKLIGHT_LEVELS 3
|
||||
|
||||
/* Set 0 if debouncing isn't needed */
|
||||
// Default: 5
|
||||
#define DEBOUNCING_DELAY 6
|
||||
|
||||
// I don't have any locking keys, so I don't need these features
|
||||
|
||||
/* 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)) \
|
||||
)
|
||||
|
||||
/* Prevent modifiers from sticking when switching layers */
|
||||
#define PREVENT_STUCK_MODIFIERS
|
||||
|
||||
/*
|
||||
* 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
|
||||
#define L_COLEMAK 0
|
||||
#define L_NUM 1
|
||||
#define L_EXTEND 2
|
||||
#define L_FUNC 3
|
||||
#define L_LL_R 4
|
||||
#define L_LL_E 5
|
||||
#define L_LL_I 6
|
||||
|
@ -1,212 +1,78 @@
|
||||
/*
|
||||
* Keyboard: Atreus
|
||||
* Keymap: replicaJunction
|
||||
* Version: 0.4
|
||||
*
|
||||
* This keymap is designed to complement my Ergodox keyboard layout, found in keyboards/ergodox_ez.
|
||||
* The Atreus keyboard is a 40% board whose design was heavily influenced by the Ergodox. I now
|
||||
* have both keyboards, so I've designed these layouts in an effort to make switching between the
|
||||
* two as easy as possible.
|
||||
*
|
||||
* Clearly, the Atreus is the limiting factor in this equation, so I've taken heavy advantage of
|
||||
* function and dual-role keys.
|
||||
*
|
||||
* The default key layout in this keymap is Colemak-ModDH. Information on that layout can be found
|
||||
* here: https://colemakmods.github.io/mod-dh/
|
||||
* Version: 2.1
|
||||
*/
|
||||
|
||||
#include QMK_KEYBOARD_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.
|
||||
|
||||
// Note that whatever is set as layer 0 will be the default layer of the keyboard.
|
||||
|
||||
#define _CO 0 // Colemak
|
||||
#define _QW 1 // QWERTY
|
||||
#define _GA 2 // Gaming
|
||||
#define _EX 3 // Extend
|
||||
#define _NU 4 // Numpad
|
||||
#define _FN 5 // Function
|
||||
|
||||
// Some quick aliases, just to make it look pretty
|
||||
#define _______ KC_TRNS
|
||||
#define KCX_CA LCTL(KC_LALT)
|
||||
#define KCX_CS LCTL(KC_LSFT)
|
||||
#define KCX_CSA LCTL(LSFT(KC_LALT))
|
||||
#define KCX_LST LSFT(KC_TAB)
|
||||
#define KX_COPY LCTL(KC_C)
|
||||
#define KX_CUT LCTL(KC_X)
|
||||
#define KX_PAST LCTL(KC_V)
|
||||
#define KX_UNDO LCTL(KC_Z)
|
||||
|
||||
#define _USER 0 // User macro
|
||||
|
||||
; // This doesn't do anything. It's just for VSCode because its syntax highlighting is weird for the above #define statements.
|
||||
#include "replicaJunction.h"
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/*
|
||||
* Colemak-ModDH
|
||||
*
|
||||
* ,----------------------------------. ,----------------------------------.
|
||||
* | Q | W | F | P | B | | J | L | U | Y | ; |
|
||||
* +------+------+------+------+------| +------+------+------+------+------|
|
||||
* | A | R | S | T | G | | M | N | E | I | O |
|
||||
* +------+------+------+------+------| +------+------+------+------+------|
|
||||
* |Z Shft| X | C | D | V | ,------. ,------. | K | H | , | . |/ Shft|
|
||||
* +------+------+------+------+------| | Ctrl | | Alt | +------+------+------+------+------|
|
||||
* | Esc | Gui | Tab | _FN | Bksp | | Del | | Enter| |Sp/_NU| _EX | - | ' | = |
|
||||
* `----------------------------------' `------' `------' `----------------------------------'
|
||||
*
|
||||
*/
|
||||
[_CO] = LAYOUT(
|
||||
KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN,
|
||||
KC_A, KC_R, KC_S, KC_T, KC_G, KC_M, KC_N, KC_E, KC_I, KC_O,
|
||||
SFT_T(KC_Z), KC_X, KC_C, KC_D, KC_V, KC_K, KC_H, KC_COMM, KC_DOT, SFT_T(KC_SLSH),
|
||||
KC_ESC, KC_LGUI, KC_TAB, MO(_FN), KC_BSPC, CTL_T(KC_DEL), ALT_T(KC_ENT), LT(_NU, KC_SPC), MO(_EX), KC_MINS, KC_QUOT, KC_EQL
|
||||
),
|
||||
|
||||
/*
|
||||
* QWERTY
|
||||
*
|
||||
* ,----------------------------------. ,----------------------------------.
|
||||
* | Q | W | E | R | T | | Y | U | I | O | P |
|
||||
* +------+------+------+------+------| +------+------+------+------+------|
|
||||
* | A | S | D | F | G | | H | J | K | L | ; |
|
||||
* +------+------+------+------+------| +------+------+------+------+------|
|
||||
* |Z Shft| X | C | V | B | ,------. ,------. | N | M | , | . |/ Shft|
|
||||
* +------+------+------+------+------| | Ctrl | | Alt | +------+------+------+------+------|
|
||||
* | Esc | Gui | Tab | _FN | Bksp | | Del | | Enter| |Sp/_NU| _EX | - | ' | = |
|
||||
* `----------------------------------' `------' `------' `----------------------------------'
|
||||
*
|
||||
*/
|
||||
[_QW] = LAYOUT( /* Qwerty */
|
||||
KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,
|
||||
KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,
|
||||
SFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, SFT_T(KC_SLSH),
|
||||
KC_ESC, KC_LGUI, KC_TAB, MO(_FN), KC_BSPC, CTL_T(KC_DEL), ALT_T(KC_ENT), LT(_NU, KC_SPC), MO(_EX), KC_MINS, KC_QUOT, KC_EQL
|
||||
),
|
||||
[L_COLEMAK] = LAYOUT(
|
||||
KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN,
|
||||
KC_A, KC_R_LT, KC_S_LT, KC_T, KC_G, KC_M, KC_N, KC_E_LT, KC_I_LT, KC_O,
|
||||
KX_Z_MT, KX_X_MT, KX_C_MT, KX_D_MT, KC_V, KC_K, KX_H_MT, KX_COMT, KX_DOMT, KX_SLMT,
|
||||
TD_LAYR, KC_LGUI, KC_TAB, KC_LSFT, KX_BKNM, KX_DCTL, KX_NALT, KX_SPAC, KC_RSFT, KC_MINS, KC_QUOT, KC_EQL
|
||||
)
|
||||
,
|
||||
|
||||
/*
|
||||
* Extend
|
||||
*
|
||||
* Ctrl+` is a keyboard shortcut for the program ConEmu, which brings up a dropdown console window.
|
||||
*
|
||||
* Also note that some dual-role keys are overridden here with their modifiers
|
||||
*
|
||||
* ,----------------------------------. ,----------------------------------.
|
||||
* | | | | |Ctrl `| | PgUp | Home | Up | End | Del |
|
||||
* +------+------+------+------+------| +------+------+------+------+------|
|
||||
* | Gui | Shift| Alt | Ctrl | | | PgDn | Left | Down | Right| Bksp |
|
||||
* +------+------+------+------+------| +------+------+------+------+------|
|
||||
* | Shift| Cut | Copy | | Paste| ,------. ,------. | | ^Tab | Tab | |Insert|
|
||||
* +------+------+------+------+------| | Del | | Enter| +------+------+------+------+------|
|
||||
* | | | | | | | | | | | Space|XXXXXX| | |PrntSc|
|
||||
* `----------------------------------' `------' `------' `----------------------------------'
|
||||
*
|
||||
*/
|
||||
[_EX] = LAYOUT( /* Extend */
|
||||
_______, _______, _______, _______, LCTL(KC_GRV), KC_PGUP, KC_HOME, KC_UP, KC_END, KC_DEL,
|
||||
KC_LGUI, KC_LSFT, KC_LALT, KC_LCTL, _______, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_BSPC,
|
||||
KC_LSFT, KX_CUT, KX_COPY, _______, KX_PAST, _______, KCX_LST, KC_TAB, _______, KC_INS,
|
||||
_______, _______, _______, _______, _______, KC_DEL, KC_ENT, KC_SPC, _______, _______, _______, KC_PSCR
|
||||
),
|
||||
[L_NUM] = LAYOUT(
|
||||
KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_SLSH, KC_COLN, KC_7, KC_8, KC_9, KC_SLSH,
|
||||
KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_PIPE, KC_HASH, KC_4, KC_5, KC_6, KC_ASTR,
|
||||
KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_BSLS, KC_BSPC, KC_1, KC_2, KC_3, KC_MINS,
|
||||
_______, KC_AMPR, KC_TILD, KC_GRV, ooooooo, _______, KC_ENT, MO_FUNC, KC_0, KC_DOT, KC_EQL, KC_PLUS
|
||||
)
|
||||
,
|
||||
|
||||
/*
|
||||
* Numbers and symbols
|
||||
*
|
||||
* ,----------------------------------. ,----------------------------------.
|
||||
* | ! | @ | { | } | & | | / | 7 | 8 | 9 | * |
|
||||
* +------+------+------+------+------| +------+------+------+------+------|
|
||||
* | # | $ | ( | ) | ~ | | | | 4 | 5 | 6 | - |
|
||||
* +------+------+------+------+------| +------+------+------+------+------|
|
||||
* | % | ^ | [ | ] | ` | ,------. ,------. | \ | 1 | 2 | 3 | + |
|
||||
* +------+------+------+------+------| | | | | +------+------+------+------+------|
|
||||
* | | _GA | | | | | | | | |XXXXXX| 0 | . | = | |
|
||||
* `----------------------------------' `------' `------' `----------------------------------'
|
||||
*
|
||||
*/
|
||||
[_NU] = LAYOUT( /* Numbers and symbols */
|
||||
KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_AMPR, KC_SLSH, KC_7, KC_8, KC_9, KC_ASTR,
|
||||
KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_TILD, KC_PIPE, KC_4, KC_5, KC_6, KC_MINS,
|
||||
KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_GRV, KC_BSLS, KC_1, KC_2, KC_3, KC_PLUS,
|
||||
_______, TG(_GA), _______, _______, _______, _______, _______, _______, KC_0, KC_DOT, KC_EQL, _______
|
||||
),
|
||||
[L_EXTEND] = LAYOUT(
|
||||
_______, _______, _______, KC_APP, KX_CGR, KC_PGUP, KC_HOME, KC_UP, KC_END, KC_DEL,
|
||||
KC_LGUI, KC_LSFT, KC_LALT, KC_LCTL, _______, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_BSPC,
|
||||
_______, _______, _______, KX_SRCH, KX_PAST, _______, KX_STAB, KC_TAB, _______, KC_INS,
|
||||
_______, _______, _______, _______, MO_FUNC, KC_DEL, KC_ENT, _______, _______, _______, _______, KC_PSCR
|
||||
)
|
||||
,
|
||||
|
||||
/*
|
||||
* Functions
|
||||
*
|
||||
* ,----------------------------------. ,----------------------------------.
|
||||
* | Caps | F9 | F10 | F11 | F12 | | _USER|Whl Up| MUp |Whl Dn| |
|
||||
* +------+------+------+------+------| +------+------+------+------+------|
|
||||
* | | F5 | F6 | F7 | F8 | | Vol ^| MLeft| MDown|MRight| |
|
||||
* +------+------+------+------+------| +------+------+------+------+------|
|
||||
* | | F1 | F2 | F3 | F4 | ,------. ,------. | Vol v| | | | |
|
||||
* +------+------+------+------+------| | | |RClick| +------+------+------+------+------|
|
||||
* | | | |XXXXXX| | | | | | |LClick|MClick| _CO | _GA | RESET|
|
||||
* `----------------------------------' `------' `------' `----------------------------------'
|
||||
*
|
||||
*/
|
||||
[_FN] = LAYOUT( /* Functions */
|
||||
KC_CAPS, KC_F9, KC_F10, KC_F11, KC_F12, M(_USER),KC_WH_U, KC_MS_U, KC_WH_D, _______,
|
||||
_______, KC_F5, KC_F6, KC_F7, KC_F8, KC_VOLU, KC_MS_L, KC_MS_D, KC_MS_R, _______,
|
||||
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_VOLD, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, KC_BTN2, KC_BTN1, KC_BTN3, DF(_CO), DF(_QW), RESET
|
||||
),
|
||||
[L_FUNC] = LAYOUT(
|
||||
_______, _______, M_LCLIK, M_RCLIK, M_MCLIK, KC_VOLU, KC_F9, KC_F10, KC_F11, KC_F12,
|
||||
KC_LGUI, KC_LSFT, KC_LALT, KC_LCTL, M_WHLUP, KC_MUTE, KC_F5, KC_F6, KC_F7, KC_F8,
|
||||
M_LEFT, M_DOWN, M_UP, M_RIGHT, M_WHLDN, KC_VOLD, KC_F1, KC_F2, KC_F3, KC_F4,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
)
|
||||
,
|
||||
|
||||
/*
|
||||
* Gaming
|
||||
*
|
||||
* ,----------------------------------. ,----------------------------------.
|
||||
* | | | | | | | |Whl Up| MUp |Whl Dn| |
|
||||
* +------+------+------+------+------| +------+------+------+------+------|
|
||||
* | | | | | | | | MLeft| MDown|MRight| |
|
||||
* +------+------+------+------+------| +------+------+------+------+------|
|
||||
* | Z | | | | | ,------. ,------. | | | | | |
|
||||
* +------+------+------+------+------| | Bksp | |RClick| +------+------+------+------+------|
|
||||
* | | _GA | | Shift| Space| | | | | |LClick|MClick| | | |
|
||||
* `----------------------------------' `------' `------' `----------------------------------'
|
||||
*
|
||||
*/
|
||||
[_GA] = LAYOUT( /* Gaming */
|
||||
_______, _______, _______, _______, _______, _______, KC_WH_U, KC_MS_U, KC_WH_D, _______,
|
||||
_______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______,
|
||||
KC_Z, _______, _______, _______, _______, _______, _______, KC_MS_D, _______, _______,
|
||||
_______, TG(_GA), _______, KC_LSFT, KC_SPC, KC_BSPC, KC_BTN2, KC_BTN1, KC_BTN3, _______, _______, _______
|
||||
)
|
||||
};
|
||||
[L_LL_R] = LAYOUT(
|
||||
_______, _______, _______, _______, _______, KC_COLN, KC_P7, KC_P8, KC_P9, KC_PSLS,
|
||||
_______, ooooooo, KC_AMPR, KC_PIPE, _______, KC_HASH, KC_P4, KC_P5, KC_P6, KC_PAST,
|
||||
_______, _______, _______, _______, _______, KC_BSPC, KC_P1, KC_P2, KC_P3, KC_PMNS,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, KC_0, KC_DOT, KC_EQL, KC_PLUS
|
||||
)
|
||||
,
|
||||
|
||||
/*
|
||||
* Template
|
||||
*
|
||||
* ,----------------------------------. ,----------------------------------.
|
||||
* | | | | | | | | | | | |
|
||||
* +------+------+------+------+------| +------+------+------+------+------|
|
||||
* | | | | | | | | | | | |
|
||||
* +------+------+------+------+------| +------+------+------+------+------|
|
||||
* | | | | | | ,------. ,------. | | | | | |
|
||||
* +------+------+------+------+------| | | | | +------+------+------+------+------|
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* `----------------------------------' `------' `------' `----------------------------------'
|
||||
*
|
||||
*/
|
||||
[L_LL_E] = LAYOUT(
|
||||
RJ_MAKE, RJ_EQ, RJ_LEQ, RJ_GEQ, RJ_GEQR, _______, _______, _______, _______, _______,
|
||||
_______, _______, RJ_SELS, RJ_DUND, _______, _______, _______, ooooooo, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
)
|
||||
,
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[L_LL_I] = LAYOUT(
|
||||
KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_SLSH, _______, KC_UNDS, KC_GRV, _______, _______,
|
||||
KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_PIPE, _______, KC_MINS, KC_QUOT, ooooooo, _______,
|
||||
KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_BSLS, _______, KC_TILD, KC_DQT, _______, _______,
|
||||
_______, KC_AMPR, KC_LABK, KC_RABK, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
)
|
||||
|
||||
};
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
// MACRODOWN only works in this function
|
||||
switch(id) {
|
||||
case _USER:
|
||||
if (record->event.pressed) {
|
||||
register_code(KC_RSFT);
|
||||
} else {
|
||||
unregister_code(KC_RSFT);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
// Uncomment any of these to add keyboard-specific code. Otherwise, they
|
||||
// will use user defaults defined in the replicaJunction.h header file.
|
||||
|
||||
// bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
|
||||
// return true;
|
||||
// }
|
||||
|
||||
// void matrix_init_keymap(void) {};
|
||||
|
||||
// void matrix_scan_keymap(void) {};
|
||||
|
34
keyboards/atreus/keymaps/replicaJunction/kle/base-layer.txt
Normal file
34
keyboards/atreus/keymaps/replicaJunction/kle/base-layer.txt
Normal file
@ -0,0 +1,34 @@
|
||||
[{r:10,rx:1,y:-0.1,x:2},"F"],
|
||||
[{y:-0.65,x:1},"W",{x:1},"P"],
|
||||
[{y:-0.75},"Q"],
|
||||
[{y:-0.9,x:4},"B"],
|
||||
[{y:-0.7,x:2},"S"],
|
||||
[{y:-0.65,x:1,c:"#45b866"},"R",{x:1,c:"#cccccc"},"T"],
|
||||
[{y:-0.75},"A"],
|
||||
[{y:-0.9,x:4},"G"],
|
||||
[{y:-0.7,x:2},"C\n\n\n<i class='fa fa-windows'></i>"],
|
||||
[{y:-0.65,x:1},"X\n\n\nCtrl",{x:1},"D\n\n\nCtrlAlt"],
|
||||
[{y:-0.75},"Z"],
|
||||
[{y:-0.9,x:4},"V\n\n\nAlt"],
|
||||
[{y:-0.75,x:5,h:1.5},"Del\nCtrl"],
|
||||
[{y:-0.95,x:2},"Tab"],
|
||||
[{y:-0.65,x:1,a:7,fa:[7]},"<i class='fa fa-windows'></i>",{x:1,a:4,f:3},"Shift"],
|
||||
[{y:-0.75,f:3},"Layer tap"],
|
||||
[{y:-0.9,x:4,f:3},"<i class='kb kb-Unicode-BackSpace-DeleteLeft-Big'></i>"],
|
||||
[{r:-10,rx:7,ry:0.965,y:-0.2,x:2,f:3},"U"],
|
||||
[{y:-0.65,x:1,f:3},"L",{x:1,f:3},"Y"],
|
||||
[{y:-0.75,x:4,f:3},":\n;"],
|
||||
[{y:-0.9,f:3},"J"],
|
||||
[{y:-0.7,x:2,c:"#ffb07b",f:3},"E"],
|
||||
[{y:-0.65,x:1,c:"#cccccc",f:3},"N",{x:1,c:"#5dcde3",f:3},"I"],
|
||||
[{y:-0.75,x:4,c:"#cccccc",f:3},"O"],
|
||||
[{y:-0.9,f:3},"M"],
|
||||
[{y:-0.7,x:2,f:3},"<\n,\n\nCtrlAlt"],
|
||||
[{y:-0.65,x:1,f:3},"H\n\n\nAlt",{x:1,f:3},">\n.\n\n<i class='fa fa-windows'></i>"],
|
||||
[{y:-0.75,x:4,f:3},"?\n/\n\nCtrl"],
|
||||
[{y:-0.9,f:3},"K"],
|
||||
[{y:-0.75,x:-1,f:3,h:1.5},"Enter\nAlt"],
|
||||
[{y:-0.95,x:2,f:3},"_\n-"],
|
||||
[{y:-0.65,x:1,f:3},"Shift",{x:1,f:3},"\"\n'"],
|
||||
[{y:-0.75,x:4,f:3},"+\n="],
|
||||
[{y:-0.9,c:"#ffe08d",f:3},"Space"]
|
34
keyboards/atreus/keymaps/replicaJunction/kle/e-layer.txt
Normal file
34
keyboards/atreus/keymaps/replicaJunction/kle/e-layer.txt
Normal file
@ -0,0 +1,34 @@
|
||||
[{r:10,rx:1,y:-0.1,x:2},"<="],
|
||||
[{y:-0.65,x:1},"==",{x:1},">="],
|
||||
[{y:-0.75},"make"],
|
||||
[{y:-0.9,x:4},"=>"],
|
||||
[{y:-0.7,x:2},"select *"],
|
||||
[{y:-0.65,x:1,a:7},"",{x:1,a:4},"$_"],
|
||||
[{y:-0.75,a:7},""],
|
||||
[{y:-0.9,x:4},""],
|
||||
[{y:-0.7,x:2},""],
|
||||
[{y:-0.65,x:1},"",{x:1},""],
|
||||
[{y:-0.75},""],
|
||||
[{y:-0.9,x:4},""],
|
||||
[{y:-0.75,x:5,h:1.5},""],
|
||||
[{y:-0.95,x:2},""],
|
||||
[{y:-0.65,x:1},"",{x:1},""],
|
||||
[{y:-0.75},""],
|
||||
[{y:-0.9,x:4},""],
|
||||
[{r:-10,rx:7,ry:0.965,y:-0.2,x:2},""],
|
||||
[{y:-0.65,x:1},"",{x:1},""],
|
||||
[{y:-0.75,x:4},""],
|
||||
[{y:-0.9},""],
|
||||
[{y:-0.7,x:2,c:"#ffb07b"},""],
|
||||
[{y:-0.65,x:1,c:"#cccccc"},"",{x:1},""],
|
||||
[{y:-0.75,x:4},""],
|
||||
[{y:-0.9},""],
|
||||
[{y:-0.7,x:2},""],
|
||||
[{y:-0.65,x:1},"",{x:1},""],
|
||||
[{y:-0.75,x:4},""],
|
||||
[{y:-0.9},""],
|
||||
[{y:-0.75,x:-1,h:1.5},""],
|
||||
[{y:-0.95,x:2},""],
|
||||
[{y:-0.65,x:1},"",{x:1},""],
|
||||
[{y:-0.75,x:4},""],
|
||||
[{y:-0.9},""]
|
35
keyboards/atreus/keymaps/replicaJunction/kle/fn-layer.txt
Normal file
35
keyboards/atreus/keymaps/replicaJunction/kle/fn-layer.txt
Normal file
@ -0,0 +1,35 @@
|
||||
[{r:10,rx:1,y:-0.1,x:2},"RClick"],
|
||||
[{y:-0.65,x:1,a:7},"",{x:1,a:4},"LClick"],
|
||||
[{y:-0.75,a:7},""],
|
||||
[{y:-0.9,x:4,a:4},"MClick"],
|
||||
[{y:-0.7,x:2},"Alt"],
|
||||
[{y:-0.65,x:1},"Shift",{x:1},"Ctrl"],
|
||||
[{y:-0.75,a:7,fa:[7]},"<i class='fa fa-windows'></i>"],
|
||||
[{y:-0.9,x:4,a:4,fa:[5,0,0,0,0,0,0,0,0,0,7]},"<i class='kb kb-Unicode-Scroll-1'></i>\n\n\n\n\n\n\n\n\n\n<i class='kb kb-Arrows-Top-4'></i>"],
|
||||
[{y:-0.7,x:2,fa:[0,0,0,0,0,0,0,0,0,0,7]},"<i class='fa fa-mouse-pointer'></i>\n\n\n\n\n\n\n\n\n\n<i class='kb kb-Arrows-Up'></i>"],
|
||||
[{y:-0.65,x:1},"<i class='fa fa-mouse-pointer'></i>\n\n\n\n\n\n\n\n\n\n<i class='kb kb-Arrows-Down'></i>",{x:1},"<i class='fa fa-mouse-pointer'></i>\n\n\n\n\n\n\n\n\n\n<i class='kb kb-Arrows-Right'></i>"],
|
||||
[{y:-0.75},"<i class='fa fa-mouse-pointer'></i>\n\n\n\n\n\n\n\n\n\n<i class='kb kb-Arrows-Left'></i>"],
|
||||
[{y:-0.9,x:4,fa:[5,0,0,0,0,0,0,0,0,0,7]},"<i class='kb kb-Unicode-Scroll-1'></i>\n\n\n\n\n\n\n\n\n\n<i class='kb kb-Arrows-Bottom-4'></i>"],
|
||||
[{y:-0.75,x:5,a:7,h:1.5},""],
|
||||
[{y:-0.95,x:2},""],
|
||||
[{y:-0.65,x:1},"",{x:1},""],
|
||||
[{y:-0.75},""],
|
||||
[{y:-0.9,x:4,c:"#ffe08d"},""],
|
||||
[{r:-10,rx:7,ry:0.965,y:-0.2,x:2,c:"#cccccc",a:4,f:3},"F10"],
|
||||
[{y:-0.65,x:1,f:3},"F9",{x:1,f:3},"F11"],
|
||||
[{y:-0.75,x:4,f:3},"F12"],
|
||||
[{y:-0.9,a:7},""],
|
||||
[{y:-0.7,x:2,a:4,f:3},"F6"],
|
||||
[{y:-0.65,x:1,f:3},"F5",{x:1,f:3},"F7"],
|
||||
[{y:-0.75,x:4,f:3},"F8"],
|
||||
[{y:-0.9,a:7},""],
|
||||
[{y:-0.7,x:2,a:4,f:3},"F2"],
|
||||
[{y:-0.65,x:1,f:3},"F1",{x:1,f:3},"F3"],
|
||||
[{y:-0.75,x:4,f:3},"F4"],
|
||||
[{y:-0.9,a:7},""],
|
||||
[{y:-0.75,x:-1,h:1.5},""],
|
||||
[{y:-0.95,x:2},""],
|
||||
[{y:-0.65,x:1},"",{x:1},""],
|
||||
[{y:-0.75,x:4},""],
|
||||
[{y:-0.9,c:"#ffe08d"},""]
|
||||
|
34
keyboards/atreus/keymaps/replicaJunction/kle/i-layer.txt
Normal file
34
keyboards/atreus/keymaps/replicaJunction/kle/i-layer.txt
Normal file
@ -0,0 +1,34 @@
|
||||
[{r:10,rx:1,y:-0.1,x:2},"{"],
|
||||
[{y:-0.65,x:1},"@",{x:1},"}"],
|
||||
[{y:-0.75},"!"],
|
||||
[{y:-0.9,x:4},"/"],
|
||||
[{y:-0.7,x:2},"("],
|
||||
[{y:-0.65,x:1},"$",{x:1},")"],
|
||||
[{y:-0.75},"#"],
|
||||
[{y:-0.9,x:4},"|"],
|
||||
[{y:-0.7,x:2},"["],
|
||||
[{y:-0.65,x:1},"^",{x:1},"]"],
|
||||
[{y:-0.75},"%"],
|
||||
[{y:-0.9,x:4},"\\"],
|
||||
[{y:-0.75,x:5,a:7,h:1.5},""],
|
||||
[{y:-0.95,x:2,a:4},"<"],
|
||||
[{y:-0.65,x:1},"&",{x:1},">"],
|
||||
[{y:-0.75,a:7},""],
|
||||
[{y:-0.9,x:4},""],
|
||||
[{r:-10,rx:7,ry:0.965,y:-0.2,x:2,a:4},"`"],
|
||||
[{y:-0.65,x:1},"_",{x:1,a:7},""],
|
||||
[{y:-0.75,x:4},""],
|
||||
[{y:-0.9},""],
|
||||
[{y:-0.7,x:2,a:4},"'"],
|
||||
[{y:-0.65,x:1},"-",{x:1,c:"#5dcde3",a:7},""],
|
||||
[{y:-0.75,x:4,c:"#cccccc"},""],
|
||||
[{y:-0.9},""],
|
||||
[{y:-0.7,x:2,a:4},"\""],
|
||||
[{y:-0.65,x:1},"~",{x:1,a:7},""],
|
||||
[{y:-0.75,x:4},""],
|
||||
[{y:-0.9},""],
|
||||
[{y:-0.75,x:-1,h:1.5},""],
|
||||
[{y:-0.95,x:2},""],
|
||||
[{y:-0.65,x:1},"",{x:1},""],
|
||||
[{y:-0.75,x:4},""],
|
||||
[{y:-0.9},""]
|
34
keyboards/atreus/keymaps/replicaJunction/kle/r-layer.txt
Normal file
34
keyboards/atreus/keymaps/replicaJunction/kle/r-layer.txt
Normal file
@ -0,0 +1,34 @@
|
||||
[{r:10,rx:1,y:-0.1,x:2,a:7},""],
|
||||
[{y:-0.65,x:1},"",{x:1},""],
|
||||
[{y:-0.75},""],
|
||||
[{y:-0.9,x:4},""],
|
||||
[{y:-0.7,x:2,a:4},"&"],
|
||||
[{y:-0.65,x:1,c:"#45b866",a:7},"",{x:1,c:"#cccccc",a:4},"|"],
|
||||
[{y:-0.75,a:7},""],
|
||||
[{y:-0.9,x:4},""],
|
||||
[{y:-0.7,x:2},""],
|
||||
[{y:-0.65,x:1},"",{x:1},""],
|
||||
[{y:-0.75},""],
|
||||
[{y:-0.9,x:4},""],
|
||||
[{y:-0.75,x:5,h:1.5},""],
|
||||
[{y:-0.95,x:2},""],
|
||||
[{y:-0.65,x:1},"",{x:1},""],
|
||||
[{y:-0.75},""],
|
||||
[{y:-0.9,x:4},""],
|
||||
[{r:-10,rx:7,ry:0.965,y:-0.2,x:2,a:4},"8"],
|
||||
[{y:-0.65,x:1},"7",{x:1},"9"],
|
||||
[{y:-0.75,x:4},"/"],
|
||||
[{y:-0.9},":"],
|
||||
[{y:-0.7,x:2},"5"],
|
||||
[{y:-0.65,x:1},"4",{x:1},"6"],
|
||||
[{y:-0.75,x:4},"*"],
|
||||
[{y:-0.9},"#"],
|
||||
[{y:-0.7,x:2},"2"],
|
||||
[{y:-0.65,x:1},"1",{x:1},"3"],
|
||||
[{y:-0.75,x:4},"-"],
|
||||
[{y:-0.9},"<i class='kb kb-Unicode-BackSpace-DeleteLeft-Big'></i>"],
|
||||
[{y:-0.75,x:-1,a:7,h:1.5},""],
|
||||
[{y:-0.95,x:2,a:4},"."],
|
||||
[{y:-0.65,x:1},"0",{x:1},"="],
|
||||
[{y:-0.75,x:4},"+"],
|
||||
[{y:-0.9},"Space"]
|
34
keyboards/atreus/keymaps/replicaJunction/kle/space-layer.txt
Normal file
34
keyboards/atreus/keymaps/replicaJunction/kle/space-layer.txt
Normal file
@ -0,0 +1,34 @@
|
||||
[{r:10,rx:1,y:-0.1,x:2,a:7},""],
|
||||
[{y:-0.65,x:1},"",{x:1,fa:[7]},"<i class='kb kb-Hamburger-Menu'></i>"],
|
||||
[{y:-0.75},""],
|
||||
[{y:-0.9,x:4},"<i class='fa fa-terminal'></i>"],
|
||||
[{y:-0.7,x:2,a:4,f:3},"Alt"],
|
||||
[{y:-0.65,x:1,f:3},"Shift",{x:1,f:3},"Ctrl"],
|
||||
[{y:-0.75,a:7},"<i class='fa fa-windows'></i>"],
|
||||
[{y:-0.9,x:4},""],
|
||||
[{y:-0.7,x:2},""],
|
||||
[{y:-0.65,x:1},"",{x:1},"<i class='fa fa-search'></i>"],
|
||||
[{y:-0.75},""],
|
||||
[{y:-0.9,x:4},"<i class='fa fa-clipboard'></i>"],
|
||||
[{y:-0.75,x:5,h:1.5},""],
|
||||
[{y:-0.95,x:2},""],
|
||||
[{y:-0.65,x:1},"",{x:1},""],
|
||||
[{y:-0.75},""],
|
||||
[{y:-0.9,x:4},""],
|
||||
[{r:-10,rx:7,ry:0.965,y:-0.2,x:2},"<i class='kb kb-Arrows-Up'></i>"],
|
||||
[{y:-0.65,x:1,a:4,f:3},"Home",{x:1,f:3},"End"],
|
||||
[{y:-0.75,x:4,f:3},"Delete"],
|
||||
[{y:-0.9,f:3},"PgUp"],
|
||||
[{y:-0.7,x:2,a:7},"<i class='kb kb-Arrows-Down'></i>"],
|
||||
[{y:-0.65,x:1},"<i class='kb kb-Arrows-Left'></i>",{x:1},"<i class='kb kb-Arrows-Right'></i>"],
|
||||
[{y:-0.75,x:4,a:4,f:3},"Bksp"],
|
||||
[{y:-0.9,f:3},"PgDn"],
|
||||
[{y:-0.7,x:2,f:3},"Tab"],
|
||||
[{y:-0.65,x:1,f:3},"Shift+\n\n\n\n\n\nTab",{x:1,a:7},""],
|
||||
[{y:-0.75,x:4,a:4,f:3},"Insert"],
|
||||
[{y:-0.9,a:7},""],
|
||||
[{y:-0.75,x:-1,h:1.5},""],
|
||||
[{y:-0.95,x:2},""],
|
||||
[{y:-0.65,x:1},"",{x:1},""],
|
||||
[{y:-0.75,x:4,a:4,f:3},"Prnt Scrn"],
|
||||
[{y:-0.9,c:"#ffe08d",a:7},""]
|
@ -1,61 +1,103 @@
|
||||
# replicaJunction - Atreus Layout #
|
||||
# replicaJunction - Atreus Layout
|
||||
|
||||
This layout is designed to make the absolute most out of the Atreus 40% keyboard.
|
||||
|
||||
I was enchanted with the idea of the Atreus keyboard after using my Ergodox for several months. I wanted something of a similar form factor that was easily portable, so I could bring and transport a keyboard to my workplace without much hassle. After building the Atreus keyboard, though, I realized very quickly that the 40% form factor requires a lot more creativity than a full-size keyboard (even one as strangely-shaped as the Ergodox).
|
||||
This layout is probably not perfect for you. That's okay! Use it for ideas as you design your own perfect layout.
|
||||
|
||||
The default Atreus keyboard layout provides all the necessary keys in order to function with the keyboard, but as a programmer, I needed quicker access to just about everything. I noticed that the default layer didn't include any dual-role keys, and so I started on my journey to build my perfect layout for the Atreus.
|
||||
Most of the custom logic in this keyboard is actually not in these files. Instead, it's in the directory `/users/replicaJunction` (from the root of the QMK repo). This allows me to share macros and custom logic between multiple keyboards. A `process_record_keyboard()` function defined weakly in `replicaJunction.h` allows keyboards to process records individually as well without overriding the `process_record_user()` function. (My Ergodox uses this to handle its LEDs, for example.)
|
||||
|
||||
I won't claim that this layout is perfect for everyone. It does make several significant changes from the "normal" Atreus layout. In my own use, though, I've found this keyboard turbocharges my Atreus, and gives it the power of a full-size keyboard without the size.
|
||||
The default letter layout in this keymap is [Colemak-ModDH](https://colemakmods.github.io/mod-dh/). I use the "matrix version" of that layout, which retains the M key on the home row as in normal Colemak.
|
||||
|
||||
## Base Layer ##
|
||||
## Design Goals
|
||||
|
||||

|
||||
I designed this layout with the following goals in mind:
|
||||
|
||||
The letters on this layout are arranged in the [Colemak Mod-DH layout](https://colemakmods.github.io/mod-dh/).
|
||||
* Nothing may interfere with ordinary typing.
|
||||
* Symbols need to be accessible quickly and organized in a manner I can remember.
|
||||
* Limit more difficult finger movements (and pinky usage in general).
|
||||
|
||||
The primary mechanism for the Shift keys in this keyboard are the dual-role Z and slash keys. Pressing the key sends the keystroke, while holding the key sends a shift. This is a design choice taken from the xyverz layout, and one I find much more intuitive than a thumb shift. In addition, the pinky doesn't need to stretch as far to reach these keys as it does to reach a standard Shift key.
|
||||
### Nothing may interfere with ordinary typing
|
||||
|
||||
Occasionally, when typing the letter Z, I'll hold the key down a fraction of a second too long, and the keyboard will shift instead. If you're not a confident typist, this dual-role Shift key layout is probably not a good solution. In that case, I'd suggest moving Shift onto the Backspace key (press for Backspace, hold for Shift).
|
||||
For a long time, this meant that I couldn't use letters or home row keys as dual-role keys. I'm a fast typer, and I'm sometimes already typing the next letter before I've fully released the previous one. Normal keyboards don't care about this, but if I started adding dual-role functionality to letters, I found that I would sometimes type the next letter before releasing the layer toggle, and the letter I tried to send would still be sent under the layer I thought I'd left off.
|
||||
|
||||
In addition to the Shift keys, there are three dual-purpose keys: Ctrl (Delete), Alt (Enter), and Space (Number layer). In QMK, these dual-role keys can be made to hold their primary key with a tap and hold. For example, if I wanted to insert a long string of Spaces, I would tap the Space key, then tap it again and hold. A single press and hold would trigger the secondary function of the key instead.
|
||||
Fortunately, though, QMK has addressed this with the `PERMISSIVE_HOLD` flag. [Details are on the QMK docs page.](https://docs.qmk.fm/#/feature_advanced_keycodes?id=permissive-hold)
|
||||
|
||||
## Extend Layer ##
|
||||
Using that flag, I'm comfortable having layer shift keys on the home row, and this goes a long way to eliminate finger stress.
|
||||
|
||||

|
||||
### Sympols need to be accessible quickly
|
||||
|
||||
This layout is designed primarily for keyboard navigation. Arrow keys are easily accessible under the right hand (a welcome change from the original Atreus layout, which places them under the left hand), along with Home/End and PgUp/PgDn.
|
||||
Symbols are available under my left hand by holding the I key (on my right hand). I've grouped parenthesis, slashes, and braces together; the remaining symbols are ordered in the same way as they appear on USA keycap legends (for example, 1 is !, so that symbol is first in my lineup). Practically, I just had to get used to these other "misc" symbols.
|
||||
|
||||
Modifiers are also placed under the home row of the left hand. One of the single keyboard actions I use most is Shift+Ctrl+Left/Right to select a whole word; this layer makes those keypresses simple by adding the Ctrl key in an easy-to-reach location.
|
||||
This also means that some symbols are accessible in more than one way. For example, the carats (greater than and less than) are available both in the "normal" location (Shift+Comma / Shift+Period) and on the symbol layer. I make regular changes to some of the symbols I don't use as commonly as I think of them.
|
||||
|
||||
For the common Ctrl shortcuts, I also added some hotkeys to this layer over the letter keys they are associated with. This gives the Extend key some extra utility by letting it "feel" like a Ctrl key in some cases.
|
||||
### Limit more difficult finger movements
|
||||
|
||||
The Space key exists to prevent going from this layer directly into the Number layer. Similarly, the Shift key on the left pinky helps make sure that the normal letter (Z) doesn't fire.
|
||||
This is why I kept trying to put layer toggles on the home row keys instead of just placing them on random thumb keys. I suffer from RSI, and it's important for me to watch out for more "stressful" finger movements.
|
||||
|
||||
## Number and Symbol Layer ##
|
||||
The home row is the easiest row for your fingers to hit, followed by the upper row, and the lower row is noticeably more difficult to press. Because of this, I favored the upper row over the lower one any time I had the option to do so.
|
||||
|
||||

|
||||
## Features
|
||||
|
||||
This layer provides the only way of accessing number keys on this keyboard, since it's too small for its own number row. Note that even though they are laid out in the number pad fashion, they send the "regular" number keystrokes. Games and programs that specifically use NumPad keys are not supported in this layout at the moment.
|
||||
### ZXC Mods
|
||||
|
||||
This layer also provides plenty of symbol shortcuts. Most of these can be accessed through other means (like Shift+8 for the asterisk), but having shortcut keys to them makes for one less keypress, which adds up quickly when using these symbols on a regular basis. I've been through many revisions of this concept on my Ergodox as well as the Atreus, and I've finally arrived at this layout as the one that provides the symbols I need most frequently in places I can think to expect them. The Ordinary layout from the Ergodox-EZ keyboard in this repository was a large influence in this design.
|
||||
Keys on the bottom row of each half of this keyboard can be held to send modifier keys. I've tried to map this in a relatively logical manner:
|
||||
|
||||
## Function Layer ##
|
||||
* Z / Slash: Ctrl
|
||||
* X / Period: GUI
|
||||
* C / Comma: Ctrl+Alt
|
||||
* D / H: Alt
|
||||
|
||||

|
||||
Combined with Shift keys on the thumbs, this makes all modifiers quick to access on either hand.
|
||||
|
||||
Function keys (F1-F12) are on this layer. Their layout in groups of four comes from Jeremy's Atreus layout in this repository. I'd been using 1-9 in a numpad layout, then adding 10-12 on the side...I suppose it took seeing someone else do it this way for me to realize how much more sense it makes.
|
||||
### Layer tap dance
|
||||
|
||||
On the right side are mouse keys - cursor left/right/up/down, and scroll up/down. Volume keys are also here, though really only because there was room for them (I'm not entirely happy with their positions).
|
||||
The lower-left key on the left hand can be used to apply or remove layers based on a number of taps:
|
||||
|
||||
Finally, the reset key is on this layer, as well as toggles from Colemak to QWERTY and back. The QWERTY layer is not currently documented, but it is functionally identical to the base layer except for letter positions.
|
||||
* 1 tap sends Escape, and also disables any persistent layers.
|
||||
* 2 taps enables the Number pad layer.
|
||||
* 5 or more taps resets the keyboard.
|
||||
|
||||
## Gaming Layer ##
|
||||
## Extend Layer
|
||||
|
||||

|
||||
[Originally found on the Colemak forums](https://forum.colemak.com/topic/2014-extend-extra-extreme/), having a QMK-powered keyboard allows a super easy implementation of this concept. The idea is to place commonly-used keys under easy reach of your hands. Since I work with text often, my most common needs are things like Ctrl+Shift+arrow keys, and they're easy to access using this layer. (While technically it's four keypresses instead of just three, since it takes one key to enter the layer, that one key is a thumb button and the other three are all on the home row, so I find it much more comfortable than modifiers on a traditional keyboard.)
|
||||
|
||||
This is a small layer developed to allow some simple gameplay without a mouse. This layer is a toggle (from the Number layer), so it is designed to stay on while in use.
|
||||
Also featured in this layer is easy access to Tab, plus a Shift+Tab key. Alt-Tabbing back and forth, along with Ctrl-Tab, are super easy and friendly. When I need Ctrl+Alt+Delete, I typically use the ones found on this layer.
|
||||
|
||||
The keys on the left hand bring Space into the left thumb's reach, as well as overriding the dual-role Shift with its standard function (Z in both QWERTY and in Colemak). This allows easy Shift presses without blocking the Z key, commonly used in games.
|
||||
## Layout Images
|
||||
|
||||
I would probably not consider the Atreus a hard-core gaming keyboard in the first place, and this layout does have the huge problem of blocking access to the number keys, but for more casual games, it plays quite well. I've used it quite a bit on Minecraft, for example, and I'm quite pleased with it.
|
||||
Colored keys indicate keys that swap to another layer when held.
|
||||
|
||||
These images are located in the `kle` folder of this directory. Also included is the "raw data" from Keyboard-Layout-Editor in a corresponding text file.
|
||||
|
||||
### Base layer
|
||||
|
||||

|
||||
|
||||
### R layer
|
||||
|
||||

|
||||
|
||||
### E layer
|
||||
|
||||

|
||||
|
||||
### I layer
|
||||
|
||||

|
||||
|
||||
### Space layer
|
||||
|
||||

|
||||
|
||||
### Function layer
|
||||
|
||||

|
||||
|
||||
## Credits
|
||||
|
||||
* [Drashna](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/readme.md)
|
||||
* User / keymap function ideas
|
||||
* [Jeremy](https://github.com/qmk/qmk_firmware/blob/master/keyboards/atreus/keymaps/jeremy/readme.md)
|
||||
* Sanity check on the Function keys (_of course they should be in rows of 4, not rows of 3 like a number pad. Why did I ever use anything else?_)
|
||||
* [DreymaR of the Colemak forums](https://forum.colemak.com/topic/2014-extend-extra-extreme/)
|
||||
* Original idea of the Extend layer
|
||||
|
12
keyboards/atreus/keymaps/replicaJunction/rules.mk
Normal file
12
keyboards/atreus/keymaps/replicaJunction/rules.mk
Normal file
@ -0,0 +1,12 @@
|
||||
# https://docs.qmk.fm/getting_started_make_guide.html
|
||||
|
||||
MOUSEKEY_ENABLE = yes
|
||||
TAP_DANCE_ENABLE = yes
|
||||
# KEY_LOCK_ENABLE = yes
|
||||
# CONSOLE_ENABLE = no
|
||||
# COMMAND_ENABLE = no
|
||||
|
||||
# Use the "Unicode map" method
|
||||
# UNICODE_ENABLE = no
|
||||
# UNICODEMAP_ENABLE = yes
|
||||
|
@ -5,6 +5,10 @@
|
||||
"layouts": {
|
||||
"KEYMAP": {
|
||||
"layout": [{"x": 0, "y": 0, "w": 1, "label": "GRAVE"}, {"x": 1, "y": 0, "w": 1, "label": "1"}, {"x": 2, "y": 0, "w": 1, "label": "2"}, {"x": 3, "y": 0, "w": 1, "label": "3"}, {"x": 4, "y": 0, "w": 1, "label": "4"}, {"x": 5, "y": 0, "w": 1, "label": "5"}, {"x": 6, "y": 0, "w": 1, "label": "6"}, {"x": 7, "y": 0, "w": 1, "label": "7"}, {"x": 8, "y": 0, "w": 1, "label": "8"}, {"x": 9, "y": 0, "w": 1, "label": "9"}, {"x": 10, "y": 0, "w": 1, "label": "0"}, {"x": 11, "y": 0, "w": 1, "label": "DASH"}, {"x": 12, "y": 0, "w": 1, "label": "EQUALSIGN"}, {"x": 13, "y": 0, "w": 1, "label": "YEN"}, {"x": 14, "y": 0, "w": 1, "label": "BACKSPACE"}, {"x": 15.5, "y": 0, "w": 1, "label": "PAGEUP"}, {"x": 0, "y": 1, "w": 1.5, "label": "TAB"}, {"x": 1.5, "y": 1, "w": 1, "label": "Q"}, {"x": 2.5, "y": 1, "w": 1, "label": "W"}, {"x": 3.5, "y": 1, "w": 1, "label": "E"}, {"x": 4.5, "y": 1, "w": 1, "label": "R"}, {"x": 5.5, "y": 1, "w": 1, "label": "T"}, {"x": 6.5, "y": 1, "w": 1, "label": "Y"}, {"x": 7.5, "y": 1, "w": 1, "label": "U"}, {"x": 8.5, "y": 1, "w": 1, "label": "I"}, {"x": 9.5, "y": 1, "w": 1, "label": "O"}, {"x": 10.5, "y": 1, "w": 1, "label": "P"}, {"x": 11.5, "y": 1, "w": 1, "label": "LBRACKET"}, {"x": 12.5, "y": 1, "w": 1, "label": "RBRACKET"}, {"x": 13.5, "y": 1, "w": 1.5, "label": "BACKSLASH"}, {"x": 15.5, "y": 1, "w": 1, "label": "PAGEDOWN"}, {"x": 0, "y": 2, "w": 1.75, "label": "CAPSLOCK"}, {"x": 1.75, "y": 2, "w": 1, "label": "A"}, {"x": 2.75, "y": 2, "w": 1, "label": "S"}, {"x": 3.75, "y": 2, "w": 1, "label": "D"}, {"x": 4.75, "y": 2, "w": 1, "label": "F"}, {"x": 5.75, "y": 2, "w": 1, "label": "G"}, {"x": 6.75, "y": 2, "w": 1, "label": "H"}, {"x": 7.75, "y": 2, "w": 1, "label": "J"}, {"x": 8.75, "y": 2, "w": 1, "label": "K"}, {"x": 9.75, "y": 2, "w": 1, "label": "L"}, {"x": 10.75, "y": 2, "w": 1, "label": "SEMICOLON"}, {"x": 11.75, "y": 2, "w": 1, "label": "QUOTE"}, {"x": 12.75, "y": 2, "w": 1, "label": "ISOHASH"}, {"x": 13.75, "y": 2, "w": 1.25, "label": "ENTER"}, {"x": 0, "y": 3, "w": 1.25, "label": "LSHIFT"}, {"x": 1.25, "y": 3, "w": 1, "label": "ISOBACKSLASH"}, {"x": 2.25, "y": 3, "w": 1, "label": "Z"}, {"x": 3.25, "y": 3, "w": 1, "label": "X"}, {"x": 4.25, "y": 3, "w": 1, "label": "C"}, {"x": 5.25, "y": 3, "w": 1, "label": "V"}, {"x": 6.25, "y": 3, "w": 1, "label": "B"}, {"x": 7.25, "y": 3, "w": 1, "label": "N"}, {"x": 8.25, "y": 3, "w": 1, "label": "M"}, {"x": 9.25, "y": 3, "w": 1, "label": "COMMA"}, {"x": 10.25, "y": 3, "w": 1, "label": "PERIOD"}, {"x": 11.25, "y": 3, "w": 1, "label": "SLASH"}, {"x": 12.25, "y": 3, "w": 1, "label": "JPBACKSLASH"}, {"x": 13.25, "y": 3, "w": 1.25, "label": "RSHIFT"}, {"x": 14.5, "y": 3, "w": 1, "label": "UP"}, {"x": 0, "y": 4, "w": 1.25, "label": "LCTRL"}, {"x": 1.25, "y": 4, "w": 1, "label": "LALT"}, {"x": 2.25, "y": 4, "w": 1.25, "label": "LCMD"}, {"x": 3.5, "y": 4, "w": 1.25, "label": "MUHENKAN"}, {"x": 4.75, "y": 4, "w": 2, "label": "SPACE1"}, {"x": 6.75, "y": 4, "w": 2, "label": "SPACE2"}, {"x": 8.75, "y": 4, "w": 1.25, "label": "HENKAN"}, {"x": 10, "y": 4, "w": 1.25, "label": "RCMD"}, {"x": 11.25, "y": 4, "w": 1, "label": "RCTRL"}, {"x": 12.25, "y": 4, "w": 1.25, "label": "FN"}, {"x": 13.5, "y": 4, "w": 1, "label": "LEFT"}, {"x": 14.5, "y": 4, "w": 1, "label": "DOWN"}, {"x": 15.5, "y": 4, "w": 1, "label": "RIGHT"}]
|
||||
},
|
||||
|
||||
"LAYOUT_66_ansi": {
|
||||
"layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"x":15.5, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"x":15.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.25}, {"x":14.5, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4}, {"label":"Menu", "x":12.25, "y":4, "w":1.25}, {"x":13.5, "y":4}, {"x":14.5, "y":4}, {"x":15.5, "y":4}]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -64,14 +64,14 @@
|
||||
{ k20, k21, k22, k23, k24, k25, k26, k27 }, \
|
||||
{ k30, KC_NO, k32, k33, k34, k35, k36, k37 }, \
|
||||
{ k40, k41, k42, KC_NO, KC_NO, KC_NO, k46, KC_NO }, \
|
||||
{ k50, k51, k52, k53, k54, KC_NO, KC_NO, k57 }, \
|
||||
{ k50, k51, k52, k53, k54, KC_NO, k56, k57 }, \
|
||||
{ k60, k61, k62, k63, k64, k65, KC_NO, k67 }, \
|
||||
{ k70, k71, k72, k73, KC_NO, k75, KC_NO, KC_NO }, \
|
||||
{ k80, k81, k82, k83, KC_NO, k85, k86, KC_NO }, \
|
||||
{ KC_NO, KC_NO, k92, k93, k94, k95, k96, k97 } \
|
||||
}
|
||||
|
||||
/* LAYOUT_66_iso, standard 67 key ISO layout
|
||||
/* LAYOUT_66_iso, standard 67 key ISO layout
|
||||
*/
|
||||
#define LAYOUT_66_iso( \
|
||||
k00, k01, k02, k03, k04, k05, k06, k07, k50, k51, k52, k53, k54, k56, k57, \
|
||||
|
@ -64,7 +64,7 @@
|
||||
{ k20, k21, k22, k23, k24, k25, k26, k27 }, \
|
||||
{ k30, KC_NO, k32, k33, k34, k35, k36, k37 }, \
|
||||
{ k40, k41, k42, KC_NO, KC_NO, KC_NO, k46, KC_NO }, \
|
||||
{ k50, k51, k52, k53, k54, KC_NO, KC_NO, k57 }, \
|
||||
{ k50, k51, k52, k53, k54, KC_NO, k56, k57 }, \
|
||||
{ k60, k61, k62, k63, k64, k65, KC_NO, k67 }, \
|
||||
{ k70, k71, k72, k73, KC_NO, k75, KC_NO, KC_NO }, \
|
||||
{ k80, k81, k82, k83, KC_NO, k85, k86, KC_NO }, \
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "dactyl_manuform.h"
|
||||
#include "4x5.h"
|
||||
|
||||
|
||||
#ifdef SSD1306OLED
|
@ -1,5 +1,4 @@
|
||||
#ifndef REV2_H
|
||||
#define REV2_H
|
||||
#pragma once
|
||||
|
||||
#include "dactyl_manuform.h"
|
||||
|
||||
@ -68,4 +67,4 @@
|
||||
\
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
@ -16,8 +16,7 @@ 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
|
||||
#pragma once
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
@ -26,7 +25,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define PRODUCT_ID 0x3060
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER tshort
|
||||
#define PRODUCT Dactyl-Manuform
|
||||
#define DESCRIPTION A split keyboard for the cheap makers
|
||||
|
||||
/* key matrix size */
|
||||
@ -45,53 +43,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
/* number of backlight levels */
|
||||
// #define BACKLIGHT_LEVELS 3
|
||||
|
||||
/* mouse config */
|
||||
#define MOUSEKEY_INTERVAL 20
|
||||
#define MOUSEKEY_DELAY 0
|
||||
#define MOUSEKEY_TIME_TO_MAX 60
|
||||
#define MOUSEKEY_MAX_SPEED 7
|
||||
#define MOUSEKEY_WHEEL_DELAY 0
|
||||
|
||||
/* Set 0 if debouncing isn't needed */
|
||||
#define DEBOUNCING_DELAY 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)) \
|
||||
)
|
||||
|
||||
/* Enables This makes it easier for fast typists to use dual-function keys */
|
||||
#define PERMISSIVE_HOLD
|
||||
|
||||
/* ws2812 RGB LED */
|
||||
#define RGB_DI_PIN D3
|
||||
#define RGBLIGHT_TIMER
|
||||
#define RGBLED_NUM 12 // Number of LEDs
|
||||
#define ws2812_PORTREG PORTD
|
||||
#define ws2812_DDRREG DDRD
|
||||
|
||||
/*
|
||||
* 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
|
||||
|
@ -1,161 +0,0 @@
|
||||
Dactyl Manuform 4x5
|
||||
======
|
||||
the [Dactyl-Manuform](https://github.com/tshort/dactyl-keyboard) is a split curved keyboard based on the design of [adereth dactyl](https://github.com/adereth/dactyl-keyboard) and thumb cluster design of the [manuform](https://geekhack.org/index.php?topic=46015.0) keyboard, the hardware is similar to the let's split keyboard. all information needed for making one is in the first link.
|
||||

|
||||
|
||||
|
||||
## First Time Setup
|
||||
|
||||
Download or clone the `qmk_firmware` repo and navigate to its top level directory. Once your build environment is setup, you'll be able to generate the default .hex using:
|
||||
|
||||
```
|
||||
$ make handwired/dactyl_manuform/4x5:dvorak
|
||||
```
|
||||
|
||||
You will see a lot of output and if everything worked correctly you will see the built hex file:
|
||||
|
||||
```
|
||||
dactyl_manuform_4x5_dvorak.hex
|
||||
```
|
||||
|
||||
If you would like to use one of the alternative keymaps, or create your own, copy one of the existing [keymaps](keymaps/) and run make like so:
|
||||
|
||||
```
|
||||
$ make handwired/dactyl_manuform/4x5:YOUR_KEYMAP_NAME
|
||||
```
|
||||
|
||||
If everything worked correctly you will see a file:
|
||||
|
||||
```
|
||||
dactyl_manuform_4x5_YOUR_KEYMAP_NAME.hex
|
||||
```
|
||||
|
||||
For more information on customizing keymaps, take a look at the primary documentation for [Customizing Your Keymap](/docs/faq_keymap.md) in the main readme.md.
|
||||
|
||||
## Keymaps
|
||||
Currently there are only two keymaps: Qwerty and Dvorak, feel free to make changes and contribute your keymap.
|
||||
### Qwerty and Dvorak
|
||||
Qwerty base layer:
|
||||

|
||||
Dvorak base layer:
|
||||

|
||||
Both keymaps have the same Raise and Lower layers:
|
||||
Raise Layer
|
||||

|
||||
Lower Layer
|
||||

|
||||
|
||||
Required Hardware
|
||||
-----------------
|
||||
|
||||
Apart from diodes and key switches for the keyboard matrix in each half, you
|
||||
will need:
|
||||
|
||||
* 2 Arduino Pro Micros. You can find these on AliExpress for ≈3.50USD each.
|
||||
* 2 TRRS sockets and 1 TRRS cable, or 2 TRS sockets and 1 TRS cable
|
||||
|
||||
Alternatively, you can use any sort of cable and socket that has at least 3
|
||||
wires. If you want to use I2C to communicate between halves, you will need a
|
||||
cable with at least 4 wires and 2x 4.7kΩ pull-up resistors
|
||||
|
||||
Optional Hardware
|
||||
-----------------
|
||||
A speaker can be hooked-up to either side to the `5` (`C6`) pin and `GND`, and turned on via `AUDIO_ENABLE`.
|
||||
|
||||
Wiring
|
||||
------
|
||||
|
||||
The 3 wires of the TRS/TRRS cable need to connect GND, VCC, and digital pin 3 (i.e.
|
||||
PD0 on the ATmega32u4) between the two Pro Micros.
|
||||
|
||||
Next, wire your key matrix to any of the remaining 17 IO pins of the pro micro
|
||||
and modify the `matrix.c` accordingly.
|
||||
|
||||
The wiring for serial:
|
||||
|
||||

|
||||
|
||||
The wiring for i2c:
|
||||
|
||||

|
||||
|
||||
The pull-up resistors may be placed on either half. It is also possible
|
||||
to use 4 resistors and have the pull-ups in both halves, but this is
|
||||
unnecessary in simple use cases.
|
||||
|
||||
You can change your configuration between serial and i2c by modifying your `config.h` file.
|
||||
|
||||
Notes on Software Configuration
|
||||
-------------------------------
|
||||
|
||||
the keymaps in here are for the 4x5 layout of the keyboard only.
|
||||
|
||||
Flashing
|
||||
-------
|
||||
From the top level `qmk_firmware` directory run `make KEYBOARD:KEYMAP:avrdude` for automatic serial port resolution and flashing.
|
||||
Example: `make lets_split/rev2:default:avrdude`
|
||||
|
||||
|
||||
Choosing which board to plug the USB cable into (choosing Master)
|
||||
--------
|
||||
Because the two boards are identical, the firmware has logic to differentiate the left and right board.
|
||||
|
||||
It uses two strategies to figure things out: looking at the EEPROM (memory on the chip) or looking if the current board has the usb cable.
|
||||
|
||||
The EEPROM approach requires additional setup (flashing the eeprom) but allows you to swap the usb cable to either side.
|
||||
|
||||
The USB cable approach is easier to setup and if you just want the usb cable on the left board, you do not need to do anything extra.
|
||||
|
||||
### Setting the left hand as master
|
||||
If you always plug the usb cable into the left board, nothing extra is needed as this is the default. Comment out `EE_HANDS` and comment out `I2C_MASTER_RIGHT` or `MASTER_RIGHT` if for some reason it was set.
|
||||
|
||||
### Setting the right hand as master
|
||||
If you always plug the usb cable into the right board, add an extra flag to your `config.h`
|
||||
```
|
||||
#define MASTER_RIGHT
|
||||
```
|
||||
|
||||
### Setting EE_hands to use either hands as master
|
||||
If you define `EE_HANDS` in your `config.h`, you will need to set the
|
||||
EEPROM for the left and right halves.
|
||||
|
||||
The EEPROM is used to store whether the
|
||||
half is left handed or right handed. This makes it so that the same firmware
|
||||
file will run on both hands instead of having to flash left and right handed
|
||||
versions of the firmware to each half. To flash the EEPROM file for the left
|
||||
half run:
|
||||
```
|
||||
avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-lefthand.eep
|
||||
// or the equivalent in dfu-programmer
|
||||
|
||||
```
|
||||
and similarly for right half
|
||||
```
|
||||
avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-righhand.eep
|
||||
// or the equivalent in dfu-programmer
|
||||
```
|
||||
|
||||
NOTE: replace `$(COM_PORT)` with the port of your device (e.g. `/dev/ttyACM0`)
|
||||
|
||||
After you have flashed the EEPROM, you then need to set `EE_HANDS` in your config.h, rebuild the hex files and reflash.
|
||||
|
||||
Note that you need to program both halves, but you have the option of using
|
||||
different keymaps for each half. You could program the left half with a QWERTY
|
||||
layout and the right half with a Colemak layout using bootmagic's default layout option.
|
||||
Then if you connect the left half to a computer by USB the keyboard will use QWERTY and Colemak when the
|
||||
right half is connected.
|
||||
|
||||
|
||||
Notes on Using Pro Micro 3.3V
|
||||
-----------------------------
|
||||
|
||||
Do update the `F_CPU` parameter in `rules.mk` to `8000000` which reflects
|
||||
the frequency on the 3.3V board.
|
||||
|
||||
Also, if the slave board is producing weird characters in certain columns,
|
||||
update the following line in `matrix.c` to the following:
|
||||
|
||||
```
|
||||
// _delay_us(30); // without this wait read unstable value.
|
||||
_delay_us(300); // without this wait read unstable value.
|
||||
```
|
@ -1,47 +1,3 @@
|
||||
# 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)
|
||||
|
||||
# Bootloader
|
||||
# This definition is optional, and if your keyboard supports multiple bootloaders of
|
||||
# different sizes, comment this out, and the correct address will be loaded
|
||||
# automatically (+60). See bootloader.mk for all options.
|
||||
BOOTLOADER = caterina
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
@ -59,10 +15,7 @@ AUDIO_ENABLE = no # 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.
|
||||
SUBPROJECT_rev1 = yes
|
||||
USE_I2C = yes
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
SPLIT_KEYBOARD = yes
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "dactyl_manuform.h"
|
||||
#include "5x6.h"
|
||||
|
||||
|
||||
#ifdef SSD1306OLED
|
@ -1,5 +1,4 @@
|
||||
#ifndef REV2_H
|
||||
#define REV2_H
|
||||
#pragma once
|
||||
|
||||
#include "dactyl_manuform.h"
|
||||
|
||||
@ -44,4 +43,4 @@
|
||||
{ R50, R51, R52, R53, KC_NO, KC_NO }, \
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -16,18 +16,12 @@ 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
|
||||
#pragma once
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x3060
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER tshort
|
||||
#define PRODUCT Dactyl-Manuform
|
||||
#define DESCRIPTION A split keyboard for the cheap makers
|
||||
|
||||
#define PRODUCT Dactyl-Manuform (5x6)
|
||||
|
||||
/* key matrix size */
|
||||
// Rows are doubled-up
|
||||
@ -45,53 +39,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
/* number of backlight levels */
|
||||
// #define BACKLIGHT_LEVELS 3
|
||||
|
||||
/* mouse config */
|
||||
#define MOUSEKEY_INTERVAL 20
|
||||
#define MOUSEKEY_DELAY 0
|
||||
#define MOUSEKEY_TIME_TO_MAX 60
|
||||
#define MOUSEKEY_MAX_SPEED 7
|
||||
#define MOUSEKEY_WHEEL_DELAY 0
|
||||
|
||||
/* Set 0 if debouncing isn't needed */
|
||||
#define DEBOUNCING_DELAY 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)) \
|
||||
)
|
||||
|
||||
/* Enables This makes it easier for fast typists to use dual-function keys */
|
||||
#define PERMISSIVE_HOLD
|
||||
|
||||
/* ws2812 RGB LED */
|
||||
#define RGB_DI_PIN D3
|
||||
#define RGBLIGHT_TIMER
|
||||
#define RGBLED_NUM 12 // Number of LEDs
|
||||
#define ws2812_PORTREG PORTD
|
||||
#define ws2812_DDRREG DDRD
|
||||
|
||||
/*
|
||||
* 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,27 @@
|
||||
/*
|
||||
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/>.
|
||||
*/
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#define USE_SERIAL
|
||||
|
||||
#define MASTER_LEFT
|
||||
// #define MASTER_RIGHT
|
||||
//#define EE_HANDS
|
||||
// Rows are doubled-up
|
@ -0,0 +1,56 @@
|
||||
/* A standard layout for the Dactyl Manuform 5x6 Keyboard */
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
extern keymap_config_t keymap_config;
|
||||
|
||||
#define _QWERTY 0
|
||||
#define _LOWER 1
|
||||
#define _RAISE 2
|
||||
|
||||
#define RAISE MO(_RAISE)
|
||||
#define LOWER MO(_LOWER)
|
||||
|
||||
#define _______ KC_TRNS
|
||||
|
||||
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[_QWERTY] = LAYOUT_5x6(
|
||||
KC_ESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 ,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_MINS,
|
||||
KC_LSFT, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L ,KC_SCLN,KC_QUOT,
|
||||
KC_LCTL, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_BSLASH,
|
||||
KC_LBRC,KC_RBRC, KC_PLUS, KC_EQL,
|
||||
RAISE,KC_SPC, KC_ENT, LOWER,
|
||||
KC_TAB,KC_HOME, KC_END, KC_DEL,
|
||||
KC_BSPC, KC_GRV, KC_LGUI, KC_LALT
|
||||
),
|
||||
|
||||
[_LOWER] = LAYOUT_5x6(
|
||||
|
||||
KC_TILD,KC_EXLM, KC_AT ,KC_HASH,KC_DLR ,KC_PERC, KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,KC_DEL,
|
||||
_______,_______,_______,_______,_______,KC_LBRC, KC_RBRC, KC_P7 , KC_P8 , KC_P9 ,_______,KC_PLUS,
|
||||
_______,KC_HOME,KC_PGUP,KC_PGDN,KC_END ,KC_LPRN, KC_RPRN, KC_P4 , KC_P5 , KC_P6 ,KC_MINS,KC_PIPE,
|
||||
_______,_______,_______,_______,_______,_______, _______, KC_P1 , KC_P2 , KC_P3 ,KC_EQL ,KC_UNDS,
|
||||
_______,KC_PSCR, _______, KC_P0,
|
||||
_______,_______, _______,_______,
|
||||
_______,_______, _______,_______,
|
||||
_______,_______, _______,_______
|
||||
|
||||
),
|
||||
|
||||
[_RAISE] = LAYOUT_5x6(
|
||||
KC_F12 , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 ,KC_F10 ,KC_F11 ,
|
||||
_______,_______,_______,_______,_______,KC_LBRC, KC_RBRC,_______,KC_NLCK,KC_INS ,KC_SLCK,KC_MUTE,
|
||||
_______,KC_LEFT,KC_UP ,KC_DOWN,KC_RGHT,KC_LPRN, KC_RPRN,KC_MPRV,KC_MPLY,KC_MNXT,_______,KC_VOLU,
|
||||
_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,KC_VOLD,
|
||||
_______,_______, KC_EQL ,_______,
|
||||
_______,_______, _______,_______,
|
||||
_______,_______, _______,_______,
|
||||
_______,_______, _______,_______
|
||||
),
|
||||
};
|
||||
|
||||
|
@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define USE_SERIAL
|
||||
|
||||
@ -22,7 +23,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
// #define MASTER_RIGHT
|
||||
//#define EE_HANDS
|
||||
// Rows are doubled-up
|
||||
#define MATRIX_ROWS 12
|
||||
#define MATRIX_COLS 6
|
||||
|
||||
#include "../../config.h"
|
||||
|
@ -1,28 +1,14 @@
|
||||
#include "dactyl_manuform.h"
|
||||
#include "action_layer.h"
|
||||
#include "eeconfig.h"
|
||||
|
||||
/* A QWERTY 3 Layer layout for the Dactyl Manuform 5x6 Keyboard */
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
extern keymap_config_t keymap_config;
|
||||
|
||||
// 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 _QWERTY 0
|
||||
#define _LOWER 1
|
||||
#define _RAISE 2
|
||||
|
||||
#define SFT_ESC SFT_T(KC_ESC)
|
||||
#define CTL_BSPC CTL_T(KC_BSPC)
|
||||
#define ALT_SPC ALT_T(KC_SPC)
|
||||
#define SFT_ENT SFT_T(KC_ENT)
|
||||
|
||||
#define KC_ML KC_MS_LEFT
|
||||
#define KC_MR KC_MS_RIGHT
|
||||
#define KC_MU KC_MS_UP
|
||||
#define KC_MD KC_MS_DOWN
|
||||
#define KC_MB1 KC_MS_BTN1
|
||||
#define KC_MB2 KC_MS_BTN1
|
||||
#define RAISE MO(_RAISE)
|
||||
#define LOWER MO(_LOWER)
|
||||
|
||||
@ -33,18 +19,19 @@ extern keymap_config_t keymap_config;
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
|
||||
[_QWERTY] = LAYOUT_5x6(
|
||||
KC_ESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 ,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_MINS,
|
||||
KC_LSFT, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L ,KC_SCLN,KC_QUOT,
|
||||
KC_LCTL, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_BSLASH,
|
||||
KC_LBRC,KC_RBRC, KC_PLUS, KC_EQL,
|
||||
RAISE,KC_SPC, KC_ENT, LOWER,
|
||||
KC_TAB,KC_HOME, KC_END, KC_DEL,
|
||||
KC_BSPC, KC_GRV, KC_LGUI, KC_LALT
|
||||
),
|
||||
[_QWERTY] = LAYOUT_5x6(
|
||||
KC_ESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 ,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_MINS,
|
||||
KC_LSFT, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L ,KC_SCLN,KC_QUOT,
|
||||
KC_LCTL, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_BSLASH,
|
||||
KC_LBRC,KC_RBRC, KC_PLUS, KC_EQL,
|
||||
RAISE,KC_SPC, KC_ENT, LOWER,
|
||||
KC_TAB,KC_HOME, KC_END, KC_DEL,
|
||||
KC_BSPC,KC_GRV, KC_LGUI, KC_LALT
|
||||
),
|
||||
|
||||
[_LOWER] = LAYOUT_5x6(
|
||||
|
||||
[_LOWER] = LAYOUT_5x6(
|
||||
KC_TILD,KC_EXLM, KC_AT ,KC_HASH,KC_DLR ,KC_PERC, KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,KC_DEL,
|
||||
_______,_______,_______,_______,_______,KC_LBRC, KC_RBRC, KC_P7 , KC_P8 , KC_P9 ,_______,KC_PLUS,
|
||||
_______,KC_HOME,KC_PGUP,KC_PGDN,KC_END ,KC_LPRN, KC_RPRN, KC_P4 , KC_P5 , KC_P6 ,KC_MINS,KC_PIPE,
|
||||
@ -53,23 +40,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
_______,_______, _______,_______,
|
||||
_______,_______, _______,_______,
|
||||
_______,_______, _______,_______
|
||||
|
||||
),
|
||||
|
||||
[_RAISE] = LAYOUT_5x6(
|
||||
KC_F12 , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 ,KC_F10 ,KC_F11 ,
|
||||
_______,_______,_______,_______,_______,KC_LBRC, KC_RBRC,_______,KC_NLCK,KC_INS ,KC_SLCK,KC_MUTE,
|
||||
_______,KC_LEFT,KC_UP ,KC_DOWN,KC_RGHT,KC_LPRN, KC_RPRN,KC_MPRV,KC_MPLY,KC_MNXT,_______,KC_VOLU,
|
||||
_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,KC_VOLD,
|
||||
_______,_______, KC_EQL ,_______,
|
||||
_______,_______, _______,_______,
|
||||
_______,_______, _______,_______,
|
||||
_______,_______, _______,_______
|
||||
KC_F12 , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 ,KC_F10 ,KC_F11 ,
|
||||
_______,_______,_______,_______,_______,KC_LBRC, KC_RBRC,_______,KC_NLCK,KC_INS ,KC_SLCK,KC_MUTE,
|
||||
_______,KC_LEFT,KC_UP ,KC_DOWN,KC_RGHT,KC_LPRN, KC_RPRN,KC_MPRV,KC_MPLY,KC_MNXT,_______,KC_VOLU,
|
||||
_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,KC_VOLD,
|
||||
_______,_______, KC_EQL ,_______,
|
||||
_______,_______, _______,_______,
|
||||
_______,_______, _______,_______,
|
||||
_______,_______, _______,_______
|
||||
),
|
||||
|
||||
};
|
||||
|
||||
|
||||
void persistant_default_layer_set(uint16_t default_layer) {
|
||||
eeconfig_update_default_layer(default_layer);
|
||||
default_layer_set(default_layer);
|
||||
}
|
||||
|
@ -1,47 +1,3 @@
|
||||
# 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)
|
||||
|
||||
# Bootloader
|
||||
# This definition is optional, and if your keyboard supports multiple bootloaders of
|
||||
# different sizes, comment this out, and the correct address will be loaded
|
||||
# automatically (+60). See bootloader.mk for all options.
|
||||
BOOTLOADER = caterina
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
@ -59,9 +15,7 @@ AUDIO_ENABLE = no # 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.
|
||||
SUBPROJECT_rev1 = yes
|
||||
USE_I2C = yes
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
SPLIT_KEYBOARD = yes
|
23
keyboards/handwired/dactyl_manuform/6x6/6x6.c
Normal file
23
keyboards/handwired/dactyl_manuform/6x6/6x6.c
Normal file
@ -0,0 +1,23 @@
|
||||
#include "6x6.h"
|
||||
|
||||
|
||||
#ifdef SSD1306OLED
|
||||
void led_set_kb(uint8_t usb_led) {
|
||||
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
||||
led_set_user(usb_led);
|
||||
}
|
||||
#endif
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
|
||||
// // green led on
|
||||
// DDRD |= (1<<5);
|
||||
// PORTD &= ~(1<<5);
|
||||
|
||||
// // orange led on
|
||||
// DDRB |= (1<<0);
|
||||
// PORTB &= ~(1<<0);
|
||||
|
||||
matrix_init_user();
|
||||
};
|
||||
|
44
keyboards/handwired/dactyl_manuform/6x6/6x6.h
Normal file
44
keyboards/handwired/dactyl_manuform/6x6/6x6.h
Normal file
@ -0,0 +1,44 @@
|
||||
#pragma once
|
||||
|
||||
#include "dactyl_manuform.h"
|
||||
#include "quantum.h"
|
||||
|
||||
|
||||
#ifdef USE_I2C
|
||||
#include <stddef.h>
|
||||
#ifdef __AVR__
|
||||
#include <avr/io.h>
|
||||
#include <avr/interrupt.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define LAYOUT_6x6(\
|
||||
L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \
|
||||
L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \
|
||||
L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \
|
||||
L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \
|
||||
L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, R45, \
|
||||
L52, L53, R52, R53, \
|
||||
L54, L55, R50, R51, \
|
||||
L64, L65, R60, R61, \
|
||||
L62, L63, R62, R63 \
|
||||
) \
|
||||
{ \
|
||||
{ L00, L01, L02, L03, L04, L05 }, \
|
||||
{ L10, L11, L12, L13, L14, L15 }, \
|
||||
{ L20, L21, L22, L23, L24, L25 }, \
|
||||
{ L30, L31, L32, L33, L34, L35 }, \
|
||||
{ L40, L41, L42, L43, L44, L45 }, \
|
||||
{ KC_NO, KC_NO, L52, L53, L54, L55 }, \
|
||||
{ KC_NO, KC_NO, L62, L63, L64, L65 }, \
|
||||
\
|
||||
{ R00, R01, R02, R03, R04, R05 }, \
|
||||
{ R10, R11, R12, R13, R14, R15 }, \
|
||||
{ R20, R21, R22, R23, R24, R25 }, \
|
||||
{ R30, R31, R32, R33, R34, R35 }, \
|
||||
{ R40, R41, R42, R43, R44, R45 }, \
|
||||
{ R50, R51, R52, R53, KC_NO, KC_NO },\
|
||||
{ R60, R61, R62, R63, KC_NO, KC_NO }, \
|
||||
}
|
||||
|
||||
|
33
keyboards/handwired/dactyl_manuform/6x6/config.h
Normal file
33
keyboards/handwired/dactyl_manuform/6x6/config.h
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
Copyright 2015 Jack Humbert
|
||||
|
||||
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/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
|
||||
#define PRODUCT Dactyl-Manuform (6x6)
|
||||
|
||||
/* key matrix size */
|
||||
// Rows are doubled-up
|
||||
#define MATRIX_ROWS 14
|
||||
#define MATRIX_COLS 6
|
||||
|
||||
// wiring of each half
|
||||
#define MATRIX_COL_PINS { D4, C6, D7, E6, B4, B5 }
|
||||
#define MATRIX_ROW_PINS { F5, F6, F7, B1, B3, B2, B6 }
|
@ -0,0 +1,27 @@
|
||||
/*
|
||||
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/>.
|
||||
*/
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#define USE_SERIAL
|
||||
|
||||
#define MASTER_LEFT
|
||||
// #define MASTER_RIGHT
|
||||
//#define EE_HANDS
|
||||
// Rows are doubled-up
|
@ -0,0 +1,57 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
extern keymap_config_t keymap_config;
|
||||
|
||||
#define _QWERTY 0
|
||||
#define _LOWER 1
|
||||
#define _RAISE 2
|
||||
|
||||
#define RAISE MO(_RAISE)
|
||||
#define LOWER MO(_LOWER)
|
||||
|
||||
#define _______ KC_TRNS
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[_QWERTY] = LAYOUT_6x6(
|
||||
|
||||
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_ESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 ,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_MINS,
|
||||
KC_LSFT, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L ,KC_SCLN,KC_QUOT,
|
||||
KC_LCTL, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_BSLASH,
|
||||
KC_LBRC,KC_RBRC, KC_PLUS, KC_EQL,
|
||||
RAISE,KC_SPC, KC_ENT, LOWER,
|
||||
KC_TAB,KC_HOME, KC_END, KC_DEL,
|
||||
KC_BSPC, KC_GRV, KC_LGUI, KC_LALT
|
||||
),
|
||||
|
||||
[_LOWER] = LAYOUT_6x6(
|
||||
|
||||
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_TILD,KC_EXLM, KC_AT ,KC_HASH,KC_DLR ,KC_PERC, KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,KC_DEL,
|
||||
_______,_______,_______,_______,_______,KC_LBRC, KC_RBRC, KC_P7 , KC_P8 , KC_P9 ,_______,KC_PLUS,
|
||||
_______,KC_HOME,KC_PGUP,KC_PGDN,KC_END ,KC_LPRN, KC_RPRN, KC_P4 , KC_P5 , KC_P6 ,KC_MINS,KC_PIPE,
|
||||
_______,_______,_______,_______,_______,_______, _______, KC_P1 , KC_P2 , KC_P3 ,KC_EQL ,KC_UNDS,
|
||||
_______,KC_PSCR, _______, KC_P0,
|
||||
_______,_______, _______,_______,
|
||||
_______,_______, _______,_______,
|
||||
_______,_______, _______,_______
|
||||
),
|
||||
|
||||
[_RAISE] = LAYOUT_6x6(
|
||||
|
||||
KC_F12 , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 ,KC_F10 ,KC_F11 ,
|
||||
_______,_______,_______,_______,_______,KC_LBRC, KC_RBRC,_______,KC_NLCK,KC_INS ,KC_SLCK,KC_MUTE,
|
||||
_______,KC_LEFT,KC_UP ,KC_DOWN,KC_RGHT,KC_LPRN, KC_RPRN,KC_MPRV,KC_MPLY,KC_MNXT,_______,KC_VOLU,
|
||||
_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,KC_VOLD,
|
||||
_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______,
|
||||
|
||||
_______,_______, KC_EQL ,_______,
|
||||
_______,_______, _______,_______,
|
||||
_______,_______, _______,_______,
|
||||
_______,_______, _______,_______
|
||||
),
|
||||
|
||||
};
|
||||
|
21
keyboards/handwired/dactyl_manuform/6x6/rules.mk
Normal file
21
keyboards/handwired/dactyl_manuform/6x6/rules.mk
Normal file
@ -0,0 +1,21 @@
|
||||
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE = no # 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 = no # 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 = no # 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
|
||||
|
78
keyboards/handwired/dactyl_manuform/config.h
Normal file
78
keyboards/handwired/dactyl_manuform/config.h
Normal file
@ -0,0 +1,78 @@
|
||||
/*
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
Copyright 2015 Jack Humbert
|
||||
|
||||
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/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x3060
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER tshort
|
||||
// defined in subfolder
|
||||
#define DESCRIPTION A split keyboard for the cheap makers
|
||||
|
||||
/* mouse config */
|
||||
#define MOUSEKEY_INTERVAL 20
|
||||
#define MOUSEKEY_DELAY 0
|
||||
#define MOUSEKEY_TIME_TO_MAX 60
|
||||
#define MOUSEKEY_MAX_SPEED 7
|
||||
#define MOUSEKEY_WHEEL_DELAY 0
|
||||
|
||||
/* Set 0 if debouncing isn't needed */
|
||||
#define DEBOUNCING_DELAY 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)) \
|
||||
)
|
||||
|
||||
/* Enables This makes it easier for fast typists to use dual-function keys */
|
||||
#define PERMISSIVE_HOLD
|
||||
|
||||
/* ws2812 RGB LED */
|
||||
#define RGB_DI_PIN D3
|
||||
#define RGBLIGHT_TIMER
|
||||
#define RGBLED_NUM 12 // Number of LEDs
|
||||
|
||||
|
||||
/*
|
||||
* 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
|
||||
|
||||
|
1
keyboards/handwired/dactyl_manuform/dactyl_manuform.c
Normal file
1
keyboards/handwired/dactyl_manuform/dactyl_manuform.c
Normal file
@ -0,0 +1 @@
|
||||
#include "dactyl_manuform.h"
|
25
keyboards/handwired/dactyl_manuform/dactyl_manuform.h
Normal file
25
keyboards/handwired/dactyl_manuform/dactyl_manuform.h
Normal file
@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
|
||||
#ifdef KEYBOARD_handwired_dactyl_manuform_6x6
|
||||
#include "6x6.h"
|
||||
#elif KEYBOARD_handwired_dactyl_manuform_5x6
|
||||
#include "5x6.h"
|
||||
#elif KEYBOARD_handwired_dactyl_manuform_4x5
|
||||
#include "4x5.h"
|
||||
#endif
|
||||
|
||||
//void promicro_bootloader_jmp(bool program);
|
||||
#include "quantum.h"
|
||||
|
||||
|
||||
#ifdef USE_I2C
|
||||
#include <stddef.h>
|
||||
#ifdef __AVR__
|
||||
#include <avr/io.h>
|
||||
#include <avr/interrupt.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -1,32 +1,55 @@
|
||||
Dactyl Manuform 5x6
|
||||
Dactyl Manuform (4x5, 5x6, 6x6)
|
||||
======
|
||||
the [Dactyl-Manuform](https://github.com/tshort/dactyl-keyboard) is a split curved keyboard based on the design of [adereth dactyl](https://github.com/adereth/dactyl-keyboard) and thumb cluster design of the [manuform](https://geekhack.org/index.php?topic=46015.0) keyboard, the hardware is similar to the let's split keyboard. all information needed for making one is in the first link.
|
||||

|
||||
|
||||
|
||||
## First Time Setup
|
||||
|
||||
-----------------
|
||||
Download or clone the `qmk_firmware` repo and navigate to its top level directory. Once your build environment is setup, you'll be able to generate the default .hex using:
|
||||
|
||||
Depending on your Layout chose one of the follwing commands:
|
||||
|
||||
```
|
||||
$ make handwired/dactyl_manuform/5x6:YOUR_KEYMAP_NAME
|
||||
$ make handwired/dactyl_manuform/YOUR_LAYOUT:YOUR_KEYMAP_NAME
|
||||
```
|
||||
|
||||
example:
|
||||
```
|
||||
$ make handwired/dactyl_manuform/4x5:default
|
||||
```
|
||||
|
||||
If everything worked correctly you will see a file:
|
||||
|
||||
```
|
||||
dactyl_manuform_5x6_YOUR_KEYMAP_NAME.hex
|
||||
dactyl_manuform_YOUR_LAYOUT_YOUR_KEYMAP_NAME.hex
|
||||
```
|
||||
|
||||
For more information on customizing keymaps, take a look at the primary documentation for [Customizing Your Keymap](/docs/faq_keymap.md) in the main readme.md.
|
||||
|
||||
|
||||
## Keymaps
|
||||
Currently there are only two keymaps: Qwerty and Dvorak, feel free to make changes and contribute your keymap.
|
||||
### Impstyle
|
||||
-----------------
|
||||
### [Keymaps 4x5](/keyboards/handwired/dactyl_manuform/4x5/keymaps/)
|
||||
|
||||
#### Default
|
||||
Simple QWERTY layout with 3 Layers.
|
||||
#### Dvorak
|
||||
|
||||
### [Keymaps 5x6](/keyboards/handwired/dactyl_manuform/5x6/keymaps/)
|
||||
|
||||
Required Hardware
|
||||
#### Default
|
||||
Just a copy of the Impstyle keymap. Feel free to adjust it.
|
||||
|
||||
#### Impstyle
|
||||
A simple QWERTY keymap with 3 Layers. Both sides are connected via serial and the Left ist the master.
|
||||
|
||||
### [Keymaps 6x6](/keyboards/handwired/dactyl_manuform/6x6/keymaps/)
|
||||
|
||||
#### Default
|
||||
Simple QWERTY layout with 3 Layers.
|
||||
|
||||
##Required Hardware
|
||||
-----------------
|
||||
|
||||
Apart from diodes and key switches for the keyboard matrix in each half, you
|
||||
@ -39,11 +62,11 @@ Alternatively, you can use any sort of cable and socket that has at least 3
|
||||
wires. If you want to use I2C to communicate between halves, you will need a
|
||||
cable with at least 4 wires and 2x 4.7kΩ pull-up resistors
|
||||
|
||||
Optional Hardware
|
||||
##Optional Hardware
|
||||
-----------------
|
||||
A speaker can be hooked-up to either side to the `5` (`C6`) pin and `GND`, and turned on via `AUDIO_ENABLE`.
|
||||
|
||||
Wiring
|
||||
##Wiring
|
||||
------
|
||||
|
||||
The 3 wires of the TRS/TRRS cable need to connect GND, VCC, and digital pin 3 (i.e.
|
||||
@ -66,18 +89,18 @@ unnecessary in simple use cases.
|
||||
|
||||
You can change your configuration between serial and i2c by modifying your `config.h` file.
|
||||
|
||||
Notes on Software Configuration
|
||||
##Notes on Software Configuration
|
||||
-------------------------------
|
||||
|
||||
the keymaps in here are for the 4x5 layout of the keyboard only.
|
||||
|
||||
Flashing
|
||||
##Flashing
|
||||
-------
|
||||
From the top level `qmk_firmware` directory run `make KEYBOARD:KEYMAP:avrdude` for automatic serial port resolution and flashing.
|
||||
Example: `make lets_split/rev2:default:avrdude`
|
||||
|
||||
To flash your firmware take a look at: [Flashing Instructions and Bootloader Information](https://docs.qmk.fm/#/flashing)
|
||||
|
||||
|
||||
Choosing which board to plug the USB cable into (choosing Master)
|
||||
##Choosing which board to plug the USB cable into (choosing Master)
|
||||
--------
|
||||
Because the two boards are identical, the firmware has logic to differentiate the left and right board.
|
||||
|
66
keyboards/handwired/dactyl_manuform/rules.mk
Normal file
66
keyboards/handwired/dactyl_manuform/rules.mk
Normal file
@ -0,0 +1,66 @@
|
||||
# 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)
|
||||
|
||||
# Bootloader
|
||||
# This definition is optional, and if your keyboard supports multiple bootloaders of
|
||||
# different sizes, comment this out, and the correct address will be loaded
|
||||
# automatically (+60). See bootloader.mk for all options.
|
||||
BOOTLOADER = caterina
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE = no # 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 = no # 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 = no # 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
|
||||
|
||||
SPLIT_KEYBOARD = yes
|
@ -81,7 +81,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | Shift| Y | S | N | I | U |Space | | | | | | | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | Ctrl | Alt | win | Sym | Num | OPT | Ent | | | | | | | |
|
||||
* | Ctrl | Alt | Gui | Sym | Num | OPT | Ent | | | | | | | |
|
||||
* `-------------------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_BASE] = LAYOUT( \
|
||||
@ -256,8 +256,31 @@ void register_delay_code(uint8_t layer){
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
struct keybuf {
|
||||
char col, row;
|
||||
char frame;
|
||||
};
|
||||
struct keybuf keybufs[256];
|
||||
unsigned char keybuf_begin, keybuf_end;
|
||||
|
||||
int col, row;
|
||||
#endif
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
col = record->event.key.col;
|
||||
row = record->event.key.row;
|
||||
if (record->event.pressed && ((row < 5 && is_master) || (row >= 5 && !is_master))) {
|
||||
int end = keybuf_end;
|
||||
keybufs[end].col = col;
|
||||
keybufs[end].row = row % 5;
|
||||
keybufs[end].frame = 0;
|
||||
keybuf_end ++;
|
||||
}
|
||||
#endif
|
||||
|
||||
if(tap_timer&&keycode!=OPT_TAP_SP){
|
||||
tapping_key = true;
|
||||
}
|
||||
@ -475,6 +498,61 @@ void music_scale_user(void)
|
||||
#define L_NFNLAYER 192
|
||||
#define L_MOUSECURSOR 256
|
||||
|
||||
// LED Effect
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
unsigned char rgb[7][5][3];
|
||||
void led_ripple_effect(char r, char g, char b) {
|
||||
static int scan_count = -10;
|
||||
static int keys[] = { 6, 6, 6, 7, 7 };
|
||||
static int keys_sum[] = { 0, 6, 12, 18, 25 };
|
||||
|
||||
if (scan_count == -1) {
|
||||
rgblight_enable_noeeprom();
|
||||
rgblight_mode(0);
|
||||
} else if (scan_count >= 0 && scan_count < 5) {
|
||||
for (unsigned char c=keybuf_begin; c!=keybuf_end; c++) {
|
||||
int i = c;
|
||||
// FIXME:
|
||||
|
||||
int y = scan_count;
|
||||
int dist_y = abs(y - keybufs[i].row);
|
||||
for (int x=0; x<keys[y]; x++) {
|
||||
int dist = abs(x - keybufs[i].col) + dist_y;
|
||||
if (dist <= keybufs[i].frame) {
|
||||
int elevation = MAX(0, (8 + dist - keybufs[i].frame)) << 2;
|
||||
if (elevation) {
|
||||
if ((rgb[x][y][0] != 255) && r) { rgb[x][y][0] = MIN(255, elevation + rgb[x][y][0]); }
|
||||
if ((rgb[x][y][1] != 255) && g) { rgb[x][y][1] = MIN(255, elevation + rgb[x][y][1]); }
|
||||
if ((rgb[x][y][2] != 255) && b) { rgb[x][y][2] = MIN(255, elevation + rgb[x][y][2]); }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (scan_count == 5) {
|
||||
for (unsigned char c=keybuf_begin; c!=keybuf_end; c++) {
|
||||
int i = c;
|
||||
if (keybufs[i].frame < 18) {
|
||||
keybufs[i].frame ++;
|
||||
} else {
|
||||
keybuf_begin ++;
|
||||
}
|
||||
}
|
||||
} else if (scan_count >= 6 && scan_count <= 10) {
|
||||
int y = scan_count - 6;
|
||||
for (int x=0; x<keys[y]; x++) {
|
||||
int at = keys_sum[y] + ((y & 1) ? x : (keys[y] - x - 1));
|
||||
led[at].r = rgb[x][y][0];
|
||||
led[at].g = rgb[x][y][1];
|
||||
led[at].b = rgb[x][y][2];
|
||||
}
|
||||
rgblight_set();
|
||||
} else if (scan_count == 11) {
|
||||
memset(rgb, 0, sizeof(rgb));
|
||||
}
|
||||
scan_count++;
|
||||
if (scan_count >= 12) { scan_count = 0; }
|
||||
}
|
||||
#endif
|
||||
|
||||
uint8_t layer_state_old;
|
||||
|
||||
@ -494,42 +572,44 @@ void matrix_scan_user(void) {
|
||||
if(layer_state_old != layer_state){
|
||||
switch (layer_state) {
|
||||
case L_BASE:
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
if (!RGBAnimation){
|
||||
rgblight_sethsv(187,255,255);
|
||||
rgblight_mode(1);
|
||||
}else{
|
||||
rgblight_mode(RGB_current_mode);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case L_OPT:
|
||||
register_delay_code(_OPT);
|
||||
break;
|
||||
case L_NUM:
|
||||
register_delay_code(_NUM);
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
rgblight_sethsv(25,255,255);
|
||||
rgblight_mode(1);
|
||||
#endif
|
||||
break;
|
||||
case L_SYM:
|
||||
register_delay_code(_SYM);
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
rgblight_sethsv(96,255,255);
|
||||
rgblight_mode(1);
|
||||
#endif
|
||||
break;
|
||||
case L_FUNC:
|
||||
register_delay_code(_FUNC);
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
rgblight_sethsv(331,255,255);
|
||||
rgblight_mode(1);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
layer_state_old = layer_state;
|
||||
}
|
||||
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
if(!RGBAnimation){
|
||||
switch (layer_state) {
|
||||
case L_BASE:
|
||||
led_ripple_effect(0,112,127);
|
||||
break;
|
||||
case L_OPT:
|
||||
led_ripple_effect(127,0,100);
|
||||
break;
|
||||
case L_NUM:
|
||||
led_ripple_effect(127,23,0);
|
||||
break;
|
||||
case L_SYM:
|
||||
led_ripple_effect(0,127,0);
|
||||
break;
|
||||
case L_FUNC:
|
||||
led_ripple_effect(127,0,61);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h
|
||||
|
5
keyboards/iris/keymaps/bmoorey/readme.md
Normal file
5
keyboards/iris/keymaps/bmoorey/readme.md
Normal file
@ -0,0 +1,5 @@
|
||||
This is (what I consider to be) an improvement over the default Iris keymap.
|
||||
It includes a QWERTY layer, a general system layer with arrows, volume control
|
||||
and a numpad on the right board; a second raised layer with function keys and
|
||||
more extensive media controls; and an adjust layer with controls for RGB
|
||||
underlighting.
|
@ -17,6 +17,20 @@
|
||||
{ K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, K412, K413, KC_NO } \
|
||||
}
|
||||
|
||||
#define LAYOUT_60_ansi_split_bksp_rshift( \
|
||||
K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \
|
||||
K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \
|
||||
K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K213, \
|
||||
K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \
|
||||
K400, K401, K402, K406, K410, K411, K412, K413 \
|
||||
) { \
|
||||
{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \
|
||||
{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, KC_NO }, \
|
||||
{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, KC_NO, K213, KC_NO }, \
|
||||
{ K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \
|
||||
{ K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, K412, K413, KC_NO } \
|
||||
}
|
||||
|
||||
#define LAYOUT_60_iso( \
|
||||
K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, \
|
||||
K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, \
|
||||
|
@ -63,4 +63,4 @@ RGBLIGHT_ENABLE = yes # Enable the RGB backlight
|
||||
# UNICODE_ENABLE = YES # Unicode
|
||||
# BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
|
||||
LAYOUTS = 60_ansi 60_iso 60_hhkb
|
||||
LAYOUTS = 60_ansi 60_ansi_split_bksp_rshift 60_iso 60_hhkb
|
||||
|
@ -1,162 +0,0 @@
|
||||
#include <util/twi.h>
|
||||
#include <avr/io.h>
|
||||
#include <stdlib.h>
|
||||
#include <avr/interrupt.h>
|
||||
#include <util/twi.h>
|
||||
#include <stdbool.h>
|
||||
#include "i2c.h"
|
||||
|
||||
#ifdef USE_I2C
|
||||
|
||||
// Limits the amount of we wait for any one i2c transaction.
|
||||
// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is
|
||||
// 9 bits, a single transaction will take around 90μs to complete.
|
||||
//
|
||||
// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit
|
||||
// poll loop takes at least 8 clock cycles to execute
|
||||
#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8
|
||||
|
||||
#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE)
|
||||
|
||||
volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE];
|
||||
|
||||
static volatile uint8_t slave_buffer_pos;
|
||||
static volatile bool slave_has_register_set = false;
|
||||
|
||||
// Wait for an i2c operation to finish
|
||||
inline static
|
||||
void i2c_delay(void) {
|
||||
uint16_t lim = 0;
|
||||
while(!(TWCR & (1<<TWINT)) && lim < I2C_LOOP_TIMEOUT)
|
||||
lim++;
|
||||
|
||||
// easier way, but will wait slightly longer
|
||||
// _delay_us(100);
|
||||
}
|
||||
|
||||
// Setup twi to run at 100kHz
|
||||
void i2c_master_init(void) {
|
||||
// no prescaler
|
||||
TWSR = 0;
|
||||
// Set TWI clock frequency to SCL_CLOCK. Need TWBR>10.
|
||||
// Check datasheets for more info.
|
||||
TWBR = ((F_CPU/SCL_CLOCK)-16)/2;
|
||||
}
|
||||
|
||||
// Start a transaction with the given i2c slave address. The direction of the
|
||||
// transfer is set with I2C_READ and I2C_WRITE.
|
||||
// returns: 0 => success
|
||||
// 1 => error
|
||||
uint8_t i2c_master_start(uint8_t address) {
|
||||
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTA);
|
||||
|
||||
i2c_delay();
|
||||
|
||||
// check that we started successfully
|
||||
if ( (TW_STATUS != TW_START) && (TW_STATUS != TW_REP_START))
|
||||
return 1;
|
||||
|
||||
TWDR = address;
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
|
||||
i2c_delay();
|
||||
|
||||
if ( (TW_STATUS != TW_MT_SLA_ACK) && (TW_STATUS != TW_MR_SLA_ACK) )
|
||||
return 1; // slave did not acknowledge
|
||||
else
|
||||
return 0; // success
|
||||
}
|
||||
|
||||
|
||||
// Finish the i2c transaction.
|
||||
void i2c_master_stop(void) {
|
||||
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
|
||||
|
||||
uint16_t lim = 0;
|
||||
while(!(TWCR & (1<<TWSTO)) && lim < I2C_LOOP_TIMEOUT)
|
||||
lim++;
|
||||
}
|
||||
|
||||
// Write one byte to the i2c slave.
|
||||
// returns 0 => slave ACK
|
||||
// 1 => slave NACK
|
||||
uint8_t i2c_master_write(uint8_t data) {
|
||||
TWDR = data;
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
|
||||
i2c_delay();
|
||||
|
||||
// check if the slave acknowledged us
|
||||
return (TW_STATUS == TW_MT_DATA_ACK) ? 0 : 1;
|
||||
}
|
||||
|
||||
// Read one byte from the i2c slave. If ack=1 the slave is acknowledged,
|
||||
// if ack=0 the acknowledge bit is not set.
|
||||
// returns: byte read from i2c device
|
||||
uint8_t i2c_master_read(int ack) {
|
||||
TWCR = (1<<TWINT) | (1<<TWEN) | (ack<<TWEA);
|
||||
|
||||
i2c_delay();
|
||||
return TWDR;
|
||||
}
|
||||
|
||||
void i2c_reset_state(void) {
|
||||
TWCR = 0;
|
||||
}
|
||||
|
||||
void i2c_slave_init(uint8_t address) {
|
||||
TWAR = address << 0; // slave i2c address
|
||||
// TWEN - twi enable
|
||||
// TWEA - enable address acknowledgement
|
||||
// TWINT - twi interrupt flag
|
||||
// TWIE - enable the twi interrupt
|
||||
TWCR = (1<<TWIE) | (1<<TWEA) | (1<<TWINT) | (1<<TWEN);
|
||||
}
|
||||
|
||||
ISR(TWI_vect);
|
||||
|
||||
ISR(TWI_vect) {
|
||||
uint8_t ack = 1;
|
||||
switch(TW_STATUS) {
|
||||
case TW_SR_SLA_ACK:
|
||||
// this device has been addressed as a slave receiver
|
||||
slave_has_register_set = false;
|
||||
break;
|
||||
|
||||
case TW_SR_DATA_ACK:
|
||||
// this device has received data as a slave receiver
|
||||
// The first byte that we receive in this transaction sets the location
|
||||
// of the read/write location of the slaves memory that it exposes over
|
||||
// i2c. After that, bytes will be written at slave_buffer_pos, incrementing
|
||||
// slave_buffer_pos after each write.
|
||||
if(!slave_has_register_set) {
|
||||
slave_buffer_pos = TWDR;
|
||||
// don't acknowledge the master if this memory loctaion is out of bounds
|
||||
if ( slave_buffer_pos >= SLAVE_BUFFER_SIZE ) {
|
||||
ack = 0;
|
||||
slave_buffer_pos = 0;
|
||||
}
|
||||
slave_has_register_set = true;
|
||||
} else {
|
||||
i2c_slave_buffer[slave_buffer_pos] = TWDR;
|
||||
BUFFER_POS_INC();
|
||||
}
|
||||
break;
|
||||
|
||||
case TW_ST_SLA_ACK:
|
||||
case TW_ST_DATA_ACK:
|
||||
// master has addressed this device as a slave transmitter and is
|
||||
// requesting data.
|
||||
TWDR = i2c_slave_buffer[slave_buffer_pos];
|
||||
BUFFER_POS_INC();
|
||||
break;
|
||||
|
||||
case TW_BUS_ERROR: // something went wrong, reset twi state
|
||||
TWCR = 0;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// Reset everything, so we are ready for the next TWI interrupt
|
||||
TWCR |= (1<<TWIE) | (1<<TWINT) | (ack<<TWEA) | (1<<TWEN);
|
||||
}
|
||||
#endif
|
@ -1,49 +0,0 @@
|
||||
#ifndef I2C_H
|
||||
#define I2C_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef F_CPU
|
||||
#define F_CPU 16000000UL
|
||||
#endif
|
||||
|
||||
#define I2C_READ 1
|
||||
#define I2C_WRITE 0
|
||||
|
||||
#define I2C_ACK 1
|
||||
#define I2C_NACK 0
|
||||
|
||||
#define SLAVE_BUFFER_SIZE 0x10
|
||||
|
||||
// i2c SCL clock frequency
|
||||
#define SCL_CLOCK 400000L
|
||||
|
||||
extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE];
|
||||
|
||||
void i2c_master_init(void);
|
||||
uint8_t i2c_master_start(uint8_t address);
|
||||
void i2c_master_stop(void);
|
||||
uint8_t i2c_master_write(uint8_t data);
|
||||
uint8_t i2c_master_read(int);
|
||||
void i2c_reset_state(void);
|
||||
void i2c_slave_init(uint8_t address);
|
||||
|
||||
|
||||
static inline unsigned char i2c_start_read(unsigned char addr) {
|
||||
return i2c_master_start((addr << 1) | I2C_READ);
|
||||
}
|
||||
|
||||
static inline unsigned char i2c_start_write(unsigned char addr) {
|
||||
return i2c_master_start((addr << 1) | I2C_WRITE);
|
||||
}
|
||||
|
||||
// from SSD1306 scrips
|
||||
extern unsigned char i2c_rep_start(unsigned char addr);
|
||||
extern void i2c_start_wait(unsigned char addr);
|
||||
extern unsigned char i2c_readAck(void);
|
||||
extern unsigned char i2c_readNak(void);
|
||||
extern unsigned char i2c_read(unsigned char ack);
|
||||
|
||||
#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak();
|
||||
|
||||
#endif
|
@ -3,6 +3,7 @@ This is the c configuration file for the keymap
|
||||
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
Copyright 2015 Jack Humbert
|
||||
Copyright 2018 Danny Nguyen <danny@keeb.io>
|
||||
|
||||
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
|
||||
@ -18,14 +19,9 @@ 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_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "config_common.h"
|
||||
#pragma once
|
||||
|
||||
/* Use I2C or Serial, not both */
|
||||
|
||||
#define USE_SERIAL
|
||||
// #define USE_I2C
|
||||
|
||||
#endif
|
||||
|
@ -1,467 +0,0 @@
|
||||
/*
|
||||
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/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
* scan matrix
|
||||
*/
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <avr/io.h>
|
||||
#include "wait.h"
|
||||
#include "print.h"
|
||||
#include "debug.h"
|
||||
#include "util.h"
|
||||
#include "matrix.h"
|
||||
#include "split_util.h"
|
||||
#include "pro_micro.h"
|
||||
#include "config.h"
|
||||
#include "timer.h"
|
||||
#include "backlight.h"
|
||||
|
||||
#ifdef USE_I2C
|
||||
# include "i2c.h"
|
||||
#else // USE_SERIAL
|
||||
# include "serial.h"
|
||||
#endif
|
||||
|
||||
#ifndef DEBOUNCING_DELAY
|
||||
# define DEBOUNCING_DELAY 5
|
||||
#endif
|
||||
|
||||
#if (DEBOUNCING_DELAY > 0)
|
||||
static uint16_t debouncing_time;
|
||||
static bool debouncing = false;
|
||||
#endif
|
||||
|
||||
#if (MATRIX_COLS <= 8)
|
||||
# define print_matrix_header() print("\nr/c 01234567\n")
|
||||
# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
|
||||
# define matrix_bitpop(i) bitpop(matrix[i])
|
||||
# define ROW_SHIFTER ((uint8_t)1)
|
||||
#else
|
||||
# error "Currently only supports 8 COLS"
|
||||
#endif
|
||||
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
|
||||
|
||||
#define ERROR_DISCONNECT_COUNT 5
|
||||
|
||||
#define SERIAL_LED_ADDR 0x00
|
||||
|
||||
#define ROWS_PER_HAND (MATRIX_ROWS/2)
|
||||
|
||||
static uint8_t error_count = 0;
|
||||
|
||||
static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
|
||||
static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
|
||||
|
||||
/* matrix state(1:on, 0:off) */
|
||||
static matrix_row_t matrix[MATRIX_ROWS];
|
||||
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
|
||||
|
||||
#if (DIODE_DIRECTION == COL2ROW)
|
||||
static void init_cols(void);
|
||||
static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row);
|
||||
static void unselect_rows(void);
|
||||
static void select_row(uint8_t row);
|
||||
static void unselect_row(uint8_t row);
|
||||
#elif (DIODE_DIRECTION == ROW2COL)
|
||||
static void init_rows(void);
|
||||
static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col);
|
||||
static void unselect_cols(void);
|
||||
static void unselect_col(uint8_t col);
|
||||
static void select_col(uint8_t col);
|
||||
#endif
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_init_kb(void) {
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_scan_kb(void) {
|
||||
matrix_scan_user();
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_init_user(void) {
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_scan_user(void) {
|
||||
}
|
||||
|
||||
inline
|
||||
uint8_t matrix_rows(void)
|
||||
{
|
||||
return MATRIX_ROWS;
|
||||
}
|
||||
|
||||
inline
|
||||
uint8_t matrix_cols(void)
|
||||
{
|
||||
return MATRIX_COLS;
|
||||
}
|
||||
|
||||
void matrix_init(void)
|
||||
{
|
||||
debug_enable = true;
|
||||
debug_matrix = true;
|
||||
debug_mouse = true;
|
||||
// initialize row and col
|
||||
unselect_rows();
|
||||
init_cols();
|
||||
|
||||
TX_RX_LED_INIT;
|
||||
|
||||
// initialize matrix state: all keys off
|
||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||
matrix[i] = 0;
|
||||
matrix_debouncing[i] = 0;
|
||||
}
|
||||
|
||||
matrix_init_quantum();
|
||||
|
||||
}
|
||||
|
||||
uint8_t _matrix_scan(void)
|
||||
{
|
||||
int offset = isLeftHand ? 0 : (ROWS_PER_HAND);
|
||||
#if (DIODE_DIRECTION == COL2ROW)
|
||||
// Set row, read cols
|
||||
for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) {
|
||||
# if (DEBOUNCING_DELAY > 0)
|
||||
bool matrix_changed = read_cols_on_row(matrix_debouncing+offset, current_row);
|
||||
|
||||
if (matrix_changed) {
|
||||
debouncing = true;
|
||||
debouncing_time = timer_read();
|
||||
}
|
||||
|
||||
# else
|
||||
read_cols_on_row(matrix+offset, current_row);
|
||||
# endif
|
||||
|
||||
}
|
||||
|
||||
#elif (DIODE_DIRECTION == ROW2COL)
|
||||
// Set col, read rows
|
||||
for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) {
|
||||
# if (DEBOUNCING_DELAY > 0)
|
||||
bool matrix_changed = read_rows_on_col(matrix_debouncing+offset, current_col);
|
||||
if (matrix_changed) {
|
||||
debouncing = true;
|
||||
debouncing_time = timer_read();
|
||||
}
|
||||
# else
|
||||
read_rows_on_col(matrix+offset, current_col);
|
||||
# endif
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
# if (DEBOUNCING_DELAY > 0)
|
||||
if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) {
|
||||
for (uint8_t i = 0; i < ROWS_PER_HAND; i++) {
|
||||
matrix[i+offset] = matrix_debouncing[i+offset];
|
||||
}
|
||||
debouncing = false;
|
||||
}
|
||||
# endif
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef USE_I2C
|
||||
|
||||
// Get rows from other half over i2c
|
||||
int i2c_transaction(void) {
|
||||
int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
|
||||
|
||||
int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE);
|
||||
if (err) goto i2c_error;
|
||||
|
||||
// start of matrix stored at 0x00
|
||||
err = i2c_master_write(0x00);
|
||||
if (err) goto i2c_error;
|
||||
|
||||
// Start read
|
||||
err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ);
|
||||
if (err) goto i2c_error;
|
||||
|
||||
if (!err) {
|
||||
int i;
|
||||
for (i = 0; i < ROWS_PER_HAND-1; ++i) {
|
||||
matrix[slaveOffset+i] = i2c_master_read(I2C_ACK);
|
||||
}
|
||||
matrix[slaveOffset+i] = i2c_master_read(I2C_NACK);
|
||||
i2c_master_stop();
|
||||
} else {
|
||||
i2c_error: // the cable is disconnceted, or something else went wrong
|
||||
i2c_reset_state();
|
||||
return err;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else // USE_SERIAL
|
||||
|
||||
int serial_transaction(void) {
|
||||
int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
|
||||
|
||||
if (serial_update_buffers()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
||||
matrix[slaveOffset+i] = serial_slave_buffer[i];
|
||||
}
|
||||
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
// Write backlight level for slave to read
|
||||
serial_master_buffer[SERIAL_LED_ADDR] = get_backlight_level();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
uint8_t matrix_scan(void)
|
||||
{
|
||||
uint8_t ret = _matrix_scan();
|
||||
|
||||
#ifdef USE_I2C
|
||||
if( i2c_transaction() ) {
|
||||
#else // USE_SERIAL
|
||||
if( serial_transaction() ) {
|
||||
#endif
|
||||
// turn on the indicator led when halves are disconnected
|
||||
TXLED1;
|
||||
|
||||
error_count++;
|
||||
|
||||
if (error_count > ERROR_DISCONNECT_COUNT) {
|
||||
// reset other half if disconnected
|
||||
int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
|
||||
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
||||
matrix[slaveOffset+i] = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// turn off the indicator led on no error
|
||||
TXLED0;
|
||||
error_count = 0;
|
||||
}
|
||||
matrix_scan_quantum();
|
||||
return ret;
|
||||
}
|
||||
|
||||
void matrix_slave_scan(void) {
|
||||
_matrix_scan();
|
||||
|
||||
int offset = (isLeftHand) ? 0 : ROWS_PER_HAND;
|
||||
|
||||
#ifdef USE_I2C
|
||||
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
||||
i2c_slave_buffer[i] = matrix[offset+i];
|
||||
}
|
||||
#else // USE_SERIAL
|
||||
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
||||
serial_slave_buffer[i] = matrix[offset+i];
|
||||
}
|
||||
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
// Read backlight level sent from master and update level on slave
|
||||
backlight_set(serial_master_buffer[SERIAL_LED_ADDR]);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
bool matrix_is_modified(void)
|
||||
{
|
||||
if (debouncing) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
inline
|
||||
bool matrix_is_on(uint8_t row, uint8_t col)
|
||||
{
|
||||
return (matrix[row] & ((matrix_row_t)1<<col));
|
||||
}
|
||||
|
||||
inline
|
||||
matrix_row_t matrix_get_row(uint8_t row)
|
||||
{
|
||||
return matrix[row];
|
||||
}
|
||||
|
||||
void matrix_print(void)
|
||||
{
|
||||
print("\nr/c 0123456789ABCDEF\n");
|
||||
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||
phex(row); print(": ");
|
||||
pbin_reverse16(matrix_get_row(row));
|
||||
print("\n");
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t matrix_key_count(void)
|
||||
{
|
||||
uint8_t count = 0;
|
||||
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||
count += bitpop16(matrix[i]);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
#if (DIODE_DIRECTION == COL2ROW)
|
||||
|
||||
static void init_cols(void)
|
||||
{
|
||||
for(uint8_t x = 0; x < MATRIX_COLS; x++) {
|
||||
uint8_t pin = col_pins[x];
|
||||
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||
}
|
||||
}
|
||||
|
||||
static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
|
||||
{
|
||||
// Store last value of row prior to reading
|
||||
matrix_row_t last_row_value = current_matrix[current_row];
|
||||
|
||||
// Clear data in matrix row
|
||||
current_matrix[current_row] = 0;
|
||||
|
||||
// Select row and wait for row selecton to stabilize
|
||||
select_row(current_row);
|
||||
wait_us(30);
|
||||
|
||||
// For each col...
|
||||
for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
|
||||
|
||||
// Select the col pin to read (active low)
|
||||
uint8_t pin = col_pins[col_index];
|
||||
uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF));
|
||||
|
||||
// Populate the matrix row with the state of the col pin
|
||||
current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index);
|
||||
}
|
||||
|
||||
// Unselect row
|
||||
unselect_row(current_row);
|
||||
|
||||
return (last_row_value != current_matrix[current_row]);
|
||||
}
|
||||
|
||||
static void select_row(uint8_t row)
|
||||
{
|
||||
uint8_t pin = row_pins[row];
|
||||
_SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT
|
||||
_SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW
|
||||
}
|
||||
|
||||
static void unselect_row(uint8_t row)
|
||||
{
|
||||
uint8_t pin = row_pins[row];
|
||||
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||
}
|
||||
|
||||
static void unselect_rows(void)
|
||||
{
|
||||
for(uint8_t x = 0; x < ROWS_PER_HAND; x++) {
|
||||
uint8_t pin = row_pins[x];
|
||||
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||
}
|
||||
}
|
||||
|
||||
#elif (DIODE_DIRECTION == ROW2COL)
|
||||
|
||||
static void init_rows(void)
|
||||
{
|
||||
for(uint8_t x = 0; x < ROWS_PER_HAND; x++) {
|
||||
uint8_t pin = row_pins[x];
|
||||
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||
}
|
||||
}
|
||||
|
||||
static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
|
||||
{
|
||||
bool matrix_changed = false;
|
||||
|
||||
// Select col and wait for col selecton to stabilize
|
||||
select_col(current_col);
|
||||
wait_us(30);
|
||||
|
||||
// For each row...
|
||||
for(uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++)
|
||||
{
|
||||
|
||||
// Store last value of row prior to reading
|
||||
matrix_row_t last_row_value = current_matrix[row_index];
|
||||
|
||||
// Check row pin state
|
||||
if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0)
|
||||
{
|
||||
// Pin LO, set col bit
|
||||
current_matrix[row_index] |= (ROW_SHIFTER << current_col);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Pin HI, clear col bit
|
||||
current_matrix[row_index] &= ~(ROW_SHIFTER << current_col);
|
||||
}
|
||||
|
||||
// Determine if the matrix changed state
|
||||
if ((last_row_value != current_matrix[row_index]) && !(matrix_changed))
|
||||
{
|
||||
matrix_changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Unselect col
|
||||
unselect_col(current_col);
|
||||
|
||||
return matrix_changed;
|
||||
}
|
||||
|
||||
static void select_col(uint8_t col)
|
||||
{
|
||||
uint8_t pin = col_pins[col];
|
||||
_SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT
|
||||
_SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW
|
||||
}
|
||||
|
||||
static void unselect_col(uint8_t col)
|
||||
{
|
||||
uint8_t pin = col_pins[col];
|
||||
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||
}
|
||||
|
||||
static void unselect_cols(void)
|
||||
{
|
||||
for(uint8_t x = 0; x < MATRIX_COLS; x++) {
|
||||
uint8_t pin = col_pins[x];
|
||||
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
@ -15,6 +15,8 @@ Example of flashing this keyboard:
|
||||
|
||||
make quefrency/rev1:default:avrdude
|
||||
|
||||
Handedness detection is already hardwired onto the PCB, so no need to deal with `EE_HANDS` or flashing .eep files.
|
||||
|
||||
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
|
||||
|
||||
A build guide for this keyboard can be found here: [Keebio Build Guides](https://docs.keeb.io)
|
||||
|
@ -16,10 +16,9 @@ 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 REV1_CONFIG_H
|
||||
#define REV1_CONFIG_H
|
||||
#pragma once
|
||||
|
||||
#include "../config.h"
|
||||
#include QMK_KEYBOARD_CONFIG_H
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xCB10
|
||||
@ -37,9 +36,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
// wiring of each half
|
||||
#define MATRIX_ROW_PINS { F4, D4, D7, E6, B4 }
|
||||
#define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2, B6, C6 }
|
||||
|
||||
/* define if matrix has ghost */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
#define SPLIT_HAND_PIN D2
|
||||
|
||||
/* Set 0 if debouncing isn't needed */
|
||||
#define DEBOUNCING_DELAY 5
|
||||
@ -56,29 +53,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/* ws2812 RGB LED */
|
||||
#define RGB_DI_PIN D3
|
||||
#define RGBLIGHT_TIMER
|
||||
#define RGBLIGHT_ANIMATIONS
|
||||
#define RGBLED_NUM 16 // Number of LEDs
|
||||
#define ws2812_PORTREG PORTD
|
||||
#define ws2812_DDRREG DDRD
|
||||
|
||||
/*
|
||||
* 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
|
||||
|
@ -1,7 +1,5 @@
|
||||
#include "quefrency.h"
|
||||
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
matrix_init_user();
|
||||
};
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
#ifndef REV1_H
|
||||
#define REV1_H
|
||||
#pragma once
|
||||
|
||||
#include "../quefrency.h"
|
||||
#include "quefrency.h"
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
@ -33,5 +32,3 @@
|
||||
{ RD1, RD2, RD3, RD4, KC_NO, RD6, RD7, RD8 }, \
|
||||
{ RE1, KC_NO, KC_NO, RE4, RE5, RE6, RE7, RE8 } \
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1,48 +1,7 @@
|
||||
SRC += matrix.c \
|
||||
i2c.c \
|
||||
split_util.c \
|
||||
serial.c
|
||||
|
||||
# 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)
|
||||
|
||||
# Bootloader
|
||||
# This definition is optional, and if your keyboard supports multiple bootloaders of
|
||||
# different sizes, comment this out, and the correct address will be loaded
|
||||
# automatically (+60). See bootloader.mk for all options.
|
||||
BOOTLOADER = caterina
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
@ -69,6 +28,6 @@ USE_I2C = yes
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
CUSTOM_MATRIX = yes
|
||||
SPLIT_KEYBOARD = yes
|
||||
|
||||
DEFAULT_FOLDER = quefrency/rev1
|
||||
|
@ -1,228 +0,0 @@
|
||||
/*
|
||||
* WARNING: be careful changing this code, it is very timing dependent
|
||||
*/
|
||||
|
||||
#ifndef F_CPU
|
||||
#define F_CPU 16000000
|
||||
#endif
|
||||
|
||||
#include <avr/io.h>
|
||||
#include <avr/interrupt.h>
|
||||
#include <util/delay.h>
|
||||
#include <stdbool.h>
|
||||
#include "serial.h"
|
||||
|
||||
#ifndef USE_I2C
|
||||
|
||||
// Serial pulse period in microseconds. Its probably a bad idea to lower this
|
||||
// value.
|
||||
#define SERIAL_DELAY 24
|
||||
|
||||
uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0};
|
||||
uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0};
|
||||
|
||||
#define SLAVE_DATA_CORRUPT (1<<0)
|
||||
volatile uint8_t status = 0;
|
||||
|
||||
inline static
|
||||
void serial_delay(void) {
|
||||
_delay_us(SERIAL_DELAY);
|
||||
}
|
||||
|
||||
inline static
|
||||
void serial_output(void) {
|
||||
SERIAL_PIN_DDR |= SERIAL_PIN_MASK;
|
||||
}
|
||||
|
||||
// make the serial pin an input with pull-up resistor
|
||||
inline static
|
||||
void serial_input(void) {
|
||||
SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK;
|
||||
SERIAL_PIN_PORT |= SERIAL_PIN_MASK;
|
||||
}
|
||||
|
||||
inline static
|
||||
uint8_t serial_read_pin(void) {
|
||||
return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK);
|
||||
}
|
||||
|
||||
inline static
|
||||
void serial_low(void) {
|
||||
SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK;
|
||||
}
|
||||
|
||||
inline static
|
||||
void serial_high(void) {
|
||||
SERIAL_PIN_PORT |= SERIAL_PIN_MASK;
|
||||
}
|
||||
|
||||
void serial_master_init(void) {
|
||||
serial_output();
|
||||
serial_high();
|
||||
}
|
||||
|
||||
void serial_slave_init(void) {
|
||||
serial_input();
|
||||
|
||||
// Enable INT0
|
||||
EIMSK |= _BV(INT0);
|
||||
// Trigger on falling edge of INT0
|
||||
EICRA &= ~(_BV(ISC00) | _BV(ISC01));
|
||||
}
|
||||
|
||||
// Used by the master to synchronize timing with the slave.
|
||||
static
|
||||
void sync_recv(void) {
|
||||
serial_input();
|
||||
// This shouldn't hang if the slave disconnects because the
|
||||
// serial line will float to high if the slave does disconnect.
|
||||
while (!serial_read_pin());
|
||||
serial_delay();
|
||||
}
|
||||
|
||||
// Used by the slave to send a synchronization signal to the master.
|
||||
static
|
||||
void sync_send(void) {
|
||||
serial_output();
|
||||
|
||||
serial_low();
|
||||
serial_delay();
|
||||
|
||||
serial_high();
|
||||
}
|
||||
|
||||
// Reads a byte from the serial line
|
||||
static
|
||||
uint8_t serial_read_byte(void) {
|
||||
uint8_t byte = 0;
|
||||
serial_input();
|
||||
for ( uint8_t i = 0; i < 8; ++i) {
|
||||
byte = (byte << 1) | serial_read_pin();
|
||||
serial_delay();
|
||||
_delay_us(1);
|
||||
}
|
||||
|
||||
return byte;
|
||||
}
|
||||
|
||||
// Sends a byte with MSB ordering
|
||||
static
|
||||
void serial_write_byte(uint8_t data) {
|
||||
uint8_t b = 8;
|
||||
serial_output();
|
||||
while( b-- ) {
|
||||
if(data & (1 << b)) {
|
||||
serial_high();
|
||||
} else {
|
||||
serial_low();
|
||||
}
|
||||
serial_delay();
|
||||
}
|
||||
}
|
||||
|
||||
// interrupt handle to be used by the slave device
|
||||
ISR(SERIAL_PIN_INTERRUPT) {
|
||||
sync_send();
|
||||
|
||||
uint8_t checksum = 0;
|
||||
for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) {
|
||||
serial_write_byte(serial_slave_buffer[i]);
|
||||
sync_send();
|
||||
checksum += serial_slave_buffer[i];
|
||||
}
|
||||
serial_write_byte(checksum);
|
||||
sync_send();
|
||||
|
||||
// wait for the sync to finish sending
|
||||
serial_delay();
|
||||
|
||||
// read the middle of pulses
|
||||
_delay_us(SERIAL_DELAY/2);
|
||||
|
||||
uint8_t checksum_computed = 0;
|
||||
for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) {
|
||||
serial_master_buffer[i] = serial_read_byte();
|
||||
sync_send();
|
||||
checksum_computed += serial_master_buffer[i];
|
||||
}
|
||||
uint8_t checksum_received = serial_read_byte();
|
||||
sync_send();
|
||||
|
||||
serial_input(); // end transaction
|
||||
|
||||
if ( checksum_computed != checksum_received ) {
|
||||
status |= SLAVE_DATA_CORRUPT;
|
||||
} else {
|
||||
status &= ~SLAVE_DATA_CORRUPT;
|
||||
}
|
||||
}
|
||||
|
||||
inline
|
||||
bool serial_slave_DATA_CORRUPT(void) {
|
||||
return status & SLAVE_DATA_CORRUPT;
|
||||
}
|
||||
|
||||
// Copies the serial_slave_buffer to the master and sends the
|
||||
// serial_master_buffer to the slave.
|
||||
//
|
||||
// Returns:
|
||||
// 0 => no error
|
||||
// 1 => slave did not respond
|
||||
int serial_update_buffers(void) {
|
||||
// this code is very time dependent, so we need to disable interrupts
|
||||
cli();
|
||||
|
||||
// signal to the slave that we want to start a transaction
|
||||
serial_output();
|
||||
serial_low();
|
||||
_delay_us(1);
|
||||
|
||||
// wait for the slaves response
|
||||
serial_input();
|
||||
serial_high();
|
||||
_delay_us(SERIAL_DELAY);
|
||||
|
||||
// check if the slave is present
|
||||
if (serial_read_pin()) {
|
||||
// slave failed to pull the line low, assume not present
|
||||
sei();
|
||||
return 1;
|
||||
}
|
||||
|
||||
// if the slave is present syncronize with it
|
||||
sync_recv();
|
||||
|
||||
uint8_t checksum_computed = 0;
|
||||
// receive data from the slave
|
||||
for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) {
|
||||
serial_slave_buffer[i] = serial_read_byte();
|
||||
sync_recv();
|
||||
checksum_computed += serial_slave_buffer[i];
|
||||
}
|
||||
uint8_t checksum_received = serial_read_byte();
|
||||
sync_recv();
|
||||
|
||||
if (checksum_computed != checksum_received) {
|
||||
sei();
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint8_t checksum = 0;
|
||||
// send data to the slave
|
||||
for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) {
|
||||
serial_write_byte(serial_master_buffer[i]);
|
||||
sync_recv();
|
||||
checksum += serial_master_buffer[i];
|
||||
}
|
||||
serial_write_byte(checksum);
|
||||
sync_recv();
|
||||
|
||||
// always, release the line when not in use
|
||||
serial_output();
|
||||
serial_high();
|
||||
|
||||
sei();
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
@ -1,26 +0,0 @@
|
||||
#ifndef MY_SERIAL_H
|
||||
#define MY_SERIAL_H
|
||||
|
||||
#include "config.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
/* TODO: some defines for interrupt setup */
|
||||
#define SERIAL_PIN_DDR DDRD
|
||||
#define SERIAL_PIN_PORT PORTD
|
||||
#define SERIAL_PIN_INPUT PIND
|
||||
#define SERIAL_PIN_MASK _BV(PD0)
|
||||
#define SERIAL_PIN_INTERRUPT INT0_vect
|
||||
|
||||
#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
|
||||
#define SERIAL_MASTER_BUFFER_LENGTH 1
|
||||
|
||||
// Buffers for master - slave communication
|
||||
extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH];
|
||||
extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH];
|
||||
|
||||
void serial_master_init(void);
|
||||
void serial_slave_init(void);
|
||||
int serial_update_buffers(void);
|
||||
bool serial_slave_data_corrupt(void);
|
||||
|
||||
#endif
|
@ -1,80 +0,0 @@
|
||||
#include <avr/io.h>
|
||||
#include <avr/wdt.h>
|
||||
#include <avr/power.h>
|
||||
#include <avr/interrupt.h>
|
||||
#include <util/delay.h>
|
||||
#include <avr/eeprom.h>
|
||||
#include "split_util.h"
|
||||
#include "matrix.h"
|
||||
#include "keyboard.h"
|
||||
#include "config.h"
|
||||
#include "timer.h"
|
||||
#include "pincontrol.h"
|
||||
|
||||
#ifdef USE_I2C
|
||||
# include "i2c.h"
|
||||
#else
|
||||
# include "serial.h"
|
||||
#endif
|
||||
|
||||
volatile bool isLeftHand = true;
|
||||
|
||||
static void setup_handedness(void) {
|
||||
// Test D2 pin for handedness, if D2 is grounded, it's the right hand
|
||||
pinMode(D2, PinDirectionInput);
|
||||
isLeftHand = digitalRead(D2);
|
||||
}
|
||||
|
||||
static void keyboard_master_setup(void) {
|
||||
#ifdef USE_I2C
|
||||
i2c_master_init();
|
||||
#ifdef SSD1306OLED
|
||||
matrix_master_OLED_init();
|
||||
#endif
|
||||
#else
|
||||
serial_master_init();
|
||||
#endif
|
||||
}
|
||||
|
||||
static void keyboard_slave_setup(void) {
|
||||
timer_init();
|
||||
#ifdef USE_I2C
|
||||
i2c_slave_init(SLAVE_I2C_ADDRESS);
|
||||
#else
|
||||
serial_slave_init();
|
||||
#endif
|
||||
}
|
||||
|
||||
bool has_usb(void) {
|
||||
USBCON |= (1 << OTGPADE); //enables VBUS pad
|
||||
_delay_us(5);
|
||||
return (USBSTA & (1<<VBUS)); //checks state of VBUS
|
||||
}
|
||||
|
||||
void split_keyboard_setup(void) {
|
||||
setup_handedness();
|
||||
|
||||
if (has_usb()) {
|
||||
keyboard_master_setup();
|
||||
} else {
|
||||
keyboard_slave_setup();
|
||||
}
|
||||
sei();
|
||||
}
|
||||
|
||||
void keyboard_slave_loop(void) {
|
||||
matrix_init();
|
||||
|
||||
while (1) {
|
||||
matrix_slave_scan();
|
||||
}
|
||||
}
|
||||
|
||||
// this code runs before the usb and keyboard is initialized
|
||||
void matrix_setup(void) {
|
||||
split_keyboard_setup();
|
||||
|
||||
if (!has_usb()) {
|
||||
keyboard_slave_loop();
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
#ifndef SPLIT_KEYBOARD_UTIL_H
|
||||
#define SPLIT_KEYBOARD_UTIL_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "eeconfig.h"
|
||||
|
||||
#define SLAVE_I2C_ADDRESS 0x32
|
||||
|
||||
extern volatile bool isLeftHand;
|
||||
|
||||
// slave version of matix scan, defined in matrix.c
|
||||
void matrix_slave_scan(void);
|
||||
|
||||
void split_keyboard_setup(void);
|
||||
bool has_usb(void);
|
||||
void keyboard_slave_loop(void);
|
||||
|
||||
void matrix_master_OLED_init (void);
|
||||
|
||||
#endif
|
@ -63,4 +63,6 @@
|
||||
}
|
||||
#endif
|
||||
|
||||
#define LAYOUT_ortho_5x14 LAYOUT
|
||||
|
||||
#endif
|
||||
|
@ -1 +1,3 @@
|
||||
BACKLIGHT_ENABLE = no
|
||||
BACKLIGHT_ENABLE = no
|
||||
|
||||
LAYOUTS = ortho_5x14
|
||||
|
@ -41,7 +41,7 @@ F_USB = $(F_CPU)
|
||||
|
||||
# Bootloader
|
||||
# This definition is optional, and if your keyboard supports multiple bootloaders of
|
||||
# different sizes, comment this out, and the correct address will be loaded
|
||||
# different sizes, comment this out, and the correct address will be loaded
|
||||
# automatically (+60). See bootloader.mk for all options.
|
||||
BOOTLOADER = caterina
|
||||
|
||||
@ -71,4 +71,6 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
CUSTOM_MATRIX = yes
|
||||
|
||||
DEFAULT_FOLDER = viterbi/rev1
|
||||
DEFAULT_FOLDER = viterbi/rev1
|
||||
|
||||
LAYOUTS = ortho_5x14
|
||||
|
@ -21,6 +21,8 @@
|
||||
KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##L45, KC_##L46, KC_##R40, KC_##R41, KC_##R42, KC_##R43, KC_##R44, KC_##R45, KC_##R46 \
|
||||
)
|
||||
|
||||
#define LAYOUT_ortho_5x14 LAYOUT
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
#endif
|
||||
|
@ -1,64 +1,13 @@
|
||||
/*
|
||||
Config file - Ergodox QMK with replicaJunction layout
|
||||
#pragma once
|
||||
|
||||
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.
|
||||
// Layer definitions
|
||||
|
||||
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 KEYBOARDS_ERGODOX_CONFIG_H_
|
||||
#define KEYBOARDS_ERGODOX_CONFIG_H_
|
||||
|
||||
#include QMK_KEYBOARD_CONFIG_H
|
||||
|
||||
|
||||
#undef MOUSEKEY_DELAY
|
||||
#undef MOUSEKEY_INTERVAL
|
||||
#undef MOUSEKEY_MAX_SPEED
|
||||
#undef MOUSEKEY_TIME_TO_MAX
|
||||
|
||||
#define MOUSEKEY_DELAY 100
|
||||
#define MOUSEKEY_INTERVAL 20
|
||||
#define MOUSEKEY_MAX_SPEED 3
|
||||
#define MOUSEKEY_TIME_TO_MAX 10
|
||||
|
||||
#define TAPPING_TOGGLE 1
|
||||
|
||||
/* define if matrix has ghost */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
// MS the button needs to be held before a tap becomes a hold (default: 200)
|
||||
#define TAPPING_TERM 200
|
||||
|
||||
#define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.)
|
||||
|
||||
// I don't have any locking keys, so I don't need these features
|
||||
|
||||
|
||||
/* 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
|
||||
|
||||
/* Prevent modifiers from sticking when switching layers */
|
||||
/* Uses 5 bytes of memory per 8 keys, but makes sure modifiers don't get "stuck" switching layers */
|
||||
#define PREVENT_STUCK_MODIFIERS
|
||||
|
||||
/* key combination for command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \
|
||||
)
|
||||
|
||||
|
||||
#endif /* KEYBOARDS_ERGODOX_CONFIG_H_ */
|
||||
#define L_COLEMAK 0
|
||||
#define L_QWERTY 1
|
||||
#define L_NUM 2
|
||||
#define L_EXTEND 3
|
||||
#define L_FUNC 4
|
||||
#define L_GAMING 5
|
||||
#define L_LL_R 6
|
||||
#define L_LL_E 7
|
||||
#define L_LL_I 8
|
||||
|
@ -1,333 +1,424 @@
|
||||
/*
|
||||
* Keyboard: Ergodox
|
||||
* Keymap: replicaJunction
|
||||
* Version: 1.2
|
||||
*
|
||||
* This keymap is designed to complement my Atreus keyboard layout, found in keyboards/atreus.
|
||||
* The Atreus keyboard is a 40% board whose design was heavily influenced by the Ergodox, and I now
|
||||
* have both keyboards, so I've designed these layouts in an effort to make switching between the
|
||||
* two as easy as possible.
|
||||
*
|
||||
* I've also tried to make use of the extra keys on the Ergodox in as logical of a manner as possible,
|
||||
* adding to the layers in the Atreus config without disturbing what's there already. This allows for
|
||||
* things like F11-F20, the Application (Menu) key, and better media key placement.
|
||||
*
|
||||
* The default key layout in this keymap is Colemak-ModDH. Information on that layout can be found
|
||||
* here: https://colemakmods.github.io/mod-dh/
|
||||
* Version: 2.1
|
||||
*/
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "debug.h"
|
||||
#include "action_layer.h"
|
||||
|
||||
#define _CO 0 // Colemak
|
||||
#define _QW 1 // QWERTY
|
||||
#define _ME 2 // media keys
|
||||
#define _NU 3 // numpad
|
||||
#define _EX 4 // extend
|
||||
#define _GA 5 // mouse overlay for gaming
|
||||
|
||||
// Some quick aliases, just to make it look pretty
|
||||
#define _______ KC_TRNS
|
||||
#define KCX_CGR LCTL(KC_GRV)
|
||||
#define KX_STAB LSFT(KC_TAB)
|
||||
#define KX_COPY LCTL(KC_C)
|
||||
#define KX_CUT LCTL(KC_X)
|
||||
#define KX_PAST LCTL(KC_V)
|
||||
#define KX_UNDO LCTL(KC_Z)
|
||||
|
||||
; // This doesn't do anything. It's just for VSCode because its syntax highlighting is weird for the above #define statements.
|
||||
#include "config.h"
|
||||
#include "replicaJunction.h"
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/*
|
||||
* Keymap: Colemak-ModDH
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | ` | 1 | 2 | 3 | 4 | 5 | Esc | | | 6 | 7 | 8 | 9 | 0 | = |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | LCtrl | Q | W | F | P | B | Home | | BkSp | J | L | U | Y | ; | - |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | Tab | A | R | S | T | G |------| |------| M | N | E | I | O | ' |
|
||||
* |--------+------+------+------+------+------| Hyper| | \ |------+------+------+------+------+--------|
|
||||
* | LShft | Z | X | C | D | V | | | | K | H | , | , | / | RShft |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | LGui | [ | ] |CtlShf| LAlt | | _EX | - | ' | = | \ |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | LCtrl| ~GA | | Left | Right|
|
||||
* ,------|------|------| |------+------+------.
|
||||
* |LCtrl/| LAlt/| Home | | Up | Alt/| _NU/ |
|
||||
* | BkSp | Del |------| |------| Enter| Space|
|
||||
* | | | _NU | | Down | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
[_CO] = LAYOUT_ergodox(
|
||||
// left hand
|
||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC,
|
||||
KC_LCTL,KC_Q, KC_W, KC_F, KC_P, KC_B, KC_HOME,
|
||||
KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_G,
|
||||
KC_LSFT,KC_Z, KC_X, KC_C, KC_D, KC_V, ALL_T(KC_NO),
|
||||
KC_LGUI,KC_LBRC,KC_RBRC, LCTL(KC_LSFT), KC_LALT,
|
||||
|
||||
KC_LCTL, TG(_GA),
|
||||
KC_HOME,
|
||||
CTL_T(KC_BSPC), ALT_T(KC_DEL), MO(_NU),
|
||||
// right hand
|
||||
KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL,
|
||||
KC_BSPC, KC_J, KC_L, KC_U, KC_Y, KC_SCLN,KC_MINS,
|
||||
KC_M, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
|
||||
KC_BSLS, KC_K, KC_H, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT,
|
||||
MO(_EX),KC_MINS,KC_QUOT,KC_EQL, KC_BSLS,
|
||||
[L_COLEMAK] = LAYOUT_ergodox(
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
KC_ESC ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_GRV ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
KX_ECTL ,KC_Q ,KC_W ,KC_F ,KC_P ,KC_B ,KC_LBRC ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
KC_TAB ,KC_A ,KC_R_LT ,KC_S_LT ,KC_T ,KC_G,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
KC_LSFT ,KX_Z_MT ,KX_X_MT ,KX_C_MT ,KX_D_MT ,KC_V ,KC_RBRC ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
TD_LAYR ,KC_LGUI ,KC_HYPR ,KX_CTSF ,KC_LCTL ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
KC_HOME ,KC_END ,
|
||||
// |--------|--------|
|
||||
KC_PGUP ,
|
||||
// |--------|--------|--------|
|
||||
KX_BKNM ,KX_DCTL ,KC_PGDN ,
|
||||
// |--------|--------|--------|
|
||||
|
||||
KC_LEFT, KC_RGHT,
|
||||
KC_UP,
|
||||
KC_DOWN, ALT_T(KC_ENT), LT(_NU,KC_SPC)
|
||||
),
|
||||
//--------|--------|--------|--------|--------|--------|-------|
|
||||
TG_GAME ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_EQL ,
|
||||
//--------|--------|--------|--------|--------|--------|-------|
|
||||
KC_DEL ,KC_J ,KC_L ,KC_U ,KC_Y ,KC_SCLN ,KC_BSLS,
|
||||
//--------|--------|--------|--------|--------|--------|-------|
|
||||
KC_M ,KC_N ,KC_E_LT ,KC_I_LT ,KC_O ,KC_QUOT,
|
||||
//--------|--------|--------|--------|--------|--------|-------|
|
||||
KC_LOCK ,KC_K ,KX_H_MT ,KX_COMT ,KX_DOMT ,KX_SLMT ,KC_RSFT,
|
||||
//--------|--------|--------|--------|--------|--------|-------|
|
||||
KC_LALT ,KC_MINS ,KC_QUOT ,KC_EQL ,TT_NUM ,
|
||||
//--------|--------|--------|--------|--------|--------|-------|
|
||||
KC_LEFT ,KC_RGHT ,
|
||||
//--------|--------|
|
||||
KC_UP ,
|
||||
//--------|--------|--------|
|
||||
KC_DOWN ,KX_NALT ,KX_SPAC
|
||||
//--------|--------|--------|
|
||||
|
||||
/*
|
||||
* Keymap: QWERTY layout.
|
||||
*
|
||||
* This is optimized for gaming, not typing, so there aren't as many macros
|
||||
* as the Dvorak layer. Some of the keys have also been moved to "game-
|
||||
* like" locations, such as making the spacebar available to the left thumb,
|
||||
* and repositioning the arrow keys at the bottom right corner.
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | ` | 1 | 2 | 3 | 4 | 5 | Esc | | | 6 | 7 | 8 | 9 | 0 | = |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | LCtrl | Q | W | E | R | T | Home | | BkSp | Y | U | I | O | P | - |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | Tab | A | S | D | F | G |------| |------| H | J | K | L | ; | ' |
|
||||
* |--------+------+------+------+------+------| Hyper| | \ |------+------+------+------+------+--------|
|
||||
* | LShft | Z | X | C | V | B | | | | N | M | , | . | / | RShft |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | LGui | ` | \ |CtlShf| _NU | | _EX | - | ' | = | \ |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | LCtrl| ~GA | | Left | Right|
|
||||
* ,------|------|------| |------+------+------.
|
||||
* |LCtrl/| LAlt/| Home | | Up | Alt/| _NU/ |
|
||||
* | BkSp | Del |------| |------| Enter| Space|
|
||||
* | | | _NU | | Down | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
[_QW] = LAYOUT_ergodox( // Layer1: QWERTY
|
||||
// left hand
|
||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC,
|
||||
KC_LCTL,KC_Q, KC_W, KC_E, KC_R, KC_T, KC_HOME,
|
||||
KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G,
|
||||
KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO),
|
||||
KC_LGUI,KC_GRV, KC_SLSH,LCTL(KC_LSFT), MO(_NU),
|
||||
),
|
||||
|
||||
KC_LCTL,TG(_GA),
|
||||
KC_HOME,
|
||||
CTL_T(KC_BSPC), ALT_T(KC_DEL), MO(_NU),
|
||||
// right hand
|
||||
KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL,
|
||||
KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS,
|
||||
KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,
|
||||
KC_BSLS, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT,
|
||||
MO(_EX),KC_MINS,KC_QUOT,KC_EQL, KC_BSLS,
|
||||
|
||||
KC_LEFT, KC_RGHT,
|
||||
KC_UP,
|
||||
KC_DOWN, ALT_T(KC_ENT), LT(_NU,KC_SPC)
|
||||
),
|
||||
|
||||
/*
|
||||
* Keymap: Numbers and symbols
|
||||
*
|
||||
* Note that the number keys here are actually numpad keystrokes. This often doesn't matter, but it may be relevant in a few cases.
|
||||
* That's why the Num Lock key exists on this layer - just in case.
|
||||
*
|
||||
* This layer also contains the layout switches.
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | ! | @ | { | } | & | | | | / | 7 | 8 | 9 | * | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | # | $ | ( | ) | ~ |------| |------| | | 4 | 5 | 6 | - | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | % | ^ | [ | ] | ` | | | | \ | 1 | 2 | 3 | + | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | |QWERTY|Colemk| | | | 0 | . | = | | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* |NumLck| RESET| | | |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | | |
|
||||
* | | |------| |------| | |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
[_NU] = LAYOUT_ergodox(
|
||||
// left hand
|
||||
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______,
|
||||
_______, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_AMPR, _______,
|
||||
_______, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_TILD,
|
||||
_______, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_GRV, _______,
|
||||
_______, DF(_QW), DF(_CO), _______, _______,
|
||||
[L_QWERTY] = LAYOUT_ergodox(
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,
|
||||
// |--------|--------|
|
||||
_______ ,
|
||||
// |--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,
|
||||
// |--------|--------|--------|
|
||||
|
||||
KC_NLCK,RESET,
|
||||
_______,
|
||||
_______,_______,_______,
|
||||
// right hand
|
||||
_______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______,
|
||||
_______, KC_SLSH, KC_P7, KC_P8, KC_P9, KC_PAST, _______,
|
||||
KC_PIPE, KC_P4, KC_P5, KC_P6, KC_PMNS, _______,
|
||||
_______, KC_BSLS, KC_P1, KC_P2, KC_P3, KC_PPLS, _______,
|
||||
KC_P0, KC_PDOT, KC_EQL, _______, _______,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,KC_EQL ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,KC_QUOT ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
KC_LOCK ,KC_N ,KC_M ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_RSPC ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
KC_RALT ,KC_MINS ,KC_QUOT ,KC_EQL ,TT_NUM ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
KC_LEFT ,KC_RGHT ,
|
||||
//--------|--------|
|
||||
KC_UP ,
|
||||
//--------|--------|--------|
|
||||
KC_DOWN ,KX_NALT ,KX_SPAC
|
||||
//--------|--------|--------|
|
||||
),
|
||||
|
||||
_______, _______,
|
||||
_______,
|
||||
_______, _______, _______
|
||||
),
|
||||
|
||||
/*
|
||||
* Keymap: Extend
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | | F11 | F12 | F13 | F14 | F15 | Mute | | | F16 | F17 | F18 | F19 | F20 | |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | | | | | Ctrl`| Vol | | | PgUp | Home | Up | End | Del | |
|
||||
* |--------+------+------+------+------+------| Up | | |------+------+------+------+------+--------|
|
||||
* | | | Gui | Alt | Ctrl | |------| |------| PgDn | Left | Down | Right| BkSp | Menu |
|
||||
* |--------+------+------+------+------+------| Vol | | |------+------+------+------+------+--------|
|
||||
* | | Undo | Cut | Copy | | Paste| Down | | | | ^Tab | Tab | |Insert| PrntScr|
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | | | | | | | | | | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | | |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | | |
|
||||
* | | |------| |------| | |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*
|
||||
* Ctrl+` is a keyboard shortcut for the program ConEmu, which provides a Quake-style drop-down command prompt.
|
||||
*
|
||||
*/
|
||||
[_EX] = LAYOUT_ergodox(
|
||||
// left hand
|
||||
_______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_MUTE,
|
||||
_______, _______, _______, _______, _______, KCX_CGR, KC_VOLU,
|
||||
_______, _______, KC_LGUI, KC_LALT, KC_LCTL, _______,
|
||||
_______, KX_UNDO, KX_CUT, KX_COPY, _______, KX_PAST, KC_VOLD,
|
||||
_______, _______, _______, _______, _______,
|
||||
|
||||
_______,_______,
|
||||
_______,
|
||||
_______,_______,_______,
|
||||
// right hand
|
||||
_______, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, _______,
|
||||
_______, KC_PGUP, KC_HOME, KC_UP, KC_END, KC_DEL, _______,
|
||||
KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_BSPC, KC_MENU,
|
||||
_______, _______, KX_STAB, KC_TAB, _______, KC_INS, KC_PSCR,
|
||||
_______, _______, _______, _______, _______,
|
||||
_______, _______,
|
||||
_______,
|
||||
_______, _______, _______
|
||||
),
|
||||
[L_NUM] = LAYOUT_ergodox(
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,KC_EXLM ,KC_AT ,KC_LCBR ,KC_RCBR ,KC_SLSH ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,KC_HASH ,KC_DLR ,KC_LPRN ,KC_RPRN ,KC_PIPE,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,KC_PERC ,KC_CIRC ,KC_LBRC ,KC_RBRC ,KC_BSLS ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,KC_AMPR ,KC_LABK ,KC_RABK,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,
|
||||
// |--------|--------|
|
||||
_______ ,
|
||||
// |--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,
|
||||
// |--------|--------|--------|
|
||||
|
||||
/*
|
||||
* Keymap: Gaming
|
||||
*
|
||||
* Provides a mouse overlay for the right hand, and also moves some "gamer friendly" keys to the left, such as space.
|
||||
* This layer also removes a lot of dual-role keys, as when gaming, it's nicer not to need to keep track of those.
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | |WhlUp | MsUp |WhlDn | | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | | | | | |------| |------| |MsLeft|MsDown|MsRght| | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | LCtrl| | | | | | | | | | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | ~_GA | | |MClick|
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | | |
|
||||
* | Space| |------| |------|RClick|LClick|
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
[_GA] = LAYOUT_ergodox(
|
||||
// left hand
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
KC_LCTL, _______, _______, _______, _______,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,KC_COLN ,KC_P7 ,KC_P8 ,KC_P9 ,KC_PSLS ,KC_F12 ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
KC_HASH ,KC_P4 ,KC_P5 ,KC_P6 ,KC_PAST ,KC_BSPC ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,KC_BSPC ,KC_P1 ,KC_P2 ,KC_P3 ,KC_PMNS ,KC_TAB ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
KC_P0 ,KC_PDOT ,KC_PEQL ,KC_PPLS ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,
|
||||
//--------|--------|
|
||||
_______ ,
|
||||
//--------|--------|--------|
|
||||
_______ ,KC_PENT ,MO_FUNC
|
||||
//--------|--------|--------|
|
||||
),
|
||||
|
||||
_______,_______,
|
||||
_______,
|
||||
KC_SPC, _______,_______,
|
||||
|
||||
// right hand
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, KC_WH_U, KC_MS_U, KC_WH_D, _______, _______,
|
||||
_______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______,
|
||||
_______, KC_BTN3,
|
||||
_______,
|
||||
_______, KC_BTN2, KC_BTN1
|
||||
),
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[1] = ACTION_LAYER_TAP_TOGGLE(_NU) // FN1 - Momentary Layer 1 (Numbers and symbols)
|
||||
};
|
||||
[L_EXTEND] = LAYOUT_ergodox(
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,_______ ,KC_APP ,KX_CGR, KC_VOLU,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,KC_LGUI, KC_LSFT, KC_LALT, KC_LCTL, _______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,_______ ,KX_SRCH, KX_PAST, KC_VOLD,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,
|
||||
// |--------|--------|--------|
|
||||
_______ ,
|
||||
// |--------|--------|--------|
|
||||
MO_FUNC, _______ ,_______ ,
|
||||
// |--------|--------|--------|
|
||||
|
||||
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;
|
||||
};
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,KC_PGUP, KC_HOME, KC_UP, KC_END, KC_DEL, _______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_BSPC, KC_MENU,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,KX_STAB, KC_TAB, _______ ,KC_INS, KC_PSCR,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,KC_PSCR, _______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
),
|
||||
|
||||
|
||||
|
||||
[L_FUNC] = LAYOUT_ergodox(
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,KC_F11 ,KC_F12 ,KC_F13 ,KC_F14 ,KC_F15 ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,M_LCLIK, M_RCLIK, M_MCLIK, _______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,KC_LGUI, KC_LSFT, KC_LALT, KC_LCTL, M_WHLUP,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,M_LEFT, M_DOWN, M_UP ,M_RIGHT, M_WHLDN, _______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,
|
||||
// |--------|--------|--------|
|
||||
_______ ,
|
||||
// |--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,
|
||||
// |--------|--------|--------|
|
||||
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,KC_F16 ,KC_F17 ,KC_F18 ,KC_F19 ,KC_F20 ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,KC_VOLU, KC_F9, KC_F10, KC_F11, KC_F12, _______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
KC_MUTE, KC_F5, KC_F6, KC_F7, KC_F8, _______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,KC_VOLD, KC_F1, KC_F2, KC_F3, KC_F4, _______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
),
|
||||
|
||||
|
||||
|
||||
[L_GAMING] = LAYOUT_ergodox(
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
KC_ESC ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,KC_R ,KC_S ,_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
KC_LSFT, _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,KC_LALT ,KC_LCTL ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,
|
||||
// |--------|--------|
|
||||
_______ ,
|
||||
// |--------|--------|--------|
|
||||
KC_SPC, KC_LSFT, _______ ,
|
||||
// |--------|--------|--------|
|
||||
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,KC_E ,KC_I ,_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,_______ ,_______ ,KC_UP, KC_SLSH,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,KC_LEFT, KC_DOWN, KC_RGHT,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
M_MCLIK ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
M_RCLIK ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
M_LCLIK ,KC_ENT ,KC_BSPC
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
)
|
||||
,
|
||||
|
||||
// "Letter Layers"
|
||||
|
||||
[L_LL_R] = LAYOUT_ergodox(
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,ooooooo ,KC_AMPR ,KC_PIPE ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,
|
||||
// |--------|--------|
|
||||
_______ ,
|
||||
// |--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,
|
||||
// |--------|--------|--------|
|
||||
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,KC_COLN ,KC_P7 ,KC_P8 ,KC_P9 ,KC_PSLS ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
KC_HASH ,KC_P4 ,KC_P5 ,KC_P6 ,KC_PAST ,KC_TAB ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,KC_BSPC ,KC_P1 ,KC_P2 ,KC_P3 ,KC_PMNS ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
KC_P0 ,KC_PDOT ,KC_PEQL ,KC_PPLS ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,
|
||||
//--------|--------|
|
||||
_______ ,
|
||||
//--------|--------|--------|
|
||||
_______ ,KC_PENT ,MO_FUNC
|
||||
//--------|--------|--------|
|
||||
)
|
||||
,
|
||||
|
||||
[L_LL_E] = LAYOUT_ergodox(
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
RJ_QMKV ,RJ_MAKE ,RJ_EQ ,RJ_LEQ ,RJ_GEQ ,RJ_GEQR ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,RJ_SELS ,RJ_DUND ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,
|
||||
// |--------|--------|
|
||||
_______ ,
|
||||
// |--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,
|
||||
// |--------|--------|--------|
|
||||
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,ooooooo ,_______ ,_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,
|
||||
//--------|--------|
|
||||
_______ ,
|
||||
//--------|--------|--------|
|
||||
_______ ,_______ ,_______
|
||||
//--------|--------|--------|
|
||||
)
|
||||
,
|
||||
|
||||
[L_LL_I] = LAYOUT_ergodox(
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,KC_EXLM ,KC_AT ,KC_LCBR ,KC_RCBR ,KC_SLSH ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,KC_HASH ,KC_DLR ,KC_LPRN ,KC_RPRN ,KC_PIPE,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,KC_PERC ,KC_CIRC ,KC_LBRC ,KC_RBRC ,KC_BSLS ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,KC_AMPR ,KC_LABK ,KC_RABK,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,
|
||||
// |--------|--------|
|
||||
_______ ,
|
||||
// |--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,
|
||||
// |--------|--------|--------|
|
||||
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,KC_UNDS, KC_GRV ,_______ ,_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,KC_MINS ,KC_QUOT ,ooooooo ,_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,KC_TILD, KC_DQT ,_______ ,_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______ ,_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
_______ ,_______ ,_______
|
||||
//--------|--------|--------|--------|--------|--------|--------|
|
||||
)
|
||||
|
||||
// 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) {
|
||||
// The normal QMK functions ending in _user are overridden in the
|
||||
// replicaJunction userspace. Those functions handle my global
|
||||
// settings, and redirect to these _keymap functions if something
|
||||
// is unhandled. This allows me to keep most of my global preferences
|
||||
// in one place while still allowing keyboard-specific code.
|
||||
|
||||
// The idea was shamelessly copied from the amazing Drashna.
|
||||
|
||||
// Nothing to do here, so I've commented it out.
|
||||
// bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
|
||||
// return true;
|
||||
// }
|
||||
|
||||
// void matrix_init_keymap(void) {};
|
||||
|
||||
void matrix_scan_keymap(void) {
|
||||
|
||||
uint8_t layer = biton32(layer_state);
|
||||
// uint8_t default_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 _CO:
|
||||
case L_COLEMAK:
|
||||
ergodox_right_led_1_on();
|
||||
ergodox_right_led_2_off();
|
||||
ergodox_right_led_3_off();
|
||||
break;
|
||||
case _QW:
|
||||
case L_NUM:
|
||||
ergodox_right_led_1_on();
|
||||
ergodox_right_led_2_on();
|
||||
ergodox_right_led_3_off();
|
||||
break;
|
||||
case _NU:
|
||||
case L_EXTEND:
|
||||
ergodox_right_led_1_on();
|
||||
ergodox_right_led_2_off();
|
||||
ergodox_right_led_3_on();
|
||||
break;
|
||||
case _GA:
|
||||
case L_FUNC:
|
||||
ergodox_right_led_1_on();
|
||||
ergodox_right_led_2_on();
|
||||
ergodox_right_led_3_on();
|
||||
break;
|
||||
case L_GAMING:
|
||||
ergodox_right_led_1_off();
|
||||
ergodox_right_led_2_on();
|
||||
ergodox_right_led_3_on();
|
||||
break;
|
||||
default:
|
||||
// none
|
||||
break;
|
||||
|
@ -1,5 +1,94 @@
|
||||
# replicaJunction - Ergodox (EZ) Layout
|
||||
|
||||
I designed this layout, along with my complimentary Atreus layout, to address the challenge of having an Ergodox as my primary home keyboard and an Atreus as my primary work board. I wanted a layout that provided symbols in comfortable locations on both keyboards - but didn't require me to learn two separate sets of symbols for the two keyboards.
|
||||
This keymap is designed to complement my Atreus keyboard layout, found in keyboards/atreus. The Atreus keyboard is a 40% board whose design was heavily influenced by the Ergodox. Since I use both keyboards, I've designed these layouts in an effort to make switching between the two as easy as possible.
|
||||
|
||||
I had originally used several keys as dual-role keys, where a tap would send a keypress and a long press and hold would trigger a different layer. However, after several months of experimenting with those ideas, I've begun moving away from that design due to performance. It's very hard to strike a balance between the time it takes to press a key normally while typing and the "delay" in the typing motion needed to trigger the alternate layer. I was frequently getting strange characters and artifacts because I pressed the function key + the symbol key too quickly, and the layer never shifted.
|
||||
I've also tried to make use of the extra keys on the Ergodox in as logical of a manner as possible, adding to the layers in the Atreus config without disturbing what's there already. This allows for things like F11-F20, the Application (Menu) key, and better media key placement.
|
||||
|
||||
Because of this design philosophy, there are several cases where functionality is duplicated and keys are available in more than one place. I don't find that a bad thing.
|
||||
|
||||
This layout makes heavy use of dual-role keys. Dual-role keys seemed to affect my typing speed for quite some time until I discovered the [`USE_PERMISSIVE_HOLD` flag](https://docs.qmk.fm/features/advanced-keycodes#permissive-hold). After applying this flag, I haven't had an issue with dual-role keys and typing quickly.
|
||||
|
||||
The default letter layout in this keymap is [Colemak-ModDH](https://colemakmods.github.io/mod-dh/). I use the "matrix version" of that layout, which retains the M key on the home row as in normal Colemak.
|
||||
|
||||
## Design Goals
|
||||
|
||||
I designed this layout with the following goals in mind:
|
||||
|
||||
* Atreus layout compatibility.
|
||||
* Nothing may interfere with ordinary typing.
|
||||
* Symbols need to be accessible quickly and organized in a manner I can remember.
|
||||
* Limit more difficult finger movements (and pinky usage in general).
|
||||
* Gaming should be easy.
|
||||
|
||||
### Atreus layout compatibility
|
||||
|
||||
Most of the functionality in this layout isn't strictly necessary - the Ergodox is a 76-key keyboard, and it's got plenty of room for extra keys and functionality compared to smaller boards like the Atreus. However, I've replicated a lot of 40% functionality on this layout in order to preserve my muscle memory.
|
||||
|
||||
The biggest deviation is the Shift keys. My Atreus uses thumb keys for Shift, but the Ergodox doesn't have corresponding thumb keys in a comfortable enough location. I briefly tried using the outermost 1u keys in the bottom row as Shift keys, but they take a large enough thumb movement that it interfered with typing.
|
||||
|
||||
### Nothing may interfere with ordinary typing
|
||||
|
||||
For a long time, this meant that I couldn't use letters or home row keys as dual-role keys. I'm a fast typer, and I'm sometimes already typing the next letter before I've fully released the previous one. Normal keyboards don't care about this, but if I started adding dual-role functionality to letters, I found that I would sometimes type the next letter before releasing the layer toggle, and the letter I tried to send would still be sent under the layer I thought I'd left off.
|
||||
|
||||
Fortunately, though, QMK has addressed this with the `PERMISSIVE_HOLD` flag. [Details are on the QMK docs page.](https://docs.qmk.fm/#/feature_advanced_keycodes?id=permissive-hold)
|
||||
|
||||
Using that flag, I'm comfortable having layer shift keys on the home row, and this goes a long way to eliminate finger stress.
|
||||
|
||||
### Sympols need to be accessible quickly
|
||||
|
||||
Symbols are available under my left hand by holding the I key (on my right hand). I've grouped parenthesis, slashes, and braces together; the remaining symbols are ordered in the same way as they appear on USA keycap legends (for example, 1 is !, so that symbol is first in my lineup). Practically, I just had to get used to these other "misc" symbols.
|
||||
|
||||
This also means that some symbols are accessible in more than one way. For example, the carats (greater than and less than) are available both in the "normal" location (Shift+Comma / Shift+Period) and on the symbol layer. I make regular changes to some of the symbols I don't use as commonly as I think of them.
|
||||
|
||||
### Limit more difficult finger movements
|
||||
|
||||
This is why I kept trying to put layer toggles on the home row keys instead of just placing them on random thumb keys. I suffer from RSI, and it's important for me to watch out for more "stressful" finger movements.
|
||||
|
||||
The home row is the easiest row for your fingers to hit, followed by the upper row, and the lower row is noticeably more difficult to press. Because of this, I favored the upper row over the lower one any time I had the option to do so.
|
||||
|
||||
### Gaming should be easy
|
||||
|
||||
I've added a dedicated gaming layer accessible by pressing the upper-right key on the right hand (next to the 6 key). This layer disables most of the tap/hold functionality to allow keys to act normally. This layer also reverses Backspace and Space (so Space is available on the left thumb while the right hand is on the mouse).
|
||||
|
||||
I've also added a lock key on the right hand's bottom 1.5u key and mouse keys on the right thumb cluster. This has been amazingly helpful for games that involve holding keys for extended times (for example, I can hold the left mouse button in Minecraft to continually mine).
|
||||
|
||||
I strongly recommend using ESDF (QWERTY positions) for movement on the Ergodox rather than WASD. This makes the thumb keys much more accessible.
|
||||
|
||||
Finally, I considered having the gaming layer revert to a QWERTY layout, but decided against it because it really threw me off when I needed to type in chat. I've accepted that I will need to rebind keys in most games as a reasonable compromise.
|
||||
|
||||
## Features
|
||||
|
||||
### ZXC Mods
|
||||
|
||||
Keys on the bottom row of each half of this keyboard can be held to send modifier keys. I've tried to map this in a relatively logical manner:
|
||||
|
||||
* Z / Slash: Ctrl
|
||||
* X / Period: GUI
|
||||
* C / Comma: Ctrl+Alt
|
||||
* D / H: Alt
|
||||
|
||||
This is an example of maintaining compatibility with the Atreus layout. An Ergodox doesn't really need these keys, but I've grown accustomed to them on the Atreus, so they're copied here to preserve compatibility.
|
||||
|
||||
### Layer Switching - Tap Dance
|
||||
|
||||
The lower-left key on the left hand can be used to apply or remove layers based on a number of taps:
|
||||
|
||||
* 1 tap sends Escape, and also disables any persistent layers.
|
||||
* 2 taps enables the Number pad layer.
|
||||
* 3 taps enables the QWERTY layer.
|
||||
* 5 or more taps resets the keyboard.
|
||||
|
||||
## Extend Layer
|
||||
|
||||
[Originally found on the Colemak forums](https://forum.colemak.com/topic/2014-extend-extra-extreme/), having a QMK-powered keyboard allows a super easy implementation of this concept. The idea is to place commonly-used keys under easy reach of your hands. Since I work with text often, my most common needs are things like Ctrl+Shift+arrow keys, and they're easy to access using this layer. (While technically it's four keypresses instead of just three, since it takes one key to enter the layer, that one key is a thumb button and the other three are all on the home row, so I find it much more comfortable than modifiers on a traditional keyboard.)
|
||||
|
||||
Also featured in this layer is easy access to Tab, plus a Shift+Tab key. Alt-Tabbing back and forth, along with Ctrl-Tab, are super easy and friendly. When I need Ctrl+Alt+Delete, I typically use the ones found on this layer.
|
||||
|
||||
## Credits
|
||||
|
||||
* [Drashna](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/readme.md)
|
||||
* User / keymap function ideas
|
||||
* [Jeremy](https://github.com/qmk/qmk_firmware/blob/master/keyboards/atreus/keymaps/jeremy/readme.md)
|
||||
* Sanity check on the Function keys (_of course they should be in rows of 4, not rows of 3 like a number pad. Why did I ever use anything else?_)
|
||||
* [DreymaR of the Colemak forums](https://forum.colemak.com/topic/2014-extend-extra-extreme/)
|
||||
* Original idea of the Extend layer
|
||||
|
8
layouts/community/ergodox/replicaJunction/rules.mk
Normal file
8
layouts/community/ergodox/replicaJunction/rules.mk
Normal file
@ -0,0 +1,8 @@
|
||||
# https://docs.qmk.fm/getting_started_make_guide.html
|
||||
|
||||
MOUSEKEY_ENABLE = yes
|
||||
TAP_DANCE_ENABLE = yes
|
||||
KEY_LOCK_ENABLE = yes
|
||||
RGBLIGHT_ENABLE = no
|
||||
# CONSOLE_ENABLE = no
|
||||
# COMMAND_ENABLE = no
|
11
layouts/default/ortho_5x14/default_ortho_5x14/keymap.c
Normal file
11
layouts/default/ortho_5x14/default_ortho_5x14/keymap.c
Normal file
@ -0,0 +1,11 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = LAYOUT_ortho_5x14(
|
||||
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_ESC, KC_TAB, KC_Q, KC_W, 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_NUHS,
|
||||
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_RSFT, KC_UP,
|
||||
KC_LEFT, KC_RGHT, KC_LCTL, KC_LGUI, KC_LALT, KC_ENT, KC_ENT, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_DOWN
|
||||
)
|
||||
};
|
5
layouts/default/ortho_5x14/layout.json
Normal file
5
layouts/default/ortho_5x14/layout.json
Normal file
@ -0,0 +1,5 @@
|
||||
["","","","","","","","","","","","","","",""],
|
||||
["","","","","","","","","","","","","","",""],
|
||||
["","","","","","","","","","","","","","",""],
|
||||
["","","","","","","","","","","","","","",""],
|
||||
["","","","","","","","","","","","","","",""]
|
3
layouts/default/ortho_5x14/readme.md
Normal file
3
layouts/default/ortho_5x14/readme.md
Normal file
@ -0,0 +1,3 @@
|
||||
# ortho_5x14
|
||||
|
||||
LAYOUT_ortho_5x14
|
@ -106,16 +106,16 @@ void map_row_column_to_led( uint8_t row, uint8_t column, uint8_t *led_i, uint8_t
|
||||
}
|
||||
|
||||
void rgb_matrix_update_pwm_buffers(void) {
|
||||
IS31FL3731_update_pwm_buffers( DRIVER_ADDR_1, DRIVER_ADDR_2 );
|
||||
IS31FL3731_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 );
|
||||
IS31_update_pwm_buffers( DRIVER_ADDR_1, DRIVER_ADDR_2 );
|
||||
IS31_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 );
|
||||
}
|
||||
|
||||
void rgb_matrix_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) {
|
||||
IS31FL3731_set_color( index, red, green, blue );
|
||||
IS31_set_color( index, red, green, blue );
|
||||
}
|
||||
|
||||
void rgb_matrix_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) {
|
||||
IS31FL3731_set_color_all( red, green, blue );
|
||||
IS31_set_color_all( red, green, blue );
|
||||
}
|
||||
|
||||
bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record) {
|
||||
@ -752,16 +752,16 @@ void rgb_matrix_init(void) {
|
||||
void rgb_matrix_setup_drivers(void) {
|
||||
// Initialize TWI
|
||||
i2c_init();
|
||||
IS31FL3731_init( DRIVER_ADDR_1 );
|
||||
IS31FL3731_init( DRIVER_ADDR_2 );
|
||||
IS31_init( DRIVER_ADDR_1 );
|
||||
IS31_init( DRIVER_ADDR_2 );
|
||||
|
||||
for ( int index = 0; index < DRIVER_LED_TOTAL; index++ ) {
|
||||
bool enabled = true;
|
||||
// This only caches it for later
|
||||
IS31FL3731_set_led_control_register( index, enabled, enabled, enabled );
|
||||
IS31_set_led_control_register( index, enabled, enabled, enabled );
|
||||
}
|
||||
// This actually updates the LED drivers
|
||||
IS31FL3731_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 );
|
||||
IS31_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 );
|
||||
}
|
||||
|
||||
// Deals with the messy details of incrementing an integer
|
||||
@ -811,11 +811,11 @@ void rgb_matrix_test_led( uint8_t index, bool red, bool green, bool blue ) {
|
||||
{
|
||||
if ( i == index )
|
||||
{
|
||||
IS31FL3731_set_led_control_register( i, red, green, blue );
|
||||
IS31_set_led_control_register( i, red, green, blue );
|
||||
}
|
||||
else
|
||||
{
|
||||
IS31FL3731_set_led_control_register( i, false, false, false );
|
||||
IS31_set_led_control_register( i, false, false, false );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
72
users/replicaJunction/config.h
Normal file
72
users/replicaJunction/config.h
Normal file
@ -0,0 +1,72 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Features That Can Be Enabled
|
||||
// https://docs.qmk.fm/reference/config-options#features-that-can-be-enabled
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Prevent modifiers from sticking when switching layers
|
||||
// Uses 5 bytes of memory per 8 keys, but makes sure modifiers don't get "stuck" switching layers
|
||||
#define PREVENT_STUCK_MODIFIERS
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Behaviors That Can Be Configured
|
||||
// https://docs.qmk.fm/reference/config-options#behaviors-that-can-be-configured
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// MS the button needs to be held before a tap becomes a hold (default: 200)
|
||||
#undef TAPPING_TERM
|
||||
#define TAPPING_TERM 250
|
||||
|
||||
// Makes it easier for fast typists to use dual-role keys. See additional details here:
|
||||
// https://docs.qmk.fm/features/advanced-keycodes#permissive-hold
|
||||
#define PERMISSIVE_HOLD
|
||||
|
||||
// MS after tapping the Leader key to listen for a sequence (default: 300)
|
||||
#undef LEADER_TIMEOUT
|
||||
#define LEADER_TIMEOUT 750
|
||||
|
||||
// This makes it possible to do rolling combos (zx) with keys that convert to other keys on hold
|
||||
// (for example, if z becomes ctrl when you hold it, when this option isn't enabled, z rapidly
|
||||
// followed by x actually sends Ctrl-x. That's bad.)
|
||||
#define IGNORE_MOD_TAP_INTERRUPT
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Mouse Key Options
|
||||
// https://docs.qmk.fm/reference/config-options#mouse-key-options
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef MOUSEKEY_ENABLE
|
||||
// Mouse key config
|
||||
|
||||
// Frequency with which cursor movements are sent. Lower means more resolution / DPI.
|
||||
// Default: 20
|
||||
// #undef MOUSEKEY_INTERVAL
|
||||
// #define MOUSEKEY_INTERVAL 20
|
||||
|
||||
// MS after pressing the key before initial movement begins. Lower means quicker response.
|
||||
// Default: 0
|
||||
// #undef MOUSEKEY_DELAY
|
||||
// #define MOUSEKEY_DELAY 0
|
||||
|
||||
// MS it takes the cursor to accelerate to max speed
|
||||
// Default: 60
|
||||
// #undef MOUSEKEY_TIME_TO_MAX
|
||||
// #define MOUSEKEY_TIME_TO_MAX 60
|
||||
|
||||
// Maximum speed for the mouse keys
|
||||
// Default: 7
|
||||
// #undef MOUSEKEY_MAX_SPEED
|
||||
// #define MOUSEKEY_MAX_SPEED 7
|
||||
|
||||
// Delay before the mouse wheel
|
||||
// Default: 0
|
||||
// #undef MOUSEKEY_WHEEL_DELAY
|
||||
// #define MOUSEKEY_WHEEL_DELAY 0
|
||||
|
||||
#endif // MOUSEKEY_ENABLE
|
14
users/replicaJunction/readme.md
Normal file
14
users/replicaJunction/readme.md
Normal file
@ -0,0 +1,14 @@
|
||||
Copyright 2018 @<replicaJunction>
|
||||
|
||||
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/>.
|
149
users/replicaJunction/replicaJunction.c
Normal file
149
users/replicaJunction/replicaJunction.c
Normal file
@ -0,0 +1,149 @@
|
||||
#include "replicaJunction.h"
|
||||
#include "version.h"
|
||||
|
||||
#ifdef TAP_DANCE_ENABLE
|
||||
void dance_layer(qk_tap_dance_state_t *state, void *user_data)
|
||||
{
|
||||
uint8_t layer = biton32(layer_state);
|
||||
|
||||
if (state->count >= 5)
|
||||
{
|
||||
// 5 or more taps resets the keyboard
|
||||
reset_keyboard();
|
||||
}
|
||||
#ifdef L_QWERTY
|
||||
else if (state->count == 3)
|
||||
{
|
||||
// Triple tap changes to QWERTY layer
|
||||
if (layer == L_QWERTY)
|
||||
{
|
||||
layer_off(L_QWERTY);
|
||||
}
|
||||
else
|
||||
{
|
||||
layer_on(L_QWERTY);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifdef L_NUM
|
||||
else if (state->count == 2)
|
||||
{
|
||||
// Double tap toggles Number layer
|
||||
if (layer == L_NUM)
|
||||
{
|
||||
layer_off(L_NUM);
|
||||
}
|
||||
else
|
||||
{
|
||||
layer_on(L_NUM);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
else
|
||||
{
|
||||
// Single tap sends Escape, and also turns off layers
|
||||
// That's mostly in case I get stuck and forget where I am
|
||||
#ifdef L_NUM
|
||||
layer_off(L_NUM);
|
||||
#endif
|
||||
#ifdef L_EXTEND
|
||||
layer_off(L_EXTEND);
|
||||
#endif
|
||||
#ifdef L_SYMBOL
|
||||
layer_off(L_SYMBOL);
|
||||
#endif
|
||||
#ifdef L_QWERTY
|
||||
layer_off(L_QWERTY);
|
||||
#endif
|
||||
register_code(KC_ESC);
|
||||
unregister_code(KC_ESC);
|
||||
}
|
||||
};
|
||||
|
||||
// Tap Dance Definitions
|
||||
// Note - this needs to come AFTER the function is declared
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
[TD_LAYER_TOGGLE] = ACTION_TAP_DANCE_FN(dance_layer)
|
||||
};
|
||||
|
||||
#endif // TAP_DANCE_ENABLE
|
||||
|
||||
// These functions can be overridden in individual keymap files.
|
||||
// This allows a user function to be shared for all my keyboards, while each
|
||||
// keyboard can also have a keyboard-specific section.
|
||||
|
||||
// Note that keymaps don't need to override these if there's nothing to
|
||||
// override them with.
|
||||
__attribute__ ((weak))
|
||||
void matrix_init_keymap(void) {}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_scan_keymap(void) {}
|
||||
|
||||
__attribute__ ((weak))
|
||||
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
};
|
||||
|
||||
// Runs just one time when the keyboard initializes.
|
||||
void matrix_init_user(void) {
|
||||
#ifdef UNICODEMAP_ENABLE
|
||||
// Set Unicode input to use WinCompose
|
||||
// https://github.com/samhocevar/wincompose
|
||||
set_unicode_input_mode(UC_WINC);
|
||||
#endif // UNICODEMAP_ENABLE
|
||||
|
||||
matrix_init_keymap();
|
||||
};
|
||||
|
||||
// Runs constantly in the background, in a loop.
|
||||
void matrix_scan_user(void) {
|
||||
matrix_scan_keymap();
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
if (record->event.pressed)
|
||||
return true;
|
||||
|
||||
switch(keycode)
|
||||
{
|
||||
case RJ_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader
|
||||
SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP
|
||||
#if (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU))
|
||||
":dfu"
|
||||
#elif defined(BOOTLOADER_HALFKAY)
|
||||
":teensy"
|
||||
#elif defined(BOOTLOADER_CATERINA)
|
||||
":avrdude"
|
||||
#endif // bootloader options
|
||||
//SS_TAP(X_ENTER)
|
||||
);
|
||||
return false;
|
||||
case RJ_QMKV:
|
||||
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
|
||||
return false;
|
||||
case RJ_EQ:
|
||||
SEND_STRING("==");
|
||||
return false;
|
||||
case RJ_NEQ:
|
||||
SEND_STRING("!=");
|
||||
return false;
|
||||
case RJ_GEQ:
|
||||
SEND_STRING(">=");
|
||||
return false;
|
||||
case RJ_LEQ:
|
||||
SEND_STRING("<=");
|
||||
return false;
|
||||
case RJ_GEQR:
|
||||
SEND_STRING("=>");
|
||||
return false;
|
||||
case RJ_DUND:
|
||||
SEND_STRING("$_");
|
||||
return false;
|
||||
case RJ_SELS:
|
||||
SEND_STRING("select *");
|
||||
return false;
|
||||
}
|
||||
|
||||
return process_record_keymap(keycode, record);
|
||||
};
|
115
users/replicaJunction/replicaJunction.h
Normal file
115
users/replicaJunction/replicaJunction.h
Normal file
@ -0,0 +1,115 @@
|
||||
#pragma once
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Keymap definitions
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Layer definitions
|
||||
// #define L_COLEMAK 0
|
||||
// #define L_QWERTY 1
|
||||
// #define L_NUM 2
|
||||
// #define L_EXTEND 3
|
||||
// #define L_FUNC 4
|
||||
// #define L_GAMING 5
|
||||
// #define L_SYMBOL 6
|
||||
// #define L_LL_R 7
|
||||
// #define L_LL_S 8
|
||||
// #define L_LL_E 9
|
||||
// #define L_LL_I 10
|
||||
|
||||
// Keyboard aliases
|
||||
#define _______ KC_TRNS
|
||||
#define ooooooo KC_TRNS
|
||||
|
||||
#define MO_FUNC MO(L_FUNC)
|
||||
#define TT_NUM TT(L_NUM)
|
||||
#define TG_GAME TG(L_GAMING)
|
||||
#define OSL_SYM OSL(L_SYMBOL)
|
||||
|
||||
#define OSM_LSF OSM(MOD_LSFT)
|
||||
#define OSM_RSF OSM(MOD_RSFT)
|
||||
|
||||
#define KX_CTSF LCTL(KC_LSFT)
|
||||
#define KX_STAB LSFT(KC_TAB)
|
||||
#define KX_CGR LCTL(KC_GRV)
|
||||
#define KX_PAST LCTL(LGUI(LALT(KC_V)))
|
||||
#define KX_SRCH LCTL(LGUI(LALT(KC_S)))
|
||||
|
||||
#define KX_BKNM LT(L_NUM, KC_BSPC)
|
||||
#define KX_DCTL CTL_T(KC_DEL)
|
||||
#define KX_NALT ALT_T(KC_ENT)
|
||||
#define KX_ECTL CTL_T(KC_ESC)
|
||||
#define KX_SPAC LT(L_EXTEND, KC_SPC)
|
||||
|
||||
#define KX_Z_MT CTL_T(KC_Z)
|
||||
#define KX_X_MT GUI_T(KC_X)
|
||||
#define KX_C_MT MT(MOD_LCTL | MOD_LALT, KC_C)
|
||||
#define KX_D_MT ALT_T(KC_D)
|
||||
|
||||
#define KX_SLMT CTL_T(KC_SLSH)
|
||||
#define KX_DOMT GUI_T(KC_DOT)
|
||||
#define KX_COMT MT(MOD_LCTL | MOD_LALT, KC_COMM)
|
||||
#define KX_H_MT ALT_T(KC_H)
|
||||
|
||||
#ifdef L_LL_R
|
||||
#define KC_R_LT LT(L_LL_R, KC_R)
|
||||
#else
|
||||
#define KC_R_LT KC_R
|
||||
#endif
|
||||
|
||||
#ifdef L_LL_S
|
||||
#define KC_S_LT LT(L_LL_S, KC_S)
|
||||
#else
|
||||
#define KC_S_LT KC_S
|
||||
#endif
|
||||
|
||||
#ifdef L_LL_E
|
||||
#define KC_E_LT LT(L_LL_E, KC_E)
|
||||
#else
|
||||
#define KC_E_LT KC_E
|
||||
#endif
|
||||
|
||||
#ifdef L_LL_I
|
||||
#define KC_I_LT LT(L_LL_I, KC_I)
|
||||
#else
|
||||
#define KC_I_LT KC_I
|
||||
#endif
|
||||
|
||||
// "Macro" functions
|
||||
enum userspace_custom_keycodes {
|
||||
RJ_MAKE = SAFE_RANGE, // QMK make command
|
||||
RJ_QMKV, // QMK version
|
||||
RJ_EQ, // ==
|
||||
RJ_NEQ, // !=
|
||||
RJ_GEQ, // >=
|
||||
RJ_LEQ, // <=
|
||||
RJ_GEQR, // => ("greater than or equal - right")
|
||||
RJ_DUND, // $_
|
||||
RJ_SELS, // select * (used for PowerShell)
|
||||
RJ_MUTE, // Discord mute (GUI+Shift+M)
|
||||
RJ_DEAF, // Discord deafen (GUI+Shift+D)
|
||||
RJ_DOVR // Toggle Discord overlay (GUI+Shift+O)
|
||||
};
|
||||
|
||||
// Mouse keys
|
||||
#define M_UP KC_MS_UP
|
||||
#define M_DOWN KC_MS_DOWN
|
||||
#define M_LEFT KC_MS_LEFT
|
||||
#define M_RIGHT KC_MS_RIGHT
|
||||
#define M_LCLIK KC_MS_BTN1
|
||||
#define M_RCLIK KC_MS_BTN2
|
||||
#define M_MCLIK KC_MS_BTN3
|
||||
#define M_WHLUP KC_WH_U
|
||||
#define M_WHLDN KC_WH_D
|
||||
|
||||
// Used in macro definitions
|
||||
#define TAP(code) register_code (code); unregister_code (code);
|
||||
|
||||
// Tap Dance
|
||||
#ifdef TAP_DANCE_ENABLE
|
||||
#define TD_LAYER_TOGGLE 0
|
||||
extern void dance_layer(qk_tap_dance_state_t *state, void *user_data);
|
||||
#define TD_LAYR TD(TD_LAYER_TOGGLE)
|
||||
#endif // TAP_DANCE_ENABLE
|
1
users/replicaJunction/rules.mk
Normal file
1
users/replicaJunction/rules.mk
Normal file
@ -0,0 +1 @@
|
||||
SRC += replicaJunction.c
|
Loading…
Reference in New Issue
Block a user