From 6be061c6d42d538f756a986a412f28adb955ef1e Mon Sep 17 00:00:00 2001 From: dbroqua Date: Thu, 22 Dec 2016 19:08:17 +0100 Subject: [PATCH] - Fixed bug in dbroqua layout for Satan keyboard --- keyboards/satan/keymaps/dbroqua/Makefile | 20 ----------- keyboards/satan/keymaps/dbroqua/keymap.c | 44 +++++++++++++----------- 2 files changed, 24 insertions(+), 40 deletions(-) delete mode 100644 keyboards/satan/keymaps/dbroqua/Makefile diff --git a/keyboards/satan/keymaps/dbroqua/Makefile b/keyboards/satan/keymaps/dbroqua/Makefile deleted file mode 100644 index fa2608aa2e..0000000000 --- a/keyboards/satan/keymaps/dbroqua/Makefile +++ /dev/null @@ -1,20 +0,0 @@ - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -RGBLIGHT_ENABLE ?= yes # Enable keyboard underlight functionality (+4870) -BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality (+1150) -MIDI_ENABLE ?= no # MIDI controls -AUDIO_ENABLE ?= no -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/satan/keymaps/dbroqua/keymap.c b/keyboards/satan/keymaps/dbroqua/keymap.c index 3171b75b11..d3c3dc679f 100644 --- a/keyboards/satan/keymaps/dbroqua/keymap.c +++ b/keyboards/satan/keymaps/dbroqua/keymap.c @@ -1,4 +1,5 @@ #include "satan.h" +#include "action_layer.h" #include "rgblight.h" #define _DEFAULT 0 @@ -52,7 +53,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_CAPS, ______, ______, ______, ______, ______, ______, ______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, ______, ______, \ ______, KC_VOLD,KC_VOLU,KC_MUTE,______, ______, KC_PAST,KC_PSLS,KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, ______, \ ______, KC_MPRV,KC_MPLY,KC_MNXT,______, ______, KC_PPLS,KC_PMNS,KC_END, KC_PGDN, KC_DOWN, ______, ______, \ - ______, ______, ______, TO(_SFX), KC_MSTP, ______, ______, ______ \ + ______, ______, ______, TG(_SFX), KC_MSTP, ______, ______, ______ \ ), /* SFX Layer @@ -68,15 +69,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | * `-----------------------------------------------------------------' */ - [_SFX] = KEYMAP_HHKB( /* Layer 2 */ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - ______, BL_DEC, BL_INC, BL_TOGG, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - ______, F(0), F(1), ______, ______, ______, ______, ______,______, ______, ______, ______, ______, \ - ______, F(2), F(3), F(4),F(5),F(6),F(7),______,______, ______, ______, ______,______, \ - ______, ______, ______, TO(_DEFAULT), ______, ______, ______, ______ \ + [_SFX] = KEYMAP_HHKB( + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, BL_DEC, BL_INC, BL_TOGG,______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, F(2), F(3), ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, F(4), F(5), F(6), F(7), F(8), F(9), ______, ______, ______, ______, ______, ______, \ + ______, ______, ______, ______, ______, ______, ______, ______ \ ) }; +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + return MACRO_NONE; +}; + enum function_id { RGBLED_TOGGLE, RGBLED_STEP_MODE, @@ -89,14 +96,16 @@ enum function_id { }; const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(RGBLED_TOGGLE), - [1] = ACTION_FUNCTION(RGBLED_STEP_MODE), - [2] = ACTION_FUNCTION(RGBLED_INCREASE_HUE), - [3] = ACTION_FUNCTION(RGBLED_DECREASE_HUE), - [4] = ACTION_FUNCTION(RGBLED_INCREASE_SAT), - [5] = ACTION_FUNCTION(RGBLED_DECREASE_SAT), - [6] = ACTION_FUNCTION(RGBLED_INCREASE_VAL), - [7] = ACTION_FUNCTION(RGBLED_DECREASE_VAL) + [0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay + [1] = ACTION_LAYER_TOGGLE(2), // toggle wasd overlay + [2] = ACTION_FUNCTION(RGBLED_TOGGLE), + [3] = ACTION_FUNCTION(RGBLED_STEP_MODE), + [4] = ACTION_FUNCTION(RGBLED_INCREASE_HUE), + [5] = ACTION_FUNCTION(RGBLED_DECREASE_HUE), + [6] = ACTION_FUNCTION(RGBLED_INCREASE_SAT), + [7] = ACTION_FUNCTION(RGBLED_DECREASE_SAT), + [8] = ACTION_FUNCTION(RGBLED_INCREASE_VAL), + [9] = ACTION_FUNCTION(RGBLED_DECREASE_VAL) }; void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { @@ -142,9 +151,4 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { } break; } -} - -void persistant_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); } \ No newline at end of file