summaryrefslogtreecommitdiffstats
path: root/keyboard/preonic
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2016-04-16 18:51:58 -0400
committerJack Humbert <jack.humb@gmail.com>2016-04-16 18:51:58 -0400
commitab19ebd08a8b955775e6fa94cdf6b8d128d8b43c (patch)
tree7120e8037a1a9935b3b9e4109e251530f893c3b3 /keyboard/preonic
parent5f648b6c4060d586c343ea05562c607e2630dfc4 (diff)
MAGIC functionality, AG swap in default layout
Diffstat (limited to 'keyboard/preonic')
-rw-r--r--keyboard/preonic/Makefile2
-rw-r--r--keyboard/preonic/keymaps/default/keymap.c19
2 files changed, 11 insertions, 10 deletions
diff --git a/keyboard/preonic/Makefile b/keyboard/preonic/Makefile
index eaf9ef927c..9199968c3d 100644
--- a/keyboard/preonic/Makefile
+++ b/keyboard/preonic/Makefile
@@ -130,7 +130,7 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096
# change to "no" to disable the options, or define them in the makefile.mk in
# the appropriate keymap folder that will get included automatically
#
-BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
+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)
diff --git a/keyboard/preonic/keymaps/default/keymap.c b/keyboard/preonic/keymaps/default/keymap.c
index 6824f68b60..e1f9b62029 100644
--- a/keyboard/preonic/keymaps/default/keymap.c
+++ b/keyboard/preonic/keymaps/default/keymap.c
@@ -153,9 +153,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | Reset| | | | | | | | | | Del |
* |------+------+------+------+------+-------------+------+------+------+------+------|
- * | | | |Audoff|Aud on| | |Qwerty|Colemk|Dvorak| | |
+ * | | | |Audoff|Aud on|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | |
* |------+------+------+------+------+------|------+------+------+------+------+------|
- * | | | | | | | | | | | | |
+ * | | | |Musoff|Mus on| | | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
@@ -163,7 +163,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_ADJUST] = {
{KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12},
{_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL},
- {_______, _______, _______, AUD_ON, AUD_OFF, _______, _______, QWERTY, COLEMAK, DVORAK, _______, _______},
+ {_______, _______, _______, AUD_ON, AUD_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______},
{_______, _______, _______, MUS_ON, MUS_OFF, _______, _______, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
},
@@ -231,6 +231,10 @@ float tone_music[][2] = {
};
#endif
+void persistant_default_layer_set(uint16_t default_layer) {
+ eeconfig_write_default_layer(default_layer);
+ default_layer_set(default_layer);
+}
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
@@ -240,8 +244,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
#ifdef AUDIO_ENABLE
play_notes(&tone_qwerty, 4, false);
#endif
- eeconfig_write_default_layer(1UL<<_QWERTY);
- default_layer_set(1UL<<_QWERTY);
+ persistant_default_layer_set(1UL<<_QWERTY);
}
break;
case _COLEMAK:
@@ -249,8 +252,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
#ifdef AUDIO_ENABLE
play_notes(&tone_colemak, 6, false);
#endif
- eeconfig_write_default_layer(1UL<<_COLEMAK);
- default_layer_set(1UL<<_COLEMAK);
+ persistant_default_layer_set(1UL<<_COLEMAK);
}
break;
case _DVORAK:
@@ -258,8 +260,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
#ifdef AUDIO_ENABLE
play_notes(&tone_dvorak, 8, false);
#endif
- eeconfig_write_default_layer(1UL<<_DVORAK);
- default_layer_set(1UL<<_DVORAK);
+ persistant_default_layer_set(1UL<<_DVORAK);
}
break;
case _LOWER: