clean up bananasplit keymap

This commit is contained in:
Balz Guenat 2017-11-20 18:26:44 +01:00 committed by Jack Humbert
parent bb53635f33
commit 7235c93827
4 changed files with 39 additions and 40 deletions

View file

@ -47,11 +47,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
} }
/* Here is the above keymap filled with KC_TRNS. It's a useful starting point when defining layers. /* Here is the above keymap filled with KC_TRNS. It's a useful starting point when defining layers.
KEYMAP( \ KEYMAP( \
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,\ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______ \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
) )
*/ */

View file

@ -17,7 +17,7 @@
#ifndef CONFIG_USER_H #ifndef CONFIG_USER_H
#define CONFIG_USER_H #define CONFIG_USER_H
#include "../../config.h" #include "config_common.h"
// place overrides here // place overrides here
#define GRAVE_ESC_CTRL_OVERRIDE #define GRAVE_ESC_CTRL_OVERRIDE

View file

@ -15,7 +15,9 @@
*/ */
#include "bananasplit.h" #include "bananasplit.h"
#define ______ KC_TRNS enum custom_keycodes {
WIN_SWITCH_LAYOUT = SAFE_RANGE
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* /*
@ -35,7 +37,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
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_BSPC, \ 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_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_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(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ MO(1), 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, M(0),\ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, WIN_SWITCH_LAYOUT,\
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_SPC, KC_RALT, KC_RGUI, KC_NO, KC_APP, KC_RCTL \ KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_SPC, KC_RALT, KC_RGUI, KC_NO, KC_APP, KC_RCTL \
), ),
/* /*
@ -52,11 +54,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------
*/ */
[1] = KEYMAP( \ [1] = KEYMAP( \
______, 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_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, \
KC_CAPS, KC_MPRV, KC_VOLU, KC_MNXT, KC_PGUP, KC_INS, KC_HOME, LCTL(KC_LEFT), LCTL(KC_RGHT), KC_END, ______, ______, ______, KC_PSCR, \ KC_CAPS, KC_MPRV, KC_VOLU, KC_MNXT, KC_PGUP, KC_INS, KC_HOME, LCTL(KC_LEFT), LCTL(KC_RGHT), KC_END, _______, _______, _______, KC_PSCR, \
______, KC_MUTE, KC_VOLD, KC_MPLY, KC_PGDN, KC_DEL, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, ______, ______, ______, \ _______, KC_MUTE, KC_VOLD, KC_MPLY, KC_PGDN, KC_DEL, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, \
______, ______, ______, ______, ______, ______, LCTL(KC_BSPC), LCTL(KC_DEL), ______, ______, ______, ______, ______, \ _______, _______, _______, _______, _______,_______, LCTL(KC_BSPC), LCTL(KC_DEL), _______, _______, _______, _______, _______, \
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, RESET \ _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, RESET \
), ),
}; };
@ -64,21 +66,6 @@ const uint16_t PROGMEM fn_actions[] = {
}; };
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
switch(id) {
case 0:
// Sends Alt+Shift on both key down and key up.
// Fesigned to switch between two keyboard layouts on Windows using a locking switch.
// Does nothing if right shift is pressed for easier resync.
if (!(get_mods() & MOD_BIT(KC_RSFT)))
return MACRO(D(LALT), T(LSFT), U(LALT), END);
else
return MACRO_NONE;
}
return MACRO_NONE;
};
void matrix_init_user(void) { void matrix_init_user(void) {
} }
@ -88,6 +75,19 @@ void matrix_scan_user(void) {
} }
bool process_record_user(uint16_t keycode, keyrecord_t *record) { bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case WIN_SWITCH_LAYOUT: {
// Sends Alt+Shift on both key down and key up.
// Designed to switch between two keyboard layouts on Windows using a locking switch.
// Does nothing if right shift is pressed for easy resync.
if (!(get_mods() & MOD_BIT(KC_RSFT))) {
SEND_STRING(SS_DOWN(X_LALT)SS_TAP(X_LSHIFT)SS_UP(X_LALT));
return false;
}
else
return false;
}
}
return true; return true;
} }

View file

@ -1,6 +1,5 @@
# MCU name # MCU name
#MCU = at90usb1287 MCU ?= atmega32u4
MCU = atmega32u4
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
@ -13,14 +12,14 @@ MCU = atmega32u4
# does not *change* the processor frequency - it should merely be updated to # 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 # reflect the processor speed set externally so that the code can use accurate
# software delays. # software delays.
F_CPU = 16000000 F_CPU ?= 16000000
# #
# LUFA specific # LUFA specific
# #
# Target architecture (see library "Board Types" documentation). # Target architecture (see library "Board Types" documentation).
ARCH = AVR8 ARCH ?= AVR8
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the # This will define a symbol, F_USB, in all source code files equal to the
@ -33,7 +32,7 @@ ARCH = AVR8
# #
# If no clock division is performed on the input clock inside the AVR (via the # 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. # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU) F_USB ?= $(F_CPU)
# Interrupt driven control endpoint task(+60) # Interrupt driven control endpoint task(+60)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
@ -51,14 +50,14 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options # Build Options
# comment out to disable the options. # comment out to disable the options.
# #
BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700) MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450) EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400) CONSOLE_ENABLE ?= yes # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration COMMAND_ENABLE ?= yes # Commands for debug and configuration
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend #SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA NKRO_ENABLE ?= yes # USB Nkey Rollover - not yet supported in LUFA
BACKLIGHT_ENABLE = yes BACKLIGHT_ENABLE ?= yes
# Optimize size but this may cause error "relocation truncated to fit" # Optimize size but this may cause error "relocation truncated to fit"