]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
clean up bananasplit keymap
authorBalz Guenat <balz.guenat@gmail.com>
Mon, 20 Nov 2017 17:26:44 +0000 (18:26 +0100)
committerJack Humbert <jack.humb@gmail.com>
Sun, 10 Dec 2017 05:40:19 +0000 (00:40 -0500)
keyboards/bananasplit/bananasplit.h
keyboards/bananasplit/keymaps/coloneljesus/config.h
keyboards/bananasplit/keymaps/coloneljesus/keymap.c
keyboards/bananasplit/rules.mk

index fa4c13258bfe7f5df6f99aff2d337733f905fade..f9b055c639978425f3561edd130facb30ec094fe 100644 (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.
 KEYMAP( \
-    ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
-    ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
-    ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
-    ______,         ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,\
-    ______, ______, ______,         ______, ______, ______,         ______, ______, ______, ______, ______  \
+    _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
+    _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
+    _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
+    _______,          _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\
+    _______, _______, _______,          _______, _______, _______,          _______, _______, _______, _______, _______  \
 )
 */
 
index af6cf8ef1f1f1f817d024937eea0d7c825914840..5f2cd13fef7a3cd6b05c51631460c3fc6757f287 100644 (file)
@@ -17,7 +17,7 @@
 #ifndef CONFIG_USER_H
 #define CONFIG_USER_H
 
-#include "../../config.h"
+#include "config_common.h"
 
 // place overrides here
 #define GRAVE_ESC_CTRL_OVERRIDE
index 5d67079f81cce2b7663b01860956864f0d66c6f4..ac7f1113a981efec42a233eed9a4bd83cdd08d7c 100644 (file)
@@ -15,7 +15,9 @@
  */
 #include "bananasplit.h"
 
-#define ______ KC_TRNS
+enum custom_keycodes {
+  WIN_SWITCH_LAYOUT = SAFE_RANGE
+};
 
 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_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, \
-    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 \
 ),
 /*
@@ -52,11 +54,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
 -------------------------------------------------------------------------------------------
 */
 [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_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, ______, ______, ______, \
-    ______,           ______,  ______,  ______,  ______, ______,  LCTL(KC_BSPC), LCTL(KC_DEL),   ______,  ______, ______, ______, ______, \
-    ______,  ______,  ______,           ______,  ______, ______,                 ______,         ______,  ______, ______, RESET \
+    _______, 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_MUTE, KC_VOLD, KC_MPLY, KC_PGDN, KC_DEL, KC_LEFT, KC_DOWN,       KC_UP,         KC_RGHT, _______, _______, _______, \
+    _______,          _______, _______, _______, _______,_______, LCTL(KC_BSPC), LCTL(KC_DEL),  _______, _______, _______, _______, _______, \
+    _______, _______, _______,          _______, _______,_______,                _______,       _______, _______, _______, 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) {
 
 }
@@ -88,6 +75,19 @@ void matrix_scan_user(void) {
 }
 
 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;
 }
 
index 04579d4ce614205e3510e041e34e10edf5a36585..168fa06d1e33f783cf8a3ff6458421aff6885809 100644 (file)
@@ -1,6 +1,5 @@
 # MCU name
-#MCU = at90usb1287
-MCU = atmega32u4
+MCU ?= atmega32u4
 
 # Processor frequency.
 #     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
 #     reflect the processor speed set externally so that the code can use accurate
 #     software delays.
-F_CPU = 16000000
+F_CPU ?= 16000000
 
 
 #
 # LUFA specific
 #
 # Target architecture (see library "Board Types" documentation).
-ARCH = AVR8
+ARCH ?= AVR8
 
 # Input clock frequency.
 #     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
 #     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)
 OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
@@ -51,14 +50,14 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096
 # Build Options
 #   comment out to disable the options.
 #
-BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
-MOUSEKEY_ENABLE = yes  # Mouse keys(+4700)
-EXTRAKEY_ENABLE = yes  # Audio control and System control(+450)
-CONSOLE_ENABLE = yes   # Console for debug(+400)
-COMMAND_ENABLE = yes    # Commands for debug and configuration
+BOOTMAGIC_ENABLE ?= yes        # Virtual DIP switch configuration(+1000)
+MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
+EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
+CONSOLE_ENABLE ?= yes  # Console for debug(+400)
+COMMAND_ENABLE ?= yes    # Commands for debug and configuration
 #SLEEP_LED_ENABLE = yes  # Breathing sleep LED during USB suspend
-NKRO_ENABLE = yes      # USB Nkey Rollover - not yet supported in LUFA
-BACKLIGHT_ENABLE = yes
+NKRO_ENABLE ?= yes     # USB Nkey Rollover - not yet supported in LUFA
+BACKLIGHT_ENABLE ?= yes
 
 
 # Optimize size but this may cause error "relocation truncated to fit"