mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-07-18 05:32:05 +00:00
Merge branch 'master' of https://github.com/qmk/qmk_firmware
This commit is contained in:
commit
e8040e895e
@ -248,3 +248,7 @@ Use these to enable or disable building certain features. The more you have enab
|
||||
* Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
* `SPLIT_KEYBOARD`
|
||||
* Enables split keyboard support (dual MCU like the let's split and bakingpy's boards) and includes all necessary files located at quantum/split_common
|
||||
* `WAIT_FOR_USB`
|
||||
* Forces the keyboard to wait for a USB connection to be established before it starts up
|
||||
* `NO_USB_STARTUP_CHECK`
|
||||
* Disables usb suspend check after keyboard startup. Usually the keyboard waits for the host to wake it up before any tasks are performed. This is useful for split keyboards as one half will not get a wakeup call but must send commands to the master.
|
||||
|
@ -127,8 +127,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
void matrix_init_user(void) {
|
||||
#ifdef BOOTLOADER_CATERINA
|
||||
// This will disable the red LEDs on the ProMicros
|
||||
DDRD &= ~(1<<5);
|
||||
PORTD &= ~(1<<5);
|
||||
DDRB &= ~(1<<0);
|
||||
PORTB &= ~(1<<0);
|
||||
#endif
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
};
|
||||
|
||||
void persistent_default_layer_set(uint16_t default_layer) {
|
||||
|
@ -16,9 +16,16 @@ 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"
|
||||
#include <serial_config.h>
|
||||
|
||||
#endif
|
||||
#ifdef USE_Link_Time_Optimization
|
||||
// LTO has issues with macros (action_get_macro) and "functions" (fn_actions),
|
||||
// so just disable them
|
||||
#define NO_ACTION_MACRO
|
||||
#define NO_ACTION_FUNCTION
|
||||
|
||||
#define DISABLE_LEADER
|
||||
#endif // USE_Link_Time_Optimization
|
||||
|
@ -1,8 +1,5 @@
|
||||
#ifndef CRKBD_H
|
||||
#define CRKBD_H
|
||||
#pragma once
|
||||
|
||||
#ifdef KEYBOARD_crkbd_rev1
|
||||
#include "rev1.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -34,7 +34,7 @@ void i2c_delay(void) {
|
||||
// _delay_us(100);
|
||||
}
|
||||
|
||||
// Setup twi to run at 100kHz
|
||||
// Setup twi to run at 100kHz or 400kHz (see ./i2c.h SCL_CLOCK)
|
||||
void i2c_master_init(void) {
|
||||
// no prescaler
|
||||
TWSR = 0;
|
||||
|
@ -1,5 +1,4 @@
|
||||
#ifndef I2C_H
|
||||
#define I2C_H
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
@ -15,7 +14,7 @@
|
||||
|
||||
#define SLAVE_BUFFER_SIZE 0x10
|
||||
|
||||
// i2c SCL clock frequency
|
||||
// i2c SCL clock frequency 400kHz
|
||||
#define SCL_CLOCK 400000L
|
||||
|
||||
extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE];
|
||||
@ -45,5 +44,3 @@ extern unsigned char i2c_readNak(void);
|
||||
extern unsigned char i2c_read(unsigned char ack);
|
||||
|
||||
#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak();
|
||||
|
||||
#endif
|
||||
|
@ -5,7 +5,6 @@
|
||||
#include "split_util.h"
|
||||
#endif
|
||||
#ifdef SSD1306OLED
|
||||
#include "LUFA/Drivers/Peripheral/TWI.h"
|
||||
#include "ssd1306.h"
|
||||
#endif
|
||||
|
||||
@ -130,7 +129,6 @@ void matrix_init_user(void) {
|
||||
#endif
|
||||
//SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h
|
||||
#ifdef SSD1306OLED
|
||||
TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000));
|
||||
iota_gfx_init(!has_usb()); // turns on the display
|
||||
#endif
|
||||
}
|
||||
|
@ -21,10 +21,10 @@ SWAP_HANDS_ENABLE = no # Enable one-hand typing
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
# If you want to change the display of OLED, you need to change here
|
||||
SRC += ../lib/rgb_state_reader.c \
|
||||
../lib/layer_state_reader.c \
|
||||
../lib/logo_reader.c \
|
||||
../lib/keylogger.c \
|
||||
# ../lib/mode_icon_reader.c \
|
||||
# ../lib/host_led_state_reader.c \
|
||||
# ../lib/timelogger.c \
|
||||
SRC += ./lib/rgb_state_reader.c \
|
||||
./lib/layer_state_reader.c \
|
||||
./lib/logo_reader.c \
|
||||
./lib/keylogger.c \
|
||||
# ./lib/mode_icon_reader.c \
|
||||
# ./lib/host_led_state_reader.c \
|
||||
# ./lib/timelogger.c \
|
||||
|
@ -5,7 +5,6 @@
|
||||
#include "split_util.h"
|
||||
#endif
|
||||
#ifdef SSD1306OLED
|
||||
#include "LUFA/Drivers/Peripheral/TWI.h"
|
||||
#include "ssd1306.h"
|
||||
#endif
|
||||
|
||||
@ -124,7 +123,6 @@ void matrix_init_user(void) {
|
||||
#endif
|
||||
//SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h
|
||||
#ifdef SSD1306OLED
|
||||
TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000));
|
||||
iota_gfx_init(!has_usb()); // turns on the display
|
||||
#endif
|
||||
}
|
||||
|
@ -21,10 +21,10 @@ SWAP_HANDS_ENABLE = no # Enable one-hand typing
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
# If you want to change the display of OLED, you need to change here
|
||||
SRC += ../lib/rgb_state_reader.c \
|
||||
../lib/layer_state_reader.c \
|
||||
../lib/logo_reader.c \
|
||||
../lib/keylogger.c \
|
||||
# ../lib/mode_icon_reader.c \
|
||||
# ../lib/host_led_state_reader.c \
|
||||
# ../lib/timelogger.c \
|
||||
SRC += ./lib/rgb_state_reader.c \
|
||||
./lib/layer_state_reader.c \
|
||||
./lib/logo_reader.c \
|
||||
./lib/keylogger.c \
|
||||
# ./lib/mode_icon_reader.c \
|
||||
# ./lib/host_led_state_reader.c \
|
||||
# ./lib/timelogger.c \
|
||||
|
@ -21,9 +21,7 @@
|
||||
|
||||
$Id: wiring.h 249 2007-02-03 16:52:51Z mellis $
|
||||
*/
|
||||
|
||||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
#pragma once
|
||||
|
||||
#include <avr/pgmspace.h>
|
||||
|
||||
@ -358,5 +356,3 @@ const uint8_t PROGMEM analog_pin_to_channel_PGM[] = {
|
||||
#define SERIAL_PORT_USBVIRTUAL Serial
|
||||
#define SERIAL_PORT_HARDWARE Serial1
|
||||
#define SERIAL_PORT_HARDWARE_OPEN Serial1
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
|
@ -16,10 +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 REV1_CONFIG_H
|
||||
#define REV1_CONFIG_H
|
||||
|
||||
#include "../config.h"
|
||||
#pragma once
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFEED
|
||||
@ -82,6 +79,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//#define NO_ACTION_ONESHOT
|
||||
//#define NO_ACTION_MACRO
|
||||
//#define NO_ACTION_FUNCTION
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -20,6 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include <avr/io.h>
|
||||
#include <avr/wdt.h>
|
||||
#include <avr/interrupt.h>
|
||||
@ -30,12 +31,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "matrix.h"
|
||||
#include "split_util.h"
|
||||
#include "pro_micro.h"
|
||||
#include "config.h"
|
||||
|
||||
#ifdef USE_MATRIX_I2C
|
||||
# include "i2c.h"
|
||||
#else // USE_SERIAL
|
||||
# include "serial.h"
|
||||
# include "split_scomm.h"
|
||||
#endif
|
||||
|
||||
#ifndef DEBOUNCE
|
||||
@ -103,6 +103,8 @@ void matrix_init(void)
|
||||
init_cols();
|
||||
|
||||
TX_RX_LED_INIT;
|
||||
TXLED0;
|
||||
RXLED0;
|
||||
|
||||
// initialize matrix state: all keys off
|
||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||
@ -179,17 +181,20 @@ i2c_error: // the cable is disconnceted, or something else went wrong
|
||||
|
||||
#else // USE_SERIAL
|
||||
|
||||
int serial_transaction(void) {
|
||||
int serial_transaction(int master_changed) {
|
||||
int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
|
||||
#ifdef SERIAL_USE_MULTI_TRANSACTION
|
||||
int ret=serial_update_buffers(master_changed);
|
||||
#else
|
||||
int ret=serial_update_buffers();
|
||||
#endif
|
||||
if (ret ) {
|
||||
if(ret==2) RXLED1;
|
||||
return 1;
|
||||
}
|
||||
RXLED0;
|
||||
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
||||
matrix[slaveOffset+i] = serial_slave_buffer[i];
|
||||
}
|
||||
memcpy(&matrix[slaveOffset],
|
||||
(void *)serial_slave_buffer, SERIAL_SLAVE_BUFFER_LENGTH);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
@ -200,19 +205,9 @@ uint8_t matrix_scan(void)
|
||||
matrix_master_scan();
|
||||
}else{
|
||||
matrix_slave_scan();
|
||||
|
||||
// if(serial_slave_DATA_CORRUPT()){
|
||||
// TXLED0;
|
||||
int offset = (isLeftHand) ? ROWS_PER_HAND : 0;
|
||||
|
||||
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
||||
matrix[offset+i] = serial_master_buffer[i];
|
||||
}
|
||||
|
||||
// }else{
|
||||
// TXLED1;
|
||||
// }
|
||||
|
||||
memcpy(&matrix[offset],
|
||||
(void *)serial_master_buffer, SERIAL_MASTER_BUFFER_LENGTH);
|
||||
matrix_scan_quantum();
|
||||
}
|
||||
return 1;
|
||||
@ -222,6 +217,7 @@ uint8_t matrix_scan(void)
|
||||
uint8_t matrix_master_scan(void) {
|
||||
|
||||
int ret = _matrix_scan();
|
||||
int mchanged = 1;
|
||||
|
||||
int offset = (isLeftHand) ? 0 : ROWS_PER_HAND;
|
||||
|
||||
@ -231,15 +227,18 @@ uint8_t matrix_master_scan(void) {
|
||||
// i2c_slave_buffer[i] = matrix[offset+i];
|
||||
// }
|
||||
#else // USE_SERIAL
|
||||
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
||||
serial_master_buffer[i] = matrix[offset+i];
|
||||
}
|
||||
#ifdef SERIAL_USE_MULTI_TRANSACTION
|
||||
mchanged = memcmp((void *)serial_master_buffer,
|
||||
&matrix[offset], SERIAL_MASTER_BUFFER_LENGTH);
|
||||
#endif
|
||||
memcpy((void *)serial_master_buffer,
|
||||
&matrix[offset], SERIAL_MASTER_BUFFER_LENGTH);
|
||||
#endif
|
||||
|
||||
#ifdef USE_MATRIX_I2C
|
||||
if( i2c_transaction() ) {
|
||||
#else // USE_SERIAL
|
||||
if( serial_transaction() ) {
|
||||
if( serial_transaction(mchanged) ) {
|
||||
#endif
|
||||
// turn on the indicator led when halves are disconnected
|
||||
TXLED1;
|
||||
@ -273,9 +272,19 @@ void matrix_slave_scan(void) {
|
||||
i2c_slave_buffer[i] = matrix[offset+i];
|
||||
}
|
||||
#else // USE_SERIAL
|
||||
#ifdef SERIAL_USE_MULTI_TRANSACTION
|
||||
int change = 0;
|
||||
#endif
|
||||
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
||||
#ifdef SERIAL_USE_MULTI_TRANSACTION
|
||||
if( serial_slave_buffer[i] != matrix[offset+i] )
|
||||
change = 1;
|
||||
#endif
|
||||
serial_slave_buffer[i] = matrix[offset+i];
|
||||
}
|
||||
#ifdef SERIAL_USE_MULTI_TRANSACTION
|
||||
slave_buffer_change_count += change;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
#ifndef REV1_H
|
||||
#define REV1_CONFIG_H
|
||||
#pragma once
|
||||
|
||||
#include "../crkbd.h"
|
||||
|
||||
@ -49,5 +48,3 @@
|
||||
KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, \
|
||||
KC_##L30, KC_##L31, KC_##L32, KC_##R30, KC_##R31, KC_##R32 \
|
||||
)
|
||||
|
||||
#endif
|
||||
|
@ -1,2 +1,3 @@
|
||||
SRC += rev1/matrix.c \
|
||||
ws2812.c
|
||||
SRC += rev1/matrix.c
|
||||
SRC += rev1/split_util.c
|
||||
SRC += rev1/split_scomm.c
|
||||
|
10
keyboards/crkbd/rev1/serial_config.h
Normal file
10
keyboards/crkbd/rev1/serial_config.h
Normal file
@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
/* Soft Serial defines */
|
||||
#define SERIAL_PIN_DDR DDRD
|
||||
#define SERIAL_PIN_PORT PORTD
|
||||
#define SERIAL_PIN_INPUT PIND
|
||||
#define SERIAL_PIN_MASK _BV(PD2)
|
||||
#define SERIAL_PIN_INTERRUPT INT2_vect
|
||||
|
||||
#define SERIAL_USE_MULTI_TRANSACTION
|
5
keyboards/crkbd/rev1/serial_config_simpleapi.h
Normal file
5
keyboards/crkbd/rev1/serial_config_simpleapi.h
Normal file
@ -0,0 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#undef SERIAL_USE_MULTI_TRANSACTION
|
||||
#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
|
||||
#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2
|
73
keyboards/crkbd/rev1/split_scomm.c
Normal file
73
keyboards/crkbd/rev1/split_scomm.c
Normal file
@ -0,0 +1,73 @@
|
||||
#ifdef USE_SERIAL
|
||||
#ifdef SERIAL_USE_MULTI_TRANSACTION
|
||||
/* --- USE flexible API (using multi-type transaction function) --- */
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <split_scomm.h>
|
||||
#include "serial.h"
|
||||
#ifdef SERIAL_DEBUG_MODE
|
||||
#include <avr/io.h>
|
||||
#endif
|
||||
|
||||
uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0};
|
||||
uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0};
|
||||
uint8_t volatile status_com = 0;
|
||||
uint8_t volatile status1 = 0;
|
||||
uint8_t slave_buffer_change_count = 0;
|
||||
uint8_t s_change_old = 0xff;
|
||||
|
||||
SSTD_t transactions[] = {
|
||||
#define GET_SLAVE_STATUS 0
|
||||
/* master buffer not changed, only recive slave_buffer_change_count */
|
||||
{ (uint8_t *)&status_com,
|
||||
0, NULL,
|
||||
sizeof(slave_buffer_change_count), &slave_buffer_change_count,
|
||||
},
|
||||
#define PUT_MASTER_GET_SLAVE_STATUS 1
|
||||
/* master buffer changed need send, and recive slave_buffer_change_count */
|
||||
{ (uint8_t *)&status_com,
|
||||
sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer,
|
||||
sizeof(slave_buffer_change_count), &slave_buffer_change_count,
|
||||
},
|
||||
#define GET_SLAVE_BUFFER 2
|
||||
/* recive serial_slave_buffer */
|
||||
{ (uint8_t *)&status1,
|
||||
0, NULL,
|
||||
sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer
|
||||
}
|
||||
};
|
||||
|
||||
void serial_master_init(void)
|
||||
{
|
||||
soft_serial_initiator_init(transactions);
|
||||
}
|
||||
|
||||
void serial_slave_init(void)
|
||||
{
|
||||
soft_serial_target_init(transactions);
|
||||
}
|
||||
|
||||
// 0 => no error
|
||||
// 1 => slave did not respond
|
||||
// 2 => checksum error
|
||||
int serial_update_buffers(int master_update)
|
||||
{
|
||||
int status;
|
||||
static int need_retry = 0;
|
||||
if( s_change_old != slave_buffer_change_count ) {
|
||||
status = soft_serial_transaction(GET_SLAVE_BUFFER);
|
||||
if( status == TRANSACTION_END )
|
||||
s_change_old = slave_buffer_change_count;
|
||||
}
|
||||
if( !master_update && !need_retry)
|
||||
status = soft_serial_transaction(GET_SLAVE_STATUS);
|
||||
else
|
||||
status = soft_serial_transaction(PUT_MASTER_GET_SLAVE_STATUS);
|
||||
need_retry = ( status == TRANSACTION_END ) ? 0 : 1;
|
||||
return status;
|
||||
}
|
||||
|
||||
#endif // SERIAL_USE_MULTI_TRANSACTION
|
||||
#endif /* USE_SERIAL */
|
21
keyboards/crkbd/rev1/split_scomm.h
Normal file
21
keyboards/crkbd/rev1/split_scomm.h
Normal file
@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef SERIAL_USE_MULTI_TRANSACTION
|
||||
/* --- USE Simple API (OLD API, compatible with let's split serial.c) --- */
|
||||
#include "serial.h"
|
||||
|
||||
#else
|
||||
/* --- USE flexible API (using multi-type transaction function) --- */
|
||||
// Buffers for master - slave communication
|
||||
#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
|
||||
#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2
|
||||
|
||||
extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH];
|
||||
extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH];
|
||||
extern uint8_t slave_buffer_change_count;
|
||||
|
||||
void serial_master_init(void);
|
||||
void serial_slave_init(void);
|
||||
int serial_update_buffers(int master_changed);
|
||||
|
||||
#endif
|
@ -7,12 +7,11 @@
|
||||
#include "split_util.h"
|
||||
#include "matrix.h"
|
||||
#include "keyboard.h"
|
||||
#include "config.h"
|
||||
|
||||
#ifdef USE_MATRIX_I2C
|
||||
# include "i2c.h"
|
||||
#else
|
||||
# include "serial.h"
|
||||
# include "split_scomm.h"
|
||||
#endif
|
||||
|
||||
volatile bool isLeftHand = true;
|
@ -1,5 +1,4 @@
|
||||
#ifndef SPLIT_KEYBOARD_UTIL_H
|
||||
#define SPLIT_KEYBOARD_UTIL_H
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "eeconfig.h"
|
||||
@ -15,5 +14,3 @@ void split_keyboard_setup(void);
|
||||
bool has_usb(void);
|
||||
|
||||
void matrix_master_OLED_init (void);
|
||||
|
||||
#endif
|
@ -1,7 +1,9 @@
|
||||
SRC += i2c.c \
|
||||
serial.c \
|
||||
split_util.c \
|
||||
ssd1306.c
|
||||
SRC += i2c.c
|
||||
SRC += serial.c
|
||||
SRC += ssd1306.c
|
||||
|
||||
# if firmware size over limit, try this option
|
||||
# CFLAGS += -flto
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
|
@ -9,36 +9,128 @@
|
||||
#include <avr/io.h>
|
||||
#include <avr/interrupt.h>
|
||||
#include <util/delay.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
#include "serial.h"
|
||||
//#include <pro_micro.h>
|
||||
|
||||
#ifdef USE_SERIAL
|
||||
|
||||
// Serial pulse period in microseconds. Its probably a bad idea to lower this
|
||||
// value.
|
||||
#define SERIAL_DELAY 24
|
||||
|
||||
#ifndef SERIAL_USE_MULTI_TRANSACTION
|
||||
/* --- USE Simple API (OLD API, compatible with let's split serial.c) */
|
||||
#if SERIAL_SLAVE_BUFFER_LENGTH > 0
|
||||
uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0};
|
||||
#endif
|
||||
#if SERIAL_MASTER_BUFFER_LENGTH > 0
|
||||
uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0};
|
||||
#endif
|
||||
uint8_t volatile status0 = 0;
|
||||
|
||||
#define SLAVE_DATA_CORRUPT (1<<0)
|
||||
volatile uint8_t status = 0;
|
||||
SSTD_t transactions[] = {
|
||||
{ (uint8_t *)&status0,
|
||||
#if SERIAL_MASTER_BUFFER_LENGTH > 0
|
||||
sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer,
|
||||
#else
|
||||
0, (uint8_t *)NULL,
|
||||
#endif
|
||||
#if SERIAL_SLAVE_BUFFER_LENGTH > 0
|
||||
sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer
|
||||
#else
|
||||
0, (uint8_t *)NULL,
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
void serial_master_init(void)
|
||||
{ soft_serial_initiator_init(transactions); }
|
||||
|
||||
void serial_slave_init(void)
|
||||
{ soft_serial_target_init(transactions); }
|
||||
|
||||
// 0 => no error
|
||||
// 1 => slave did not respond
|
||||
// 2 => checksum error
|
||||
int serial_update_buffers()
|
||||
{ return soft_serial_transaction(); }
|
||||
|
||||
#endif // Simple API (OLD API, compatible with let's split serial.c)
|
||||
|
||||
#define ALWAYS_INLINE __attribute__((always_inline))
|
||||
#define NO_INLINE __attribute__((noinline))
|
||||
#define _delay_sub_us(x) __builtin_avr_delay_cycles(x)
|
||||
|
||||
// Serial pulse period in microseconds.
|
||||
#define TID_SEND_ADJUST 14
|
||||
|
||||
#define SELECT_SERIAL_SPEED 1
|
||||
#if SELECT_SERIAL_SPEED == 0
|
||||
// Very High speed
|
||||
#define SERIAL_DELAY 4 // micro sec
|
||||
#define READ_WRITE_START_ADJUST 33 // cycles
|
||||
#define READ_WRITE_WIDTH_ADJUST 3 // cycles
|
||||
#elif SELECT_SERIAL_SPEED == 1
|
||||
// High speed
|
||||
#define SERIAL_DELAY 6 // micro sec
|
||||
#define READ_WRITE_START_ADJUST 30 // cycles
|
||||
#define READ_WRITE_WIDTH_ADJUST 3 // cycles
|
||||
#elif SELECT_SERIAL_SPEED == 2
|
||||
// Middle speed
|
||||
#define SERIAL_DELAY 12 // micro sec
|
||||
#define READ_WRITE_START_ADJUST 30 // cycles
|
||||
#define READ_WRITE_WIDTH_ADJUST 3 // cycles
|
||||
#elif SELECT_SERIAL_SPEED == 3
|
||||
// Low speed
|
||||
#define SERIAL_DELAY 24 // micro sec
|
||||
#define READ_WRITE_START_ADJUST 30 // cycles
|
||||
#define READ_WRITE_WIDTH_ADJUST 3 // cycles
|
||||
#elif SELECT_SERIAL_SPEED == 4
|
||||
// Very Low speed
|
||||
#define SERIAL_DELAY 50 // micro sec
|
||||
#define READ_WRITE_START_ADJUST 30 // cycles
|
||||
#define READ_WRITE_WIDTH_ADJUST 3 // cycles
|
||||
#else
|
||||
#error Illegal Serial Speed
|
||||
#endif
|
||||
|
||||
|
||||
#define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2)
|
||||
#define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2)
|
||||
|
||||
#define SLAVE_INT_WIDTH_US 1
|
||||
#ifndef SERIAL_USE_MULTI_TRANSACTION
|
||||
#define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY
|
||||
#else
|
||||
#define SLAVE_INT_ACK_WIDTH_UNIT 2
|
||||
#define SLAVE_INT_ACK_WIDTH 4
|
||||
#endif
|
||||
|
||||
static SSTD_t *Transaction_table = NULL;
|
||||
|
||||
inline static
|
||||
void serial_delay(void) {
|
||||
_delay_us(SERIAL_DELAY);
|
||||
}
|
||||
void serial_delay_short(void) {
|
||||
_delay_us(SERIAL_DELAY-1);
|
||||
|
||||
inline static
|
||||
void serial_delay_half1(void) {
|
||||
_delay_us(SERIAL_DELAY_HALF1);
|
||||
}
|
||||
|
||||
inline static
|
||||
void serial_delay_half2(void) {
|
||||
_delay_us(SERIAL_DELAY_HALF2);
|
||||
}
|
||||
|
||||
inline static void serial_output(void) ALWAYS_INLINE;
|
||||
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_with_pullup(void) ALWAYS_INLINE;
|
||||
inline static
|
||||
void serial_input(void) {
|
||||
void serial_input_with_pullup(void) {
|
||||
SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK;
|
||||
SERIAL_PIN_PORT |= SERIAL_PIN_MASK;
|
||||
}
|
||||
@ -48,191 +140,305 @@ uint8_t serial_read_pin(void) {
|
||||
return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK);
|
||||
}
|
||||
|
||||
inline static void serial_low(void) ALWAYS_INLINE;
|
||||
inline static
|
||||
void serial_low(void) {
|
||||
SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK;
|
||||
}
|
||||
|
||||
inline static void serial_high(void) ALWAYS_INLINE;
|
||||
inline static
|
||||
void serial_high(void) {
|
||||
SERIAL_PIN_PORT |= SERIAL_PIN_MASK;
|
||||
}
|
||||
|
||||
void serial_master_init(void) {
|
||||
void soft_serial_initiator_init(SSTD_t *sstd_table)
|
||||
{
|
||||
Transaction_table = sstd_table;
|
||||
serial_output();
|
||||
serial_high();
|
||||
}
|
||||
|
||||
void serial_slave_init(void) {
|
||||
serial_input();
|
||||
void soft_serial_target_init(SSTD_t *sstd_table)
|
||||
{
|
||||
Transaction_table = sstd_table;
|
||||
serial_input_with_pullup();
|
||||
|
||||
#ifndef USE_SERIAL_PD2
|
||||
#if SERIAL_PIN_MASK == _BV(PD0)
|
||||
// Enable INT0
|
||||
EIMSK |= _BV(INT0);
|
||||
// Trigger on falling edge of INT0
|
||||
EICRA &= ~(_BV(ISC00) | _BV(ISC01));
|
||||
#else
|
||||
#elif SERIAL_PIN_MASK == _BV(PD2)
|
||||
// Enable INT2
|
||||
EIMSK |= _BV(INT2);
|
||||
// Trigger on falling edge of INT2
|
||||
EICRA &= ~(_BV(ISC20) | _BV(ISC21));
|
||||
#else
|
||||
#error unknown SERIAL_PIN_MASK value
|
||||
#endif
|
||||
}
|
||||
|
||||
// Used by the master to synchronize timing with the slave.
|
||||
// Used by the sender to synchronize timing with the reciver.
|
||||
static void sync_recv(void) NO_INLINE;
|
||||
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.
|
||||
for (uint8_t i = 0; i < SERIAL_DELAY*5 && serial_read_pin(); i++ ) {
|
||||
}
|
||||
// This shouldn't hang if the target disconnects because the
|
||||
// serial line will float to high if the target does disconnect.
|
||||
while (!serial_read_pin());
|
||||
//serial_delay();
|
||||
_delay_us(SERIAL_DELAY-5);
|
||||
}
|
||||
|
||||
// Used by the slave to send a synchronization signal to the master.
|
||||
// Used by the reciver to send a synchronization signal to the sender.
|
||||
static void sync_send(void)NO_INLINE;
|
||||
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);
|
||||
static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) NO_INLINE;
|
||||
static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) {
|
||||
uint8_t byte, i, p, pb;
|
||||
|
||||
_delay_sub_us(READ_WRITE_START_ADJUST);
|
||||
for( i = 0, byte = 0, p = 0; i < bit; i++ ) {
|
||||
serial_delay_half1(); // read the middle of pulses
|
||||
if( serial_read_pin() ) {
|
||||
byte = (byte << 1) | 1; p ^= 1;
|
||||
} else {
|
||||
byte = (byte << 1) | 0; p ^= 0;
|
||||
}
|
||||
_delay_sub_us(READ_WRITE_WIDTH_ADJUST);
|
||||
serial_delay_half2();
|
||||
}
|
||||
/* recive parity bit */
|
||||
serial_delay_half1(); // read the middle of pulses
|
||||
pb = serial_read_pin();
|
||||
_delay_sub_us(READ_WRITE_WIDTH_ADJUST);
|
||||
serial_delay_half2();
|
||||
|
||||
*pterrcount += (p != pb)? 1 : 0;
|
||||
|
||||
return byte;
|
||||
}
|
||||
|
||||
// Sends a byte with MSB ordering
|
||||
void serial_write_chunk(uint8_t data, uint8_t bit) NO_INLINE;
|
||||
void serial_write_chunk(uint8_t data, uint8_t bit) {
|
||||
uint8_t b, p;
|
||||
for( p = 0, b = 1<<(bit-1); b ; b >>= 1) {
|
||||
if(data & b) {
|
||||
serial_high(); p ^= 1;
|
||||
} else {
|
||||
serial_low(); p ^= 0;
|
||||
}
|
||||
serial_delay();
|
||||
}
|
||||
/* send parity bit */
|
||||
if(p & 1) { serial_high(); }
|
||||
else { serial_low(); }
|
||||
serial_delay();
|
||||
|
||||
serial_low(); // sync_send() / senc_recv() need raise edge
|
||||
}
|
||||
|
||||
static void serial_send_packet(uint8_t *buffer, uint8_t size) NO_INLINE;
|
||||
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();
|
||||
void serial_send_packet(uint8_t *buffer, uint8_t size) {
|
||||
for (uint8_t i = 0; i < size; ++i) {
|
||||
uint8_t data;
|
||||
data = buffer[i];
|
||||
sync_send();
|
||||
serial_write_chunk(data,8);
|
||||
}
|
||||
}
|
||||
|
||||
// interrupt handle to be used by the slave device
|
||||
static uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) NO_INLINE;
|
||||
static
|
||||
uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) {
|
||||
uint8_t pecount = 0;
|
||||
for (uint8_t i = 0; i < size; ++i) {
|
||||
uint8_t data;
|
||||
sync_recv();
|
||||
data = serial_read_chunk(&pecount, 8);
|
||||
buffer[i] = data;
|
||||
}
|
||||
return pecount == 0;
|
||||
}
|
||||
|
||||
inline static
|
||||
void change_sender2reciver(void) {
|
||||
sync_send(); //0
|
||||
serial_delay_half1(); //1
|
||||
serial_low(); //2
|
||||
serial_input_with_pullup(); //2
|
||||
serial_delay_half1(); //3
|
||||
}
|
||||
|
||||
inline static
|
||||
void change_reciver2sender(void) {
|
||||
sync_recv(); //0
|
||||
serial_delay(); //1
|
||||
serial_low(); //3
|
||||
serial_output(); //3
|
||||
serial_delay_half1(); //4
|
||||
}
|
||||
|
||||
// interrupt handle to be used by the target 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();
|
||||
#ifndef SERIAL_USE_MULTI_TRANSACTION
|
||||
serial_low();
|
||||
serial_output();
|
||||
SSTD_t *trans = Transaction_table;
|
||||
#else
|
||||
// recive transaction table index
|
||||
uint8_t tid;
|
||||
uint8_t pecount = 0;
|
||||
sync_recv();
|
||||
tid = serial_read_chunk(&pecount,4);
|
||||
if(pecount> 0)
|
||||
return;
|
||||
serial_delay_half1();
|
||||
|
||||
// wait for the sync to finish sending
|
||||
serial_delay();
|
||||
serial_high(); // response step1 low->high
|
||||
serial_output();
|
||||
_delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT*SLAVE_INT_ACK_WIDTH);
|
||||
SSTD_t *trans = &Transaction_table[tid];
|
||||
serial_low(); // response step2 ack high->low
|
||||
#endif
|
||||
|
||||
// read the middle of pulses
|
||||
_delay_us(SERIAL_DELAY/2);
|
||||
// target send phase
|
||||
if( trans->target2initiator_buffer_size > 0 )
|
||||
serial_send_packet((uint8_t *)trans->target2initiator_buffer,
|
||||
trans->target2initiator_buffer_size);
|
||||
// target switch to input
|
||||
change_sender2reciver();
|
||||
|
||||
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;
|
||||
// target recive phase
|
||||
if( trans->initiator2target_buffer_size > 0 ) {
|
||||
if (serial_recive_packet((uint8_t *)trans->initiator2target_buffer,
|
||||
trans->initiator2target_buffer_size) ) {
|
||||
*trans->status = TRANSACTION_ACCEPTED;
|
||||
} else {
|
||||
status &= ~SLAVE_DATA_CORRUPT;
|
||||
*trans->status = TRANSACTION_DATA_ERROR;
|
||||
}
|
||||
} else {
|
||||
*trans->status = TRANSACTION_ACCEPTED;
|
||||
}
|
||||
|
||||
inline
|
||||
bool serial_slave_DATA_CORRUPT(void) {
|
||||
return status & SLAVE_DATA_CORRUPT;
|
||||
sync_recv(); //weit initiator output to high
|
||||
}
|
||||
|
||||
// Copies the serial_slave_buffer to the master and sends the
|
||||
// serial_master_buffer to the slave.
|
||||
/////////
|
||||
// start transaction by initiator
|
||||
//
|
||||
// int soft_serial_transaction(int sstd_index)
|
||||
//
|
||||
// Returns:
|
||||
// 0 => no error
|
||||
// 1 => slave did not respond
|
||||
int serial_update_buffers(void) {
|
||||
// TRANSACTION_END
|
||||
// TRANSACTION_NO_RESPONSE
|
||||
// TRANSACTION_DATA_ERROR
|
||||
// this code is very time dependent, so we need to disable interrupts
|
||||
#ifndef SERIAL_USE_MULTI_TRANSACTION
|
||||
int soft_serial_transaction(void) {
|
||||
SSTD_t *trans = Transaction_table;
|
||||
#else
|
||||
int soft_serial_transaction(int sstd_index) {
|
||||
SSTD_t *trans = &Transaction_table[sstd_index];
|
||||
#endif
|
||||
cli();
|
||||
|
||||
// signal to the slave that we want to start a transaction
|
||||
// signal to the target that we want to start a transaction
|
||||
serial_output();
|
||||
serial_low();
|
||||
_delay_us(1);
|
||||
_delay_us(SLAVE_INT_WIDTH_US);
|
||||
|
||||
// wait for the slaves response
|
||||
serial_input();
|
||||
serial_high();
|
||||
_delay_us(SERIAL_DELAY);
|
||||
#ifndef SERIAL_USE_MULTI_TRANSACTION
|
||||
// wait for the target response
|
||||
serial_input_with_pullup();
|
||||
_delay_us(SLAVE_INT_RESPONSE_TIME);
|
||||
|
||||
// check if the slave is present
|
||||
// check if the target 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 2;
|
||||
}
|
||||
|
||||
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
|
||||
// target failed to pull the line low, assume not present
|
||||
serial_output();
|
||||
serial_high();
|
||||
|
||||
*trans->status = TRANSACTION_NO_RESPONSE;
|
||||
sei();
|
||||
return 0;
|
||||
return TRANSACTION_NO_RESPONSE;
|
||||
}
|
||||
|
||||
#else
|
||||
// send transaction table index
|
||||
sync_send();
|
||||
_delay_sub_us(TID_SEND_ADJUST);
|
||||
serial_write_chunk(sstd_index, 4);
|
||||
serial_delay_half1();
|
||||
|
||||
// wait for the target response (step1 low->high)
|
||||
serial_input_with_pullup();
|
||||
while( !serial_read_pin() ) {
|
||||
_delay_sub_us(2);
|
||||
}
|
||||
|
||||
// check if the target is present (step2 high->low)
|
||||
for( int i = 0; serial_read_pin(); i++ ) {
|
||||
if (i > SLAVE_INT_ACK_WIDTH + 1) {
|
||||
// slave failed to pull the line low, assume not present
|
||||
serial_output();
|
||||
serial_high();
|
||||
*trans->status = TRANSACTION_NO_RESPONSE;
|
||||
sei();
|
||||
return TRANSACTION_NO_RESPONSE;
|
||||
}
|
||||
_delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT);
|
||||
}
|
||||
#endif
|
||||
|
||||
// initiator recive phase
|
||||
// if the target is present syncronize with it
|
||||
if( trans->target2initiator_buffer_size > 0 ) {
|
||||
if (!serial_recive_packet((uint8_t *)trans->target2initiator_buffer,
|
||||
trans->target2initiator_buffer_size) ) {
|
||||
serial_output();
|
||||
serial_high();
|
||||
*trans->status = TRANSACTION_DATA_ERROR;
|
||||
sei();
|
||||
return TRANSACTION_DATA_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
// initiator switch to output
|
||||
change_reciver2sender();
|
||||
|
||||
// initiator send phase
|
||||
if( trans->initiator2target_buffer_size > 0 ) {
|
||||
serial_send_packet((uint8_t *)trans->initiator2target_buffer,
|
||||
trans->initiator2target_buffer_size);
|
||||
}
|
||||
|
||||
// always, release the line when not in use
|
||||
sync_send();
|
||||
|
||||
*trans->status = TRANSACTION_END;
|
||||
sei();
|
||||
return TRANSACTION_END;
|
||||
}
|
||||
|
||||
#ifdef SERIAL_USE_MULTI_TRANSACTION
|
||||
int soft_serial_get_and_clean_status(int sstd_index) {
|
||||
SSTD_t *trans = &Transaction_table[sstd_index];
|
||||
cli();
|
||||
int retval = *trans->status;
|
||||
*trans->status = 0;;
|
||||
sei();
|
||||
return retval;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -1,32 +1,77 @@
|
||||
#ifndef MY_SERIAL_H
|
||||
#define MY_SERIAL_H
|
||||
#pragma once
|
||||
|
||||
#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
|
||||
// /////////////////////////////////////////////////////////////////
|
||||
// Need Soft Serial defines in serial_config.h
|
||||
// /////////////////////////////////////////////////////////////////
|
||||
// ex.
|
||||
// #define SERIAL_PIN_DDR DDRD
|
||||
// #define SERIAL_PIN_PORT PORTD
|
||||
// #define SERIAL_PIN_INPUT PIND
|
||||
// #define SERIAL_PIN_MASK _BV(PD?) ?=0,2
|
||||
// #define SERIAL_PIN_INTERRUPT INT?_vect ?=0,2
|
||||
//
|
||||
// //// USE Simple API (OLD API, compatible with let's split serial.c)
|
||||
// ex.
|
||||
// #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
|
||||
// #define SERIAL_MASTER_BUFFER_LENGTH 1
|
||||
//
|
||||
// //// USE flexible API (using multi-type transaction function)
|
||||
// #define SERIAL_USE_MULTI_TRANSACTION
|
||||
//
|
||||
// /////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef USE_SERIAL_PD2
|
||||
#define SERIAL_PIN_MASK _BV(PD0)
|
||||
#define SERIAL_PIN_INTERRUPT INT0_vect
|
||||
#else
|
||||
#define SERIAL_PIN_MASK _BV(PD2)
|
||||
#define SERIAL_PIN_INTERRUPT INT2_vect
|
||||
#endif
|
||||
|
||||
#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
|
||||
#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2
|
||||
|
||||
// Buffers for master - slave communication
|
||||
#ifndef SERIAL_USE_MULTI_TRANSACTION
|
||||
/* --- USE Simple API (OLD API, compatible with let's split serial.c) */
|
||||
#if SERIAL_SLAVE_BUFFER_LENGTH > 0
|
||||
extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH];
|
||||
#endif
|
||||
#if SERIAL_MASTER_BUFFER_LENGTH > 0
|
||||
extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH];
|
||||
#endif
|
||||
|
||||
void serial_master_init(void);
|
||||
void serial_slave_init(void);
|
||||
int serial_update_buffers(void);
|
||||
bool serial_slave_data_corrupt(void);
|
||||
|
||||
#endif // USE Simple API
|
||||
|
||||
// Soft Serial Transaction Descriptor
|
||||
typedef struct _SSTD_t {
|
||||
uint8_t *status;
|
||||
uint8_t initiator2target_buffer_size;
|
||||
uint8_t *initiator2target_buffer;
|
||||
uint8_t target2initiator_buffer_size;
|
||||
uint8_t *target2initiator_buffer;
|
||||
} SSTD_t;
|
||||
|
||||
// initiator is transaction start side
|
||||
void soft_serial_initiator_init(SSTD_t *sstd_table);
|
||||
// target is interrupt accept side
|
||||
void soft_serial_target_init(SSTD_t *sstd_table);
|
||||
|
||||
// initiator resullt
|
||||
#define TRANSACTION_END 0
|
||||
#define TRANSACTION_NO_RESPONSE 0x1
|
||||
#define TRANSACTION_DATA_ERROR 0x2
|
||||
#ifndef SERIAL_USE_MULTI_TRANSACTION
|
||||
int soft_serial_transaction(void);
|
||||
#else
|
||||
int soft_serial_transaction(int sstd_index);
|
||||
#endif
|
||||
|
||||
// target status
|
||||
// *SSTD_t.status has
|
||||
// initiator:
|
||||
// TRANSACTION_END
|
||||
// or TRANSACTION_NO_RESPONSE
|
||||
// or TRANSACTION_DATA_ERROR
|
||||
// target:
|
||||
// TRANSACTION_DATA_ERROR
|
||||
// or TRANSACTION_ACCEPTED
|
||||
#define TRANSACTION_ACCEPTED 0x4
|
||||
#ifdef SERIAL_USE_MULTI_TRANSACTION
|
||||
int soft_serial_get_and_clean_status(int sstd_index);
|
||||
#endif
|
||||
|
@ -123,6 +123,7 @@ static int8_t capture_sendchar(uint8_t c) {
|
||||
bool iota_gfx_init(bool rotate) {
|
||||
bool success = false;
|
||||
|
||||
i2c_master_init();
|
||||
send_cmd1(DisplayOff);
|
||||
send_cmd2(SetDisplayClockDiv, 0x80);
|
||||
send_cmd2(SetMultiPlex, DisplayHeight - 1);
|
||||
|
@ -1,10 +1,8 @@
|
||||
#ifndef SSD1306_H
|
||||
#define SSD1306_H
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include "pincontrol.h"
|
||||
#include "config.h"
|
||||
|
||||
enum ssd1306_cmds {
|
||||
DisplayOff = 0xAE,
|
||||
@ -88,7 +86,3 @@ void matrix_write(struct CharacterMatrix *matrix, const char *data);
|
||||
void matrix_write_ln(struct CharacterMatrix *matrix, const char *data);
|
||||
void matrix_write_P(struct CharacterMatrix *matrix, const char *data);
|
||||
void matrix_render(struct CharacterMatrix *matrix);
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
79
keyboards/divergetm2/config.h
Normal file
79
keyboards/divergetm2/config.h
Normal file
@ -0,0 +1,79 @@
|
||||
/* Copyright 2018 Christon DeWan (xton)
|
||||
* Copyright 2017 IslandMan93
|
||||
*
|
||||
* 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 0x1256
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER UniKeyboard
|
||||
#define PRODUCT diverge tm2
|
||||
#define DESCRIPTION Split 46 key keyboard
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 8
|
||||
#define MATRIX_COLS 6
|
||||
|
||||
/*
|
||||
* Keyboard Matrix Assignments
|
||||
*
|
||||
* Change this to how you wired your keyboard
|
||||
* COLS: AVR pins used for columns, left to right
|
||||
* ROWS: AVR pins used for rows, top to bottom
|
||||
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||
*
|
||||
*/
|
||||
#define MATRIX_ROW_PINS { D7, E6, B4, B5 }
|
||||
#define MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */
|
||||
#define DIODE_DIRECTION ROW2COL
|
||||
|
||||
|
||||
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||
#define DEBOUNCING_DELAY 5
|
||||
|
||||
/* number of backlight levels */
|
||||
|
||||
/* 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
|
||||
|
||||
/*
|
||||
* Magic Key Options
|
||||
*
|
||||
* Magic keys are hotkey commands that allow control over firmware functions of
|
||||
* the keyboard. They are best used in combination with the HID Listen program,
|
||||
* found here: https://www.pjrc.com/teensy/hid_listen.html
|
||||
*
|
||||
* The options below allow the magic key functionality to be changed. This is
|
||||
* useful if your keyboard/keypad is missing keys and you want magic key support.
|
||||
*
|
||||
*/
|
||||
|
||||
/* key combination for magic key command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||
)
|
||||
|
||||
|
17
keyboards/divergetm2/divergetm2.c
Normal file
17
keyboards/divergetm2/divergetm2.c
Normal file
@ -0,0 +1,17 @@
|
||||
/* Copyright 2018 Christon DeWan (xton)
|
||||
* Copyright 2017 IslandMan93
|
||||
*
|
||||
* 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 "divergetm2.h"
|
74
keyboards/divergetm2/divergetm2.h
Normal file
74
keyboards/divergetm2/divergetm2.h
Normal file
@ -0,0 +1,74 @@
|
||||
/* Copyright 2018 Christon DeWan (xton)
|
||||
* Copyright 2017 IslandMan93
|
||||
*
|
||||
* 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
|
||||
|
||||
//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
|
||||
|
||||
//void promicro_bootloader_jmp(bool program);
|
||||
|
||||
#ifndef FLIP_HALF
|
||||
// Standard Keymap
|
||||
// (TRRS jack on the left half is to the right, TRRS jack on the right half is to the left)
|
||||
#define LAYOUT( \
|
||||
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, R31, R32, R33, R34, R35 \
|
||||
) \
|
||||
{ \
|
||||
{ L00, L01, L02, L03, L04, L05 }, \
|
||||
{ L10, L11, L12, L13, L14, L15 }, \
|
||||
{ L20, L21, L22, L23, L24, L25 }, \
|
||||
{ L30, L31, L32, L33, L34, KC_NO }, \
|
||||
{ R05, R04, R03, R02, R01, R00 }, \
|
||||
{ R15, R14, R13, R12, R11, R10 }, \
|
||||
{ R25, R24, R23, R22, R21, R20 }, \
|
||||
{ R35, R34, R33, R32, R31, KC_NO } \
|
||||
}
|
||||
#else
|
||||
// Keymap with right side flipped
|
||||
// (TRRS jack on both halves are to the right)
|
||||
#define LAYOUT( \
|
||||
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, R31, R32, R33, R34, R35 \
|
||||
) \
|
||||
{ \
|
||||
{ L00, L01, L02, L03, L04, L05 }, \
|
||||
{ L10, L11, L12, L13, L14, L15 }, \
|
||||
{ L20, L21, L22, L23, L24, L25 }, \
|
||||
{ L30, L31, L32, L33, L34, KC_NO }, \
|
||||
{ R00, R01, R02, R03, R04, R05 }, \
|
||||
{ R10, R11, R12, R13, R14, R15 }, \
|
||||
{ R20, R21, R22, R23, R24, R25 }, \
|
||||
{ KC_NO, R31, R32, R33, R34, R35 } \
|
||||
}
|
||||
#endif
|
||||
|
||||
#define LAYOUT_ortho_4x12_2x2u LAYOUT
|
23
keyboards/divergetm2/keymaps/default/config.h
Normal file
23
keyboards/divergetm2/keymaps/default/config.h
Normal file
@ -0,0 +1,23 @@
|
||||
/* Copyright 2018 Christon DeWan (xton)
|
||||
* Copyright 2017 IslandMan93
|
||||
*
|
||||
* 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
|
||||
|
||||
// place overrides here
|
||||
#define MASTER_RIGHT
|
||||
#define PERMISSIVE_HOLD
|
||||
#define TAPPING_TERM 150
|
200
keyboards/divergetm2/keymaps/default/keymap.c
Normal file
200
keyboards/divergetm2/keymaps/default/keymap.c
Normal file
@ -0,0 +1,200 @@
|
||||
/* Copyright 2018 Christon DeWan (xton)
|
||||
* Copyright 2017 IslandMan93
|
||||
*
|
||||
* 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 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 _COLEMAK 1
|
||||
#define _DVORAK 2
|
||||
#define _LOWER 3
|
||||
#define _RAISE 4
|
||||
#define _ADJUST 16
|
||||
|
||||
enum custom_keycodes {
|
||||
QWERTY = SAFE_RANGE,
|
||||
COLEMAK,
|
||||
DVORAK
|
||||
};
|
||||
|
||||
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/* Qwerty
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Esc | A | S | D | F | G | H | J | K | L | ; | " |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | Ctrl | Alt | GUI | Lower | Raise | Left | Down | Up |Right |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_QWERTY] = LAYOUT_ortho_4x12_2x2u( \
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
|
||||
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
|
||||
RESET, KC_LCTL, KC_LALT, KC_LGUI, LT(_LOWER, KC_SPC), LT(_RAISE,KC_SPC), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
|
||||
),
|
||||
|
||||
/* Colemak
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Esc | A | R | S | T | D | H | N | E | I | O | " |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | Ctrl | Alt | GUI | Lower | Raise | Left | Down | Up |Right |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_COLEMAK] = LAYOUT_ortho_4x12_2x2u( \
|
||||
KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \
|
||||
KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
|
||||
KC_NO, KC_LCTL, KC_LALT, KC_LGUI, LT(_LOWER, KC_SPC), LT(_RAISE,KC_SPC), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
|
||||
),
|
||||
|
||||
/* Dvorak
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Esc | A | O | E | U | I | D | H | T | N | S | / |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | Ctrl | Alt | GUI | Lower | Raise | Left | Down | Up |Right |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_DVORAK] = LAYOUT_ortho_4x12_2x2u( \
|
||||
KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \
|
||||
KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \
|
||||
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \
|
||||
KC_NO, KC_LCTL, KC_LALT, KC_LGUI, LT(_LOWER, KC_SPC), LT(_RAISE,KC_SPC), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
|
||||
),
|
||||
|
||||
/* Lower
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | | | | | Next | Vol- | Vol+ | Play |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_LOWER] = LAYOUT_ortho_4x12_2x2u( \
|
||||
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \
|
||||
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
|
||||
BL_STEP, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, MO(_RAISE), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
|
||||
),
|
||||
|
||||
/* Raise
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | | | | | Next | Vol- | Vol+ | Play |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_RAISE] = LAYOUT_ortho_4x12_2x2u( \
|
||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
|
||||
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \
|
||||
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \
|
||||
_______, _______, _______, _______, MO(_LOWER), _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
|
||||
),
|
||||
|
||||
/* Adjust (Lower + Raise)
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | | Reset| | | | | | | | | | Del |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | | | | | | | | |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_ADJUST] = LAYOUT_ortho_4x12_2x2u( \
|
||||
_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \
|
||||
_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||
)
|
||||
|
||||
|
||||
};
|
||||
|
||||
#ifdef AUDIO_ENABLE
|
||||
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
|
||||
float tone_dvorak[][2] = SONG(DVORAK_SOUND);
|
||||
float tone_colemak[][2] = SONG(COLEMAK_SOUND);
|
||||
#endif
|
||||
|
||||
#define SPACE_WAIT 100
|
||||
uint16_t rl_start_time = 0;
|
||||
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
if(rl_start_time && record->event.pressed) rl_start_time = 0;
|
||||
switch (keycode) {
|
||||
case QWERTY:
|
||||
if (record->event.pressed) {
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_SONG(tone_qwerty);
|
||||
#endif
|
||||
set_single_persistent_default_layer(1UL<<_QWERTY);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case COLEMAK:
|
||||
if (record->event.pressed) {
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_SONG(tone_colemak);
|
||||
#endif
|
||||
set_single_persistent_default_layer(1UL<<_COLEMAK);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case DVORAK:
|
||||
if (record->event.pressed) {
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_SONG(tone_dvorak);
|
||||
#endif
|
||||
set_single_persistent_default_layer(1UL<<_DVORAK);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
return update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST);
|
||||
}
|
5
keyboards/divergetm2/keymaps/default/readme.md
Normal file
5
keyboards/divergetm2/keymaps/default/readme.md
Normal file
@ -0,0 +1,5 @@
|
||||
# A default-ish keymap for diverge tm2
|
||||
|
||||
Actually it's a Planck layout, but I needed something for the default. :-D
|
||||
|
||||
The 2u spacebars are space when tapped, raise/lower when held.
|
0
keyboards/divergetm2/keymaps/default/rules.mk
Normal file
0
keyboards/divergetm2/keymaps/default/rules.mk
Normal file
23
keyboards/divergetm2/keymaps/xtonhasvim/config.h
Normal file
23
keyboards/divergetm2/keymaps/xtonhasvim/config.h
Normal file
@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
// help for fast typist+dual function keys?
|
||||
#define PERMISSIVE_HOLD
|
||||
// Let me type `ls -l` more quickly.
|
||||
#define TAPPING_FORCE_HOLD
|
||||
|
||||
// where is the cord plugged in?
|
||||
#define MASTER_RIGHT
|
||||
|
||||
/* speed up mousekeys a bit */
|
||||
#define MOUSEKEY_DELAY 50
|
||||
#define MOUSEKEY_INTERVAL 20
|
||||
#define MOUSEKEY_MAX_SPEED 8
|
||||
#define MOUSEKEY_TIME_TO_MAX 30
|
||||
#define MOUSEKEY_WHEEL_MAX_SPEED 8
|
||||
#define MOUSEKEY_WHEEL_TIME_TO_MAX 40
|
||||
|
||||
// because I'm lazy and didn't case out the rgb support
|
||||
#define RGBLED_NUM 2
|
||||
|
||||
#define BACKLIGHT_PIN B7
|
||||
#define BACKLIGHT_LEVELS 3
|
155
keyboards/divergetm2/keymaps/xtonhasvim/keymap.c
Normal file
155
keyboards/divergetm2/keymaps/xtonhasvim/keymap.c
Normal file
@ -0,0 +1,155 @@
|
||||
/* Copyright 2018 Christon DeWan
|
||||
*
|
||||
* 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 QMK_KEYBOARD_H
|
||||
#include "xtonhasvim.h"
|
||||
|
||||
/************************************
|
||||
* states
|
||||
************************************/
|
||||
|
||||
enum layers {
|
||||
_QWERTY,
|
||||
_LOWER,
|
||||
_RAISE,
|
||||
_ADJUST,
|
||||
_MOVE,
|
||||
_MOUSE,
|
||||
_CMD
|
||||
};
|
||||
|
||||
extern uint8_t vim_cmd_layer(void) { return _CMD; }
|
||||
|
||||
enum keymap_keycodes {
|
||||
RAISE = VIM_SAFE_RANGE,
|
||||
LOWER
|
||||
};
|
||||
|
||||
/************************************
|
||||
* keymaps!
|
||||
************************************/
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/* Qwerty
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Ctrl*| A | S | D | F | G | H | J | K | L | ;* | ' |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | chkwm| | Alt | GUI | Lower* | Raise* | SPC | GUI | | Vim |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*
|
||||
* - Ctrl acts as Esc when tapped.
|
||||
* - Holding ; switches to movement layer.
|
||||
* - Tapping raise or lower produces space.
|
||||
*/
|
||||
[_QWERTY] = LAYOUT_ortho_4x12_2x2u( \
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
|
||||
LCTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(_MOVE,KC_SCLN), KC_QUOT, \
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_ENT) , \
|
||||
LSFT(KC_LALT), MO(_MOVE), KC_LALT, KC_LGUI, LT(_LOWER, KC_SPC), LT(_RAISE, KC_SPC), KC_RGUI, KC_RALT, MO(_MOVE), VIM_START \
|
||||
),
|
||||
|
||||
/* Lower
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | ~ | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | Bksp |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | | |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | | F7 | F8 | F9 | F10 | F11 | F12 | | Next | Vol- | Vol+ | Play |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | Bail | | | | Raise | | | Bail | |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_LOWER] = LAYOUT_ortho_4x12_2x2u( \
|
||||
KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_BSPC, \
|
||||
KC_DEL, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, \
|
||||
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, X_____X, X_____X, X_____X, X_____X, FIREY_RETURN, \
|
||||
RESET, TO(_QWERTY), _______, _______, _______, MO(_RAISE), _______, _______, TO(_QWERTY), X_____X \
|
||||
),
|
||||
|
||||
/* Raise
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | ` | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | Bksp |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Del | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \ |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | | F7 | F8 | F9 | F10 | F11 | F12 | | Next | Vol- | Vol+ | Play |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | Bail | | | Lower | | | | Bail | |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_RAISE] = LAYOUT_ortho_4x12_2x2u( \
|
||||
KC_GRV, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSPC, \
|
||||
KC_DEL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, \
|
||||
_______, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, FIREY_RETURN, \
|
||||
X_____X, TO(_QWERTY), _______, _______, MO(_LOWER), _______, _______, _______, TO(_QWERTY), RESET \
|
||||
),
|
||||
|
||||
|
||||
/* Adjust (Lower + Raise)
|
||||
* ,-------------------------------------------------------------------------------------.
|
||||
* |BL Raise| | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* |BL Lower| | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* |BL STEP | | | | | | | Next | Vol- | Vol+ | Play | |
|
||||
* |--------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* |Backlite| Mouse| | | | | | | Bail | |
|
||||
* `-------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_ADJUST] = LAYOUT_ortho_4x12_2x2u( \
|
||||
BL_INC, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, \
|
||||
BL_DEC, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, \
|
||||
BL_STEP, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, X_____X, \
|
||||
BL_TOGG, TO(_MOUSE), _______, _______, _______, _______, _______, _______, TO(_QWERTY), X_____X \
|
||||
),
|
||||
|
||||
|
||||
/* movement layer (hold semicolon) */
|
||||
[_MOVE] = LAYOUT_ortho_4x12_2x2u( \
|
||||
TO(_QWERTY), X_____X, X_____X, X_____X, X_____X, X_____X, KC_HOME, KC_PGDN, KC_PGUP, KC_END, X_____X, X_____X, \
|
||||
_______, X_____X, LGUI(KC_LBRC), LGUI(LSFT(KC_LBRC)), LGUI(LSFT(KC_RBRC)), LGUI(KC_RBRC), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, X_____X, \
|
||||
_______, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, X_____X \
|
||||
),
|
||||
|
||||
/* mouse layer
|
||||
*/
|
||||
[_MOUSE] = LAYOUT_ortho_4x12_2x2u( \
|
||||
TO(_QWERTY), X_____X, X_____X, KC_MS_UP, X_____X, X_____X, KC_MS_WH_LEFT, KC_MS_WH_DOWN, KC_MS_WH_UP, KC_MS_WH_RIGHT, X_____X, X_____X , \
|
||||
_______, X_____X, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, X_____X, X_____X, KC_MS_BTN1, KC_MS_BTN2, KC_MS_BTN3, X_____X, X_____X, \
|
||||
_______, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, _______, \
|
||||
_______, TO(_QWERTY), _______, _______, _______, _______, _______, _______, TO(_QWERTY), X_____X \
|
||||
),
|
||||
|
||||
/* vim command layer.
|
||||
*/
|
||||
[_CMD] = LAYOUT_ortho_4x12_2x2u( \
|
||||
X_____X, X_____X, VIM_W, VIM_E, X_____X, X_____X, VIM_Y, VIM_U, VIM_I, VIM_O, VIM_P, X_____X, \
|
||||
VIM_ESC, VIM_A, VIM_S, VIM_D, X_____X, VIM_G, VIM_H, VIM_J, VIM_K, VIM_L, X_____X, X_____X, \
|
||||
VIM_SHIFT, X_____X, VIM_X, VIM_C, VIM_V, VIM_B, X_____X, X_____X, VIM_COMMA, VIM_PERIOD, X_____X, VIM_SHIFT, \
|
||||
_______, TO(_QWERTY), _______, _______, X_____X, X_____X, _______, _______, TO(_QWERTY), X_____X \
|
||||
)
|
||||
|
||||
};
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
return update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST);
|
||||
}
|
9
keyboards/divergetm2/keymaps/xtonhasvim/readme.md
Normal file
9
keyboards/divergetm2/keymaps/xtonhasvim/readme.md
Normal file
@ -0,0 +1,9 @@
|
||||
# Xton has a tiny keyboard! With Vim!
|
||||
|
||||
Based on the standard Planck layout with a few changes:
|
||||
|
||||
* Escape moved to dual-function with control.
|
||||
* Dedicated movement and mouse layers.
|
||||
* Top and middle row swapped in `_RAISE` and `_LOWER` because I never use F-keys.
|
||||
* Vim layers! See `users/xtonhasvim`.
|
||||
|
3
keyboards/divergetm2/keymaps/xtonhasvim/rules.mk
Normal file
3
keyboards/divergetm2/keymaps/xtonhasvim/rules.mk
Normal file
@ -0,0 +1,3 @@
|
||||
MOUSEKEY_ENABLE = yes
|
||||
# BACKLIGHT_ENABLE = yes
|
||||
AUDIO_ENABLE = no
|
21
keyboards/divergetm2/readme.md
Normal file
21
keyboards/divergetm2/readme.md
Normal file
@ -0,0 +1,21 @@
|
||||
# diverge tm2
|
||||
|
||||
A 4x6x2 split ortholinear keyboard with 2u spacebars like the Levinson (similar to Let's Split). Made by [Unikeyboard](https://unikeyboard.io).
|
||||
|
||||
Keyboard Maintainer: [IslandMan93](https://github.com/islandman93) and [xton](https://github.com/xton)
|
||||
Hardware Supported: Pro Micro
|
||||
Hardware Availability: [Diverge TM2](https://unikeyboard.io/product/diverge-tm/)
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make divergetm2:default
|
||||
|
||||
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
|
||||
|
||||
# Flashing the first time
|
||||
|
||||
Disassemble the case so you have access to each Pro Micro. Flash each half with QMK Toolbox by connecting the USB cable and shorting RST and GND. After that, just use the soft reset key on your respective layout to reflash both halves.
|
||||
|
||||
# Reflashing Animus
|
||||
|
||||
Reflashing the stock firmware is pretty easy. Just follow the same steps in the [original guide](https://imgur.com/a/8UapN). You will have to manually reset the Pro Micro (by shorting the GND and RST) during the upload step. Then reapply your keymap through Arbites.
|
75
keyboards/divergetm2/rules.mk
Normal file
75
keyboards/divergetm2/rules.mk
Normal file
@ -0,0 +1,75 @@
|
||||
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1286
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
# OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
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
|
||||
|
||||
# must specify this to enable soft-reset
|
||||
BOOTLOADER = caterina
|
71
keyboards/dz60/keymaps/marianas/keymap.c
Normal file
71
keyboards/dz60/keymaps/marianas/keymap.c
Normal file
@ -0,0 +1,71 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
enum marianas_layers {
|
||||
BASE,
|
||||
NAV_CLUSTER,
|
||||
RGB,
|
||||
MOUSE,
|
||||
GAMING,
|
||||
FN_LAYER,
|
||||
LAYER_SEL
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[BASE]=
|
||||
LAYOUT(
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_NO, KC_BSPC,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
|
||||
MO(FN_LAYER), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
||||
KC_LSPO, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_NO,
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_LGUI, KC_NO, KC_APP, KC_RCTL),
|
||||
|
||||
[NAV_CLUSTER]=
|
||||
LAYOUT(
|
||||
KC_TRNS, KC_PSCREEN, KC_SCROLLLOCK, KC_PAUSE, KC_INSERT, KC_HOME, KC_PGUP, KC_NUMLOCK, KC_KP_SLASH, KC_KP_ASTERISK, KC_KP_MINUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DELETE, KC_END, KC_PGDOWN, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_UP, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_PLUS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_ENTER, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_KP_0, KC_KP_0, KC_KP_0, KC_KP_DOT, KC_KP_ENTER, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||
|
||||
[RGB]=
|
||||
LAYOUT(
|
||||
KC_TRNS, RGB_TOG, RGB_MOD, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G, RGB_SPD, RGB_SPI, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, RGB_HUI, RGB_HUD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, RGB_SAI, RGB_SAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||
|
||||
[MOUSE]=
|
||||
LAYOUT(
|
||||
KC_TRNS, KC_ACL0, KC_ACL1, KC_ACL2, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_WH_U, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN3, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_WH_L, KC_WH_D, KC_WH_R, KC_TRNS, KC_TRNS, KC_BTN4, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN5, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||
|
||||
[GAMING]=
|
||||
LAYOUT(
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_NO, KC_BSPC,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
|
||||
KC_TRNS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
||||
KC_LSHIFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSHIFT, KC_NO,
|
||||
KC_LCTL, KC_NO, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RCTL, KC_NO, KC_NO, TO(BASE)),
|
||||
|
||||
[FN_LAYER]=
|
||||
LAYOUT(
|
||||
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_DEL,
|
||||
KC_CAPSLOCK, KC_MPRV, KC_MPLY, KC_MNXT, LWIN(KC_R), KC_TRNS, KC_CALC, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_SLCK, KC_BRK, KC_TRNS,
|
||||
KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU, KC_TRNS, KC_TRNS, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, KC_INS, KC_DEL, MO(LAYER_SEL),
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HYPR, KC_TRNS, KC_MEH, KC_TRNS),
|
||||
|
||||
[LAYER_SEL]=
|
||||
LAYOUT(
|
||||
TO(BASE), TO(NAV_CLUSTER), TO(RGB), TO(MOUSE), TO(GAMING), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS)
|
||||
|
||||
};
|
16
keyboards/ergodox_ez/keymaps/lukaus/config.h
Normal file
16
keyboards/ergodox_ez/keymaps/lukaus/config.h
Normal file
@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#define TAPPING_TERM 200
|
||||
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
#undef RGBLIGHT_SAT_STEP
|
||||
#define RGBLIGHT_SAT_STEP 12
|
||||
#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 7
|
||||
#define RGBLIGHT_EFFECT_SNAKE_LENGTH 7
|
||||
#define RGBLIGHT_EFFECT_BREATHE_CENTER 1
|
||||
#endif // RGBLIGHT_ENABLE
|
||||
|
||||
#define FORCE_NKRO
|
||||
|
||||
#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))
|
843
keyboards/ergodox_ez/keymaps/lukaus/keymap.c
Normal file
843
keyboards/ergodox_ez/keymaps/lukaus/keymap.c
Normal file
@ -0,0 +1,843 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "version.h"
|
||||
|
||||
#include "keymap_german.h"
|
||||
|
||||
#include "keymap_nordic.h"
|
||||
|
||||
enum custom_keycodes {
|
||||
PLACEHOLDER = SAFE_RANGE, // can always be here
|
||||
|
||||
// Programmer's Dvorak "macros" :
|
||||
// To be paired with get_mods to enable both
|
||||
// Shift functionality and Programmer's Dvorak
|
||||
|
||||
DVP_ESC, // Grave escape basically i think
|
||||
DVP_AMPR,
|
||||
DVP_LBRACKET,
|
||||
DVP_LCBR,
|
||||
DVP_RCBR,
|
||||
DVP_LPRN,
|
||||
DVP_AT,
|
||||
|
||||
DVP_EQUAL,
|
||||
DVP_ASTERISK,
|
||||
DVP_RPRN,
|
||||
DVP_PLUS,
|
||||
DVP_RBRACKET,
|
||||
DVP_EXLM,
|
||||
DVP_HASH,
|
||||
|
||||
RU_2,
|
||||
RU_3,
|
||||
RU_4,
|
||||
RU_6,
|
||||
RU_7,
|
||||
RU_DOT,
|
||||
|
||||
SHFT_COMMA,
|
||||
SHFT_DOT,
|
||||
|
||||
RGB_SLD,
|
||||
RGB_FF0000,
|
||||
RGB_008000,
|
||||
RGB_0000FF,
|
||||
RGB_FFFFFF,
|
||||
RGB_800080
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
// Programmer's Dvorak layer
|
||||
[0] = LAYOUT_ergodox(
|
||||
DVP_ESC, DVP_AMPR, DVP_LBRACKET, DVP_LCBR, DVP_RCBR, DVP_LPRN, DVP_AT,
|
||||
KC_TAB, KC_SCOLON, KC_COMMA, KC_DOT, KC_P, KC_Y, MO(4),
|
||||
MO(3), KC_A, KC_O, KC_E, KC_U, KC_I,
|
||||
KC_LSHIFT, KC_QUOTE, KC_Q, KC_J, KC_K, KC_X, KC_HYPR,
|
||||
KC_LCTL, KC_LALT, KC_LGUI, LCTL(KC_C), LCTL(KC_V),
|
||||
|
||||
KC_MS_BTN3, TO(1), KC_HOME, KC_SPACE, MO(4), KC_END,
|
||||
|
||||
DVP_EQUAL, DVP_ASTERISK, DVP_RPRN, DVP_PLUS, DVP_RBRACKET, DVP_EXLM, DVP_HASH,
|
||||
TT(4), KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLASH,
|
||||
KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINUS,
|
||||
KC_MEH, KC_B, KC_M, KC_W, KC_V, KC_Z, MO(3),
|
||||
KC_DELETE, KC_BSLASH, KC_RGUI, KC_RCTL, LCTL(KC_F),
|
||||
|
||||
KC_F17, KC_F18, KC_PGUP, KC_PGDOWN, KC_ENTER, KC_BSPACE
|
||||
),
|
||||
// Gaming QWERTY layer
|
||||
[1] = LAYOUT_ergodox(
|
||||
KC_ESCAPE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F14,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_F23,
|
||||
MO(3), KC_A, KC_S, KC_D, KC_F, KC_G,
|
||||
KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_F24,
|
||||
KC_LCTL, KC_F8, KC_LALT, KC_F14, KC_F13,
|
||||
|
||||
KC_HOME, TO(0), KC_F15, KC_SPACE, KC_LCTL, KC_LALT,
|
||||
|
||||
KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQUAL,
|
||||
KC_F24, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH,
|
||||
KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_QUOTE,
|
||||
KC_F17, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLASH, KC_RSHIFT,
|
||||
KC_DELETE, KC_F19, KC_LGUI, KC_F21, KC_F22,
|
||||
|
||||
KC_F17, KC_F18, KC_PGUP, KC_PGDOWN, KC_ENTER, KC_BSPACE
|
||||
),
|
||||
[2] = LAYOUT_ergodox(
|
||||
KC_ESCAPE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_C,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TO(0),
|
||||
MO(3), KC_1, KC_2, KC_3, KC_4, KC_5,
|
||||
KC_LSHIFT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NO,
|
||||
KC_LCTL, KC_F8, KC_LALT, KC_I, KC_S,
|
||||
|
||||
KC_MS_BTN3, TO(1), KC_HOME, KC_SPACE, KC_LSHIFT, KC_END,
|
||||
|
||||
KC_NO, KC_NUMLOCK, KC_KP_SLASH, KC_KP_ASTERISK, KC_KP_MINUS, KC_NO, KC_NO,
|
||||
TO(0), KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, KC_NO, KC_NO,
|
||||
KC_KP_4, KC_KP_5, KC_KP_6, KC_EQUAL, KC_NO, KC_NO,
|
||||
KC_NO, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_ENTER, KC_NO, KC_NO,
|
||||
KC_KP_0, KC_KP_DOT, KC_NO, KC_NO, KC_NO,
|
||||
|
||||
TO(0), KC_F18, KC_PGUP, KC_PGDOWN, KC_ENTER, KC_BSPACE
|
||||
),
|
||||
// Function Layer
|
||||
[3] = LAYOUT_ergodox(
|
||||
KC_DLR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRANSPARENT,
|
||||
KC_TRANSPARENT, KC_TRANSPARENT, KC_MEDIA_PREV_TRACK,KC_MEDIA_PLAY_PAUSE,KC_MEDIA_NEXT_TRACK,KC_NO, TT(4),
|
||||
KC_TRANSPARENT, KC_TRANSPARENT, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, KC_AUDIO_MUTE, KC_TRANSPARENT,
|
||||
KC_LSHIFT, LALT(KC_Z), KC_TRANSPARENT, KC_TRANSPARENT, KC_F12, KC_TRANSPARENT, ALL_T(KC_NO),
|
||||
KC_LCTL, KC_LALT, KC_LGUI, KC_CAPSLOCK, LSFT(KC_F12),
|
||||
|
||||
KC_PSCREEN, KC_PGUP, KC_PGDOWN, KC_SPACE, KC_LSHIFT, KC_INSERT,
|
||||
|
||||
KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
|
||||
KC_NO, KC_HOME, KC_TRANSPARENT, KC_PSCREEN, KC_SLCK, KC_TRANSPARENT, KC_TRANSPARENT,
|
||||
KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRANSPARENT, KC_TRANSPARENT,
|
||||
MEH_T(KC_NO), KC_CALCULATOR, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_RSHIFT,
|
||||
KC_DELETE, KC_INSERT, KC_TRANSPARENT, KC_F19, KC_RCTL,
|
||||
|
||||
TO(2),KC_TRANSPARENT,KC_TRANSPARENT,LALT(KC_F10),KC_ENTER,KC_BSPACE
|
||||
),
|
||||
// Keypad, Lighting, and Mouse emulation layer
|
||||
///*
|
||||
[4] = LAYOUT_ergodox(
|
||||
KC_ESCAPE, KC_NO, KC_NO, KC_MS_BTN3, KC_NO, KC_NO, KC_NO,
|
||||
KC_TAB, KC_NO, KC_MS_BTN2, KC_MS_UP, KC_MS_BTN1, KC_MS_WH_UP, TO(0),
|
||||
KC_NO, KC_NO, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_MS_WH_DOWN,
|
||||
KC_LSHIFT, KC_NO, KC_NO, KC_UP, KC_NO, KC_NO, TO(5),
|
||||
KC_LCTL, KC_NO, KC_LEFT, KC_DOWN, KC_RIGHT,
|
||||
|
||||
KC_MS_BTN3, TO(1), KC_HOME, KC_SPACE, KC_LSHIFT, KC_END,
|
||||
|
||||
KC_NO, KC_NUMLOCK, KC_KP_SLASH, KC_KP_ASTERISK, KC_CALCULATOR, KC_NO, RGB_VAI,
|
||||
TO(0), KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_MINUS, KC_NO, RGB_VAD,
|
||||
KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_PLUS, KC_NO, RGB_HUI,
|
||||
KC_NO, KC_KP_1, KC_KP_2, KC_KP_3, KC_EQUAL, RGB_SLD, RGB_HUD,
|
||||
KC_KP_0, KC_KP_DOT, KC_KP_ENTER, RGB_MOD, RGB_TOG,
|
||||
|
||||
KC_F17, KC_F18, KC_PGUP, KC_PGDOWN, KC_ENTER, KC_BSPACE
|
||||
)
|
||||
//*/
|
||||
/*
|
||||
// Keypad, Lighting, and Mouse emulation layer
|
||||
[4] = KEYMAP(
|
||||
KC_ESCAPE, KC_NO, KC_NO, KC_MS_BTN3, KC_NO, KC_NO, KC_NO,
|
||||
KC_TAB, KC_NO, KC_MS_BTN2, KC_MS_UP, KC_MS_BTN1, KC_MS_WH_UP, TO(0),
|
||||
KC_NO, KC_NO, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_MS_WH_DOWN,
|
||||
KC_LSHIFT, KC_NO, KC_NO, KC_UP, KC_NO, KC_NO, TO(5),
|
||||
KC_LCTL, KC_NO, KC_LEFT, KC_DOWN, KC_RIGHT,
|
||||
|
||||
KC_MS_BTN3, TO(1), KC_HOME, KC_SPACE, KC_LSHIFT, KC_END,
|
||||
|
||||
KC_NO, KC_I, KC_NUMLOCK, KC_KP_SLASH, KC_KP_ASTERISK, KC_CALCULATOR, RGB_VAI,
|
||||
TO(0), KC_G, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_MINUS, RGB_VAD,
|
||||
SHFT_COMMA, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_PLUS, RGB_HUI,
|
||||
KC_NO, SHFT_DOT, KC_KP_1, KC_KP_2, KC_KP_3, KC_EQUAL, RGB_HUD,
|
||||
KC_NO, KC_KP_0, KC_KP_DOT, KC_KP_ENTER, RGB_TOG,
|
||||
|
||||
KC_F17, KC_F18, KC_PGUP, KC_PGDOWN, KC_ENTER, KC_BSPACE
|
||||
)
|
||||
*/
|
||||
|
||||
};
|
||||
|
||||
void led_set_keymap(uint8_t usb_led) {
|
||||
|
||||
}
|
||||
|
||||
void matrix_init_user (void) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
bool left_shift_down = false;
|
||||
bool right_shift_down = false;
|
||||
|
||||
bool numlock = false;
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
|
||||
switch (keycode) {
|
||||
case KC_LSHIFT:
|
||||
if (record->event.pressed)
|
||||
{
|
||||
left_shift_down = true;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
left_shift_down = false;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case KC_RSHIFT:
|
||||
|
||||
if (record->event.pressed)
|
||||
{
|
||||
right_shift_down = true;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
right_shift_down = false;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case KC_NUMLOCK:
|
||||
|
||||
if (record->event.pressed)
|
||||
{
|
||||
numlock = !numlock;
|
||||
}
|
||||
break;
|
||||
|
||||
case DVP_ESC:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("~");
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING(SS_DOWN(X_ESCAPE));
|
||||
else
|
||||
SEND_STRING(SS_UP(X_ESCAPE));
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case DVP_AMPR:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
{
|
||||
SEND_STRING("%");
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("&");
|
||||
}
|
||||
return false;
|
||||
|
||||
break;
|
||||
|
||||
case SHFT_DOT:
|
||||
if(record->event.pressed)
|
||||
SEND_STRING(">");
|
||||
break;
|
||||
|
||||
case SHFT_COMMA:
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("<");
|
||||
break;
|
||||
|
||||
case DVP_LBRACKET:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
{
|
||||
if(left_shift_down)
|
||||
unregister_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
unregister_code(KC_RSHIFT);
|
||||
|
||||
register_code(KC_7);
|
||||
unregister_code(KC_7);
|
||||
|
||||
if(left_shift_down)
|
||||
register_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
register_code(KC_RSHIFT);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("[");
|
||||
}
|
||||
return false;
|
||||
|
||||
return false;
|
||||
break;
|
||||
|
||||
case DVP_LCBR:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
{
|
||||
if(left_shift_down)
|
||||
unregister_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
unregister_code(KC_RSHIFT);
|
||||
|
||||
register_code(KC_5);
|
||||
unregister_code(KC_5);
|
||||
|
||||
if(left_shift_down)
|
||||
register_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
register_code(KC_RSHIFT);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("{");
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
|
||||
case DVP_RCBR:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
{
|
||||
if(left_shift_down)
|
||||
unregister_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
unregister_code(KC_RSHIFT);
|
||||
|
||||
register_code(KC_3);
|
||||
unregister_code(KC_3);
|
||||
|
||||
if(left_shift_down)
|
||||
register_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
register_code(KC_RSHIFT);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("}");
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
|
||||
case DVP_LPRN:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
{
|
||||
if(left_shift_down)
|
||||
unregister_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
unregister_code(KC_RSHIFT);
|
||||
|
||||
register_code(KC_1);
|
||||
unregister_code(KC_1);
|
||||
|
||||
if(left_shift_down)
|
||||
register_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
register_code(KC_RSHIFT);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("(");
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
|
||||
case DVP_AT:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
{
|
||||
if(left_shift_down)
|
||||
unregister_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
unregister_code(KC_RSHIFT);
|
||||
|
||||
register_code(KC_LSHIFT);
|
||||
register_code(KC_6);
|
||||
unregister_code(KC_6);
|
||||
unregister_code(KC_LSHIFT);
|
||||
|
||||
if(left_shift_down)
|
||||
register_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
register_code(KC_RSHIFT);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("@");
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
|
||||
|
||||
case DVP_EQUAL:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
{
|
||||
if(left_shift_down)
|
||||
unregister_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
unregister_code(KC_RSHIFT);
|
||||
|
||||
register_code(KC_9);
|
||||
unregister_code(KC_9);
|
||||
|
||||
if(left_shift_down)
|
||||
register_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
register_code(KC_RSHIFT);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("=");
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
|
||||
case DVP_ASTERISK:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
{
|
||||
if(left_shift_down)
|
||||
unregister_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
unregister_code(KC_RSHIFT);
|
||||
|
||||
register_code(KC_0);
|
||||
unregister_code(KC_0);
|
||||
|
||||
if(left_shift_down)
|
||||
register_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
register_code(KC_RSHIFT);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("*");
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
|
||||
case DVP_RPRN:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
{
|
||||
if(left_shift_down)
|
||||
unregister_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
unregister_code(KC_RSHIFT);
|
||||
|
||||
register_code(KC_2);
|
||||
unregister_code(KC_2);
|
||||
|
||||
if(left_shift_down)
|
||||
register_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
register_code(KC_RSHIFT);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING(")");
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
|
||||
case DVP_PLUS:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
{
|
||||
if(left_shift_down)
|
||||
unregister_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
unregister_code(KC_RSHIFT);
|
||||
|
||||
register_code(KC_4);
|
||||
unregister_code(KC_4);
|
||||
|
||||
if(left_shift_down)
|
||||
register_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
register_code(KC_RSHIFT);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("+");
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
|
||||
case DVP_RBRACKET:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
{
|
||||
if(left_shift_down)
|
||||
unregister_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
unregister_code(KC_RSHIFT);
|
||||
|
||||
register_code(KC_6);
|
||||
unregister_code(KC_6);
|
||||
|
||||
if(left_shift_down)
|
||||
register_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
register_code(KC_RSHIFT);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("]");
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
|
||||
case DVP_EXLM:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
{
|
||||
if(left_shift_down)
|
||||
unregister_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
unregister_code(KC_RSHIFT);
|
||||
|
||||
register_code(KC_8);
|
||||
unregister_code(KC_8);
|
||||
|
||||
if(left_shift_down)
|
||||
register_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
register_code(KC_RSHIFT);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("!");
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
|
||||
case DVP_HASH:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
{
|
||||
if(left_shift_down)
|
||||
unregister_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
unregister_code(KC_RSHIFT);
|
||||
|
||||
register_code(KC_GRAVE);
|
||||
unregister_code(KC_GRAVE);
|
||||
|
||||
if(left_shift_down)
|
||||
register_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
register_code(KC_RSHIFT);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("#");
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
|
||||
// Russian
|
||||
case RU_2:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
{
|
||||
if(left_shift_down)
|
||||
unregister_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
unregister_code(KC_RSHIFT);
|
||||
|
||||
register_code(KC_GRAVE);
|
||||
unregister_code(KC_GRAVE);
|
||||
|
||||
if(left_shift_down)
|
||||
register_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
register_code(KC_RSHIFT);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("#");
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case RU_3:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
{
|
||||
if(left_shift_down)
|
||||
unregister_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
unregister_code(KC_RSHIFT);
|
||||
|
||||
register_code(KC_GRAVE);
|
||||
unregister_code(KC_GRAVE);
|
||||
|
||||
if(left_shift_down)
|
||||
register_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
register_code(KC_RSHIFT);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("#");
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case RU_4:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
{
|
||||
if(left_shift_down)
|
||||
unregister_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
unregister_code(KC_RSHIFT);
|
||||
|
||||
register_code(KC_GRAVE);
|
||||
unregister_code(KC_GRAVE);
|
||||
|
||||
if(left_shift_down)
|
||||
register_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
register_code(KC_RSHIFT);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("#");
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case RU_6:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
{
|
||||
if(left_shift_down)
|
||||
unregister_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
unregister_code(KC_RSHIFT);
|
||||
|
||||
register_code(KC_GRAVE);
|
||||
unregister_code(KC_GRAVE);
|
||||
|
||||
if(left_shift_down)
|
||||
register_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
register_code(KC_RSHIFT);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("#");
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case RU_7:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
{
|
||||
if(left_shift_down)
|
||||
unregister_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
unregister_code(KC_RSHIFT);
|
||||
|
||||
register_code(KC_GRAVE);
|
||||
unregister_code(KC_GRAVE);
|
||||
|
||||
if(left_shift_down)
|
||||
register_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
register_code(KC_RSHIFT);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("#");
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
|
||||
case RU_DOT:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
{
|
||||
if(left_shift_down)
|
||||
unregister_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
unregister_code(KC_RSHIFT);
|
||||
|
||||
register_code(KC_GRAVE);
|
||||
unregister_code(KC_GRAVE);
|
||||
|
||||
if(left_shift_down)
|
||||
register_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
register_code(KC_RSHIFT);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("#");
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
|
||||
|
||||
case RGB_SLD:
|
||||
if (record->event.pressed) {
|
||||
rgblight_mode(1);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
|
||||
case RGB_FF0000:
|
||||
if (record->event.pressed) {
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
rgblight_enable();
|
||||
rgblight_mode(1);
|
||||
rgblight_setrgb(0xff,0x00,0x00);
|
||||
#endif
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
|
||||
case RGB_008000:
|
||||
if (record->event.pressed) {
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
rgblight_enable();
|
||||
rgblight_mode(1);
|
||||
rgblight_setrgb(0x00,0x80,0x00);
|
||||
#endif
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
|
||||
case RGB_0000FF:
|
||||
if (record->event.pressed) {
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
rgblight_enable();
|
||||
rgblight_mode(1);
|
||||
rgblight_setrgb(0x00,0x00,0xff);
|
||||
#endif
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
|
||||
case RGB_FFFFFF:
|
||||
if (record->event.pressed) {
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
rgblight_enable();
|
||||
rgblight_mode(1);
|
||||
rgblight_setrgb(0xff,0xff,0xff);
|
||||
#endif
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
|
||||
case RGB_800080:
|
||||
if (record->event.pressed) {
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
rgblight_enable();
|
||||
rgblight_mode(1);
|
||||
rgblight_setrgb(0x80,0x00,0x80);
|
||||
#endif
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
|
||||
uint8_t layer = biton32(state);
|
||||
|
||||
// ergodox_board_led_off();
|
||||
ergodox_right_led_1_off();
|
||||
ergodox_right_led_2_off();
|
||||
ergodox_right_led_3_off();
|
||||
switch (layer) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
ergodox_right_led_1_on();
|
||||
break;
|
||||
case 2:
|
||||
ergodox_right_led_2_on();
|
||||
break;
|
||||
case 3:
|
||||
ergodox_right_led_3_on();
|
||||
break;
|
||||
case 4:
|
||||
ergodox_right_led_1_on();
|
||||
ergodox_right_led_3_on();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return state;
|
||||
|
||||
};
|
3
keyboards/ergodox_ez/keymaps/lukaus/readme.md
Normal file
3
keyboards/ergodox_ez/keymaps/lukaus/readme.md
Normal file
@ -0,0 +1,3 @@
|
||||
# Lukaus' keymap
|
||||
|
||||
Programmer's Dvorak as default layer with Qwerty gaming layer and two function layers
|
1
keyboards/ergodox_ez/keymaps/lukaus/rules.mk
Normal file
1
keyboards/ergodox_ez/keymaps/lukaus/rules.mk
Normal file
@ -0,0 +1 @@
|
||||
#UNICODE_ENABLE = yes
|
47
keyboards/fc660c/keymaps/dbroqua/keymap.c
Normal file
47
keyboards/fc660c/keymaps/dbroqua/keymap.c
Normal file
@ -0,0 +1,47 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* BASE layer: Default Layer
|
||||
* ,--------------------------------------------------------------------------------------------------.
|
||||
* | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace | | Ins |
|
||||
* |-----------------------------------------------------------------------------------------+ +-----+
|
||||
* | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Bksp | | Del |
|
||||
* |-----------------------------------------------------------------------------------------+ +-----+
|
||||
* | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | Enter |
|
||||
* |--------------------------------------------------------------------------------------------+
|
||||
* | Shift | Z | X | C | V | B | N | M | , | . | / | Shift | Up |
|
||||
* +--------------------------------------------------------------------------------------------+-----+
|
||||
* | Ctrl | Gui | Alt | Space | Alt | Gui | Fn | Left| Down|Right|
|
||||
* `--------------------------------------------------------------------------------------------------´
|
||||
*/
|
||||
[0] = LAYOUT(
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSPC, KC_INS,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSLS, KC_DEL,
|
||||
KC_LCTL,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT,
|
||||
KC_LSFT,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_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RCTL,MO(1), KC_LEFT,KC_DOWN,KC_RGHT
|
||||
),
|
||||
/* FN layer
|
||||
* ,--------------------------------------------------------------------------------------------------.
|
||||
* | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | | |
|
||||
* |-----------------------------------------------------------------------------------------+ +-----+
|
||||
* | | | | | | | | |PrtSc| Slck| Paus| | | | | |
|
||||
* |-----------------------------------------------------------------------------------------+ +-----+
|
||||
* | | Vol-| Vol+| Mute|Eject| | | | Home| PgUp| | | |
|
||||
* |--------------------------------------------------------------------------------------------+
|
||||
* | | Prev| Play| Next| | | | | End | PgDn| | | |
|
||||
* +--------------------------------------------------------------------------------------------+-----+
|
||||
* | | | | | | | | | | |
|
||||
* `--------------------------------------------------------------------------------------------------´
|
||||
*/
|
||||
[1] = LAYOUT(
|
||||
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______,
|
||||
_______,_______,_______,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK,KC_PAUS,_______,_______,_______, _______,
|
||||
_______,KC_VOLD,KC_VOLU,KC_MUTE,KC_EJCT,_______,_______,_______,KC_HOME,KC_PGUP,_______,_______, _______,
|
||||
_______,KC_MPRV,KC_MPLY,KC_MNXT,_______,_______,_______,_______,KC_END, KC_PGDN,_______,_______, _______,
|
||||
_______,_______,_______, _______, _______,_______,MO(1), _______,_______,_______
|
||||
)
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
};
|
51
keyboards/gh60/keymaps/emiilsd/keymap.c
Normal file
51
keyboards/gh60/keymaps/emiilsd/keymap.c
Normal file
@ -0,0 +1,51 @@
|
||||
/* Copyright 2018 Funderburker
|
||||
*
|
||||
* 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 QMK_KEYBOARD_H
|
||||
|
||||
// Fillers to make layering more clear
|
||||
#define _______ KC_TRNS
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/*
|
||||
ISO HHKB layout:
|
||||
|
||||
* 2u Backspace
|
||||
* ISO Enter
|
||||
* split left Shift
|
||||
* split right Shift
|
||||
* Caps as Control
|
||||
* 1u/1.5u/7u/1.5u//1u bottom row
|
||||
*/
|
||||
|
||||
/* 0: QWERTY */
|
||||
[0] = LAYOUT(
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_NO,
|
||||
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, KC_ENT,
|
||||
KC_LSFT, KC_GRV, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MO(1), KC_RSFT,
|
||||
KC_NO, KC_LALT, KC_LGUI, KC_SPC, KC_NO, KC_NO, KC_RALT, KC_CAPSLOCK, KC_NO
|
||||
),
|
||||
|
||||
/* 1: Fn layer */
|
||||
[1] = LAYOUT(
|
||||
KC_ESC, 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_DEL,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_END, KC_UP, _______, _______,
|
||||
_______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, _______, _______, KC_PGUP, KC_LEFT, KC_RGHT, _______, _______,
|
||||
_______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, _______, _______, _______, KC_PGDN, KC_DOWN, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
};
|
190
keyboards/handwired/ibm122m/config.h
Normal file
190
keyboards/handwired/ibm122m/config.h
Normal file
@ -0,0 +1,190 @@
|
||||
/*
|
||||
Copyright 2018 REPLACE_WITH_YOUR_NAME
|
||||
|
||||
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 0x0000
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER IBM
|
||||
#define PRODUCT IBM Model M 122 key
|
||||
#define DESCRIPTION Mapping by github.com/lukexorz
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 8
|
||||
#define MATRIX_COLS 20
|
||||
|
||||
/*
|
||||
* Keyboard Matrix Assignments
|
||||
*
|
||||
* Change this to how you wired your keyboard
|
||||
* COLS: AVR pins used for columns, left to right
|
||||
* ROWS: AVR pins used for rows, top to bottom
|
||||
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||
*
|
||||
*/
|
||||
#define MATRIX_COL_PINS { E6, B7, D0, D1, D2, D3, D4, D5, D6, D7, E0, E1, C0, C1, C2, C3, C4, C5, C7, F1 }
|
||||
#define MATRIX_ROW_PINS { F0, B5, B4, B3, B2, B1, B0, E7 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */
|
||||
#define DIODE_DIRECTION ROW2COL
|
||||
|
||||
// #define BACKLIGHT_PIN B7
|
||||
// #define BACKLIGHT_BREATHING
|
||||
// #define BACKLIGHT_LEVELS 3
|
||||
|
||||
|
||||
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||
#define DEBOUNCING_DELAY 15
|
||||
|
||||
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* number of backlight levels */
|
||||
|
||||
/* 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
|
||||
|
||||
/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
|
||||
* This is userful for the Windows task manager shortcut (ctrl+shift+esc).
|
||||
*/
|
||||
// #define GRAVE_ESC_CTRL_OVERRIDE
|
||||
|
||||
/*
|
||||
* Force NKRO
|
||||
*
|
||||
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
|
||||
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
|
||||
* makefile for this to work.)
|
||||
*
|
||||
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
|
||||
* until the next keyboard reset.
|
||||
*
|
||||
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
|
||||
* fully operational during normal computer usage.
|
||||
*
|
||||
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
|
||||
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
|
||||
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
|
||||
* power-up.
|
||||
*
|
||||
*/
|
||||
//#define FORCE_NKRO
|
||||
|
||||
/*
|
||||
* Magic Key Options
|
||||
*
|
||||
* Magic keys are hotkey commands that allow control over firmware functions of
|
||||
* the keyboard. They are best used in combination with the HID Listen program,
|
||||
* found here: https://www.pjrc.com/teensy/hid_listen.html
|
||||
*
|
||||
* The options below allow the magic key functionality to be changed. This is
|
||||
* useful if your keyboard/keypad is missing keys and you want magic key support.
|
||||
*
|
||||
*/
|
||||
|
||||
/* key combination for magic key command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||
)
|
||||
|
||||
#define B6_AUDIO
|
||||
#define C6_AUDIO
|
||||
|
||||
/* control how magic key switches layers */
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
|
||||
|
||||
/* override magic key keymap */
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
|
||||
//#define MAGIC_KEY_HELP1 H
|
||||
//#define MAGIC_KEY_HELP2 SLASH
|
||||
//#define MAGIC_KEY_DEBUG D
|
||||
//#define MAGIC_KEY_DEBUG_MATRIX X
|
||||
//#define MAGIC_KEY_DEBUG_KBD K
|
||||
//#define MAGIC_KEY_DEBUG_MOUSE M
|
||||
//#define MAGIC_KEY_VERSION V
|
||||
//#define MAGIC_KEY_STATUS S
|
||||
//#define MAGIC_KEY_CONSOLE C
|
||||
//#define MAGIC_KEY_LAYER0_ALT1 ESC
|
||||
//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
|
||||
//#define MAGIC_KEY_LAYER0 0
|
||||
//#define MAGIC_KEY_LAYER1 1
|
||||
//#define MAGIC_KEY_LAYER2 2
|
||||
//#define MAGIC_KEY_LAYER3 3
|
||||
//#define MAGIC_KEY_LAYER4 4
|
||||
//#define MAGIC_KEY_LAYER5 5
|
||||
//#define MAGIC_KEY_LAYER6 6
|
||||
//#define MAGIC_KEY_LAYER7 7
|
||||
//#define MAGIC_KEY_LAYER8 8
|
||||
//#define MAGIC_KEY_LAYER9 9
|
||||
//#define MAGIC_KEY_BOOTLOADER PAUSE
|
||||
//#define MAGIC_KEY_LOCK CAPS
|
||||
//#define MAGIC_KEY_EEPROM E
|
||||
//#define MAGIC_KEY_NKRO N
|
||||
//#define MAGIC_KEY_SLEEP_LED Z
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
* These options are also useful to firmware size reduction.
|
||||
*/
|
||||
|
||||
/* 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
|
||||
|
||||
/*
|
||||
* MIDI options
|
||||
*/
|
||||
|
||||
/* Prevent use of disabled MIDI features in the keymap */
|
||||
//#define MIDI_ENABLE_STRICT 1
|
||||
|
||||
/* enable basic MIDI features:
|
||||
- MIDI notes can be sent when in Music mode is on
|
||||
*/
|
||||
//#define MIDI_BASIC
|
||||
|
||||
/* enable advanced MIDI features:
|
||||
- MIDI notes can be added to the keymap
|
||||
- Octave shift and transpose
|
||||
- Virtual sustain, portamento, and modulation wheel
|
||||
- etc.
|
||||
*/
|
||||
//#define MIDI_ADVANCED
|
||||
|
||||
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
|
||||
//#define MIDI_TONE_KEYCODE_OCTAVES 1
|
43
keyboards/handwired/ibm122m/ibm122m.c
Normal file
43
keyboards/handwired/ibm122m/ibm122m.c
Normal file
@ -0,0 +1,43 @@
|
||||
/* Copyright 2018 REPLACE_WITH_YOUR_NAME
|
||||
*
|
||||
* 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 "ibm122m.h"
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
// put your keyboard start-up code here
|
||||
// runs once when the firmware starts up
|
||||
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
void matrix_scan_kb(void) {
|
||||
// put your looping keyboard code here
|
||||
// runs every cycle (a lot)
|
||||
|
||||
matrix_scan_user();
|
||||
}
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
// put your per-action keyboard code here
|
||||
// runs for every action, just before processing by the firmware
|
||||
|
||||
return process_record_user(keycode, record);
|
||||
}
|
||||
|
||||
void led_set_kb(uint8_t usb_led) {
|
||||
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
||||
|
||||
led_set_user(usb_led);
|
||||
}
|
42
keyboards/handwired/ibm122m/ibm122m.h
Normal file
42
keyboards/handwired/ibm122m/ibm122m.h
Normal file
@ -0,0 +1,42 @@
|
||||
/* Copyright 2018 REPLACE_WITH_YOUR_NAME
|
||||
*
|
||||
* 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 "quantum.h"
|
||||
|
||||
// This a shortcut to help you visually see your layout.
|
||||
// The following is an example using the Planck MIT layout
|
||||
// The first section contains all of the arguments
|
||||
// The second converts the arguments into a two-dimensional array
|
||||
#define LAYOUT( \
|
||||
k09, k19, k1A, k29, k39, k3A, k49, k59, k5A, k69, k79, k7A, k3G, k3H, k2G, \
|
||||
k0A, k0B, k1B, k2A, k2B, k3B, k4A, k4B, k5B, k6A, k6B, k7B, k1G, k5G, k4G, \
|
||||
k31, k32, k34, k24, k25, k26, k27, k37, k38, k28, k2C, k2D, k2E, k3E, k3C, k3F, k2F, k2H, k2I, k20, \
|
||||
k21, k41, k42, k44, k45, k46, k47, k57, k58, k48, k4C, k4D, k4E, k5E, k5C, k6F, k4F, k4H, k4I, k40, \
|
||||
k51, k52, k62, k14, k15, k16, k17, k07, k08, k18, k1C, k1D, k1E, k0E, k6E, k1F, k1H, k1I, k10, \
|
||||
k11, k12, k73, k74, k64, k65, k66, k67, k77, k78, k68, k6C, k6D, k7E, k63, k0G, k61, k6H, k6I, k7J, \
|
||||
k02, k01, k00, k70, k71, k03, k72, k60, k0J, k1J, k7H, k7I, \
|
||||
k0F \
|
||||
) \
|
||||
{ \
|
||||
{ k00, k01, k02, k03, KC_NO, KC_NO, KC_NO, k07, k08, k09, k0A, k0B, KC_NO, KC_NO, k0E, k0F, k0G, KC_NO, KC_NO, k0J }, \
|
||||
{ k10, k11, k12, KC_NO, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, k1F, k1G, k1H, k1I, k1J }, \
|
||||
{ k20, k21, KC_NO, KC_NO, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, k2F, k2G, k2H, k2I, KC_NO }, \
|
||||
{ KC_NO, k31, k32, KC_NO, k34, KC_NO, KC_NO, k37, k38, k39, k3A, k3B, k3C, KC_NO, k3E, k3F, k3G, k3H, KC_NO, KC_NO }, \
|
||||
{ k40, k41, k42, KC_NO, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, k4F, k4G, k4H, k4I, KC_NO }, \
|
||||
{ KC_NO, k51, k52, KC_NO, KC_NO, KC_NO, KC_NO, k57, k58, k59, k5A, k5B, k5C, KC_NO, k5E, KC_NO, k5G, KC_NO, KC_NO, KC_NO }, \
|
||||
{ k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k6A, k6B, k6C, k6D, k6E, k6F, KC_NO, k6H, k6I, KC_NO }, \
|
||||
{ k70, k71, k72, k73, k74, KC_NO, KC_NO, k77, k78, k79, k7A, k7B, KC_NO, KC_NO, k7E, KC_NO, KC_NO, k7H, k7I, k7J }, \
|
||||
}
|
0
keyboards/handwired/ibm122m/info.json
Normal file
0
keyboards/handwired/ibm122m/info.json
Normal file
19
keyboards/handwired/ibm122m/keymaps/default/config.h
Normal file
19
keyboards/handwired/ibm122m/keymaps/default/config.h
Normal file
@ -0,0 +1,19 @@
|
||||
/* Copyright 2018 REPLACE_WITH_YOUR_NAME
|
||||
*
|
||||
* 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
|
||||
|
||||
// place overrides below
|
46
keyboards/handwired/ibm122m/keymaps/default/keymap.c
Normal file
46
keyboards/handwired/ibm122m/keymaps/default/keymap.c
Normal file
@ -0,0 +1,46 @@
|
||||
/* Copyright 2018 REPLACE_WITH_YOUR_NAME
|
||||
*
|
||||
* 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 QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
// Original Layer
|
||||
[0] = LAYOUT(
|
||||
KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_INS, KC_HOME, KC_PGUP,
|
||||
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_DEL, KC_END, KC_PGDN,
|
||||
KC_ESC, KC_NO, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
|
||||
KC_NO, KC_NO, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_ENTER, KC_P7, KC_P8, KC_P9, KC_PPLS,
|
||||
KC_NO, KC_NO, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_QUOT, KC_BSLS, KC_P4, KC_P5, KC_P6, KC_BSPC,
|
||||
KC_NO, KC_NO, KC_LSHIFT,KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT,
|
||||
KC_NO, KC_NO, KC_LCTRL, KC_LALT, KC_SPC, KC_RALT, KC_RCTRL, KC_LEFT, KC_NO, KC_RIGHT,KC_P0, KC_PDOT,
|
||||
KC_DOWN),
|
||||
};
|
||||
|
||||
void matrix_init_user(void) {
|
||||
|
||||
}
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void led_set_user(uint8_t usb_led) {
|
||||
|
||||
}
|
2
keyboards/handwired/ibm122m/keymaps/default/readme.md
Normal file
2
keyboards/handwired/ibm122m/keymaps/default/readme.md
Normal file
@ -0,0 +1,2 @@
|
||||
# The default keymap for ibm122m2
|
||||
The 10 keys to the left of the alphanumerics are unbound (other than Escape on the top-left one) as I have no idea what is supposed to go there.
|
19
keyboards/handwired/ibm122m/keymaps/lukaus/config.h
Normal file
19
keyboards/handwired/ibm122m/keymaps/lukaus/config.h
Normal file
@ -0,0 +1,19 @@
|
||||
/* Copyright 2018 REPLACE_WITH_YOUR_NAME
|
||||
*
|
||||
* 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
|
||||
// place overrides here
|
||||
|
587
keyboards/handwired/ibm122m/keymaps/lukaus/keymap.c
Normal file
587
keyboards/handwired/ibm122m/keymaps/lukaus/keymap.c
Normal file
@ -0,0 +1,587 @@
|
||||
/* Copyright 2018 REPLACE_WITH_YOUR_NAME
|
||||
*
|
||||
* 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 QMK_KEYBOARD_H
|
||||
|
||||
enum custom_keycodes {
|
||||
PLACEHOLDER = SAFE_RANGE,
|
||||
|
||||
DVP_ESC, // Grave escape basically i think
|
||||
DVP_AMPR,
|
||||
DVP_LBRACKET,
|
||||
DVP_LCBR,
|
||||
DVP_RCBR,
|
||||
DVP_LPRN,
|
||||
DVP_AT,
|
||||
DVP_EQUAL,
|
||||
DVP_ASTERISK,
|
||||
DVP_RPRN,
|
||||
DVP_PLUS,
|
||||
DVP_RBRACKET,
|
||||
DVP_EXLM,
|
||||
DVP_HASH,
|
||||
SHFT_DOT,
|
||||
SHFT_COMMA
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
// Programmer's Dvorak
|
||||
[0] = LAYOUT(
|
||||
KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_INS, KC_HOME, KC_PGUP,
|
||||
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_DEL, KC_END, KC_PGDN,
|
||||
KC_ESC, TO(1), DVP_ESC, DVP_AMPR, DVP_LBRACKET, DVP_LCBR, DVP_RCBR, DVP_LPRN, DVP_EQUAL,DVP_ASTERISK, DVP_RPRN, DVP_PLUS, DVP_RBRACKET, DVP_EXLM, DVP_HASH, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
|
||||
KC_NO, TO(2), KC_TAB, KC_SCOLON,KC_COMMA, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, DVP_AT, KC_ENTER, KC_P7, KC_P8, KC_P9, KC_PPLS,
|
||||
KC_NO, KC_NO, MO(3), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINUS, KC_BSLS, KC_P4, KC_P5, KC_P6, MO(4),
|
||||
LCTL(KC_F), KC_LALT, KC_LSHIFT,KC_ESC, KC_QUOT, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT,
|
||||
LCTL(KC_C), LCTL(KC_V), KC_LCTRL, KC_LGUI, KC_SPC, KC_RALT, KC_RCTRL, KC_LEFT, KC_BTN3, KC_RIGHT, KC_P0, KC_PDOT,
|
||||
KC_DOWN
|
||||
),
|
||||
|
||||
// Qwerty layer + function
|
||||
[1] = LAYOUT(
|
||||
KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_INS, KC_HOME, KC_PGUP,
|
||||
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_DEL, KC_END, KC_PGDN,
|
||||
KC_ESC, TO(0), KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
|
||||
KC_NO, KC_NO, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_ENTER, KC_P7, KC_P8, KC_P9, KC_PPLS,
|
||||
KC_NO, KC_NO, MO(3), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_QUOT, KC_BSLS, KC_P4, KC_P5, KC_P6, KC_BSPC,
|
||||
KC_NO, KC_NO, KC_LSHIFT,KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT,
|
||||
KC_NO, KC_LALT,KC_LCTRL, KC_LGUI, KC_SPC, KC_RALT, KC_RCTRL, KC_LEFT, KC_WH_D, KC_RIGHT,KC_P0, KC_PDOT,
|
||||
KC_DOWN
|
||||
),
|
||||
// Orirginal Layer
|
||||
[2] = LAYOUT(
|
||||
KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_INS, KC_HOME, KC_PGUP,
|
||||
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_DEL, KC_END, KC_PGDN,
|
||||
KC_ESC, TO(1), KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
|
||||
KC_NO, TO(0), KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_ENTER, KC_P7, KC_P8, KC_P9, KC_PPLS,
|
||||
KC_NO, KC_NO, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_QUOT, KC_BSLS, KC_P4, KC_P5, KC_P6, KC_BSPC,
|
||||
KC_NO, KC_NO, KC_LSHIFT,KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT,
|
||||
KC_NO, KC_LALT,KC_LCTRL, KC_LGUI, KC_SPC, KC_RALT, KC_RCTRL, KC_LEFT, KC_WH_D, KC_RIGHT,KC_P0, KC_PDOT,
|
||||
KC_DOWN
|
||||
),
|
||||
|
||||
// Function Layer
|
||||
[3] = LAYOUT(
|
||||
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_INS, KC_HOME, KC_PGUP,
|
||||
KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_DEL, KC_END, KC_PGDN,
|
||||
MU_TOG, KC_NO, KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
|
||||
MU_MOD, KC_NO, KC_TAB, KC_NO, KC_MEDIA_PREV_TRACK, KC_MEDIA_PLAY_PAUSE, KC_MEDIA_NEXT_TRACK, KC_NO, KC_NO, KC_PGUP, KC_DEL, KC_NO, KC_NO, KC_LBRC, KC_RBRC,KC_ENTER, KC_NO, KC_NO, KC_NO, KC_PPLS,
|
||||
KC_NO, KC_NO, KC_TRNS, KC_NO, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, KC_AUDIO_MUTE, KC_NO, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_SCOLON, KC_QUOT, KC_BSLS, LSFT(KC_E), LSFT(KC_F), KC_NO, KC_BSPC,
|
||||
KC_NO, KC_LALT, KC_LSHIFT,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PGDN, KC_COMMA, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, LSFT(KC_B), LSFT(KC_C), LSFT(KC_D), KC_PENT,
|
||||
KC_NO, KC_NO, KC_LCTRL, KC_LGUI, KC_SPC, KC_RALT, KC_CAPS, KC_LEFT, KC_WH_D, KC_RIGHT,LSFT(KC_A), KC_PDOT,
|
||||
KC_DOWN
|
||||
),
|
||||
// Literally just the numpad is different
|
||||
[4] = LAYOUT(
|
||||
KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_INS, KC_HOME, KC_PGUP,
|
||||
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_DEL, KC_END, KC_PGDN,
|
||||
KC_ESC, TO(1), DVP_ESC, DVP_AMPR, DVP_LBRACKET, DVP_LCBR, DVP_RCBR, DVP_LPRN, DVP_EQUAL,DVP_ASTERISK, DVP_RPRN, DVP_PLUS, DVP_RBRACKET, DVP_EXLM, DVP_HASH, KC_BSPC, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_NO, TO(2), KC_TAB, KC_SCOLON,KC_COMMA, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, DVP_AT, KC_ENTER, KC_BTN1, KC_MS_U, KC_BTN2, KC_NO,
|
||||
KC_NO, KC_NO, TO(0), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINUS, KC_BSLS, KC_MS_L, KC_NO, KC_MS_R, KC_TRNS,
|
||||
LCTL(KC_F), KC_LALT, KC_LSHIFT,KC_NO, KC_QUOT, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_UP, KC_GT, KC_MS_D, KC_GT, KC_PENT,
|
||||
LCTL(KC_C), LCTL(KC_V), KC_LCTRL, KC_LGUI, KC_SPC, KC_RALT, KC_RCTRL, KC_LEFT, KC_BTN3, KC_RIGHT, KC_BTN1, KC_PDOT,
|
||||
KC_DOWN
|
||||
),
|
||||
/*
|
||||
[4] = LAYOUT(
|
||||
KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_INS, KC_HOME, KC_PGUP,
|
||||
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_DEL, KC_END, KC_PGDN,
|
||||
MU_TOG, TO(0), KC_DLR, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
|
||||
MU_MOD, KC_NO, KC_TAB, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LBRC, KC_RBRC,KC_ENTER, KC_NO, KC_NO, KC_NO, KC_PPLS,
|
||||
KC_NO, KC_NO, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_QUOT, KC_BSLS, LSFT(KC_E), LSFT(KC_F), KC_NO, KC_BSPC,
|
||||
KC_NO, KC_LALT, KC_LSHIFT,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_COMMA, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, LSFT(KC_B), LSFT(KC_C), LSFT(KC_D), KC_PENT,
|
||||
KC_NO, KC_LGUI, KC_LCTRL, KC_LALT, KC_SPC, KC_RALT, KC_RCTRL, KC_LEFT, KC_WH_D, KC_RIGHT, LSFT(KC_A), KC_PDOT,
|
||||
KC_DOWN
|
||||
),*/
|
||||
/*[0] = LAYOUT(
|
||||
KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_NO,TO(1),KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1,
|
||||
KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, TO(2),KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, KC_2,
|
||||
KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3,
|
||||
KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_BSPC,KC_4,KC_4,KC_4, KC_4,
|
||||
KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5,
|
||||
KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6,
|
||||
KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7,
|
||||
KC_8, KC_SPC,KC_8,KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, TO(1)
|
||||
|
||||
),
|
||||
[1] = LAYOUT(
|
||||
KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, TO(0),KC_NO,KC_M, KC_N, KC_O, KC_P, KC_Q, KC_R, KC_S, KC_T,
|
||||
KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, KC_K, TO(2),KC_M, KC_N, KC_O, KC_P, KC_Q, KC_R, KC_S, KC_T,
|
||||
KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, KC_P, KC_Q, KC_R, KC_S, KC_T,
|
||||
KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, KC_BSPC,KC_Q,KC_R,KC_S, KC_T,
|
||||
KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, KC_P, KC_Q, KC_R, KC_S, KC_T,
|
||||
KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, KC_P, KC_Q, KC_R, KC_S, KC_T,
|
||||
KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, KC_P, KC_Q, KC_R, KC_S, KC_T,
|
||||
KC_A, KC_SPC,KC_C,KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, KC_P, KC_Q, KC_R, KC_S, TO(0)
|
||||
),
|
||||
[2] = LAYOUT(
|
||||
KC_LCTRL, KC_LALT, KC_C, KC_RALT, KC_E, KC_F, KC_G, KC_G, KC_H, KC_J, TO(0), TO(1), KC_M, KC_N, KC_QUOT, KC_DOWN, KC_UP, KC_R, KC_S, KC_ENTER,
|
||||
KC_PPLS, KC_B, KC_C, KC_D, KC_A, KC_S, KC_D, KC_F, KC_J, KC_J, KC_K, KC_NO, KC_K, KC_L, KC_SCOLON, KC_P4, KC_DEL, KC_P5, KC_P6, KC_RIGHT,
|
||||
KC_PMNS, KC_1, KC_C, KC_D, KC_1, KC_2, KC_3, KC_4, KC_7, KC_J, KC_K, KC_L, KC_8, KC_9, KC_0, KC_NLCK, KC_PGUP,KC_PSLS, KC_PAST, KC_T,
|
||||
KC_A, KC_ESC, TO(0),KC_D, KC_GRV, KC_F, KC_G, KC_5, KC_6, KC_J, KC_K, KC_L, KC_EQL, KC_N, KC_MINUS, KC_BSPC, KC_INS, KC_HOME, KC_S, KC_T,
|
||||
KC_PPLS, KC_NO, KC_TAB, KC_D, KC_Q, KC_W, KC_E, KC_R, KC_U, KC_J, KC_K, KC_L, KC_I, KC_O, KC_P, KC_P7, KC_PGDN,KC_P8, KC_P9, KC_T,
|
||||
KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_T, KC_Y, KC_J, KC_K, KC_L, KC_RBRC, KC_N, KC_LBRC, KC_P, KC_END, KC_R, KC_S, KC_T,
|
||||
KC_LEFT, KC_P1, KC_CAPS, KC_RSFT, KC_Z, KC_X, KC_C, KC_V, KC_M, KC_J, KC_K, KC_L, KC_COMMA, KC_DOT, KC_BSLS, KC_PENT, KC_Q, KC_P2, KC_P3, KC_T,
|
||||
KC_LGUI, KC_SPACE, KC_RCTRL, KC_LSHIFT, KC_E, KC_F, KC_G, KC_B, KC_N, KC_J, KC_K, KC_L, KC_M, KC_N, KC_SLSH, KC_P, KC_Q, KC_P0, KC_PDOT, KC_KP_ENTER
|
||||
),*/
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
|
||||
};
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
// MACRODOWN only works in this function
|
||||
switch(id) {
|
||||
case 0:
|
||||
if (record->event.pressed) {
|
||||
register_code(KC_RSFT);
|
||||
} else {
|
||||
unregister_code(KC_RSFT);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
|
||||
void matrix_init_user(void) {
|
||||
|
||||
}
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
|
||||
}
|
||||
|
||||
bool left_shift_down = false;
|
||||
bool right_shift_down = false;
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case KC_LSHIFT:
|
||||
if (record->event.pressed)
|
||||
{
|
||||
left_shift_down = true;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
left_shift_down = false;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case KC_RSHIFT:
|
||||
|
||||
if (record->event.pressed)
|
||||
{
|
||||
right_shift_down = true;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
right_shift_down = false;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case DVP_ESC:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("~");
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("$");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case DVP_AMPR:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
{
|
||||
SEND_STRING("%");
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("&");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case DVP_LBRACKET:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
{
|
||||
if(left_shift_down)
|
||||
unregister_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
unregister_code(KC_RSHIFT);
|
||||
|
||||
register_code(KC_7);
|
||||
unregister_code(KC_7);
|
||||
|
||||
if(left_shift_down)
|
||||
register_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
register_code(KC_RSHIFT);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("[");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case DVP_LCBR:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
{
|
||||
if(left_shift_down)
|
||||
unregister_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
unregister_code(KC_RSHIFT);
|
||||
|
||||
register_code(KC_5);
|
||||
unregister_code(KC_5);
|
||||
|
||||
if(left_shift_down)
|
||||
register_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
register_code(KC_RSHIFT);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("{");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case DVP_RCBR:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
{
|
||||
if(left_shift_down)
|
||||
unregister_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
unregister_code(KC_RSHIFT);
|
||||
|
||||
register_code(KC_3);
|
||||
unregister_code(KC_3);
|
||||
|
||||
if(left_shift_down)
|
||||
register_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
register_code(KC_RSHIFT);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("}");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case DVP_LPRN:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
{
|
||||
if(left_shift_down)
|
||||
unregister_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
unregister_code(KC_RSHIFT);
|
||||
|
||||
register_code(KC_1);
|
||||
unregister_code(KC_1);
|
||||
|
||||
if(left_shift_down)
|
||||
register_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
register_code(KC_RSHIFT);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("(");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
//
|
||||
case DVP_AT:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
{
|
||||
if(left_shift_down)
|
||||
unregister_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
unregister_code(KC_RSHIFT);
|
||||
|
||||
register_code(KC_LSHIFT);
|
||||
register_code(KC_6);
|
||||
unregister_code(KC_6);
|
||||
unregister_code(KC_LSHIFT);
|
||||
|
||||
if(left_shift_down)
|
||||
register_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
register_code(KC_RSHIFT);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("@");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case DVP_EQUAL:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
{
|
||||
if(left_shift_down)
|
||||
unregister_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
unregister_code(KC_RSHIFT);
|
||||
|
||||
register_code(KC_9);
|
||||
unregister_code(KC_9);
|
||||
|
||||
if(left_shift_down)
|
||||
register_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
register_code(KC_RSHIFT);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("=");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case DVP_ASTERISK:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
{
|
||||
if(left_shift_down)
|
||||
unregister_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
unregister_code(KC_RSHIFT);
|
||||
|
||||
register_code(KC_0);
|
||||
unregister_code(KC_0);
|
||||
|
||||
if(left_shift_down)
|
||||
register_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
register_code(KC_RSHIFT);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("*");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case DVP_RPRN:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
{
|
||||
if(left_shift_down)
|
||||
unregister_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
unregister_code(KC_RSHIFT);
|
||||
|
||||
register_code(KC_2);
|
||||
unregister_code(KC_2);
|
||||
|
||||
if(left_shift_down)
|
||||
register_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
register_code(KC_RSHIFT);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING(")");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case DVP_PLUS:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
{
|
||||
if(left_shift_down)
|
||||
unregister_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
unregister_code(KC_RSHIFT);
|
||||
|
||||
register_code(KC_4);
|
||||
unregister_code(KC_4);
|
||||
|
||||
if(left_shift_down)
|
||||
register_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
register_code(KC_RSHIFT);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("+");
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
|
||||
case DVP_RBRACKET:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
{
|
||||
if(left_shift_down)
|
||||
unregister_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
unregister_code(KC_RSHIFT);
|
||||
|
||||
register_code(KC_6);
|
||||
unregister_code(KC_6);
|
||||
|
||||
if(left_shift_down)
|
||||
register_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
register_code(KC_RSHIFT);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("]");
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
|
||||
case DVP_EXLM:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
{
|
||||
if(left_shift_down)
|
||||
unregister_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
unregister_code(KC_RSHIFT);
|
||||
|
||||
register_code(KC_8);
|
||||
unregister_code(KC_8);
|
||||
|
||||
if(left_shift_down)
|
||||
register_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
register_code(KC_RSHIFT);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("!");
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
|
||||
case DVP_HASH:
|
||||
if (left_shift_down || right_shift_down)
|
||||
{
|
||||
if(record->event.pressed)
|
||||
{
|
||||
if(left_shift_down)
|
||||
unregister_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
unregister_code(KC_RSHIFT);
|
||||
|
||||
register_code(KC_GRAVE);
|
||||
unregister_code(KC_GRAVE);
|
||||
|
||||
if(left_shift_down)
|
||||
register_code(KC_LSHIFT);
|
||||
if(right_shift_down)
|
||||
register_code(KC_RSHIFT);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("#");
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case SHFT_DOT:
|
||||
if(record->event.pressed)
|
||||
SEND_STRING(">");
|
||||
break;
|
||||
|
||||
case SHFT_COMMA:
|
||||
if(record->event.pressed)
|
||||
SEND_STRING("<");
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void led_set_user(uint8_t usb_led) {
|
||||
|
||||
}
|
2
keyboards/handwired/ibm122m/keymaps/lukaus/readme.md
Normal file
2
keyboards/handwired/ibm122m/keymaps/lukaus/readme.md
Normal file
@ -0,0 +1,2 @@
|
||||
# Lukaus' for ibm122m2
|
||||
Programmer's Dvorak as the default layer with a Qwerty layer that can access a function layer. Also includes the default layout, slightly modified
|
16
keyboards/handwired/ibm122m/readme.md
Normal file
16
keyboards/handwired/ibm122m/readme.md
Normal file
@ -0,0 +1,16 @@
|
||||
# ibm122m
|
||||
|
||||

|
||||
|
||||
This is a keymap for the IBM Model M 122 key terminal keyboard running on a Teensy 2.0++
|
||||
I wired it to weird pins on mine (mainly to accomodate speakers), so make sure to update the pin arrays.
|
||||
|
||||
Keyboard Maintainer: [Luke Stanley](https://github.com/lukexorz)
|
||||
Hardware Supported: Teensy 2.0++
|
||||
Hardware Availability: https://www.pjrc.com/store/teensypp.html
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make handwired/ibm122m:default
|
||||
|
||||
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.
|
67
keyboards/handwired/ibm122m/rules.mk
Normal file
67
keyboards/handwired/ibm122m/rules.mk
Normal file
@ -0,0 +1,67 @@
|
||||
# MCU name
|
||||
MCU = at90usb1286
|
||||
BOOTLOADER = halfKay
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
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 = yes # Console for debug(+400)
|
||||
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE = yes # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default
|
||||
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE = yes # Audio output on port C6
|
||||
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
49
keyboards/jj40/keymaps/like_jis/config.h
Normal file
49
keyboards/jj40/keymaps/like_jis/config.h
Normal file
@ -0,0 +1,49 @@
|
||||
/*
|
||||
This is the c configuration file for the keymap
|
||||
|
||||
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
|
||||
|
||||
// place overrides here
|
||||
|
||||
#define TAPPING_TERM 200
|
||||
|
||||
#ifdef MOUSEKEY_ENABLE
|
||||
#undef MOUSEKEY_INTERVAL
|
||||
#define MOUSEKEY_INTERVAL 5
|
||||
|
||||
#undef MOUSEKEY_TIME_TO_MAX
|
||||
#define MOUSEKEY_TIME_TO_MAX 150
|
||||
|
||||
#undef MOUSEKEY_MAX_SPEED
|
||||
#define MOUSEKEY_MAX_SPEED 3
|
||||
|
||||
#undef MOUSEKEY_MOVE_DELTA
|
||||
#define MOUSEKEY_MOVE_DELTA 3
|
||||
|
||||
#undef MOUSEKEY_DELAY
|
||||
#define MOUSEKEY_DELAY 0
|
||||
#endif
|
||||
|
||||
#undef BACKLIGHT_LEVELS
|
||||
#define BACKLIGHT_LEVELS 15
|
||||
// #undef BACKLIGHT_LEVELS
|
||||
// #define BACKLIGHT_BREATHING
|
||||
// #undef BREATHING_PERIOD
|
||||
// #define BREATHING_PERIOD 4
|
200
keyboards/jj40/keymaps/like_jis/keymap.c
Normal file
200
keyboards/jj40/keymaps/like_jis/keymap.c
Normal file
@ -0,0 +1,200 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
#define _QWERTY 0
|
||||
#define _LOWER 3
|
||||
#define _RAISE 4
|
||||
#define _ADJUST 16
|
||||
|
||||
enum custom_keycodes {
|
||||
LOWER = SAFE_RANGE,
|
||||
RAISE,
|
||||
ADJUST,
|
||||
RGBRST
|
||||
};
|
||||
|
||||
#define KC______ KC_TRNS
|
||||
#define KC_XXXXX KC_NO
|
||||
#define KC_KANJI KC_GRV
|
||||
|
||||
#define KC_LOWER LOWER
|
||||
#define KC_RAISE RAISE
|
||||
#define KC_ADJST ADJUST
|
||||
|
||||
#define KC_RST RESET
|
||||
|
||||
#define KC_LRST RGBRST
|
||||
#define KC_LTOG RGB_TOG
|
||||
#define KC_LHUI RGB_HUI
|
||||
#define KC_LHUD RGB_HUD
|
||||
#define KC_LSAI RGB_SAI
|
||||
#define KC_LSAD RGB_SAD
|
||||
#define KC_LVAI RGB_VAI
|
||||
#define KC_LVAD RGB_VAD
|
||||
#define KC_LSMOD RGB_SMOD
|
||||
#define KC_BTOG BL_TOGG
|
||||
#define KC_BINC BL_INC
|
||||
#define KC_BDEC BL_DEC
|
||||
// #define KC_BRTG BL_BRTG
|
||||
|
||||
#define KC_KNRM AG_NORM
|
||||
#define KC_KSWP AG_SWAP
|
||||
|
||||
// Layer Mode aliases
|
||||
// #define KC_L_LO MO(_LOWER)
|
||||
// #define KC_L_RA MO(_RAISE)
|
||||
// #define KC_L_AD MO(_ADJUST)
|
||||
#define KC_TBSF LSFT_T(KC_TAB)
|
||||
// #define KC_SPSF LSFT_T(KC_SPC)
|
||||
// #define KC_GUAP LALT_T(KC_APP)
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[_QWERTY] = KC_LAYOUT_ortho_4x12( \
|
||||
//,-----------------------------------------------------------------------------------.
|
||||
ESC, Q, W, E, R, T, Y, U, I, O, P, MINS,\
|
||||
//|------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
TBSF, A, S, D, F, G, H, J, K, L, SCLN, ENT,\
|
||||
//|------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
LSFT, Z, X, C, V, B, N, M, COMM, DOT, UP, RSFT,\
|
||||
//|------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
LCTRL, LALT, LGUI, ADJST, LOWER, BSPC, SPC, RAISE, APP, LEFT, DOWN, RGHT \
|
||||
//|------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
),
|
||||
|
||||
[_LOWER] = KC_LAYOUT_ortho_4x12( \
|
||||
//,-----------------------------------------------------------------------------------.
|
||||
TAB, F1, F2, F3, F4, F5, XXXXX, MINS, EQL, JYEN, LBRC, RBRC,\
|
||||
//|------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
_____, F6, F7, F8, F9, F10, XXXXX, XXXXX, XXXXX, SCLN, QUOT, BSLS,\
|
||||
//|------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
_____, F11, F12, XXXXX, KANJI, ENT, XXXXX, XXXXX, COMM, DOT, SLSH, RO,\
|
||||
//|------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
_____, _____, _____, _____, _____, DEL, _____, _____, _____, _____, _____, _____ \
|
||||
//|------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
),
|
||||
|
||||
[_RAISE] = KC_LAYOUT_ortho_4x12( \
|
||||
//,-----------------------------------------------------------------------------------.
|
||||
_____, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,\
|
||||
//|------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
_____, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, 4, 5, 6, QUOT, PLUS,\
|
||||
//|------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
_____, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, 0, 1, 2, 3, DOT, SLSH,\
|
||||
//|------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
_____, _____, _____, _____, _____, BSPC, _____, _____, _____, _____, _____, _____ \
|
||||
//|------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
),
|
||||
|
||||
[_ADJUST] = KC_LAYOUT_ortho_4x12( \
|
||||
//,-----------------------------------------------------------------------------------.
|
||||
XXXXX, RST, LRST, KNRM, KSWP, XXXXX, XXXXX, WH_L, WH_U, HOME, PGUP, XXXXX,\
|
||||
//|------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
XXXXX, LTOG, LHUI, LSAI, LVAI, BTOG, BINC, WH_R, WH_D, END, PGDN, XXXXX,\
|
||||
//|------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
XXXXX, LSMOD, LHUD, LSAD, LVAD, XXXXX, BDEC, XXXXX, BTN1, BTN2, MS_U, XXXXX,\
|
||||
//|------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
_____, _____, _____, _____, _____, XXXXX, XXXXX, _____, _____, MS_L, MS_D, MS_R \
|
||||
//|------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
)
|
||||
};
|
||||
|
||||
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
extern backlight_config_t backlight_config;
|
||||
|
||||
inline void enable_backright(bool on) {
|
||||
backlight_config.enable = on;
|
||||
if (backlight_config.raw == 1) // enabled but level = 0
|
||||
backlight_config.level = 1;
|
||||
eeconfig_update_backlight(backlight_config.raw);
|
||||
// dprintf("backlight toggle: %u\n", backlight_config.enable);
|
||||
backlight_set(backlight_config.enable ? backlight_config.level : 0);
|
||||
}
|
||||
|
||||
uint8_t bl_breath_count;
|
||||
uint8_t bl_breath_speed = 10;
|
||||
int8_t bl_breath_updown = 1;
|
||||
bool bl_breath_on;
|
||||
backlight_config_t bl_breath_backup;
|
||||
|
||||
void bl_breath_start(uint8_t speed) {
|
||||
|
||||
bl_breath_on = true;
|
||||
bl_breath_speed = speed;
|
||||
bl_breath_backup = backlight_config;
|
||||
}
|
||||
|
||||
void bl_breath_end(void) {
|
||||
|
||||
bl_breath_on = false;
|
||||
backlight_config = bl_breath_backup;
|
||||
eeconfig_update_backlight(backlight_config.raw);
|
||||
backlight_set(backlight_config.enable ? backlight_config.level : 0);
|
||||
}
|
||||
|
||||
void bl_breath_update(void) {
|
||||
|
||||
if (bl_breath_on) {
|
||||
++bl_breath_count;
|
||||
if (bl_breath_count > bl_breath_speed) {
|
||||
bl_breath_count = 0;
|
||||
|
||||
backlight_config.level += bl_breath_updown;
|
||||
bl_breath_updown = (backlight_config.level > BACKLIGHT_LEVELS) ? -1 :
|
||||
(backlight_config.level <= 0) ? 1 :
|
||||
bl_breath_updown;
|
||||
enable_backright(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#define BL_BREATH_START bl_breath_start
|
||||
#define BL_BREATH_END bl_breath_end
|
||||
#define BL_BREATH_UPDATE bl_breath_update
|
||||
|
||||
#else
|
||||
|
||||
#define BL_BREATH_START(a)
|
||||
#define BL_BREATH_END()
|
||||
#define BL_BREATH_UPDATE()
|
||||
#endif
|
||||
|
||||
// Loop
|
||||
void matrix_scan_user(void) {
|
||||
|
||||
BL_BREATH_UPDATE();
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
|
||||
switch (keycode) {
|
||||
case LOWER:
|
||||
if (record->event.pressed) {
|
||||
BL_BREATH_START(50);
|
||||
layer_on(_LOWER);
|
||||
} else {
|
||||
BL_BREATH_END();
|
||||
layer_off(_LOWER);
|
||||
}
|
||||
break;
|
||||
case RAISE:
|
||||
if (record->event.pressed) {
|
||||
BL_BREATH_START(100);
|
||||
layer_on(_RAISE);
|
||||
} else {
|
||||
BL_BREATH_END();
|
||||
layer_off(_RAISE);
|
||||
}
|
||||
break;
|
||||
case ADJUST:
|
||||
if (record->event.pressed) {
|
||||
layer_on(_ADJUST);
|
||||
} else {
|
||||
layer_off(_ADJUST);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
5
keyboards/jj40/keymaps/like_jis/rules.mk
Normal file
5
keyboards/jj40/keymaps/like_jis/rules.mk
Normal file
@ -0,0 +1,5 @@
|
||||
MOUSEKEY_ENABLE = yes
|
||||
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
@ -5,6 +5,7 @@ A WKL Hot Swap Double USB C 60%
|
||||
Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin)
|
||||
Hardware Supported: KBD6x PCB
|
||||
Hardware Availability: [KBDFans](https://kbdfans.cn/products/kbd6x-wkl-hot-swap-60-double-type-c-pcb)
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make kbd6x:default
|
||||
|
@ -51,7 +51,7 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||
BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE = yes # Console for debug(+400)
|
||||
|
@ -20,6 +20,11 @@ enum custom_keycodes {
|
||||
#define _______ KC_TRNS
|
||||
#define XXXXXXX KC_NO
|
||||
|
||||
// Aliases to make the keymap more uniform
|
||||
#define GUI_END GUI_T(KC_END)
|
||||
#define MED_DEL LT(_MEDIA, KC_DEL)
|
||||
#define KPD_ENT LT(_KEYPAD, KC_ENT)
|
||||
|
||||
/*
|
||||
|
||||
Function Keys on All Layers (Keypad toggles):
|
||||
@ -96,9 +101,9 @@ enum custom_keycodes {
|
||||
|--------+------+------+------+------+------||------+------+------+------+------+--------|
|
||||
| | | | | | || | | | | | |
|
||||
|--------+------+------+------+------+------||------+------+------+------+------+--------|
|
||||
| | | | | | || | Mute | Vol- | Vol+ | | |
|
||||
| | | Mute | Vol- | Vol+ | || | | | | | |
|
||||
|--------+------+------+------+------+------||------+------+------+------+------+--------|
|
||||
| | | | | | || Stop | Prev | Play | Next | Sel | |
|
||||
| | Stop | Prev | Play | Next | Sel || | | | | | |
|
||||
`--------+------+------+------+------+------'`------+------+------+------+------+--------'
|
||||
| | | | | | | | | |
|
||||
`---------------------------' `---------------------------'
|
||||
@ -116,12 +121,12 @@ enum custom_keycodes {
|
||||
|--------+------+------+------+------+------||------+------+------+------+------+--------|
|
||||
| Sleep | | | | | || | KP 7 | KP 8 | KP 9 | KP - | |
|
||||
|--------+------+------+------+------+------||------+------+------+------+------+--------|
|
||||
| Wake | |QWERTY|Colemk|Dvorak| || | KP 4 | KP 5 | KP 6 | KP + | |
|
||||
| Wake | | Mute | Vol- | Vol+ | || | KP 4 | KP 5 | KP 6 | KP + | |
|
||||
|--------+------+------+------+------+------||------+------+------+------+------+--------|
|
||||
| | | | | | || | KP 1 | KP 2 | KP 3 |KP Ent| |
|
||||
| | Stop | Prev | Play | Next | Sel || | KP 1 | KP 2 | KP 3 |KP Ent| |
|
||||
`--------+------+------+------+------+------'`------+------+------+------+------+--------'
|
||||
| | | | | | | | KP . |KP Ent| |
|
||||
`---------------------------' `----------------------------------'
|
||||
| |QWERTY|Colemk|Dvorak| | | | KP . |KP Ent|
|
||||
`---------------------------' `---------------------------'
|
||||
,-------------.,-------------.
|
||||
| | || | |
|
||||
,------|------|------||------+------+------.
|
||||
@ -144,7 +149,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
// Left Thumb
|
||||
KC_LCTL, KC_LALT,
|
||||
KC_HOME,
|
||||
KC_BSPC, LT(_MEDIA, KC_DEL), KC_END,
|
||||
KC_BSPC, MED_DEL, GUI_END,
|
||||
|
||||
// Right Hand
|
||||
KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, TG(_KEYPAD), RESET,
|
||||
@ -156,7 +161,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
// Right Thumb
|
||||
KC_RGUI, KC_RCTL,
|
||||
KC_PGUP,
|
||||
KC_PGDN, LT(_KEYPAD, KC_ENT), KC_SPC
|
||||
KC_PGDN, KPD_ENT, KC_SPC
|
||||
),
|
||||
|
||||
[_QWERTY] = LAYOUT (
|
||||
@ -170,7 +175,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
// Left Thumb
|
||||
KC_LCTL, KC_LALT,
|
||||
KC_HOME,
|
||||
KC_BSPC, LT(_MEDIA, KC_DEL), KC_END,
|
||||
KC_BSPC, MED_DEL, KC_END,
|
||||
|
||||
// Right Hand
|
||||
KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, TG(_KEYPAD), RESET,
|
||||
@ -182,7 +187,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
// Right Thumb
|
||||
KC_RGUI, KC_RCTL,
|
||||
KC_PGUP,
|
||||
KC_PGDN, LT(_KEYPAD, KC_ENT), KC_SPC
|
||||
KC_PGDN, KPD_ENT, KC_SPC
|
||||
),
|
||||
|
||||
[_COLEMAK] = LAYOUT (
|
||||
@ -196,7 +201,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
// Left Thumb
|
||||
KC_LCTL, KC_LALT,
|
||||
KC_HOME,
|
||||
KC_BSPC, LT(_MEDIA, KC_DEL), KC_END,
|
||||
KC_BSPC, MED_DEL, KC_END,
|
||||
|
||||
// Right Hand
|
||||
KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, TG(_KEYPAD), RESET,
|
||||
@ -208,7 +213,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
// Right Thumb
|
||||
KC_RGUI, KC_RCTL,
|
||||
KC_PGUP,
|
||||
KC_PGDN, LT(_KEYPAD, KC_ENT), KC_SPC
|
||||
KC_PGDN, KPD_ENT, KC_SPC
|
||||
),
|
||||
|
||||
[_MEDIA] = LAYOUT (
|
||||
@ -216,8 +221,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5,
|
||||
_______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______,
|
||||
_______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______,
|
||||
_______, KC_MSTP, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSEL,
|
||||
_______, _______, _______, _______,
|
||||
// Left Thumb
|
||||
_______, _______,
|
||||
@ -228,8 +233,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12,
|
||||
_______, _______, _______, _______, _______, _______,
|
||||
_______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______,
|
||||
KC_MSTP, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSEL, _______,
|
||||
_______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______,
|
||||
// Right Thumb
|
||||
_______, _______,
|
||||
@ -242,9 +247,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
KC_PWR, _______, _______, _______, _______, _______,
|
||||
KC_SLEP, _______, _______, _______, _______, _______,
|
||||
KC_WAKE, _______, QWERTY, COLEMAK, DVORAK, _______,
|
||||
_______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______,
|
||||
KC_WAKE, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______,
|
||||
_______, KC_MSTP, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSEL,
|
||||
_______, QWERTY, COLEMAK, DVORAK,
|
||||
// Left Thumb
|
||||
_______, _______,
|
||||
_______,
|
||||
|
@ -4,19 +4,17 @@
|
||||
|
||||
The Dvorak layout shown here stems from my early Kinesis years, using the Contour PS/2 with a Dvorak software layout. Because of this, the RBRC and LBRC were on opposite sides of the board in the corner keys. I've decided to continue using this layout with my QMK Kinesis.
|
||||
|
||||
~~After a year of using a planck, I've become accustomed to my / and ? being above the - key, so I've decided to move my [, ], and = to the normal Advantage location and set the two keys above the - to new locations. I'll play with it for a while and see how I like it.~~ I didn't like it, so I've switched back.
|
||||
|
||||
The QWERTY layout shown here is based entirely on the Kinesis Advantage layout. The Colemak layout is merely an adaptation of that.
|
||||
|
||||
I've enabled persistent keymaps for Qwerty, Dvorak and Colemak layers, similar to the default Planck layouts.
|
||||
|
||||
As of August 4 2018, I've got the LEDs working ... mostly. Caps Lock and Num Lock LEDs work for me. The Scroll Lock LED does work on my keyboard, but I can't get it to work when I use the Scroll Lock key on my keyboard. I also have no idea how to get the Num Pad LED working when I switch to the Numpad layer.
|
||||
Depending on the OS, most of the LEDs are now working in this keymap, but I still have yet to get the Num Pad LED working when switching to the Numpad layer.
|
||||
|
||||
## Still to do:
|
||||
|
||||
* Figure out how to make the Numpad and ScrLck LEDs work properly.
|
||||
* Figure out how to make the Numpad LED work properly.
|
||||
|
||||
### Function Keys on All Layers (keypad toggles):
|
||||
### Function Keys on All Layers (`keypad` toggles to the keypad layer):
|
||||
,-----------------------------------------------------------------.
|
||||
| Esc | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 |
|
||||
`-----------------------------------------------------------------'
|
||||
@ -94,9 +92,9 @@ As of August 4 2018, I've got the LEDs working ... mostly. Caps Lock and Num Loc
|
||||
|--------+------+------+------+------+------||------+------+------+------+------+--------|
|
||||
| | | | | | || | | | | | |
|
||||
|--------+------+------+------+------+------||------+------+------+------+------+--------|
|
||||
| | | | | | || | Mute | Vol- | Vol+ | | |
|
||||
| | | Mute | Vol- | Vol+ | || | | | | | |
|
||||
|--------+------+------+------+------+------||------+------+------+------+------+--------|
|
||||
| | | | | | || Stop | Prev | Play | Next | Sel | |
|
||||
| | Stop | Prev | Play | Next | Sel || | | | | | |
|
||||
`--------+------+------+------+------+------'`------+------+------+------+------+--------'
|
||||
| | | | | | | | | |
|
||||
`---------------------------' `---------------------------'
|
||||
@ -117,12 +115,12 @@ As of August 4 2018, I've got the LEDs working ... mostly. Caps Lock and Num Loc
|
||||
|--------+------+------+------+------+------||------+------+------+------+------+--------|
|
||||
| Sleep | | | | | || | KP 7 | KP 8 | KP 9 | KP - | |
|
||||
|--------+------+------+------+------+------||------+------+------+------+------+--------|
|
||||
| Wake | |QWERTY|Colemk|Dvorak| || | KP 4 | KP 5 | KP 6 | KP + | |
|
||||
| Wake | | Mute | Vol- | Vol+ | || | KP 4 | KP 5 | KP 6 | KP + | |
|
||||
|--------+------+------+------+------+------||------+------+------+------+------+--------|
|
||||
| | | | | | || | KP 1 | KP 2 | KP 3 |KP Ent| |
|
||||
| | Stop | Prev | Play | Next | Sel || | KP 1 | KP 2 | KP 3 |KP Ent| |
|
||||
`--------+------+------+------+------+------'`------+------+------+------+------+--------'
|
||||
| | | | | | | | KP . |KP Ent| |
|
||||
`---------------------------' `----------------------------------'
|
||||
| |QWERTY|Colemk|Dvorak| | | | KP . |KP Ent|
|
||||
`---------------------------' `---------------------------'
|
||||
,-------------.,-------------.
|
||||
| | || | |
|
||||
,------|------|------||------+------+------.
|
||||
|
@ -2,11 +2,11 @@
|
||||
# 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 = yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = no # 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
|
||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE = no # MIDI controls
|
||||
|
@ -16,6 +16,12 @@
|
||||
|
||||
#define TAPPING_TERM 150
|
||||
|
||||
/* default layer sounds */
|
||||
#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
|
||||
SONG(GAME_SOUND), \
|
||||
SONG(COLEMAK_SOUND) \
|
||||
}
|
||||
|
||||
//#undef RGBLED_NUM
|
||||
//#define RGBLIGHT_ANIMATIONS
|
||||
//#define RGBLED_NUM 12
|
||||
|
@ -4,7 +4,7 @@ extern keymap_config_t keymap_config;
|
||||
|
||||
#define _QWERTY 0
|
||||
#define _COLEMAK 1
|
||||
#define _DVORAK 2
|
||||
#define _GAME 2
|
||||
#define _NUMB 3
|
||||
#define _CODE 4
|
||||
#define _SYS 5
|
||||
@ -14,7 +14,7 @@ extern keymap_config_t keymap_config;
|
||||
enum custom_keycodes {
|
||||
QWERTY = SAFE_RANGE,
|
||||
COLEMAK,
|
||||
DVORAK,
|
||||
GAME,
|
||||
NUMB,
|
||||
CODE,
|
||||
SYS,
|
||||
@ -25,13 +25,9 @@ enum custom_keycodes {
|
||||
#define KC_ KC_TRNS
|
||||
#define _______ KC_TRNS
|
||||
|
||||
#define KC_CAPW LGUI(LSFT(KC_3)) // Capture whole screen
|
||||
#define KC_CPYW LGUI(LSFT(LCTL(KC_3))) // Copy whole screen
|
||||
#define KC_CAPP LGUI(LSFT(KC_4)) // Capture portion of screen
|
||||
#define KC_CPYP LGUI(LSFT(LCTL(KC_4))) // Copy portion of screen
|
||||
#define KC_X1 CODE
|
||||
#define KC_X2 NUMB
|
||||
#define KC_X3 SYS
|
||||
#define KC_X3 MO(_SYS)
|
||||
#define KC_X4 MT(MOD_LSFT, KC_ENT)
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
@ -60,25 +56,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
//`----+----+----+----+----+----' `----+----+----+----+----+----'
|
||||
),
|
||||
|
||||
[_DVORAK] = LAYOUT_kc(
|
||||
[_GAME] = LAYOUT_kc(
|
||||
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
|
||||
TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,MINS,
|
||||
TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS,
|
||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||
BSPC, A , O , E , U , I , D , H , T , N , S ,SLSH,
|
||||
ESC , A , S , D , F , G , H , J , K , L ,SCLN,QUOT,
|
||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||
LSFT,SCLN, Q , J , K , X , B , M , W , V , Z , X4 ,
|
||||
LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, X4 ,
|
||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||
X3 ,LCTL,LALT,LGUI, X1 ,LALT, SPC , X2 ,LEFT,DOWN, UP ,RGHT
|
||||
X3 ,LCTL,LALT,LGUI, X2 , SPC, SPC , X1 ,LEFT,DOWN, UP ,RGHT
|
||||
//`----+----+----+----+----+----' `----+----+----+----+----+----'
|
||||
),
|
||||
|
||||
[_NUMB] = LAYOUT_kc(
|
||||
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
|
||||
TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,PMNS,
|
||||
TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, DEL,
|
||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||
GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,UNDS,
|
||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||
, ,MPRV,MPLY,MNXT, , ,VOLD,VOLU,MUTE, , ,
|
||||
, ,MPRV,MNXT,MPLY, , ,VOLD,VOLU,MUTE, , ,
|
||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||
, , , , ,LALT, , , , , ,
|
||||
//`----+----+----+----+----+----' `----+----+----+----+----+----'
|
||||
@ -90,7 +86,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
//|----+------+----+----+----+----| |----+----+----+----+----+----|
|
||||
CAPS,SELECT,LEFT,DOWN,RGHT,DEL , PGDN, END,LBRC,RBRC,MINS,UNDS,
|
||||
//|----+------+----+----+----+----| |----+----+----+----+----+----|
|
||||
, UNDO ,CUT ,COPY,PASTE, , LEFT,RGHT,LCBR,RCBR,PLUS,PEQL,
|
||||
LSFT, UNDO ,CUT ,COPY,PASTE, , LEFT,RGHT,LCBR,RCBR,PLUS,PEQL,
|
||||
//|----+------+----+----+----+----| |----+----+----+----+----+----|
|
||||
, , , , ,LALT, , , , , ,
|
||||
//`----+------+----+----+----+----' `----+----+----+----+----+----'
|
||||
@ -98,9 +94,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[_SYS] = LAYOUT_kc(
|
||||
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
|
||||
F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,
|
||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||
, , , , , , , , , , , ,
|
||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||
F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,
|
||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||
, , , , , , , , , , , ,
|
||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||
@ -121,7 +117,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
*/
|
||||
[_ADJUST] = LAYOUT_ortho_4x12( \
|
||||
_______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, \
|
||||
_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \
|
||||
_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, GAME , _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||
)
|
||||
@ -129,43 +125,23 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
};
|
||||
|
||||
#ifdef AUDIO_ENABLE
|
||||
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
|
||||
float tone_dvorak[][2] = SONG(DVORAK_SOUND);
|
||||
float tone_colemak[][2] = SONG(COLEMAK_SOUND);
|
||||
#endif
|
||||
|
||||
void persistent_default_layer_set(uint16_t default_layer) {
|
||||
eeconfig_update_default_layer(default_layer);
|
||||
default_layer_set(default_layer);
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case QWERTY:
|
||||
if (record->event.pressed) {
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_SONG(tone_qwerty);
|
||||
#endif
|
||||
persistent_default_layer_set(1UL<<_QWERTY);
|
||||
set_single_persistent_default_layer(_QWERTY);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case COLEMAK:
|
||||
if (record->event.pressed) {
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_SONG(tone_colemak);
|
||||
#endif
|
||||
persistent_default_layer_set(1UL<<_COLEMAK);
|
||||
set_single_persistent_default_layer(_COLEMAK);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case DVORAK:
|
||||
case GAME:
|
||||
if (record->event.pressed) {
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_SONG(tone_dvorak);
|
||||
#endif
|
||||
persistent_default_layer_set(1UL<<_DVORAK);
|
||||
set_single_persistent_default_layer(_GAME);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
|
35
keyboards/levinson/keymaps/xtonhasvim/config.h
Normal file
35
keyboards/levinson/keymaps/xtonhasvim/config.h
Normal file
@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#define USE_SERIAL
|
||||
|
||||
// #define MUSIC_MASK (keycode != KC_NO)
|
||||
|
||||
/*
|
||||
* MIDI options
|
||||
*/
|
||||
|
||||
/* Prevent use of disabled MIDI features in the keymap */
|
||||
//#define MIDI_ENABLE_STRICT 1
|
||||
|
||||
/* enable basic MIDI features:
|
||||
- MIDI notes can be sent when in Music mode is on
|
||||
*/
|
||||
|
||||
// #define MIDI_BASIC
|
||||
|
||||
/* enable advanced MIDI features:
|
||||
- MIDI notes can be added to the keymap
|
||||
- Octave shift and transpose
|
||||
- Virtual sustain, portamento, and modulation wheel
|
||||
- etc.
|
||||
*/
|
||||
//#define MIDI_ADVANCED
|
||||
|
||||
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
|
||||
//#define MIDI_TONE_KEYCODE_OCTAVES 2
|
||||
|
||||
// help for fast typist+dual function keys?
|
||||
#define PERMISSIVE_HOLD
|
||||
|
||||
// where is the cord plugged in?
|
||||
#define MASTER_LEFT
|
237
keyboards/levinson/keymaps/xtonhasvim/keymap.c
Normal file
237
keyboards/levinson/keymaps/xtonhasvim/keymap.c
Normal file
@ -0,0 +1,237 @@
|
||||
/* Copyright 2015-2017 Christon DeWan
|
||||
*
|
||||
* 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 QMK_KEYBOARD_H
|
||||
#include "xtonhasvim.h"
|
||||
#include "fancylighting.h"
|
||||
|
||||
/************************************
|
||||
* states
|
||||
************************************/
|
||||
|
||||
enum layers {
|
||||
_QWERTY,
|
||||
_LOWER,
|
||||
_RAISE,
|
||||
_ADJUST,
|
||||
_MOVE,
|
||||
_MOUSE,
|
||||
_CMD
|
||||
};
|
||||
|
||||
extern uint8_t vim_cmd_layer(void) { return _CMD; }
|
||||
|
||||
/************************************
|
||||
* keymaps!
|
||||
************************************/
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/* Qwerty
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Ctrl*| A* | S | D | F | G | H | J | K | L | ;* | ' |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | chkwm| | Alt | GUI |Lower*| Sp|ace |Raise*| SPC | GUI | | Vim |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*
|
||||
* - Ctrl acts as Esc when tapped.
|
||||
* - Holding A or ; switches to movement layer.
|
||||
* - Raise and Lower are one-shot layers.
|
||||
*/
|
||||
[_QWERTY] = LAYOUT_ortho_4x12( \
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
|
||||
LCTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(_MOVE,KC_SCLN), KC_QUOT, \
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_ENT) , \
|
||||
LSFT(KC_LALT), MO(_MOVE), KC_LALT, KC_LGUI, MO(_LOWER), KC_SPC, KC_SPC, MO(_RAISE), KC_RGUI, KC_RALT, MO(_MOVE), VIM_START \
|
||||
),
|
||||
|
||||
/* Lower
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | ~ | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | Bksp |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | | |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | | F7 | F8 | F9 | F10 | F11 | F12 | | Next | Vol- | Vol+ | Play |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | Bail | | | | | |Raise | | | Bail | |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_LOWER] = LAYOUT_ortho_4x12( \
|
||||
KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_BSPC, \
|
||||
KC_DEL, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, \
|
||||
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, X_____X, X_____X, X_____X, X_____X, FIREY_RETURN, \
|
||||
RESET, TO(_QWERTY), _______, _______, _______, _______, _______, MO(_RAISE), _______, _______, TO(_QWERTY), X_____X \
|
||||
),
|
||||
|
||||
/* Raise
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | ` | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | Bksp |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Del | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \ |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | | F7 | F8 | F9 | F10 | F11 | F12 | | Next | Vol- | Vol+ | Play |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | Bail | | |Lower | | | | | | Bail | |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_RAISE] = LAYOUT_ortho_4x12( \
|
||||
KC_GRV, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSPC, \
|
||||
KC_DEL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, \
|
||||
_______, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, FIREY_RETURN, \
|
||||
X_____X, TO(_QWERTY), _______, _______, MO(_LOWER), _______, _______, _______, _______, _______, TO(_QWERTY), RESET \
|
||||
),
|
||||
|
||||
|
||||
/* Adjust (Lower + Raise)
|
||||
* ,-------------------------------------------------------------------------------------.
|
||||
* |BL Raise| | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* |BL Lower| | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* |BL STEP | | | | | | | Next | Vol- | Vol+ | Play | |
|
||||
* |--------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* |Backlite| Bail | | | | | | | | | Bail | |
|
||||
* `-------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_ADJUST] = LAYOUT_ortho_4x12( \
|
||||
BL_INC, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, RGB_MODE_PLAIN, \
|
||||
BL_DEC, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, RGB_MODE_REVERSE, \
|
||||
BL_STEP, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, RGB_MODE_FORWARD, \
|
||||
BL_TOGG, TO(_MOUSE), _______, _______, _______, _______, _______, _______, _______, _______, TO(_QWERTY), RGB_TOG \
|
||||
),
|
||||
|
||||
|
||||
/* movement layer (hold semicolon) */
|
||||
[_MOVE] = LAYOUT_ortho_4x12( \
|
||||
TO(_QWERTY), X_____X, X_____X, X_____X, X_____X, X_____X, KC_HOME, KC_PGDN, KC_PGUP, KC_END, X_____X, X_____X, \
|
||||
_______, X_____X, LGUI(KC_LBRC), LGUI(LSFT(KC_LBRC)), LGUI(LSFT(KC_RBRC)), LGUI(KC_RBRC), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, X_____X, \
|
||||
_______, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, _______, \
|
||||
_______, _______, _______, _______, _______, X_____X, X_____X, _______, _______, _______, _______, X_____X \
|
||||
),
|
||||
|
||||
/* mouse layer
|
||||
*/
|
||||
[_MOUSE] = LAYOUT_ortho_4x12( \
|
||||
TO(_QWERTY), X_____X, X_____X, KC_MS_UP, X_____X, X_____X, KC_MS_WH_LEFT, KC_MS_WH_DOWN, KC_MS_WH_UP, KC_MS_WH_RIGHT, X_____X, X_____X, \
|
||||
_______, X_____X, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, X_____X, X_____X, KC_MS_BTN1, KC_MS_BTN2, KC_MS_BTN3, X_____X, X_____X, \
|
||||
_______, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, _______, \
|
||||
_______, TO(_QWERTY), _______, _______, _______, X_____X, X_____X, _______, _______, _______, TO(_QWERTY), X_____X \
|
||||
),
|
||||
|
||||
/* vim command layer.
|
||||
*/
|
||||
[_CMD] = LAYOUT_ortho_4x12( \
|
||||
X_____X, X_____X, VIM_W, VIM_E, X_____X, X_____X, VIM_Y, VIM_U, VIM_I, VIM_O, VIM_P, X_____X, \
|
||||
VIM_ESC, VIM_A, VIM_S, VIM_D, X_____X, VIM_G, VIM_H, VIM_J, VIM_K, VIM_L, X_____X, X_____X, \
|
||||
VIM_SHIFT, X_____X, VIM_X, VIM_C, VIM_V, VIM_B, X_____X, X_____X, VIM_COMMA, VIM_PERIOD, X_____X, VIM_SHIFT, \
|
||||
_______, TO(_QWERTY), _______, _______, X_____X, X_____X, X_____X, X_____X, _______, _______, TO(_QWERTY), X_____X \
|
||||
)
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
#define C_RED 0xFF, 0x00, 0x00
|
||||
#define C_GRN 0x00, 0xFF, 0x00
|
||||
#define C_BLU 0x00, 0x00, 0xFF
|
||||
|
||||
#define C_YAN 0x00, 0xFF, 0xFF
|
||||
#define C_PRP 0x7A, 0x00, 0xFF
|
||||
#define C_ORG 0xFF, 0x93, 0x00
|
||||
|
||||
void rgbflag(uint8_t r, uint8_t g, uint8_t b, uint8_t rr, uint8_t gg, uint8_t bb) {
|
||||
LED_TYPE *target_led = user_rgb_mode ? shadowed_led : led;
|
||||
for (int i = 0; i < RGBLED_NUM; i++) {
|
||||
switch (i) {
|
||||
case 10: case 11:
|
||||
target_led[i].r = r;
|
||||
target_led[i].g = g;
|
||||
target_led[i].b = b;
|
||||
break;
|
||||
case 0: case 1:
|
||||
target_led[i].r = rr;
|
||||
target_led[i].g = gg;
|
||||
target_led[i].b = bb;
|
||||
break;
|
||||
default:
|
||||
target_led[i].r = 0;
|
||||
target_led[i].g = 0;
|
||||
target_led[i].b = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
rgblight_set();
|
||||
}
|
||||
|
||||
void set_state_leds(void) {
|
||||
if (rgblight_get_mode() == 1) {
|
||||
switch (biton32(layer_state)) {
|
||||
case _RAISE:
|
||||
rgbflag(C_BLU, C_GRN);
|
||||
break;
|
||||
case _LOWER:
|
||||
rgbflag(C_BLU, C_RED);
|
||||
break;
|
||||
case _ADJUST:
|
||||
rgbflag(C_BLU, C_PRP);
|
||||
break;
|
||||
case _MOVE:
|
||||
rgbflag(C_RED, C_PRP);
|
||||
break;
|
||||
case _MOUSE:
|
||||
rgbflag(C_RED, C_GRN);
|
||||
break;
|
||||
case _CMD:
|
||||
switch(vstate) {
|
||||
case VIM_V:
|
||||
case VIM_VI:
|
||||
case VIM_VS:
|
||||
rgbflag(C_GRN, C_YAN);
|
||||
break;
|
||||
case VIM_C:
|
||||
case VIM_CI:
|
||||
rgbflag(C_GRN, C_ORG);
|
||||
break;
|
||||
case VIM_D:
|
||||
case VIM_DI:
|
||||
rgbflag(C_GRN, C_RED);
|
||||
break;
|
||||
case VIM_G:
|
||||
rgbflag(C_GRN, C_BLU);
|
||||
break;
|
||||
case VIM_Y:
|
||||
rgbflag(C_GRN, C_PRP);
|
||||
break;
|
||||
case VIM_START:
|
||||
default:
|
||||
rgbflag(C_GRN, C_GRN);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default: // for any other layers, or the default layer
|
||||
rgbflag(C_YAN, C_YAN);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
return update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST);
|
||||
}
|
9
keyboards/levinson/keymaps/xtonhasvim/readme.md
Normal file
9
keyboards/levinson/keymaps/xtonhasvim/readme.md
Normal file
@ -0,0 +1,9 @@
|
||||
# Xton has a tiny keyboard! With Vim!
|
||||
|
||||
Based on the standard Planck layout with a few changes:
|
||||
|
||||
* Escape moved to dual-function with control.
|
||||
* Dedicated movement and mouse layers.
|
||||
* Top and middle row swapped in `_RAISE` and `_LOWER` because I never use F-keys.
|
||||
* Vim layers! See `users/xtonhasvim`.
|
||||
|
5
keyboards/levinson/keymaps/xtonhasvim/rules.mk
Normal file
5
keyboards/levinson/keymaps/xtonhasvim/rules.mk
Normal file
@ -0,0 +1,5 @@
|
||||
# MOUSEKEY_ENABLE = yes
|
||||
# BACKLIGHT_ENABLE = yes
|
||||
# AUDIO_ENABLE = no
|
||||
|
||||
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
|
@ -19,6 +19,7 @@ enum alt_keycodes {
|
||||
DBG_MTRX, //DEBUG Toggle Matrix Prints
|
||||
DBG_KBD, //DEBUG Toggle Keyboard Prints
|
||||
DBG_MOU, //DEBUG Toggle Mouse Prints
|
||||
MD_BOOT, //Restart into bootloader after hold timeout
|
||||
};
|
||||
|
||||
#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode
|
||||
@ -37,7 +38,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_MUTE, \
|
||||
L_T_BR, L_PSD, L_BRI, L_PSI, KC_TRNS, KC_TRNS, KC_TRNS, U_T_AUTO,U_T_AGCR,KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, \
|
||||
L_T_PTD, L_PTP, L_BRD, L_PTN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, \
|
||||
KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, KC_TRNS, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_VOLD, \
|
||||
KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, MD_BOOT, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_VOLD, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END \
|
||||
),
|
||||
/*
|
||||
@ -68,6 +69,8 @@ void matrix_scan_user(void) {
|
||||
#define MODS_ALT (keyboard_report->mods & MOD_BIT(KC_LALT) || keyboard_report->mods & MOD_BIT(KC_RALT))
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
static uint32_t key_timer;
|
||||
|
||||
switch (keycode) {
|
||||
case L_BRI:
|
||||
if (record->event.pressed) {
|
||||
@ -194,6 +197,15 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
CDC_print("\r\n");
|
||||
}
|
||||
return false;
|
||||
case MD_BOOT:
|
||||
if (record->event.pressed) {
|
||||
key_timer = timer_read32();
|
||||
} else {
|
||||
if (timer_elapsed32(key_timer) >= 500) {
|
||||
reset_keyboard();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
default:
|
||||
return true; //Process all other keycodes normally
|
||||
}
|
||||
|
212
keyboards/massdrop/alt/keymaps/mac/keymap.c
Normal file
212
keyboards/massdrop/alt/keymaps/mac/keymap.c
Normal file
@ -0,0 +1,212 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
enum alt_keycodes {
|
||||
L_BRI = SAFE_RANGE, //LED Brightness Increase
|
||||
L_BRD, //LED Brightness Decrease
|
||||
L_PTN, //LED Pattern Select Next
|
||||
L_PTP, //LED Pattern Select Previous
|
||||
L_PSI, //LED Pattern Speed Increase
|
||||
L_PSD, //LED Pattern Speed Decrease
|
||||
L_T_MD, //LED Toggle Mode
|
||||
L_T_ONF, //LED Toggle On / Off
|
||||
L_ON, //LED On
|
||||
L_OFF, //LED Off
|
||||
L_T_BR, //LED Toggle Breath Effect
|
||||
L_T_PTD, //LED Toggle Scrolling Pattern Direction
|
||||
U_T_AUTO, //USB Extra Port Toggle Auto Detect / Always Active
|
||||
U_T_AGCR, //USB Toggle Automatic GCR control
|
||||
DBG_TOG, //DEBUG Toggle On / Off
|
||||
DBG_MTRX, //DEBUG Toggle Matrix Prints
|
||||
DBG_KBD, //DEBUG Toggle Keyboard Prints
|
||||
DBG_MOU, //DEBUG Toggle Mouse Prints
|
||||
MD_BOOT, //Restart into bootloader after hold timeout
|
||||
};
|
||||
|
||||
#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode
|
||||
|
||||
keymap_config_t keymap_config;
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = LAYOUT(
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_HOME, \
|
||||
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \
|
||||
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(1), KC_LEFT, KC_DOWN, KC_RGHT \
|
||||
),
|
||||
[1] = LAYOUT(
|
||||
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_MUTE, \
|
||||
L_T_BR, L_PSD, L_BRI, L_PSI, KC_TRNS, KC_TRNS, KC_TRNS, U_T_AUTO,U_T_AGCR,KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, \
|
||||
L_T_PTD, L_PTP, L_BRD, L_PTN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, \
|
||||
KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, MD_BOOT, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_VOLD, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END \
|
||||
),
|
||||
/*
|
||||
[X] = LAYOUT(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \
|
||||
),
|
||||
*/
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
|
||||
};
|
||||
|
||||
// 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) {
|
||||
};
|
||||
|
||||
#define MODS_SHIFT (keyboard_report->mods & MOD_BIT(KC_LSHIFT) || keyboard_report->mods & MOD_BIT(KC_RSHIFT))
|
||||
#define MODS_CTRL (keyboard_report->mods & MOD_BIT(KC_LCTL) || keyboard_report->mods & MOD_BIT(KC_RCTRL))
|
||||
#define MODS_ALT (keyboard_report->mods & MOD_BIT(KC_LALT) || keyboard_report->mods & MOD_BIT(KC_RALT))
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
static uint32_t key_timer;
|
||||
|
||||
switch (keycode) {
|
||||
case L_BRI:
|
||||
if (record->event.pressed) {
|
||||
if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX;
|
||||
else gcr_desired += LED_GCR_STEP;
|
||||
if (led_animation_breathing) gcr_breathe = gcr_desired;
|
||||
}
|
||||
return false;
|
||||
case L_BRD:
|
||||
if (record->event.pressed) {
|
||||
if (LED_GCR_STEP > gcr_desired) gcr_desired = 0;
|
||||
else gcr_desired -= LED_GCR_STEP;
|
||||
if (led_animation_breathing) gcr_breathe = gcr_desired;
|
||||
}
|
||||
return false;
|
||||
case L_PTN:
|
||||
if (record->event.pressed) {
|
||||
if (led_animation_id == led_setups_count - 1) led_animation_id = 0;
|
||||
else led_animation_id++;
|
||||
}
|
||||
return false;
|
||||
case L_PTP:
|
||||
if (record->event.pressed) {
|
||||
if (led_animation_id == 0) led_animation_id = led_setups_count - 1;
|
||||
else led_animation_id--;
|
||||
}
|
||||
return false;
|
||||
case L_PSI:
|
||||
if (record->event.pressed) {
|
||||
led_animation_speed += ANIMATION_SPEED_STEP;
|
||||
}
|
||||
return false;
|
||||
case L_PSD:
|
||||
if (record->event.pressed) {
|
||||
led_animation_speed -= ANIMATION_SPEED_STEP;
|
||||
if (led_animation_speed < 0) led_animation_speed = 0;
|
||||
}
|
||||
return false;
|
||||
case L_T_MD:
|
||||
if (record->event.pressed) {
|
||||
led_lighting_mode++;
|
||||
if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL;
|
||||
}
|
||||
return false;
|
||||
case L_T_ONF:
|
||||
if (record->event.pressed) {
|
||||
led_enabled = !led_enabled;
|
||||
I2C3733_Control_Set(led_enabled);
|
||||
}
|
||||
return false;
|
||||
case L_ON:
|
||||
if (record->event.pressed) {
|
||||
led_enabled = 1;
|
||||
I2C3733_Control_Set(led_enabled);
|
||||
}
|
||||
return false;
|
||||
case L_OFF:
|
||||
if (record->event.pressed) {
|
||||
led_enabled = 0;
|
||||
I2C3733_Control_Set(led_enabled);
|
||||
}
|
||||
return false;
|
||||
case L_T_BR:
|
||||
if (record->event.pressed) {
|
||||
led_animation_breathing = !led_animation_breathing;
|
||||
if (led_animation_breathing)
|
||||
{
|
||||
gcr_breathe = gcr_desired;
|
||||
led_animation_breathe_cur = BREATHE_MIN_STEP;
|
||||
breathe_dir = 1;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
case L_T_PTD:
|
||||
if (record->event.pressed) {
|
||||
led_animation_direction = !led_animation_direction;
|
||||
}
|
||||
return false;
|
||||
case U_T_AUTO:
|
||||
if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
|
||||
usb_extra_manual = !usb_extra_manual;
|
||||
CDC_print("USB extra port manual mode ");
|
||||
CDC_print(usb_extra_manual ? "enabled" : "disabled");
|
||||
CDC_print("\r\n");
|
||||
}
|
||||
return false;
|
||||
case U_T_AGCR:
|
||||
if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
|
||||
usb_gcr_auto = !usb_gcr_auto;
|
||||
CDC_print("USB GCR auto mode ");
|
||||
CDC_print(usb_gcr_auto ? "enabled" : "disabled");
|
||||
CDC_print("\r\n");
|
||||
}
|
||||
return false;
|
||||
case DBG_TOG:
|
||||
if (record->event.pressed) {
|
||||
debug_enable = !debug_enable;
|
||||
CDC_print("Debug mode ");
|
||||
CDC_print(debug_enable ? "enabled" : "disabled");
|
||||
CDC_print("\r\n");
|
||||
}
|
||||
return false;
|
||||
case DBG_MTRX:
|
||||
if (record->event.pressed) {
|
||||
debug_matrix = !debug_matrix;
|
||||
CDC_print("Debug matrix ");
|
||||
CDC_print(debug_matrix ? "enabled" : "disabled");
|
||||
CDC_print("\r\n");
|
||||
}
|
||||
return false;
|
||||
case DBG_KBD:
|
||||
if (record->event.pressed) {
|
||||
debug_keyboard = !debug_keyboard;
|
||||
CDC_print("Debug keyboard ");
|
||||
CDC_print(debug_keyboard ? "enabled" : "disabled");
|
||||
CDC_print("\r\n");
|
||||
}
|
||||
return false;
|
||||
case DBG_MOU:
|
||||
if (record->event.pressed) {
|
||||
debug_mouse = !debug_mouse;
|
||||
CDC_print("Debug mouse ");
|
||||
CDC_print(debug_mouse ? "enabled" : "disabled");
|
||||
CDC_print("\r\n");
|
||||
}
|
||||
return false;
|
||||
case MD_BOOT:
|
||||
if (record->event.pressed) {
|
||||
key_timer = timer_read32();
|
||||
} else {
|
||||
if (timer_elapsed32(key_timer) >= 500) {
|
||||
reset_keyboard();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
default:
|
||||
return true; //Process all other keycodes normally
|
||||
}
|
||||
}
|
@ -66,85 +66,85 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
{ .id = 6, .x = 4.875, .y = 0, .adr = { .drv = 2, .cs = 7, .swr = 5, .swg = 4, .swb = 6 }, .scan = 5 }, \
|
||||
{ .id = 7, .x = 5.625, .y = 0, .adr = { .drv = 2, .cs = 8, .swr = 5, .swg = 4, .swb = 6 }, .scan = 6 }, \
|
||||
{ .id = 8, .x = 6.375, .y = 0, .adr = { .drv = 1, .cs = 1, .swr = 5, .swg = 4, .swb = 6 }, .scan = 7 }, \
|
||||
{ .id = 9, .x = 7.125, .y = 0, .adr = { .drv = 1, .cs = 2, .swr = 5, .swg = 4, .swb = 6 }, .scan = 90 }, \
|
||||
{ .id = 10, .x = 8.25, .y = 0, .adr = { .drv = 1, .cs = 3, .swr = 5, .swg = 4, .swb = 6 }, .scan = 91 }, \
|
||||
{ .id = 11, .x = 9, .y = 0, .adr = { .drv = 1, .cs = 4, .swr = 5, .swg = 4, .swb = 6 }, .scan = 92 }, \
|
||||
{ .id = 12, .x = 9.75, .y = 0, .adr = { .drv = 1, .cs = 5, .swr = 5, .swg = 4, .swb = 6 }, .scan = 93 }, \
|
||||
{ .id = 13, .x = 10.5, .y = 0, .adr = { .drv = 1, .cs = 6, .swr = 5, .swg = 4, .swb = 6 }, .scan = 94 }, \
|
||||
{ .id = 14, .x = 11.625, .y = 0, .adr = { .drv = 1, .cs = 7, .swr = 5, .swg = 4, .swb = 6 }, .scan = 95 }, \
|
||||
{ .id = 15, .x = 12.375, .y = 0, .adr = { .drv = 1, .cs = 8, .swr = 5, .swg = 4, .swb = 6 }, .scan = 96 }, \
|
||||
{ .id = 16, .x = 13.125, .y = 0, .adr = { .drv = 1, .cs = 9, .swr = 5, .swg = 4, .swb = 6 }, .scan = 97 }, \
|
||||
{ .id = 17, .x = 0, .y = -1.125, .adr = { .drv = 2, .cs = 1, .swr = 8, .swg = 7, .swb = 9 }, .scan = 15 }, \
|
||||
{ .id = 18, .x = 0.75, .y = -1.125, .adr = { .drv = 2, .cs = 2, .swr = 8, .swg = 7, .swb = 9 }, .scan = 16 }, \
|
||||
{ .id = 19, .x = 1.5, .y = -1.125, .adr = { .drv = 2, .cs = 3, .swr = 8, .swg = 7, .swb = 9 }, .scan = 17 }, \
|
||||
{ .id = 20, .x = 2.25, .y = -1.125, .adr = { .drv = 2, .cs = 4, .swr = 8, .swg = 7, .swb = 9 }, .scan = 18 }, \
|
||||
{ .id = 21, .x = 3, .y = -1.125, .adr = { .drv = 2, .cs = 5, .swr = 8, .swg = 7, .swb = 9 }, .scan = 19 }, \
|
||||
{ .id = 22, .x = 3.75, .y = -1.125, .adr = { .drv = 2, .cs = 6, .swr = 8, .swg = 7, .swb = 9 }, .scan = 20 }, \
|
||||
{ .id = 23, .x = 4.5, .y = -1.125, .adr = { .drv = 2, .cs = 7, .swr = 8, .swg = 7, .swb = 9 }, .scan = 21 }, \
|
||||
{ .id = 24, .x = 5.25, .y = -1.125, .adr = { .drv = 2, .cs = 8, .swr = 8, .swg = 7, .swb = 9 }, .scan = 22 }, \
|
||||
{ .id = 25, .x = 6, .y = -1.125, .adr = { .drv = 1, .cs = 1, .swr = 8, .swg = 7, .swb = 9 }, .scan = 105 }, \
|
||||
{ .id = 26, .x = 6.75, .y = -1.125, .adr = { .drv = 1, .cs = 2, .swr = 8, .swg = 7, .swb = 9 }, .scan = 106 }, \
|
||||
{ .id = 27, .x = 7.5, .y = -1.125, .adr = { .drv = 1, .cs = 3, .swr = 8, .swg = 7, .swb = 9 }, .scan = 107 }, \
|
||||
{ .id = 28, .x = 8.25, .y = -1.125, .adr = { .drv = 1, .cs = 4, .swr = 8, .swg = 7, .swb = 9 }, .scan = 108 }, \
|
||||
{ .id = 29, .x = 9, .y = -1.125, .adr = { .drv = 1, .cs = 5, .swr = 8, .swg = 7, .swb = 9 }, .scan = 109 }, \
|
||||
{ .id = 30, .x = 10.125, .y = -1.125, .adr = { .drv = 1, .cs = 6, .swr = 8, .swg = 7, .swb = 9 }, .scan = 110 }, \
|
||||
{ .id = 31, .x = 11.625, .y = -1.125, .adr = { .drv = 1, .cs = 7, .swr = 8, .swg = 7, .swb = 9 }, .scan = 111 }, \
|
||||
{ .id = 32, .x = 12.375, .y = -1.125, .adr = { .drv = 1, .cs = 8, .swr = 8, .swg = 7, .swb = 9 }, .scan = 112 }, \
|
||||
{ .id = 33, .x = 13.125, .y = -1.125, .adr = { .drv = 1, .cs = 9, .swr = 8, .swg = 7, .swb = 9 }, .scan = 142 }, \
|
||||
{ .id = 34, .x = 0.188, .y = -1.875, .adr = { .drv = 2, .cs = 1, .swr = 11, .swg = 10, .swb = 12 }, .scan = 30 }, \
|
||||
{ .id = 35, .x = 1.125, .y = -1.875, .adr = { .drv = 2, .cs = 2, .swr = 11, .swg = 10, .swb = 12 }, .scan = 31 }, \
|
||||
{ .id = 36, .x = 1.875, .y = -1.875, .adr = { .drv = 2, .cs = 3, .swr = 11, .swg = 10, .swb = 12 }, .scan = 32 }, \
|
||||
{ .id = 37, .x = 2.625, .y = -1.875, .adr = { .drv = 2, .cs = 4, .swr = 11, .swg = 10, .swb = 12 }, .scan = 33 }, \
|
||||
{ .id = 38, .x = 3.375, .y = -1.875, .adr = { .drv = 2, .cs = 5, .swr = 11, .swg = 10, .swb = 12 }, .scan = 34 }, \
|
||||
{ .id = 39, .x = 4.125, .y = -1.875, .adr = { .drv = 2, .cs = 6, .swr = 11, .swg = 10, .swb = 12 }, .scan = 35 }, \
|
||||
{ .id = 40, .x = 4.875, .y = -1.875, .adr = { .drv = 2, .cs = 7, .swr = 11, .swg = 10, .swb = 12 }, .scan = 36 }, \
|
||||
{ .id = 41, .x = 5.625, .y = -1.875, .adr = { .drv = 2, .cs = 8, .swr = 11, .swg = 10, .swb = 12 }, .scan = 37 }, \
|
||||
{ .id = 42, .x = 6.375, .y = -1.875, .adr = { .drv = 1, .cs = 1, .swr = 11, .swg = 10, .swb = 12 }, .scan = 120 }, \
|
||||
{ .id = 43, .x = 7.125, .y = -1.875, .adr = { .drv = 1, .cs = 2, .swr = 11, .swg = 10, .swb = 12 }, .scan = 121 }, \
|
||||
{ .id = 44, .x = 7.875, .y = -1.875, .adr = { .drv = 1, .cs = 3, .swr = 11, .swg = 10, .swb = 12 }, .scan = 122 }, \
|
||||
{ .id = 45, .x = 8.625, .y = -1.875, .adr = { .drv = 1, .cs = 4, .swr = 11, .swg = 10, .swb = 12 }, .scan = 123 }, \
|
||||
{ .id = 46, .x = 9.375, .y = -1.875, .adr = { .drv = 1, .cs = 5, .swr = 11, .swg = 10, .swb = 12 }, .scan = 124 }, \
|
||||
{ .id = 47, .x = 10.312, .y = -1.875, .adr = { .drv = 1, .cs = 6, .swr = 11, .swg = 10, .swb = 12 }, .scan = 125 }, \
|
||||
{ .id = 48, .x = 11.625, .y = -1.875, .adr = { .drv = 1, .cs = 7, .swr = 11, .swg = 10, .swb = 12 }, .scan = 126 }, \
|
||||
{ .id = 49, .x = 12.375, .y = -1.875, .adr = { .drv = 1, .cs = 8, .swr = 11, .swg = 10, .swb = 12 }, .scan = 127 }, \
|
||||
{ .id = 50, .x = 13.125, .y = -1.875, .adr = { .drv = 1, .cs = 9, .swr = 11, .swg = 10, .swb = 12 }, .scan = 141 }, \
|
||||
{ .id = 51, .x = 0.281, .y = -2.625, .adr = { .drv = 2, .cs = 1, .swr = 5, .swg = 4, .swb = 6 }, .scan = 45 }, \
|
||||
{ .id = 52, .x = 1.313, .y = -2.625, .adr = { .drv = 2, .cs = 2, .swr = 5, .swg = 4, .swb = 6 }, .scan = 46 }, \
|
||||
{ .id = 53, .x = 2.063, .y = -2.625, .adr = { .drv = 2, .cs = 13, .swr = 11, .swg = 10, .swb = 12 }, .scan = 47 }, \
|
||||
{ .id = 54, .x = 2.812, .y = -2.625, .adr = { .drv = 2, .cs = 12, .swr = 11, .swg = 10, .swb = 12 }, .scan = 48 }, \
|
||||
{ .id = 55, .x = 3.562, .y = -2.625, .adr = { .drv = 2, .cs = 11, .swr = 11, .swg = 10, .swb = 12 }, .scan = 49 }, \
|
||||
{ .id = 56, .x = 4.312, .y = -2.625, .adr = { .drv = 2, .cs = 6, .swr = 5, .swg = 4, .swb = 6 }, .scan = 50 }, \
|
||||
{ .id = 57, .x = 5.062, .y = -2.625, .adr = { .drv = 2, .cs = 10, .swr = 11, .swg = 10, .swb = 12 }, .scan = 51 }, \
|
||||
{ .id = 58, .x = 5.812, .y = -2.625, .adr = { .drv = 2, .cs = 9, .swr = 11, .swg = 10, .swb = 12 }, .scan = 52 }, \
|
||||
{ .id = 59, .x = 6.562, .y = -2.625, .adr = { .drv = 1, .cs = 16, .swr = 11, .swg = 10, .swb = 12 }, .scan = 135 }, \
|
||||
{ .id = 60, .x = 7.312, .y = -2.625, .adr = { .drv = 1, .cs = 15, .swr = 11, .swg = 10, .swb = 12 }, .scan = 136 }, \
|
||||
{ .id = 61, .x = 8.062, .y = -2.625, .adr = { .drv = 1, .cs = 14, .swr = 11, .swg = 10, .swb = 12 }, .scan = 137 }, \
|
||||
{ .id = 62, .x = 8.812, .y = -2.625, .adr = { .drv = 1, .cs = 13, .swr = 11, .swg = 10, .swb = 12 }, .scan = 138 }, \
|
||||
{ .id = 63, .x = 10.031, .y = -2.625, .adr = { .drv = 1, .cs = 12, .swr = 11, .swg = 10, .swb = 12 }, .scan = 139 }, \
|
||||
{ .id = 64, .x = 0.469, .y = -3.375, .adr = { .drv = 2, .cs = 14, .swr = 5, .swg = 4, .swb = 6 }, .scan = 60 }, \
|
||||
{ .id = 65, .x = 1.688, .y = -3.375, .adr = { .drv = 2, .cs = 13, .swr = 5, .swg = 4, .swb = 6 }, .scan = 61 }, \
|
||||
{ .id = 66, .x = 2.438, .y = -3.375, .adr = { .drv = 2, .cs = 12, .swr = 8, .swg = 7, .swb = 9 }, .scan = 62 }, \
|
||||
{ .id = 67, .x = 3.188, .y = -3.375, .adr = { .drv = 2, .cs = 12, .swr = 5, .swg = 4, .swb = 6 }, .scan = 63 }, \
|
||||
{ .id = 68, .x = 3.938, .y = -3.375, .adr = { .drv = 2, .cs = 11, .swr = 5, .swg = 4, .swb = 6 }, .scan = 64 }, \
|
||||
{ .id = 69, .x = 4.688, .y = -3.375, .adr = { .drv = 2, .cs = 10, .swr = 5, .swg = 4, .swb = 6 }, .scan = 65 }, \
|
||||
{ .id = 70, .x = 5.438, .y = -3.375, .adr = { .drv = 2, .cs = 9, .swr = 5, .swg = 4, .swb = 6 }, .scan = 66 }, \
|
||||
{ .id = 71, .x = 6.188, .y = -3.375, .adr = { .drv = 2, .cs = 9, .swr = 8, .swg = 7, .swb = 9 }, .scan = 67 }, \
|
||||
{ .id = 72, .x = 6.938, .y = -3.375, .adr = { .drv = 1, .cs = 16, .swr = 8, .swg = 7, .swb = 9 }, .scan = 150 }, \
|
||||
{ .id = 73, .x = 7.688, .y = -3.375, .adr = { .drv = 1, .cs = 15, .swr = 8, .swg = 7, .swb = 9 }, .scan = 151 }, \
|
||||
{ .id = 74, .x = 8.438, .y = -3.375, .adr = { .drv = 1, .cs = 14, .swr = 8, .swg = 7, .swb = 9 }, .scan = 152 }, \
|
||||
{ .id = 75, .x = 9.844, .y = -3.375, .adr = { .drv = 1, .cs = 13, .swr = 8, .swg = 7, .swb = 9 }, .scan = 153 }, \
|
||||
{ .id = 76, .x = 12.375, .y = -3.375, .adr = { .drv = 1, .cs = 11, .swr = 8, .swg = 7, .swb = 9 }, .scan = 140 }, \
|
||||
{ .id = 77, .x = 0.094, .y = -4.125, .adr = { .drv = 2, .cs = 14, .swr = 11, .swg = 10, .swb = 12 }, .scan = 75 }, \
|
||||
{ .id = 78, .x = 1.031, .y = -4.125, .adr = { .drv = 2, .cs = 14, .swr = 8, .swg = 7, .swb = 9 }, .scan = 76 }, \
|
||||
{ .id = 79, .x = 1.969, .y = -4.125, .adr = { .drv = 2, .cs = 13, .swr = 8, .swg = 7, .swb = 9 }, .scan = 77 }, \
|
||||
{ .id = 80, .x = 4.781, .y = -4.125, .adr = { .drv = 2, .cs = 10, .swr = 8, .swg = 7, .swb = 9 }, .scan = 78 }, \
|
||||
{ .id = 81, .x = 7.594, .y = -4.125, .adr = { .drv = 1, .cs = 16, .swr = 5, .swg = 4, .swb = 6 }, .scan = 79 }, \
|
||||
{ .id = 82, .x = 8.531, .y = -4.125, .adr = { .drv = 1, .cs = 15, .swr = 5, .swg = 4, .swb = 6 }, .scan = 80 }, \
|
||||
{ .id = 83, .x = 9.469, .y = -4.125, .adr = { .drv = 1, .cs = 14, .swr = 5, .swg = 4, .swb = 6 }, .scan = 81 }, \
|
||||
{ .id = 84, .x = 10.406, .y = -4.125, .adr = { .drv = 1, .cs = 13, .swr = 5, .swg = 4, .swb = 6 }, .scan = 82 }, \
|
||||
{ .id = 85, .x = 11.625, .y = -4.125, .adr = { .drv = 1, .cs = 12, .swr = 8, .swg = 7, .swb = 9 }, .scan = 154 }, \
|
||||
{ .id = 86, .x = 12.375, .y = -4.125, .adr = { .drv = 1, .cs = 12, .swr = 5, .swg = 4, .swb = 6 }, .scan = 155 }, \
|
||||
{ .id = 87, .x = 13.125, .y = -4.125, .adr = { .drv = 1, .cs = 11, .swr = 5, .swg = 4, .swb = 6 }, .scan = 156 }, \
|
||||
{ .id = 9, .x = 7.125, .y = 0, .adr = { .drv = 1, .cs = 2, .swr = 5, .swg = 4, .swb = 6 }, .scan = 48 }, \
|
||||
{ .id = 10, .x = 8.25, .y = 0, .adr = { .drv = 1, .cs = 3, .swr = 5, .swg = 4, .swb = 6 }, .scan = 49 }, \
|
||||
{ .id = 11, .x = 9, .y = 0, .adr = { .drv = 1, .cs = 4, .swr = 5, .swg = 4, .swb = 6 }, .scan = 50 }, \
|
||||
{ .id = 12, .x = 9.75, .y = 0, .adr = { .drv = 1, .cs = 5, .swr = 5, .swg = 4, .swb = 6 }, .scan = 51 }, \
|
||||
{ .id = 13, .x = 10.5, .y = 0, .adr = { .drv = 1, .cs = 6, .swr = 5, .swg = 4, .swb = 6 }, .scan = 52 }, \
|
||||
{ .id = 14, .x = 11.625, .y = 0, .adr = { .drv = 1, .cs = 7, .swr = 5, .swg = 4, .swb = 6 }, .scan = 53 }, \
|
||||
{ .id = 15, .x = 12.375, .y = 0, .adr = { .drv = 1, .cs = 8, .swr = 5, .swg = 4, .swb = 6 }, .scan = 54 }, \
|
||||
{ .id = 16, .x = 13.125, .y = 0, .adr = { .drv = 1, .cs = 9, .swr = 5, .swg = 4, .swb = 6 }, .scan = 55 }, \
|
||||
{ .id = 17, .x = 0, .y = -1.125, .adr = { .drv = 2, .cs = 1, .swr = 8, .swg = 7, .swb = 9 }, .scan = 8 }, \
|
||||
{ .id = 18, .x = 0.75, .y = -1.125, .adr = { .drv = 2, .cs = 2, .swr = 8, .swg = 7, .swb = 9 }, .scan = 9 }, \
|
||||
{ .id = 19, .x = 1.5, .y = -1.125, .adr = { .drv = 2, .cs = 3, .swr = 8, .swg = 7, .swb = 9 }, .scan = 10 }, \
|
||||
{ .id = 20, .x = 2.25, .y = -1.125, .adr = { .drv = 2, .cs = 4, .swr = 8, .swg = 7, .swb = 9 }, .scan = 11 }, \
|
||||
{ .id = 21, .x = 3, .y = -1.125, .adr = { .drv = 2, .cs = 5, .swr = 8, .swg = 7, .swb = 9 }, .scan = 12 }, \
|
||||
{ .id = 22, .x = 3.75, .y = -1.125, .adr = { .drv = 2, .cs = 6, .swr = 8, .swg = 7, .swb = 9 }, .scan = 13 }, \
|
||||
{ .id = 23, .x = 4.5, .y = -1.125, .adr = { .drv = 2, .cs = 7, .swr = 8, .swg = 7, .swb = 9 }, .scan = 14 }, \
|
||||
{ .id = 24, .x = 5.25, .y = -1.125, .adr = { .drv = 2, .cs = 8, .swr = 8, .swg = 7, .swb = 9 }, .scan = 15 }, \
|
||||
{ .id = 25, .x = 6, .y = -1.125, .adr = { .drv = 1, .cs = 1, .swr = 8, .swg = 7, .swb = 9 }, .scan = 56 }, \
|
||||
{ .id = 26, .x = 6.75, .y = -1.125, .adr = { .drv = 1, .cs = 2, .swr = 8, .swg = 7, .swb = 9 }, .scan = 57 }, \
|
||||
{ .id = 27, .x = 7.5, .y = -1.125, .adr = { .drv = 1, .cs = 3, .swr = 8, .swg = 7, .swb = 9 }, .scan = 58 }, \
|
||||
{ .id = 28, .x = 8.25, .y = -1.125, .adr = { .drv = 1, .cs = 4, .swr = 8, .swg = 7, .swb = 9 }, .scan = 59 }, \
|
||||
{ .id = 29, .x = 9, .y = -1.125, .adr = { .drv = 1, .cs = 5, .swr = 8, .swg = 7, .swb = 9 }, .scan = 60 }, \
|
||||
{ .id = 30, .x = 10.125, .y = -1.125, .adr = { .drv = 1, .cs = 6, .swr = 8, .swg = 7, .swb = 9 }, .scan = 61 }, \
|
||||
{ .id = 31, .x = 11.625, .y = -1.125, .adr = { .drv = 1, .cs = 7, .swr = 8, .swg = 7, .swb = 9 }, .scan = 62 }, \
|
||||
{ .id = 32, .x = 12.375, .y = -1.125, .adr = { .drv = 1, .cs = 8, .swr = 8, .swg = 7, .swb = 9 }, .scan = 63 }, \
|
||||
{ .id = 33, .x = 13.125, .y = -1.125, .adr = { .drv = 1, .cs = 9, .swr = 8, .swg = 7, .swb = 9 }, .scan = 79 }, \
|
||||
{ .id = 34, .x = 0.188, .y = -1.875, .adr = { .drv = 2, .cs = 1, .swr = 11, .swg = 10, .swb = 12 }, .scan = 16 }, \
|
||||
{ .id = 35, .x = 1.125, .y = -1.875, .adr = { .drv = 2, .cs = 2, .swr = 11, .swg = 10, .swb = 12 }, .scan = 17 }, \
|
||||
{ .id = 36, .x = 1.875, .y = -1.875, .adr = { .drv = 2, .cs = 3, .swr = 11, .swg = 10, .swb = 12 }, .scan = 18 }, \
|
||||
{ .id = 37, .x = 2.625, .y = -1.875, .adr = { .drv = 2, .cs = 4, .swr = 11, .swg = 10, .swb = 12 }, .scan = 19 }, \
|
||||
{ .id = 38, .x = 3.375, .y = -1.875, .adr = { .drv = 2, .cs = 5, .swr = 11, .swg = 10, .swb = 12 }, .scan = 20 }, \
|
||||
{ .id = 39, .x = 4.125, .y = -1.875, .adr = { .drv = 2, .cs = 6, .swr = 11, .swg = 10, .swb = 12 }, .scan = 21 }, \
|
||||
{ .id = 40, .x = 4.875, .y = -1.875, .adr = { .drv = 2, .cs = 7, .swr = 11, .swg = 10, .swb = 12 }, .scan = 22 }, \
|
||||
{ .id = 41, .x = 5.625, .y = -1.875, .adr = { .drv = 2, .cs = 8, .swr = 11, .swg = 10, .swb = 12 }, .scan = 23 }, \
|
||||
{ .id = 42, .x = 6.375, .y = -1.875, .adr = { .drv = 1, .cs = 1, .swr = 11, .swg = 10, .swb = 12 }, .scan = 64 }, \
|
||||
{ .id = 43, .x = 7.125, .y = -1.875, .adr = { .drv = 1, .cs = 2, .swr = 11, .swg = 10, .swb = 12 }, .scan = 65 }, \
|
||||
{ .id = 44, .x = 7.875, .y = -1.875, .adr = { .drv = 1, .cs = 3, .swr = 11, .swg = 10, .swb = 12 }, .scan = 66 }, \
|
||||
{ .id = 45, .x = 8.625, .y = -1.875, .adr = { .drv = 1, .cs = 4, .swr = 11, .swg = 10, .swb = 12 }, .scan = 67 }, \
|
||||
{ .id = 46, .x = 9.375, .y = -1.875, .adr = { .drv = 1, .cs = 5, .swr = 11, .swg = 10, .swb = 12 }, .scan = 68 }, \
|
||||
{ .id = 47, .x = 10.312, .y = -1.875, .adr = { .drv = 1, .cs = 6, .swr = 11, .swg = 10, .swb = 12 }, .scan = 69 }, \
|
||||
{ .id = 48, .x = 11.625, .y = -1.875, .adr = { .drv = 1, .cs = 7, .swr = 11, .swg = 10, .swb = 12 }, .scan = 70 }, \
|
||||
{ .id = 49, .x = 12.375, .y = -1.875, .adr = { .drv = 1, .cs = 8, .swr = 11, .swg = 10, .swb = 12 }, .scan = 71 }, \
|
||||
{ .id = 50, .x = 13.125, .y = -1.875, .adr = { .drv = 1, .cs = 9, .swr = 11, .swg = 10, .swb = 12 }, .scan = 78 }, \
|
||||
{ .id = 51, .x = 0.281, .y = -2.625, .adr = { .drv = 2, .cs = 1, .swr = 5, .swg = 4, .swb = 6 }, .scan = 24 }, \
|
||||
{ .id = 52, .x = 1.313, .y = -2.625, .adr = { .drv = 2, .cs = 2, .swr = 5, .swg = 4, .swb = 6 }, .scan = 25 }, \
|
||||
{ .id = 53, .x = 2.063, .y = -2.625, .adr = { .drv = 2, .cs = 13, .swr = 11, .swg = 10, .swb = 12 }, .scan = 26 }, \
|
||||
{ .id = 54, .x = 2.812, .y = -2.625, .adr = { .drv = 2, .cs = 12, .swr = 11, .swg = 10, .swb = 12 }, .scan = 27 }, \
|
||||
{ .id = 55, .x = 3.562, .y = -2.625, .adr = { .drv = 2, .cs = 11, .swr = 11, .swg = 10, .swb = 12 }, .scan = 28 }, \
|
||||
{ .id = 56, .x = 4.312, .y = -2.625, .adr = { .drv = 2, .cs = 6, .swr = 5, .swg = 4, .swb = 6 }, .scan = 29 }, \
|
||||
{ .id = 57, .x = 5.062, .y = -2.625, .adr = { .drv = 2, .cs = 10, .swr = 11, .swg = 10, .swb = 12 }, .scan = 30 }, \
|
||||
{ .id = 58, .x = 5.812, .y = -2.625, .adr = { .drv = 2, .cs = 9, .swr = 11, .swg = 10, .swb = 12 }, .scan = 31 }, \
|
||||
{ .id = 59, .x = 6.562, .y = -2.625, .adr = { .drv = 1, .cs = 16, .swr = 11, .swg = 10, .swb = 12 }, .scan = 72 }, \
|
||||
{ .id = 60, .x = 7.312, .y = -2.625, .adr = { .drv = 1, .cs = 15, .swr = 11, .swg = 10, .swb = 12 }, .scan = 73 }, \
|
||||
{ .id = 61, .x = 8.062, .y = -2.625, .adr = { .drv = 1, .cs = 14, .swr = 11, .swg = 10, .swb = 12 }, .scan = 74 }, \
|
||||
{ .id = 62, .x = 8.812, .y = -2.625, .adr = { .drv = 1, .cs = 13, .swr = 11, .swg = 10, .swb = 12 }, .scan = 75 }, \
|
||||
{ .id = 63, .x = 10.031, .y = -2.625, .adr = { .drv = 1, .cs = 12, .swr = 11, .swg = 10, .swb = 12 }, .scan = 76 }, \
|
||||
{ .id = 64, .x = 0.469, .y = -3.375, .adr = { .drv = 2, .cs = 14, .swr = 5, .swg = 4, .swb = 6 }, .scan = 32 }, \
|
||||
{ .id = 65, .x = 1.688, .y = -3.375, .adr = { .drv = 2, .cs = 13, .swr = 5, .swg = 4, .swb = 6 }, .scan = 33 }, \
|
||||
{ .id = 66, .x = 2.438, .y = -3.375, .adr = { .drv = 2, .cs = 12, .swr = 8, .swg = 7, .swb = 9 }, .scan = 34 }, \
|
||||
{ .id = 67, .x = 3.188, .y = -3.375, .adr = { .drv = 2, .cs = 12, .swr = 5, .swg = 4, .swb = 6 }, .scan = 35 }, \
|
||||
{ .id = 68, .x = 3.938, .y = -3.375, .adr = { .drv = 2, .cs = 11, .swr = 5, .swg = 4, .swb = 6 }, .scan = 36 }, \
|
||||
{ .id = 69, .x = 4.688, .y = -3.375, .adr = { .drv = 2, .cs = 10, .swr = 5, .swg = 4, .swb = 6 }, .scan = 37 }, \
|
||||
{ .id = 70, .x = 5.438, .y = -3.375, .adr = { .drv = 2, .cs = 9, .swr = 5, .swg = 4, .swb = 6 }, .scan = 38 }, \
|
||||
{ .id = 71, .x = 6.188, .y = -3.375, .adr = { .drv = 2, .cs = 9, .swr = 8, .swg = 7, .swb = 9 }, .scan = 39 }, \
|
||||
{ .id = 72, .x = 6.938, .y = -3.375, .adr = { .drv = 1, .cs = 16, .swr = 8, .swg = 7, .swb = 9 }, .scan = 80 }, \
|
||||
{ .id = 73, .x = 7.688, .y = -3.375, .adr = { .drv = 1, .cs = 15, .swr = 8, .swg = 7, .swb = 9 }, .scan = 81 }, \
|
||||
{ .id = 74, .x = 8.438, .y = -3.375, .adr = { .drv = 1, .cs = 14, .swr = 8, .swg = 7, .swb = 9 }, .scan = 82 }, \
|
||||
{ .id = 75, .x = 9.844, .y = -3.375, .adr = { .drv = 1, .cs = 13, .swr = 8, .swg = 7, .swb = 9 }, .scan = 83 }, \
|
||||
{ .id = 76, .x = 12.375, .y = -3.375, .adr = { .drv = 1, .cs = 11, .swr = 8, .swg = 7, .swb = 9 }, .scan = 77 }, \
|
||||
{ .id = 77, .x = 0.094, .y = -4.125, .adr = { .drv = 2, .cs = 14, .swr = 11, .swg = 10, .swb = 12 }, .scan = 40 }, \
|
||||
{ .id = 78, .x = 1.031, .y = -4.125, .adr = { .drv = 2, .cs = 14, .swr = 8, .swg = 7, .swb = 9 }, .scan = 41 }, \
|
||||
{ .id = 79, .x = 1.969, .y = -4.125, .adr = { .drv = 2, .cs = 13, .swr = 8, .swg = 7, .swb = 9 }, .scan = 42 }, \
|
||||
{ .id = 80, .x = 4.781, .y = -4.125, .adr = { .drv = 2, .cs = 10, .swr = 8, .swg = 7, .swb = 9 }, .scan = 43 }, \
|
||||
{ .id = 81, .x = 7.594, .y = -4.125, .adr = { .drv = 1, .cs = 16, .swr = 5, .swg = 4, .swb = 6 }, .scan = 44 }, \
|
||||
{ .id = 82, .x = 8.531, .y = -4.125, .adr = { .drv = 1, .cs = 15, .swr = 5, .swg = 4, .swb = 6 }, .scan = 45 }, \
|
||||
{ .id = 83, .x = 9.469, .y = -4.125, .adr = { .drv = 1, .cs = 14, .swr = 5, .swg = 4, .swb = 6 }, .scan = 46 }, \
|
||||
{ .id = 84, .x = 10.406, .y = -4.125, .adr = { .drv = 1, .cs = 13, .swr = 5, .swg = 4, .swb = 6 }, .scan = 47 }, \
|
||||
{ .id = 85, .x = 11.625, .y = -4.125, .adr = { .drv = 1, .cs = 12, .swr = 8, .swg = 7, .swb = 9 }, .scan = 84 }, \
|
||||
{ .id = 86, .x = 12.375, .y = -4.125, .adr = { .drv = 1, .cs = 12, .swr = 5, .swg = 4, .swb = 6 }, .scan = 85 }, \
|
||||
{ .id = 87, .x = 13.125, .y = -4.125, .adr = { .drv = 1, .cs = 11, .swr = 5, .swg = 4, .swb = 6 }, .scan = 86 }, \
|
||||
{ .id = 88, .x = 13.433, .y = -4.43, .adr = { .drv = 1, .cs = 11, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \
|
||||
{ .id = 89, .x = 12.285, .y = -4.535, .adr = { .drv = 1, .cs = 12, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \
|
||||
{ .id = 90, .x = 11.14, .y = -4.535, .adr = { .drv = 1, .cs = 13, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \
|
||||
@ -182,8 +182,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define USB_LED_INDICATOR_ENABLE //Comment out to disable indicator functionality
|
||||
#ifdef USB_LED_INDICATOR_ENABLE //Scan codes refer to actual key matrix codes, not KC_* (255 to disable)
|
||||
#define USB_LED_NUM_LOCK_SCANCODE 255
|
||||
#define USB_LED_CAPS_LOCK_SCANCODE 45
|
||||
#define USB_LED_SCROLL_LOCK_SCANCODE 96
|
||||
#define USB_LED_CAPS_LOCK_SCANCODE 24
|
||||
#define USB_LED_SCROLL_LOCK_SCANCODE 54
|
||||
#define USB_LED_COMPOSE_SCANCODE 255
|
||||
#define USB_LED_KANA_SCANCODE 255
|
||||
#endif //USB_LED_INDICATOR_ENABLE
|
||||
|
@ -19,6 +19,7 @@ enum ctrl_keycodes {
|
||||
DBG_MTRX, //DEBUG Toggle Matrix Prints
|
||||
DBG_KBD, //DEBUG Toggle Keyboard Prints
|
||||
DBG_MOU, //DEBUG Toggle Mouse Prints
|
||||
MD_BOOT, //Restart into bootloader after hold timeout
|
||||
};
|
||||
|
||||
#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode
|
||||
@ -39,7 +40,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MSTP, KC_VOLU, \
|
||||
L_T_BR, L_PSD, L_BRI, L_PSI, KC_TRNS, KC_TRNS, KC_TRNS, U_T_AUTO,U_T_AGCR,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_VOLD, \
|
||||
L_T_PTD, L_PTP, L_BRD, L_PTN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||
KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, KC_TRNS, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||
KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, MD_BOOT, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \
|
||||
),
|
||||
/*
|
||||
@ -71,6 +72,8 @@ void matrix_scan_user(void) {
|
||||
#define MODS_ALT (keyboard_report->mods & MOD_BIT(KC_LALT) || keyboard_report->mods & MOD_BIT(KC_RALT))
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
static uint32_t key_timer;
|
||||
|
||||
switch (keycode) {
|
||||
case L_BRI:
|
||||
if (record->event.pressed) {
|
||||
@ -197,6 +200,15 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
CDC_print("\r\n");
|
||||
}
|
||||
return false;
|
||||
case MD_BOOT:
|
||||
if (record->event.pressed) {
|
||||
key_timer = timer_read32();
|
||||
} else {
|
||||
if (timer_elapsed32(key_timer) >= 500) {
|
||||
reset_keyboard();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
default:
|
||||
return true; //Process all other keycodes normally
|
||||
}
|
||||
|
215
keyboards/massdrop/ctrl/keymaps/mac/keymap.c
Normal file
215
keyboards/massdrop/ctrl/keymaps/mac/keymap.c
Normal file
@ -0,0 +1,215 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
enum ctrl_keycodes {
|
||||
L_BRI = SAFE_RANGE, //LED Brightness Increase
|
||||
L_BRD, //LED Brightness Decrease
|
||||
L_PTN, //LED Pattern Select Next
|
||||
L_PTP, //LED Pattern Select Previous
|
||||
L_PSI, //LED Pattern Speed Increase
|
||||
L_PSD, //LED Pattern Speed Decrease
|
||||
L_T_MD, //LED Toggle Mode
|
||||
L_T_ONF, //LED Toggle On / Off
|
||||
L_ON, //LED On
|
||||
L_OFF, //LED Off
|
||||
L_T_BR, //LED Toggle Breath Effect
|
||||
L_T_PTD, //LED Toggle Scrolling Pattern Direction
|
||||
U_T_AUTO, //USB Extra Port Toggle Auto Detect / Always Active
|
||||
U_T_AGCR, //USB Toggle Automatic GCR control
|
||||
DBG_TOG, //DEBUG Toggle On / Off
|
||||
DBG_MTRX, //DEBUG Toggle Matrix Prints
|
||||
DBG_KBD, //DEBUG Toggle Keyboard Prints
|
||||
DBG_MOU, //DEBUG Toggle Mouse Prints
|
||||
MD_BOOT, //Restart into bootloader after hold timeout
|
||||
};
|
||||
|
||||
#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode
|
||||
|
||||
keymap_config_t keymap_config;
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = LAYOUT(
|
||||
KC_ESC, 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_PSCR, KC_SLCK, KC_PAUS, \
|
||||
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_INS, KC_HOME, KC_PGUP, \
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \
|
||||
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \
|
||||
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \
|
||||
),
|
||||
[1] = LAYOUT(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_TRNS, KC_TRNS, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MSTP, KC_VOLU, \
|
||||
L_T_BR, L_PSD, L_BRI, L_PSI, KC_TRNS, KC_TRNS, KC_TRNS, U_T_AUTO,U_T_AGCR,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_VOLD, \
|
||||
L_T_PTD, L_PTP, L_BRD, L_PTN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||
KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, KC_TRNS, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \
|
||||
),
|
||||
/*
|
||||
[X] = LAYOUT(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \
|
||||
),
|
||||
*/
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
|
||||
};
|
||||
|
||||
// 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) {
|
||||
};
|
||||
|
||||
#define MODS_SHIFT (keyboard_report->mods & MOD_BIT(KC_LSHIFT) || keyboard_report->mods & MOD_BIT(KC_RSHIFT))
|
||||
#define MODS_CTRL (keyboard_report->mods & MOD_BIT(KC_LCTL) || keyboard_report->mods & MOD_BIT(KC_RCTRL))
|
||||
#define MODS_ALT (keyboard_report->mods & MOD_BIT(KC_LALT) || keyboard_report->mods & MOD_BIT(KC_RALT))
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
static uint32_t key_timer;
|
||||
|
||||
switch (keycode) {
|
||||
case L_BRI:
|
||||
if (record->event.pressed) {
|
||||
if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX;
|
||||
else gcr_desired += LED_GCR_STEP;
|
||||
if (led_animation_breathing) gcr_breathe = gcr_desired;
|
||||
}
|
||||
return false;
|
||||
case L_BRD:
|
||||
if (record->event.pressed) {
|
||||
if (LED_GCR_STEP > gcr_desired) gcr_desired = 0;
|
||||
else gcr_desired -= LED_GCR_STEP;
|
||||
if (led_animation_breathing) gcr_breathe = gcr_desired;
|
||||
}
|
||||
return false;
|
||||
case L_PTN:
|
||||
if (record->event.pressed) {
|
||||
if (led_animation_id == led_setups_count - 1) led_animation_id = 0;
|
||||
else led_animation_id++;
|
||||
}
|
||||
return false;
|
||||
case L_PTP:
|
||||
if (record->event.pressed) {
|
||||
if (led_animation_id == 0) led_animation_id = led_setups_count - 1;
|
||||
else led_animation_id--;
|
||||
}
|
||||
return false;
|
||||
case L_PSI:
|
||||
if (record->event.pressed) {
|
||||
led_animation_speed += ANIMATION_SPEED_STEP;
|
||||
}
|
||||
return false;
|
||||
case L_PSD:
|
||||
if (record->event.pressed) {
|
||||
led_animation_speed -= ANIMATION_SPEED_STEP;
|
||||
if (led_animation_speed < 0) led_animation_speed = 0;
|
||||
}
|
||||
return false;
|
||||
case L_T_MD:
|
||||
if (record->event.pressed) {
|
||||
led_lighting_mode++;
|
||||
if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL;
|
||||
}
|
||||
return false;
|
||||
case L_T_ONF:
|
||||
if (record->event.pressed) {
|
||||
led_enabled = !led_enabled;
|
||||
I2C3733_Control_Set(led_enabled);
|
||||
}
|
||||
return false;
|
||||
case L_ON:
|
||||
if (record->event.pressed) {
|
||||
led_enabled = 1;
|
||||
I2C3733_Control_Set(led_enabled);
|
||||
}
|
||||
return false;
|
||||
case L_OFF:
|
||||
if (record->event.pressed) {
|
||||
led_enabled = 0;
|
||||
I2C3733_Control_Set(led_enabled);
|
||||
}
|
||||
return false;
|
||||
case L_T_BR:
|
||||
if (record->event.pressed) {
|
||||
led_animation_breathing = !led_animation_breathing;
|
||||
if (led_animation_breathing)
|
||||
{
|
||||
gcr_breathe = gcr_desired;
|
||||
led_animation_breathe_cur = BREATHE_MIN_STEP;
|
||||
breathe_dir = 1;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
case L_T_PTD:
|
||||
if (record->event.pressed) {
|
||||
led_animation_direction = !led_animation_direction;
|
||||
}
|
||||
return false;
|
||||
case U_T_AUTO:
|
||||
if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
|
||||
usb_extra_manual = !usb_extra_manual;
|
||||
CDC_print("USB extra port manual mode ");
|
||||
CDC_print(usb_extra_manual ? "enabled" : "disabled");
|
||||
CDC_print("\r\n");
|
||||
}
|
||||
return false;
|
||||
case U_T_AGCR:
|
||||
if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
|
||||
usb_gcr_auto = !usb_gcr_auto;
|
||||
CDC_print("USB GCR auto mode ");
|
||||
CDC_print(usb_gcr_auto ? "enabled" : "disabled");
|
||||
CDC_print("\r\n");
|
||||
}
|
||||
return false;
|
||||
case DBG_TOG:
|
||||
if (record->event.pressed) {
|
||||
debug_enable = !debug_enable;
|
||||
CDC_print("Debug mode ");
|
||||
CDC_print(debug_enable ? "enabled" : "disabled");
|
||||
CDC_print("\r\n");
|
||||
}
|
||||
return false;
|
||||
case DBG_MTRX:
|
||||
if (record->event.pressed) {
|
||||
debug_matrix = !debug_matrix;
|
||||
CDC_print("Debug matrix ");
|
||||
CDC_print(debug_matrix ? "enabled" : "disabled");
|
||||
CDC_print("\r\n");
|
||||
}
|
||||
return false;
|
||||
case DBG_KBD:
|
||||
if (record->event.pressed) {
|
||||
debug_keyboard = !debug_keyboard;
|
||||
CDC_print("Debug keyboard ");
|
||||
CDC_print(debug_keyboard ? "enabled" : "disabled");
|
||||
CDC_print("\r\n");
|
||||
}
|
||||
return false;
|
||||
case DBG_MOU:
|
||||
if (record->event.pressed) {
|
||||
debug_mouse = !debug_mouse;
|
||||
CDC_print("Debug mouse ");
|
||||
CDC_print(debug_mouse ? "enabled" : "disabled");
|
||||
CDC_print("\r\n");
|
||||
}
|
||||
return false;
|
||||
case MD_BOOT:
|
||||
if (record->event.pressed) {
|
||||
key_timer = timer_read32();
|
||||
} else {
|
||||
if (timer_elapsed32(key_timer) >= 500) {
|
||||
reset_keyboard();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
default:
|
||||
return true; //Process all other keycodes normally
|
||||
}
|
||||
}
|
@ -1,12 +1,21 @@
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "../../config.h"
|
||||
#ifdef MITOSIS_DATAGROK_SLOWUART
|
||||
// This is the highest possible baud rate that a pro micro clocked at 8Mhz can
|
||||
// support without errors. I don't notice any difference in behavior at this
|
||||
// slower speed. (So I think it should maybe be the default, to allow a single
|
||||
// codebase to support both available flavors of pro micro.) This requires a
|
||||
// corresponding change to the wireless module firmware; see
|
||||
// https://github.com/reversebias/mitosis/pull/10
|
||||
#undef SERIAL_UART_BAUD // avoids redefinition warning
|
||||
#define SERIAL_UART_BAUD 250000
|
||||
#endif
|
||||
|
||||
// I want to place an underscore as tap behavior on the right shift key. But
|
||||
// RSFT_T(KC_UNDS) doesn't work; mod-tap doesn't work with pre-shifted keys. So
|
||||
// instead we take advantage of Space Cadet Shift that does something similar
|
||||
// and just tweak it to use the -_ key instead of 0) See
|
||||
// instead I take advantage of Space Cadet Shift that does something similar
|
||||
// and just tweak it to use the -/_ key instead of 0/). See
|
||||
// https://github.com/qmk/qmk_firmware/pull/2055
|
||||
#define RSPC_KEY KC_MINS
|
||||
|
||||
@ -18,11 +27,12 @@
|
||||
//#define NO_ACTION_FUNCTION
|
||||
|
||||
#ifdef AUDIO_ENABLE
|
||||
#define STARTUP_SONG SONG(PLANCK_SOUND)
|
||||
// #define STARTUP_SONG SONG(NO_SOUND)
|
||||
#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
|
||||
#define STARTUP_SONG SONG(MARIO_MUSHROOM)
|
||||
#define DEFAULT_LAYER_SONGS { \
|
||||
SONG(QWERTY_SOUND), \
|
||||
SONG(COLEMAK_SOUND), \
|
||||
SONG(DVORAK_SOUND) \
|
||||
SONG(DVORAK_SOUND), \
|
||||
SONG(ZELDA_TREASURE), \
|
||||
}
|
||||
#define AUDIO_VOICES
|
||||
#define AUDIO_CLICKY
|
||||
@ -30,3 +40,18 @@
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#define LAYOUT_bottomspace( \
|
||||
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, \
|
||||
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, \
|
||||
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, \
|
||||
k31, k32, k33, k34, k35, k36, k37, k38, \
|
||||
k41, k42, k43, k44, k45, k46, k47, k48 \
|
||||
) \
|
||||
{ \
|
||||
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09 }, \
|
||||
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19 }, \
|
||||
{ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29 }, \
|
||||
{ KC_NO, k31, k32, k43, k44, k45, k46, k37, k38, KC_NO }, \
|
||||
{ KC_NO, k41, k42, k33, k34, k35, k36, k47, k48, KC_NO } \
|
||||
}
|
||||
|
@ -1,17 +1,35 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
#ifdef AUDIO_ENABLE
|
||||
#include "audio.h"
|
||||
#ifdef DEFAULT_LAYER_SONGS
|
||||
extern float default_layer_songs[][16][2];
|
||||
#endif
|
||||
#endif
|
||||
|
||||
enum mitosis_layers
|
||||
{
|
||||
_xQ, // qwerty
|
||||
_xC, // colemak
|
||||
_xD, // dvorak
|
||||
_xW, // workman
|
||||
_xS, // symbols
|
||||
_xN, // numbers
|
||||
_xF // functions
|
||||
};
|
||||
|
||||
enum mitosis_keycodes
|
||||
{
|
||||
KC_LAYO = SAFE_RANGE
|
||||
};
|
||||
|
||||
// Setting MITOSIS_DATAGROK_BOTTOMSPACE in rules.mk will swap the upper and
|
||||
// lower center four thumb-keys. See keymaps/datagrok/rules.mk.
|
||||
#ifdef MITOSIS_DATAGROK_BOTTOMSPACE
|
||||
#undef LAYOUT
|
||||
#define LAYOUT LAYOUT_bottomspace
|
||||
#endif
|
||||
|
||||
// Fillers to make layering more clear
|
||||
#define _______ KC_TRNS // Transparent
|
||||
|
||||
@ -34,8 +52,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
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,
|
||||
KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_QUOT,
|
||||
/*, */ KC_LGUI, KC_LCTL, MO(_xS), KC_TAB, KC_SPC, MO(_xS), KC_RCTL, KC_RGUI,
|
||||
/*, */ KC_HENK, KC_LALT, MO(_xN), KC_LSFT, KC_RSPC, MO(_xN), KC_RALT, KC_MHEN),
|
||||
/*, */ KC_LGUI, KC_LCTL, MO(_xS), KC_BSPC, KC_SPC, MO(_xS), KC_RCTL, KC_RGUI,
|
||||
/*, */ KC_HENK, KC_LALT, MO(_xN), LSFT_T(KC_TAB), KC_RSPC, MO(_xN), KC_RALT, KC_MHEN),
|
||||
[_xC] = LAYOUT(
|
||||
KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN,
|
||||
KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O,
|
||||
KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_QUOT,
|
||||
/*, */ _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
/*, */ _______, _______, _______, _______, _______, _______, _______, _______),
|
||||
[_xD] = LAYOUT(
|
||||
KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L,
|
||||
KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S,
|
||||
KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z,
|
||||
/*, */ _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
/*, */ _______, _______, _______, _______, _______, _______, _______, _______),
|
||||
[_xW] = LAYOUT(
|
||||
KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_SCLN,
|
||||
KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I,
|
||||
@ -44,30 +74,85 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/*, */ _______, _______, _______, _______, _______, _______, _______, _______),
|
||||
[_xS] = LAYOUT(
|
||||
KC_ESC, KC_GRV , KC_UP, KC_EQL , KC_TILD, KC_PLUS, KC_CIRC, KC_AMPR, KC_PERC, KC_MINS,
|
||||
KC_BSPC, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_PIPE, KC_AT, KC_DLR, KC_HASH, KC_ENT,
|
||||
KC_BSLS, KC_LABK, KC_LCBR, KC_LPRN, KC_LBRC, KC_RBRC, KC_RCBR, KC_RPRN, KC_RABK, KC_SLSH,
|
||||
/*, */ _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
/*, */ _______, _______, MO(_xF), _______, _______, MO(_xF), _______, _______),
|
||||
_______, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_PIPE, KC_AT, KC_DLR, KC_HASH, KC_ENT,
|
||||
KC_BSLS, KC_LABK, KC_LCBR, KC_LPRN, KC_LBRC, KC_RBRC, KC_RPRN, KC_RCBR, KC_RABK, KC_SLSH,
|
||||
/*, */ _______, _______, _______, KC_DEL, _______, _______, _______, _______,
|
||||
/*, */ _______, _______, TT(_xF), _______, _______, TT(_xF), _______, _______),
|
||||
[_xN] = LAYOUT(
|
||||
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_PPLS, KC_7, KC_8, KC_9, KC_PMNS,
|
||||
_______, KC_F4, KC_F5, KC_F6, KC_F11, KC_NLCK, KC_4, KC_5, KC_6, KC_PENT,
|
||||
_______, KC_F1, KC_F2, KC_F3, KC_F12, KC_PAST, KC_1, KC_2, KC_3, KC_PSLS,
|
||||
/*, */ _______, _______, MO(_xF), _______, _______, MO(_xF), KC_0, KC_PDOT,
|
||||
KC_PSCR, KC_F7, KC_F8, KC_F9, KC_F10, KC_PPLS, KC_7, KC_8, KC_9, KC_PMNS,
|
||||
KC_SLCK, KC_F4, KC_F5, KC_F6, KC_F11, KC_NLCK, KC_4, KC_5, KC_6, KC_PENT,
|
||||
KC_PAUS, KC_F1, KC_F2, KC_F3, KC_F12, KC_PAST, KC_1, KC_2, KC_3, KC_PSLS,
|
||||
/*, */ _______, _______, TT(_xF), _______, _______, TT(_xF), KC_0, KC_DOT,
|
||||
/*, */ _______, _______, _______, _______, _______, _______, _______, _______),
|
||||
[_xF] = LAYOUT(
|
||||
RESET, KC_INS, KC_PGUP, KC_DEL, KC_VOLU, KC_PPLS, KC_P7, KC_P8, KC_P9, KC_PMNS,
|
||||
RESET, KC_INS, KC_PGUP, DEBUG, KC_VOLU, KC_PPLS, KC_P7, KC_P8, KC_P9, KC_PMNS,
|
||||
CK_TOGG, KC_HOME, KC_PGDN, KC_END, KC_VOLD, KC_NLCK, KC_P4, KC_P5, KC_P6, KC_PENT,
|
||||
TG(_xW), KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_PAST, KC_P1, KC_P2, KC_P3, KC_PSLS,
|
||||
KC_LAYO, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_PAST, KC_P1, KC_P2, KC_P3, KC_PSLS,
|
||||
/*, */ CK_UP, MU_TOG, _______, _______, _______, _______, KC_P0, KC_PDOT,
|
||||
/*, */ CK_DOWN, MU_MOD, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS),
|
||||
/*, */ CK_DOWN, MU_MOD, _______, _______, _______, _______, _______, _______),
|
||||
};
|
||||
const bool defaultlayers[] = {
|
||||
[_xQ] = true,
|
||||
[_xC] = true,
|
||||
[_xD] = true,
|
||||
[_xW] = true,
|
||||
[_xS] = false,
|
||||
[_xN] = false,
|
||||
[_xF] = false,
|
||||
};
|
||||
const size_t defaultlayers_n = sizeof(defaultlayers) / sizeof(defaultlayers[0]);
|
||||
|
||||
// This is a hack to place <question mark> on <shift-comma> and <exclaimation
|
||||
// New keycode KC_LAYO rotates between available default layers (for e.g.,
|
||||
// selecting a base layout). Shift+KC_LAYO makes the current one persistent.
|
||||
bool process_record_layout(uint16_t keycode, keyrecord_t *record) {
|
||||
uint32_t default_layer;
|
||||
uint8_t i;
|
||||
#if defined(AUDIO_ENABLE)
|
||||
float saved_song[][2] = SONG(COIN_SOUND);
|
||||
#endif
|
||||
|
||||
if (keycode != KC_LAYO || !record->event.pressed) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (get_mods() & (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))) { // shift pressed
|
||||
// save default layer. whatever the current default layer is, store that
|
||||
eeconfig_update_default_layer(default_layer_state);
|
||||
#if defined(AUDIO_ENABLE)
|
||||
PLAY_SONG(saved_song);
|
||||
#endif
|
||||
} else {
|
||||
// rotate default layer.
|
||||
// find the current default layer
|
||||
default_layer = biton32(default_layer_state);
|
||||
// find next valid default layer
|
||||
for (i = 1; i < defaultlayers_n; i++) {
|
||||
if (defaultlayers[(default_layer + i) % defaultlayers_n]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == defaultlayers_n) {
|
||||
// we fell out of the loop without finding another default layer to switch
|
||||
// to.
|
||||
return false;
|
||||
}
|
||||
default_layer = (default_layer + i) % defaultlayers_n;
|
||||
default_layer_set(1U<<default_layer);
|
||||
led_set(host_keyboard_leds());
|
||||
#if defined(AUDIO_ENABLE) && defined(DEFAULT_LAYER_SONGS)
|
||||
PLAY_SONG(default_layer_songs[default_layer]);
|
||||
#endif
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// This is a hack to place <question mark> on <shift-comma> and <exclamation
|
||||
// mark> on <shift-period>, when using an operating system configured for a
|
||||
// US/qwerty layout.
|
||||
// cdeq = "comma dot exclamation question"
|
||||
bool comm_shifted = false;
|
||||
bool ques_shifted = false;
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
bool process_record_cdeq(uint16_t keycode, keyrecord_t *record) {
|
||||
uint8_t shifted;
|
||||
uint16_t s_keycode;
|
||||
bool *k_shifted;
|
||||
@ -104,47 +189,29 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef AUDIO_ENABLE
|
||||
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
|
||||
float tone_dyn_macro_rec[][2] = SONG(DVORAK_SOUND);
|
||||
float tone_dyn_macro_play[][2] = SONG(COLEMAK_SOUND);
|
||||
float tone_fnpc[][2] = SONG(PLOVER_SOUND);
|
||||
float tone_fnmac[][2] = SONG(PLOVER_GOODBYE_SOUND);
|
||||
|
||||
void startup_user()
|
||||
{
|
||||
float tone_startup[][2] = SONG(STARTUP_SOUND);
|
||||
_delay_ms(20); // gets rid of tick
|
||||
PLAY_SONG(tone_startup);
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
return \
|
||||
process_record_cdeq(keycode, record) && \
|
||||
process_record_layout(keycode, record);
|
||||
}
|
||||
|
||||
void shutdown_user()
|
||||
{
|
||||
float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
|
||||
PLAY_SONG(tone_goodbye);
|
||||
_delay_ms(150);
|
||||
stop_all_notes();
|
||||
}
|
||||
|
||||
void music_on_user(void)
|
||||
{
|
||||
music_scale_user();
|
||||
}
|
||||
|
||||
void music_scale_user(void)
|
||||
{
|
||||
float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
|
||||
PLAY_SONG(music_scale);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// Set the bits of A selected by MASK to the corresponding bits of B
|
||||
#define setbits(A, B, MASK) A = (A & (B | ~MASK)) | (B & MASK)
|
||||
void matrix_scan_user(void) {
|
||||
|
||||
void led_set_user(uint8_t usb_leds) {
|
||||
// A simple (but technically inaccurate) model of the momentary layer state:
|
||||
// Red layer active -> indicator = red
|
||||
// Blue layer active -> indicator = blue
|
||||
// Purple layer active -> indicator = purple
|
||||
// the Pro Micro tx LED displays Num Lock status.
|
||||
//
|
||||
// Workman layout active -> indicator = green
|
||||
// Workman red layer -> indicator = yellow (red + green)
|
||||
// Workman blue layer -> indicator = cyan (blue + green)
|
||||
// Workman purple layer -> indicator = white (red + blue + green)
|
||||
|
||||
// Bit # 7 6 5 4 3 2 1 0
|
||||
// layer_state: [ | | | _xF | _xN | _xS | _xQ | _xW ]
|
||||
// layer_state: [ | _xF | _xN | _xS | _xW | _xD | _xC | _xQ ]
|
||||
// usb_led [ | | |kana |cmps |scrl |caps | num ]
|
||||
// PORTB: [ NC | 10 | 9 | 8 | 14 | 16 | 15 |rxled]
|
||||
// PORTC: [ NC | 5 | | | | | | ]
|
||||
@ -158,16 +225,16 @@ void matrix_scan_user(void) {
|
||||
// board. Each may be connected to an LED by way of a resistor (4.7k to
|
||||
// match the others) for a total of 14 additional indicators.
|
||||
|
||||
// A simple (but technically inaccurate) model of the momentary layer state:
|
||||
// Fn1 key makes _xS active; indicator = red
|
||||
// Fn2 key makes _xN active; indicator = blue
|
||||
// Both keys make _xF active; indicator = purple
|
||||
// Toggling QWERTY mode makes indicator include green, so (red/blue/purple becomes yellow/cyan/white)
|
||||
|
||||
uint32_t portf_bits = \
|
||||
((layer_state|default_layer_state)&0b01100000)>>1 | \
|
||||
((layer_state|default_layer_state)&0b00010000)<<1 | \
|
||||
((layer_state|default_layer_state)&0b01000000)>>2;
|
||||
uint32_t portd_bits = \
|
||||
(usb_leds&0b1)<<5 | \
|
||||
((layer_state|default_layer_state)&0b1000)>>2;
|
||||
// negated because for ports 0=LED on.
|
||||
uint32_t portf_bits = ~(layer_state|layer_state<<1|(layer_state&0b100)<<3);
|
||||
setbits(PORTF, portf_bits, 0b00110000);
|
||||
setbits(PORTD, ~layer_state, 0b00000010);
|
||||
setbits(PORTF, ~portf_bits, 0b00110000);
|
||||
setbits(PORTD, ~portd_bits, 0b00100010);
|
||||
}
|
||||
|
||||
// vim: set sw=2 et:
|
||||
|
@ -1,54 +1,59 @@
|
||||
# a layout for the Mitosis
|
||||
|
||||
- Emphasis on momentary modifiers, all usable from either hand, arranged symmetrically, but left/right distinguishable by the OS.
|
||||
Shift, Red ("Lower"), Blue ("Raise"), Super ("Windows"), Meta ("Alt"), Hyper (actually Henkan/Muhenkan).
|
||||
I place left- and right-versions of Shift, GUI ("Super"), and Alt ("Meta"), and Henkan/Muhenkan (which I plan to overload for "Hyper").
|
||||
|
||||
I'm going for a [Space Cadet](https://en.wikipedia.org/wiki/Space-cadet_keyboard) aesthetic;
|
||||
I want a keyboard that can (even just in theory) make use of all the bucky bits my operating system can support.
|
||||
|
||||
- Red and Blue are used to momentary-enable (like a shift key) one of three layers:
|
||||
- Red key and Blue key momentary-enable (like a shift key) one of three layers:
|
||||
|
||||
- Red: Symbols layer
|
||||
- Blue: Numbers layer
|
||||
- "Purple" (both Red and Blue): Functions layer
|
||||
|
||||
This tri-state layer mechanism is a bit similar to Planck and Preonic's "Raise," "Lower," and "Adjust."
|
||||
|
||||
- The base layer is QWERTY.
|
||||
A slight variant of [Workman][] may be toggled using `Red`+`Blue`+`Z`.
|
||||
[Colemak][], [Dvorak][], and [Workman][] may be toggled using `Red`+`Blue`+`Z`.
|
||||
When you find the one you like, save it with `Shift`+`Red`+`Blue`+`Z`.
|
||||
|
||||
- Minimize hand travel, so as not to lose orientation with home row.
|
||||
|
||||
- `?` and `!` are moved to take the place of `<` and `>`. Rationale: unmodded
|
||||
and shifted keys should be for prose, while symbols useful for programming
|
||||
should be colocated on their own layer.
|
||||
- `?` and `!` are moved to take the place of `<` and `>`.
|
||||
Rationale: unmodded and shifted keys should be for prose, while symbols useful for programming should be colocated on their own layer.
|
||||
|
||||
- Key positions chosen for mnemonics.
|
||||
For example, you can distinguish between alphanumeric numerals and keypad numerals, but they occupy the same key positions.
|
||||
|
||||
## Layout Images
|
||||
|
||||

|
||||

|
||||
|
||||
Base layer. Notes:
|
||||
- customized comma and period, which have exclamation point and question mark on their shift layer.
|
||||
- tap right-shift for underscore
|
||||
- tap right-shift for underscore, tap left-shift for tab.
|
||||
|
||||

|
||||

|
||||
|
||||
Red layer. Intended for common navigation and programming symbols. Notes:
|
||||
- symmetric layout of paired braces/brackets/slashes for easier memorization
|
||||
- arrows placed directly on home position
|
||||
|
||||

|
||||

|
||||
|
||||
Blue layer. Intended for "number pad." Notes:
|
||||
- Keycodes generated for numbers, enter key, and mathematical symbols are from the alphanumeric keys, not keypad. This way they are not influenced by the state of Num Lock. If you want to send the keypad equivalents, just use Red and Blue modifiers simultaneously.
|
||||
- Keycodes generated for numbers, enter key, and mathematical symbols are from the alphanumeric keys, not keypad.
|
||||
This way they are not influenced by the state of Num Lock.
|
||||
If you want to send the keypad equivalents, just press Blue as well to access keypad numbers in the same positions in the Purple layer.
|
||||
|
||||

|
||||

|
||||
|
||||
Purple (Red+Blue) layer. Intended for "true keypad" and various functions. Notes:
|
||||
- Numbers on this layer send Keypad codes, so the result will be affected by the state of Num Lock.
|
||||
- "Switch Layout" toggles the alphabet keys between QWERTY and Workman
|
||||
- Page Up / Page Down / Home / End are placed on similar arrows
|
||||
- To press Print Screen it is necessary to use the left-side Red and Blue modifiers.
|
||||
- "Switch Layout" toggles the alphabet keys between QWERTY, Colemak, Dvorak, and Workman.
|
||||
Shift + "Switch Layout" stores the currently selected alphabet layout in eeprom, so the selection persists across reboots and computers.
|
||||
- Page Up / Page Down / Home / End are placed on corresponding arrow keys.
|
||||
|
||||
Keyboard layout editor sources:
|
||||
[base](http://www.keyboard-layout-editor.com/#/gists/bc2d06a3203d1bc3a14ed2245cf39643)
|
||||
@ -56,14 +61,41 @@ Keyboard layout editor sources:
|
||||
[blue](http://www.keyboard-layout-editor.com/#/gists/240e807f3d7e1d3ddabe1b69ee675048)
|
||||
[purple](http://www.keyboard-layout-editor.com/#/gists/9559f0f8bb1ee47677c8f2b4d766829d)
|
||||
|
||||
[Imgur album](https://imgur.com/a/KSoVgPx)
|
||||
[Imgur album](https://imgur.com/a/hm4bbdM)
|
||||
|
||||
## Indicators
|
||||
|
||||
- When Red layer is active, the RGB indicator turns red.
|
||||
- When Blue layer is active, the RGB indicator turns blue.
|
||||
- When Purple layer is active, the RGB indicator turns purple.
|
||||
- When the Workman layer is active, the RGB indicator turns green.
|
||||
Currently, this means that activating the Red layer while using the Workman layout will make the indicator show yellow. (red + green.)
|
||||
- The Num Lock status is shown on the Pro Micro tx LED.
|
||||
- If you attach a speaker to PC6 (pin 5) and compile with AUDIO_ENABLE=yes, music will be played at startup, when switching default layers, and when saving the default layer.
|
||||
|
||||
## Variants
|
||||
|
||||
Some additional compile-time options for this layout are available by editing rules.mk or compiling like so:
|
||||
|
||||
Normal compilation:
|
||||
|
||||
```make mitosis:datagrok```
|
||||
|
||||
Swap Space onto bottom thumb row: swaps Red/Backspace/Space/Red with Blue/Shift/Shift/Blue:
|
||||
|
||||
```make mitosis:datagrok MITOSIS_DATAGROK_BOTTOMSPACE=yes```
|
||||
|
||||
Lower baud UART. Useful when using an 8Mhz pro micro; corresponding changes required in wireless firmware. See rules.mk for details.
|
||||
|
||||
```make mitosis:datagrok MITOSIS_DATAGROK_SLOWUART=yes```
|
||||
|
||||
## Design notes
|
||||
|
||||
### Workman layout
|
||||
|
||||
- I'm learning a new physical key placement, so I might as well go all-out and
|
||||
use an optimal non-QWERTY layout.
|
||||
- I'm learning a new physical key placement, so I might as well go all-out and use an optimal non-QWERTY layout.
|
||||
Bonus: it's easy to switch back to QWERTY on a traditional row-staggered keyboard.
|
||||
The designer of the Mitosis had [a similar experience](https://www.reddit.com/r/MechanicalKeyboards/comments/66588f/wireless_split_qmk_mitosis/dgfr22q/).
|
||||
|
||||
- I like the way Workman feels and some of its advantages over Colemak.
|
||||
Unfortunately, it was designed using a weighting system based on a standard
|
||||
@ -78,14 +110,10 @@ Keyboard layout editor sources:
|
||||
The next fastest baudrate that works without errors is 250k baud.
|
||||
So if you want to do the same:
|
||||
|
||||
- Set the Pro Micro clock rate correctly in `rules.mk`:
|
||||
- Set the Pro Micro clock and baud rate correctly in `rules.mk`:
|
||||
```
|
||||
F_CPU = 800000
|
||||
```
|
||||
- Configure it to communicate at 250k baud in `config.h`:
|
||||
```
|
||||
#undef SERIAL_UART_BAUD // avoids redefinition warning
|
||||
#define SERIAL_UART_BAUD 250000
|
||||
MITOSIS_DATAGROK_SLOWUART = yes
|
||||
```
|
||||
- Configure the receiver's wireless module to communicate at 250k baud in `main.c`. See https://github.com/reversebias/mitosis/pull/10
|
||||
```
|
||||
@ -99,7 +127,7 @@ Keyboard layout editor sources:
|
||||
|
||||
- Arrow keys are in the home position on the Red layer.
|
||||
|
||||
- Blue+Arrows = PgUp/PgDn/Home/End, which is intuitive for me.
|
||||
- Blue+Arrows = PgUp/PgDn/Home/End, which is intuitive for me and similar to what is done on Apple and some Dell keyboards.
|
||||
|
||||
- The number pad: I placed the ten-key number pad on the Blue layer.
|
||||
However, this would do the wrong thing when Num Lock was not enabled.
|
||||
@ -111,11 +139,7 @@ Keyboard layout editor sources:
|
||||
- The Function-keys are arranged to mimic the order of the ten-key pad.
|
||||
|
||||
- Enter is now in a more qwerty-familiar location, and may be activated with one hand.
|
||||
Numpad Enter is in the same position.
|
||||
|
||||
- Rather than place Backspace opposite Space, I intentionally place it on a layer where it takes some effort to activate.
|
||||
Backspace is one of the keys I most dislike on a QWERTY keyboard because it moves me away from homerow and I need to use it so often.
|
||||
Rather than make it easier to strike, I want to discourage myself from using it by learning to type more accurately.
|
||||
Numpad Enter is in the same position for mnemonics.
|
||||
|
||||
- Why do I dislike [snake\_case](https://en.wikipedia.org/wiki/Snake_case) (`__variable_names_that_use_underscores_`)?
|
||||
Maybe because it's hard to type all those underscores requiring the shift key?
|
||||
@ -126,6 +150,22 @@ Keyboard layout editor sources:
|
||||
|
||||
### Current
|
||||
|
||||
- Discard "intentionally difficult backspace" idea.
|
||||
Tab returns to left-shift.
|
||||
Del returns to Red+Backspace
|
||||
- "High Profile mode:" Swap Red/Backspace/Space/Red with Blue/Shift/Shift/Blue (placing space on lower thumb keys) using `MITOSIS_DATAGROK_BOTTOMSPACE=yes` when compiling.
|
||||
- Move Print Screen / Scroll Lock / Pause to pinky column on Blue layer.
|
||||
- Let's try using TT instead of MO so we can e.g. lock-on the keypad.
|
||||
- We still use MO for first modifier, so e.g. Red + tapping Blue will lock purple.
|
||||
So far it feels a bit janky, we'll see.
|
||||
- One key `KC_LAYO` to cycle through available base layers instead of a dedicated key for each;
|
||||
Shift + `KC_LAYO` stores current base layer selection in eeprom so it comes back after disconnecting or a reset.
|
||||
- Added Colemak and Dvorak as default layers that may be selected.
|
||||
- Set UART to 250kbaud with make argument `MITOSIS_DATAGROK_SLOWUART=yes`, for use with 8Mhz Pro Micros.
|
||||
- Display Num Lock status on tx LED
|
||||
|
||||
### 0.6.60
|
||||
|
||||
- Experiment: no-modifier underscore on right shift key.
|
||||
- New combined numbers + keypad arrangement.
|
||||
No more worrying about Num Lock key.
|
||||
@ -168,27 +208,33 @@ Keyboard layout editor sources:
|
||||
|
||||
### Abandoned ideas
|
||||
|
||||
- "Since QWERTY and Workman keep angle brackets together, place other
|
||||
enclosing symbols on the same keys. This informs the numbers placement,
|
||||
which informs the function-key placement."
|
||||
- Abandoned: intentionally-difficult backspace.
|
||||
"Backspace is one of the keys I most dislike on a QWERTY keyboard because it moves me away from homerow and I need to use it so often.
|
||||
Rather than make it easier to strike, I want to discourage myself from using it and train myself to type more accurately."
|
||||
|
||||
- I tried this and it was bad. I don't like having to pick the right
|
||||
modifier to get the right flavor of bracket. Instead, now, one modifier
|
||||
activates a symbols layer where all brackets are easily accessible.
|
||||
- Many other people like an easy-to-reach backspace.
|
||||
- Many other split-spacebar ergo boards place backspace at the thumbs.
|
||||
- I can still train myself to type well with it in an easy location.
|
||||
- I couldn't think of anything really better to put opposite space.
|
||||
|
||||
- Space/Enter to the left of layer select for Enter
|
||||
- Abandoned: pile all brackets onto one pair of keys.
|
||||
"Since QWERTY and Workman keep angle brackets together, place other enclosing symbols on the same keys."
|
||||
|
||||
- Doesn't work well; I always trigger space first when mashing the keys
|
||||
- I didn't like having to pick the right modifier to get the right flavor of bracket.
|
||||
Instead, now, one modifier activates a symbols layer where all brackets are easily accessible.
|
||||
|
||||
- Abandoned: chorded Enter without proper chording detection
|
||||
|
||||
- I tried to make Red+Space = Enter with the intention that I could hit both with my thumb.
|
||||
That didn't work well; I always trigger space first when mashing the keys
|
||||
simultaneously. ~~This might not continue to be true if I change the angle
|
||||
at which I strike the keys e.g. with a neoprene base or a wrist support.~~
|
||||
Even with a wrist rest or low-profile, this is hard to do with one hand.
|
||||
Need to adjust the firmware to understand chorded thumb keys.
|
||||
|
||||
- I used to have Blue on ring finger, but that was too hard to use in
|
||||
conjunction with shift.
|
||||
|
||||
## To do
|
||||
|
||||
- Ctrl+'+' doesn't seem to work; fix.
|
||||
- **Shared Layouts.**
|
||||
Figure out how to make use of QMK's common `layouts/`
|
||||
- **Chorded Combos.**
|
||||
@ -203,16 +249,23 @@ Keyboard layout editor sources:
|
||||
Do any of my applications use it?
|
||||
Should I have the firmware ensure it is set how I want it?
|
||||
Maybe cause it to be momentary active with Blue?
|
||||
See [@drashna's comment](https://github.com/qmk/qmk_firmware/pull/2366#issuecomment-404951953)
|
||||
- Store default base layer in eeprom?
|
||||
See [@drashna's comment](https://github.com/qmk/qmk_firmware/pull/2366#issuecomment-404951953) for code to force it always-on, which I don't know if I want.
|
||||
- ~~Store default layer in eeprom?~~
|
||||
- Allow "!? on ,." to be easily toggled-off.
|
||||
- Modularize "!? on ,." so it can be easily used on any QMK keyboard. (about half done)
|
||||
- See if the henkan/muhenkan placement is at all useful for Japanese speakers,
|
||||
or abuse different keysyms for Left/Right Hyper. (Original space cadet used
|
||||
scancodes 145/175. 145 is LANG2, 175 is "reserved" in USB HID spec.)
|
||||
- Implement "layer lock" key
|
||||
- Feature parity with popular boards e.g. Planck?
|
||||
- Layers for ~~Dvorak, Coleman,~~ Plover
|
||||
- More music and midi stuff
|
||||
- Macros?
|
||||
- Improve tri-layer behavior
|
||||
- Find a better location for PrintScr/SysRq, Scroll Lock, Pause/Break, Caps Lock.
|
||||
- ~~Figure out where to place non-numpad numbers so we don't need num lock turned
|
||||
on to type them?~~
|
||||
- Find out what `update_tri_layer_state` offers that my simple layers arrangement lacks.
|
||||
- ~~Find a better location for Caps Lock, PrintScr/SysRq, Scroll Lock, Pause/Break,~~.
|
||||
Placed on Blue layer. Caps will be Shift+"Layer Lock," once I get that working.
|
||||
- ~~Figure out where to place non-numpad numbers so we don't need num lock turned on to type them?~~
|
||||
- ~~Add Insert, PrintScr, Pause/Break~~
|
||||
- ~~Make QWERTY base layer for people who customize layout in software?~~
|
||||
I default to QWERTY now.
|
||||
|
@ -1,4 +1,19 @@
|
||||
AUDIO_ENABLE = yes # audio output
|
||||
# Space and "Red" modifier are keys I want in the easiest-to-reach position in
|
||||
# the thumb row. Depending on the angle and height of the Mitosis and the type
|
||||
# of keycaps you use, the upper row or the lower row of thumb keys might be more
|
||||
# comfortable for you. I put red/space on the upper row and blue/shift on the
|
||||
# lower, but to swap that, set MITOSIS_DATAGROK_BOTTOMSPACE = yes. This has the
|
||||
# effect of swapping only the four center keys on the upper row of thumb keys with that
|
||||
# of the lower row of thumb keys.
|
||||
MITOSIS_DATAGROK_BOTTOMSPACE = no
|
||||
|
||||
# I used to use a pro micro clocked at 8Mhz. It can't reach the same baud rate
|
||||
# that the standard 16Mhz-clocked pro micro can, so the baud rate needs to be
|
||||
# lowered. Set this to "yes" to do that. See also
|
||||
# https://github.com/reversebias/mitosis/pull/10
|
||||
MITOSIS_DATAGROK_SLOWUART = no
|
||||
|
||||
AUDIO_ENABLE = no # audio output
|
||||
FAUXCLICKY_ENABLE = no
|
||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
|
||||
@ -9,4 +24,12 @@ UNICODE_ENABLE = no # Unicode
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
MIDI_ENABLE = no # MIDI controls
|
||||
|
||||
ifeq ($(strip $(MITOSIS_DATAGROK_BOTTOMSPACE)), yes)
|
||||
OPT_DEFS += -DMITOSIS_DATAGROK_BOTTOMSPACE
|
||||
endif
|
||||
ifeq ($(strip $(MITOSIS_DATAGROK_SLOWUART)), yes)
|
||||
OPT_DEFS += -DMITOSIS_DATAGROK_SLOWUART
|
||||
endif
|
||||
|
||||
# vim: set ts=8 noet:
|
||||
|
@ -5,13 +5,12 @@ void uart_init(void) {
|
||||
}
|
||||
|
||||
void led_init(void) {
|
||||
DDRD |= (1<<1);
|
||||
PORTD |= (1<<1);
|
||||
DDRF |= (1<<4) | (1<<5);
|
||||
PORTF |= (1<<4) | (1<<5);
|
||||
DDRD |= (1<<1); // Pin to green, set as output
|
||||
PORTD |= (1<<1); // Turn it off
|
||||
DDRF |= (1<<4) | (1<<5); // Pins to red and blue, set as output
|
||||
PORTF |= (1<<4) | (1<<5); // Turn them off
|
||||
}
|
||||
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
// put your keyboard start-up code here
|
||||
// runs once when the firmware starts up
|
||||
@ -20,16 +19,6 @@ void matrix_init_kb(void) {
|
||||
led_init();
|
||||
}
|
||||
|
||||
void matrix_scan_kb(void) {
|
||||
// put your looping keyboard code here
|
||||
// runs every cycle (a lot)
|
||||
matrix_scan_user();
|
||||
}
|
||||
|
||||
void led_set_kb(uint8_t usb_led) {
|
||||
|
||||
}
|
||||
|
||||
#ifdef SWAP_HANDS_ENABLE
|
||||
__attribute__ ((weak))
|
||||
const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
@ -63,5 +63,4 @@
|
||||
{ KC_NO, k31, k32, k33, k34, k35, k36, k37, k38, KC_NO }, \
|
||||
{ KC_NO, k41, k42, k43, k44, k45, k46, k47, k48, KC_NO } \
|
||||
}
|
||||
|
||||
#endif
|
||||
|
41
keyboards/planck/keymaps/am/config.h
Normal file
41
keyboards/planck/keymaps/am/config.h
Normal file
@ -0,0 +1,41 @@
|
||||
#pragma once
|
||||
|
||||
/* Prevent stuck modifiers */
|
||||
#define PREVENT_STUCK_MODIFIERS
|
||||
|
||||
#ifdef AUDIO_ENABLE
|
||||
#define STARTUP_SONG SONG(PLANCK_SOUND)
|
||||
|
||||
#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
|
||||
SONG(COLEMAK_SOUND) \
|
||||
}
|
||||
#endif
|
||||
|
||||
#define MUSIC_MASK (keycode != KC_NO)
|
||||
|
||||
/*
|
||||
* MIDI options
|
||||
*/
|
||||
|
||||
/* Prevent use of disabled MIDI features in the keymap */
|
||||
//#define MIDI_ENABLE_STRICT 1
|
||||
|
||||
/* enable basic MIDI features:
|
||||
- MIDI notes can be sent when in Music mode is on
|
||||
*/
|
||||
|
||||
#define MIDI_BASIC
|
||||
|
||||
/* enable advanced MIDI features:
|
||||
- MIDI notes can be added to the keymap
|
||||
- Octave shift and transpose
|
||||
- Virtual sustain, portamento, and modulation wheel
|
||||
- etc.
|
||||
*/
|
||||
//#define MIDI_ADVANCED
|
||||
|
||||
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
|
||||
//#define MIDI_TONE_KEYCODE_OCTAVES 2
|
||||
|
||||
// Most tactile encoders have detents every 4 stages
|
||||
#define ENCODER_RESOLUTION 4
|
204
keyboards/planck/keymaps/am/keymap.c
Normal file
204
keyboards/planck/keymaps/am/keymap.c
Normal file
@ -0,0 +1,204 @@
|
||||
// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
|
||||
// this is the style you want to emulate.
|
||||
|
||||
#include 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.
|
||||
enum planck_layers {
|
||||
_QWERTY,
|
||||
_COLEMAK,
|
||||
_LOWER,
|
||||
_RAISE,
|
||||
_TOUCHCURSOR,
|
||||
_MOUSE,
|
||||
_ADJUST
|
||||
};
|
||||
|
||||
enum planck_keycodes {
|
||||
QWERTY = SAFE_RANGE,
|
||||
COLEMAK,
|
||||
LOWER,
|
||||
RAISE,
|
||||
};
|
||||
|
||||
#define LOWER MO(_LOWER)
|
||||
#define RAISE MO(_RAISE)
|
||||
|
||||
// Taps
|
||||
#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctr
|
||||
#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift
|
||||
#define LT_TC LT(_TOUCHCURSOR, KC_SPC) // L-ayer T-ap T-ouch C-ursor
|
||||
#define LT_ML LT(_MOUSE, KC_A) // L-ayer T-ap M-ouse C-ursor (on A)
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/* Qwerty
|
||||
* ,--------------------------------------------------------------------------------------.
|
||||
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
|
||||
* |--------+------+------+------+------+-------------+------+------+------+------+-------|
|
||||
* |Ctrl/Esc| ML/A | S | D | F | G | H | J | K | L | ; | " |
|
||||
* |--------+------+------+------+------+------|------+------+------+------+------+-------|
|
||||
* | Shift | Z | X | C | V | B | N | M | , | . | / |Sft/Ent|
|
||||
* |--------+------+------+------+------+------+------+------+------+------+------+-------|
|
||||
* | Power | ~ | Alt | GUI |Lower | TC/Space |Raise | Next | Vol- | Vol+ | Play |
|
||||
* `--------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_QWERTY] = LAYOUT_planck_grid(
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
|
||||
CTL_ESC, LT_ML, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT,
|
||||
KC_CAPS, KC_TILD, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
|
||||
),
|
||||
|
||||
/* Colemak
|
||||
* ,-------------------------------------------------------------------------------------.
|
||||
* | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
|
||||
* |--------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* |Ctrl/Esc| ML/A | R | S | T | D | H | N | E | I | O | " |
|
||||
* |--------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | Shift | Z | X | C | V | B | K | M | , | . | / |Enter |
|
||||
* |--------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | Power | ~ | Alt | GUI |Lower | TC/Space |Raise | Next | Vol- | Vol+ | Play |
|
||||
* `-------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_COLEMAK] = LAYOUT_planck_grid(
|
||||
KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC,
|
||||
CTL_ESC, LT_ML, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT,
|
||||
KC_CAPS, KC_TILD, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
|
||||
),
|
||||
|
||||
/* Lower
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | | | F1 | F2 | F3 | F4 | F5 | F6 | - | + | { | } | ` |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | \ | F7 | F8 | F9 | F10 | F11 | F12 | _ | = | [ | ] | / |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* |Sleep | | | | | | | | | | |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_LOWER] = LAYOUT_planck_grid(
|
||||
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
|
||||
KC_PIPE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_PLUS, KC_LCBR, KC_RCBR, KC_GRV,
|
||||
KC_BSLS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_UNDS, KC_EQL, KC_LBRC, KC_RBRC, KC_SLSH,
|
||||
KC_SLEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
/* Raise
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | ^ | 4 | 5 | 6 | . | + | * | 4 | 5 | 6 | - | $ |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | = | 7 | 8 | 9 | 0 | - | / | 1 | 2 | 3 | . |Enter |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* |Sleep | | | | | | | | | | |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_RAISE] = LAYOUT_planck_grid(
|
||||
KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
|
||||
KC_CIRC, KC_4, KC_5, KC_6, KC_DOT, KC_PLUS, KC_ASTR, KC_4, KC_5, KC_6, KC_MINS, KC_DLR,
|
||||
KC_EQL, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_SLSH, KC_1, KC_2, KC_3, KC_DOT, KC_ENT,
|
||||
KC_SLEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
/* TouchCursor layer (http://martin-stone.github.io/touchcursor/) plus personal customizations
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | | | |Shift | GUI | ~ |Insert| Home | Up | End | Bksp | |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | | Alt |Space | | Find |Again | PgUp | Left | Down |Right | | |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | | Undo | Cut | Copy |Paste | ` | PgDn | Del | | | | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*
|
||||
* The KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_FIND, and KC_AGAIN keycodes don't
|
||||
* seem to work on Mac. Presumably they'll work under Windows.
|
||||
*/
|
||||
|
||||
[_TOUCHCURSOR] = LAYOUT_planck_grid(
|
||||
_______, _______, _______, KC_LSFT, KC_LGUI, KC_TILD, KC_INS, KC_HOME, KC_UP, KC_END, KC_BSPC, _______,
|
||||
_______, KC_LALT, KC_SPC, _______, KC_FIND,KC_AGAIN, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______,
|
||||
_______, KC_UNDO, KC_CUT, KC_COPY, KC_PASTE,KC_GRV, KC_PGDN, KC_DEL, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
/* Mouse Layer
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | | |ACCL0 |ACCL1 |ACCL2 |ACCL2 | |WHL_L | Up |WHL_R | BTN2 | |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | | | | BTN3 | BTN1 | BTN4 |WHL_Up| Left | Down |Right | | |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | | | | | BTN2 | BTN5 |WHL_Dn| BTN1 | | | | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
|
||||
[_MOUSE] = LAYOUT_planck_grid(
|
||||
_______, _______, KC_ACL0, KC_ACL1, KC_ACL2, KC_ACL2, _______, KC_WH_L, KC_MS_U, KC_WH_R, KC_BTN2, _______,
|
||||
_______, _______, _______, KC_BTN3, KC_BTN1, KC_BTN4, KC_WH_U, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______,
|
||||
_______, _______, _______, _______, KC_BTN2, KC_BTN5, KC_WH_D, KC_BTN1, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
/* Adjust (Lower + Raise)
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | | Reset| | | | | | | | | | Del |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk| | | |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_ADJUST] = LAYOUT_planck_grid(
|
||||
_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL,
|
||||
_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, _______, _______, _______,
|
||||
_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
)
|
||||
|
||||
|
||||
};
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case QWERTY:
|
||||
if (record->event.pressed) {
|
||||
set_single_persistent_default_layer(_QWERTY);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case COLEMAK:
|
||||
if (record->event.pressed) {
|
||||
set_single_persistent_default_layer(_COLEMAK);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool music_mask_user(uint16_t keycode) {
|
||||
switch (keycode) {
|
||||
case RAISE:
|
||||
case LOWER:
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
17
keyboards/planck/keymaps/am/readme.md
Normal file
17
keyboards/planck/keymaps/am/readme.md
Normal file
@ -0,0 +1,17 @@
|
||||
# The Am Planck Layout
|
||||
|
||||
Heavily inspired by other layouts out there, and fine tuned to work well on emacs (most recently spacemacs with vim bindings).
|
||||
|
||||
It features:
|
||||
|
||||
- Media keys (bottom right)
|
||||
- Focused on Qwerty and Colemak
|
||||
- Number pads (normal and reversed)
|
||||
- TouchCursor layer
|
||||
- Mouse layer
|
||||
|
||||
## Build
|
||||
|
||||
Making planck/rev4 with keymap am and target dfu
|
||||
|
||||
make planck/rev4:am:dfu
|
10
keyboards/planck/keymaps/am/rules.mk
Normal file
10
keyboards/planck/keymaps/am/rules.mk
Normal file
@ -0,0 +1,10 @@
|
||||
# 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
|
||||
#
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE = no # Console for debug(+400)
|
||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
AUDIO_ENABLE = yes # Audio output on port C6
|
@ -22,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \
|
||||
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \
|
||||
KC_LSFT, 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_LCTL, KC_LALT, KC_LGUI, MO(_FN1),KC_SPC, KC_BSPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
|
||||
KC_LCTL, KC_LALT, KC_LGUI, MO(_FN1),KC_SPC, MO(_FN1),KC_BSPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
|
||||
),
|
||||
|
||||
[_FN1] = LAYOUT(
|
||||
@ -30,6 +30,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
RGB_TOG, RGB_MOD, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______,\
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
KC_TILD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
KC_TILD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
)
|
||||
};
|
||||
|
27
keyboards/quefrency/keymaps/default65/config.h
Normal file
27
keyboards/quefrency/keymaps/default65/config.h
Normal file
@ -0,0 +1,27 @@
|
||||
/*
|
||||
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
|
||||
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
|
||||
|
||||
/* Use I2C or Serial, not both */
|
||||
|
||||
#define USE_SERIAL
|
||||
// #define USE_I2C
|
35
keyboards/quefrency/keymaps/default65/keymap.c
Normal file
35
keyboards/quefrency/keymaps/default65/keymap.c
Normal file
@ -0,0 +1,35 @@
|
||||
#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 _BASE 0
|
||||
#define _FN1 1
|
||||
|
||||
enum custom_keycodes {
|
||||
QWERTY = SAFE_RANGE,
|
||||
};
|
||||
|
||||
#define _______ KC_TRNS
|
||||
#define XXXXXXX KC_NO
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[_BASE] = LAYOUT_65(
|
||||
KC_GESC, 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_DEL, KC_BSPC, KC_PGUP, \
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGDN, \
|
||||
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_HOME, \
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, \
|
||||
KC_LCTL, KC_LALT, KC_LGUI, MO(_FN1),KC_SPC, MO(_FN1),KC_SPC, KC_RALT, KC_RCTL, KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT
|
||||
),
|
||||
|
||||
[_FN1] = LAYOUT_65(
|
||||
KC_GESC, 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_DEL, KC_BSPC, _______, \
|
||||
RGB_TOG, RGB_MOD, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
KC_TILD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
)
|
||||
};
|
0
keyboards/quefrency/keymaps/default65/rules.mk
Normal file
0
keyboards/quefrency/keymaps/default65/rules.mk
Normal file
@ -26,15 +26,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define DEVICE_VER 0x0100
|
||||
#define MANUFACTURER Keebio
|
||||
#define PRODUCT Quefrency
|
||||
#define DESCRIPTION Split 60 percent staggered keyboard
|
||||
#define DESCRIPTION Split 60/65 percent staggered keyboard
|
||||
|
||||
/* key matrix size */
|
||||
// Rows are doubled-up
|
||||
#define MATRIX_ROWS 10
|
||||
#define MATRIX_ROWS 12
|
||||
#define MATRIX_COLS 8
|
||||
|
||||
// wiring of each half
|
||||
#define MATRIX_ROW_PINS { F4, D4, D7, E6, B4 }
|
||||
#define MATRIX_ROW_PINS { F4, D4, D7, E6, B4, B5 }
|
||||
#define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2, B6, C6 }
|
||||
#define SPLIT_HAND_PIN D2
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
LB1, LB2, LB3, LB4, LB5, LB6, RB1, RB2, RB3, RB4, RB5, RB6, RB7, RB8, \
|
||||
LC1, LC2, LC3, LC4, LC5, LC6, RC1, RC2, RC3, RC4, RC5, RC6, RC8, \
|
||||
LD1, LD3, LD4, LD5, LD6, LD7, RD1, RD2, RD3, RD4, RD6, RD7, RD8, \
|
||||
LE1, LE2, LE3, LE5, LE7, RE1, RE4, RE5, RE6, RE7, RE8 \
|
||||
LE1, LE2, LE3, LE5, LE7, RE1, RE2, RE4, RE5, RE6, RE7, RE8 \
|
||||
) \
|
||||
{ \
|
||||
{ LA1, LA2, LA3, LA4, LA5, LA6, LA7, KC_NO }, \
|
||||
@ -26,9 +26,33 @@
|
||||
{ LC1, LC2, LC3, LC4, LC5, LC6, KC_NO, KC_NO }, \
|
||||
{ LD1, KC_NO, LD3, LD4, LD5, LD6, LD7, KC_NO }, \
|
||||
{ LE1, LE2, LE3, KC_NO, LE5, KC_NO, LE7, KC_NO }, \
|
||||
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
|
||||
{ RA1, RA2, RA3, RA4, RA5, RA6, RA7, RA8 }, \
|
||||
{ RB1, RB2, RB3, RB4, RB5, RB6, RB7, RB8 }, \
|
||||
{ RC1, RC2, RC3, RC4, RC5, RC6, KC_NO, RC8 }, \
|
||||
{ RD1, RD2, RD3, RD4, KC_NO, RD6, RD7, RD8 }, \
|
||||
{ RE1, KC_NO, KC_NO, RE4, RE5, RE6, RE7, RE8 } \
|
||||
{ RE1, RE2, KC_NO, RE4, RE5, RE6, RE7, RE8 }, \
|
||||
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \
|
||||
}
|
||||
|
||||
#define LAYOUT_65( \
|
||||
LA1, LA2, LA3, LA4, LA5, LA6, LA7, RA1, RA2, RA3, RA4, RA5, RA6, RA7, RA8, RA9, \
|
||||
LB1, LB2, LB3, LB4, LB5, LB6, RB1, RB2, RB3, RB4, RB5, RB6, RB7, RB8, RB9, \
|
||||
LC1, LC2, LC3, LC4, LC5, LC6, RC1, RC2, RC3, RC4, RC5, RC6, RC8, RC9, \
|
||||
LD1, LD3, LD4, LD5, LD6, LD7, RD1, RD2, RD3, RD4, RD6, RD7, RD8, RD9, \
|
||||
LE1, LE2, LE3, LE5, LE7, RE1, RE2, RE4, RE5, RE6, RE7, RE8, RE9 \
|
||||
) \
|
||||
{ \
|
||||
{ LA1, LA2, LA3, LA4, LA5, LA6, LA7, KC_NO }, \
|
||||
{ LB1, LB2, LB3, LB4, LB5, LB6, KC_NO, KC_NO }, \
|
||||
{ LC1, LC2, LC3, LC4, LC5, LC6, KC_NO, KC_NO }, \
|
||||
{ LD1, KC_NO, LD3, LD4, LD5, LD6, LD7, KC_NO }, \
|
||||
{ LE1, LE2, LE3, KC_NO, LE5, KC_NO, LE7, KC_NO }, \
|
||||
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
|
||||
{ RA1, RA2, RA3, RA4, RA5, RA6, RA7, RA8 }, \
|
||||
{ RB1, RB2, RB3, RB4, RB5, RB6, RB7, RB8 }, \
|
||||
{ RC1, RC2, RC3, RC4, RC5, RC6, RC9, RC8 }, \
|
||||
{ RD1, RD2, RD3, RD4, RD9, RD6, RD7, RD8 }, \
|
||||
{ RE1, RE2, RE9, RE4, RE5, RE6, RE7, RE8 }, \
|
||||
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RA9, RB9 } \
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user