aboutsummaryrefslogtreecommitdiffstats
path: root/keyboards/preonic
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/preonic')
-rw-r--r--keyboards/preonic/keymaps/cranium/config.h38
-rw-r--r--keyboards/preonic/keymaps/cranium/keymap.c224
-rw-r--r--keyboards/preonic/keymaps/cranium/readme.md72
-rw-r--r--keyboards/preonic/keymaps/cranium/rules.mk1
-rw-r--r--keyboards/preonic/keymaps/default/keymap.c65
-rw-r--r--keyboards/preonic/keymaps/egstad/config.h91
-rw-r--r--keyboards/preonic/keymaps/egstad/keymap.c229
-rw-r--r--keyboards/preonic/keymaps/egstad/readme.md11
-rw-r--r--keyboards/preonic/keymaps/egstad/rules.mk3
-rw-r--r--keyboards/preonic/keymaps/kjwon15/config.h67
-rw-r--r--keyboards/preonic/keymaps/kjwon15/keymap.c376
-rw-r--r--keyboards/preonic/keymaps/kjwon15/readme.md27
-rw-r--r--keyboards/preonic/keymaps/kjwon15/rules.mk2
-rw-r--r--keyboards/preonic/keymaps/laurentlaurent/config.h41
-rw-r--r--keyboards/preonic/keymaps/laurentlaurent/keymap.c603
-rw-r--r--keyboards/preonic/keymaps/laurentlaurent/readme.md252
-rw-r--r--keyboards/preonic/keymaps/laurentlaurent/rules.mk2
-rw-r--r--keyboards/preonic/keymaps/laurentlaurent/templates.c89
-rw-r--r--keyboards/preonic/keymaps/mguterl/config.h37
-rw-r--r--keyboards/preonic/keymaps/mguterl/keymap.c323
-rw-r--r--keyboards/preonic/keymaps/mguterl/readme.md18
-rw-r--r--keyboards/preonic/keymaps/mguterl/rules.mk1
-rw-r--r--keyboards/preonic/keymaps/mikethetiger/config.h2
-rw-r--r--keyboards/preonic/keymaps/mikethetiger/keymap.c2
-rw-r--r--keyboards/preonic/keymaps/pitty/config.h40
-rw-r--r--keyboards/preonic/keymaps/pitty/keymap.c203
-rw-r--r--keyboards/preonic/keymaps/pitty/readme.md5
-rw-r--r--keyboards/preonic/keymaps/pitty/rules.mk0
-rw-r--r--keyboards/preonic/keymaps/senseored/config.h45
-rw-r--r--keyboards/preonic/keymaps/senseored/keymap.c437
-rw-r--r--keyboards/preonic/keymaps/senseored/readme.md1
-rw-r--r--keyboards/preonic/keymaps/senseored/rules.mk1
-rw-r--r--keyboards/preonic/preonic.c2
-rw-r--r--keyboards/preonic/preonic.h10
-rw-r--r--keyboards/preonic/rev1/rev1.c4
-rw-r--r--keyboards/preonic/rev1/rules.mk54
-rw-r--r--keyboards/preonic/rev2/rev2.c4
-rw-r--r--keyboards/preonic/rev2/rules.mk60
-rw-r--r--keyboards/preonic/rev3/config.h41
-rw-r--r--keyboards/preonic/rev3/matrix.c187
-rw-r--r--keyboards/preonic/rev3/rev3.c10
-rw-r--r--keyboards/preonic/rev3/rules.mk14
42 files changed, 3346 insertions, 348 deletions
diff --git a/keyboards/preonic/keymaps/cranium/config.h b/keyboards/preonic/keymaps/cranium/config.h
new file mode 100644
index 000000000..6d73958ad
--- /dev/null
+++ b/keyboards/preonic/keymaps/cranium/config.h
@@ -0,0 +1,38 @@
+#pragma once
+
+
+#ifdef AUDIO_ENABLE
+ #define STARTUP_SONG SONG(PREONIC_SOUND)
+ // #define STARTUP_SONG SONG(NO_SOUND)
+
+ #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
+ SONG(COLEMAK_SOUND), \
+ SONG(DVORAK_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
diff --git a/keyboards/preonic/keymaps/cranium/keymap.c b/keyboards/preonic/keymaps/cranium/keymap.c
new file mode 100644
index 000000000..d640ff849
--- /dev/null
+++ b/keyboards/preonic/keymaps/cranium/keymap.c
@@ -0,0 +1,224 @@
+/* Copyright 2015-2017 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/>.
+ */
+
+#include QMK_KEYBOARD_H
+#include "muse.h"
+
+enum preonic_layers {
+ _QWERTY,
+ _LOWER,
+ _RAISE,
+ _ADJUST
+};
+
+enum preonic_keycodes {
+ LOWER = SAFE_RANGE,
+ RAISE,
+};
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+/* Qwerty (base layer)
+ * ,-----------------------------------------------------------------------------------.
+ * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Esc |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Tab | Q | W | E | R | T | Y | U | I | O | P | Esc |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Bksp | A | S | D | F | G | H | J | K | L | ; | " |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | Shift| Z | X | C | V | B | N | M | , | . | / | | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Ctrl | F12 | GUI | Alt |Lower | Space |Raise |AltGr | [ | ] |Enter |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_QWERTY] = LAYOUT_preonic_grid(
+ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_ESC,
+ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ESC,
+ KC_BSPC, 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_BSLS,
+ KC_LCTL, KC_F12, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_RALT, KC_LBRC, KC_RBRC, KC_ENT
+),
+
+/* Lower
+ * ,-----------------------------------------------------------------------------------.
+ * | ~ | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | + | = | | |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | LGUI | F7 | F8 | F9 | F10 | F11 | F12 | 1 | 2 | 3 | 4 | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | _ | | | | | |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_LOWER] = LAYOUT_preonic_grid(
+ KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
+ _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL,
+ KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_PLUS, KC_EQL, _______, _______,
+ KC_LGUI, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_1, KC_2, KC_3, KC_4, _______,
+ _______, _______, _______, _______, _______, KC_UNDS, KC_UNDS, _______, _______, _______, _______, _______
+),
+
+/* Raise
+ * ,-----------------------------------------------------------------------------------.
+ * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Del | F1 | F2 | F3 | F4 | F5 | F6 | Up | Down | Left |Right | |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | F7 | F8 | F9 | F10 | F11 | F12 | Home | End | | | Shift|
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | _ | | | | | |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_RAISE] = LAYOUT_preonic_grid(
+ _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
+ _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______,
+ KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UP, KC_DOWN, KC_LEFT, KC_RIGHT,_______,
+ _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_HOME, KC_END, _______, _______, KC_RSFT,
+ _______, _______, _______, _______, _______, KC_UNDS, KC_UNDS, _______, _______, _______, _______, _______
+),
+
+/* Adjust (Lower + Raise)
+ * ,-----------------------------------------------------------------------------------.
+ * | | | | | | | | | | | | Sleep|
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | Reset| Debug| | | | | | | | | |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | | | |Aud on|AudOff|AGnorm|AGswap| Vol+ | Vol- | Prev | Next | |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| | | | | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | Play | | | | | PrScr|
+ * `-----------------------------------------------------------------------------------'
+ */
+[_ADJUST] = LAYOUT_preonic_grid(
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_SLEP,
+ _______, RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, _______,
+ _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, KC_VOLU, KC_VOLD, KC_MPRV, KC_MNXT, _______,
+ _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, KC_MPLY, KC_MPLY, _______, _______, _______, _______, KC_PSCR
+)
+
+
+};
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ switch (keycode) {
+ case LOWER:
+ if (record->event.pressed) {
+ layer_on(_LOWER);
+ update_tri_layer(_LOWER, _RAISE, _ADJUST);
+ } else {
+ layer_off(_LOWER);
+ update_tri_layer(_LOWER, _RAISE, _ADJUST);
+ }
+ return false;
+ break;
+ case RAISE:
+ if (record->event.pressed) {
+ layer_on(_RAISE);
+ update_tri_layer(_LOWER, _RAISE, _ADJUST);
+ } else {
+ layer_off(_RAISE);
+ update_tri_layer(_LOWER, _RAISE, _ADJUST);
+ }
+ return false;
+ break;
+ }
+ return true;
+};
+
+bool muse_mode = false;
+uint8_t last_muse_note = 0;
+uint16_t muse_counter = 0;
+uint8_t muse_offset = 70;
+uint16_t muse_tempo = 50;
+
+void encoder_update_user(uint8_t index, bool clockwise) {
+ if (muse_mode) {
+ if (IS_LAYER_ON(_RAISE)) {
+ if (clockwise) {
+ muse_offset++;
+ } else {
+ muse_offset--;
+ }
+ } else {
+ if (clockwise) {
+ muse_tempo+=1;
+ } else {
+ muse_tempo-=1;
+ }
+ }
+ } else {
+ if (clockwise) {
+ tap_code(KC_PGDN);
+ } else {
+ tap_code(KC_PGUP);
+ }
+ }
+}
+
+void dip_update(uint8_t index, bool active) {
+ switch (index) {
+ case 0:
+ if (active) {
+ layer_on(_ADJUST);
+ } else {
+ layer_off(_ADJUST);
+ }
+ break;
+ case 1:
+ if (active) {
+ muse_mode = true;
+ } else {
+ muse_mode = false;
+ }
+ }
+}
+
+void matrix_scan_user(void) {
+ #ifdef AUDIO_ENABLE
+ if (muse_mode) {
+ if (muse_counter == 0) {
+ uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()];
+ if (muse_note != last_muse_note) {
+ stop_note(compute_freq_for_midi_note(last_muse_note));
+ play_note(compute_freq_for_midi_note(muse_note), 0xF);
+ last_muse_note = muse_note;
+ }
+ }
+ muse_counter = (muse_counter + 1) % muse_tempo;
+ } else {
+ if (muse_counter) {
+ stop_all_notes();
+ muse_counter = 0;
+ }
+ }
+ #endif
+}
+
+bool music_mask_user(uint16_t keycode) {
+ switch (keycode) {
+ case RAISE:
+ case LOWER:
+ return false;
+ default:
+ return true;
+ }
+}
diff --git a/keyboards/preonic/keymaps/cranium/readme.md b/keyboards/preonic/keymaps/cranium/readme.md
new file mode 100644
index 000000000..0f1d99598
--- /dev/null
+++ b/keyboards/preonic/keymaps/cranium/readme.md
@@ -0,0 +1,72 @@
+# Cranium's Preonic layout
+
+This layout is based on the Preonic default with some changes I find interesting to share.
+
+## Default layer
+```
+ ,-----------------------------------------------------------------------------------.
+ | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Esc |
+ |------|------|------|------|------|------|------|------|------|------|------|------|
+ | Tab | Q | W | E | R | T | Y | U | I | O | P | Esc |
+ |------|------|------|------|------|-------------|------|------|------|------|------|
+ | Bksp | A | S | D | F | G | H | J | K | L | ; | " |
+ |------|------|------|------|------|------|------|------|------|------|------|------|
+ | Shift| Z | X | C | V | B | N | M | , | . | / | | |
+ |------|------|------|------|------|------|------|------|------|------|------|------|
+ | Ctrl | F12 | GUI | Alt |Lower | Space |Raise |AltGr | [ | ] |Enter |
+ `-----------------------------------------------------------------------------------'
+```
+- As a Colemak user, Capslock was rebound to Backspace.
+- Escape was moved to the top-right of the keyboard
+- Enter was moved to the bottom-right of the keyboard. It's now easy to hit and can even be activated with the palm.
+- An F12 was put next to the left CTRL => it's the shortcut I use to toggle the Guake terminal.
+- I don't really use the key below my Escape (top-right, 2nd row), so I'll consider any ideas for the moment.
+
+
+## Lower
+```
+ ,-----------------------------------------------------------------------------------.
+ | ~ | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 |
+ |------|------|------|------|------|-------------|------|------|------|------|------|
+ | | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del |
+ |------|------|------|------|------|-------------|------|------|------|------|------|
+ | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | + | = | | |
+ |------|------|------|------|------|------|------|------|------|------|------|------|
+ | LGUI | F7 | F8 | F9 | F10 | F11 | F12 | 1 | 2 | 3 | 4 | |
+ |------|------|------|------|------|------|------|------|------|------|------|------|
+ | | | | | | _ | | | | | |
+ `-----------------------------------------------------------------------------------'
+```
+- Not much changes here
+
+## Raise
+```
+ ,-----------------------------------------------------------------------------------.
+ | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | |
+ |------|------|------|------|------|------|------|------|------|------|------|------|
+ | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | |
+ |------|------|------|------|------|-------------|------|------|------|------|------|
+ | Del | F1 | F2 | F3 | F4 | F5 | F6 | Up | Down | Left |Right | |
+ |------|------|------|------|------|------|------|------|------|------|------|------|
+ | | F7 | F8 | F9 | F10 | F11 | F12 | Home | End | | | Shift|
+ |------|------|------|------|------|------|------|------|------|------|------|------|
+ | | | | | | _ | | | | | |
+ `-----------------------------------------------------------------------------------'
+```
+- Perhaps one of the most interesting change: the arrow keys were moved to the right-hand home row, activated with the Raise layer. It means I can use the arrow keys without moving my hand from the home row, by activating the Raise layer with my thumb. It took a while to adapt but it was totally worth it. To note, I also put Home/End on the same layer but one row below, with I also find really useful.
+
+## Adjust
+```
+ ,-----------------------------------------------------------------------------------.
+ | | | | | | | | | | | | Sleep|
+ |------|------|------|------|------|------|------|------|------|------|------|------|
+ | | Reset| Debug| | | | | | | | | |
+ |------|------|------|------|------|-------------|------|------|------|------|------|
+ | | | |Aud on|AudOff|AGnorm|AGswap| Vol+ | Vol- | Prev | Next | |
+ |------|------|------|------|------|------|------|------|------|------|------|------|
+ | |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| | | | | |
+ |------|------|------|------|------|------|------|------|------|------|------|------|
+ | | | | | | Play | | | | | PrScr|
+ `-----------------------------------------------------------------------------------'
+```
+- The "arrow" keys act as Vol+/Vol-/Previous/Next on the Adjust layer (which is quite a natural mapping for these media keys).
diff --git a/keyboards/preonic/keymaps/cranium/rules.mk b/keyboards/preonic/keymaps/cranium/rules.mk
new file mode 100644
index 000000000..dcf16bef3
--- /dev/null
+++ b/keyboards/preonic/keymaps/cranium/rules.mk
@@ -0,0 +1 @@
+SRC += muse.c
diff --git a/keyboards/preonic/keymaps/default/keymap.c b/keyboards/preonic/keymaps/default/keymap.c
index d37882eab..d8bb2d5f7 100644
--- a/keyboards/preonic/keymaps/default/keymap.c
+++ b/keyboards/preonic/keymaps/default/keymap.c
@@ -213,12 +213,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
backlight_step();
#endif
#ifdef __AVR__
- PORTE &= ~(1<<6);
+ writePinLow(E6);
#endif
} else {
unregister_code(KC_RSFT);
#ifdef __AVR__
- PORTE |= (1<<6);
+ writePinHigh(E6);
#endif
}
return false;
@@ -259,41 +259,44 @@ void encoder_update_user(uint8_t index, bool clockwise) {
}
}
-void dip_update(uint8_t index, bool active) {
- switch (index) {
- case 0:
- if (active) {
- layer_on(_ADJUST);
- } else {
- layer_off(_ADJUST);
- }
- break;
- case 1:
- if (active) {
- muse_mode = true;
- } else {
- muse_mode = false;
- #ifdef AUDIO_ENABLE
- stop_all_notes();
- #endif
- }
- }
+void dip_switch_update_user(uint8_t index, bool active) {
+ switch (index) {
+ case 0:
+ if (active) {
+ layer_on(_ADJUST);
+ } else {
+ layer_off(_ADJUST);
+ }
+ break;
+ case 1:
+ if (active) {
+ muse_mode = true;
+ } else {
+ muse_mode = false;
+ }
+ }
}
+
void matrix_scan_user(void) {
- #ifdef AUDIO_ENABLE
+#ifdef AUDIO_ENABLE
if (muse_mode) {
- if (muse_counter == 0) {
- uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()];
- if (muse_note != last_muse_note) {
- stop_note(compute_freq_for_midi_note(last_muse_note));
- play_note(compute_freq_for_midi_note(muse_note), 0xF);
- last_muse_note = muse_note;
+ if (muse_counter == 0) {
+ uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()];
+ if (muse_note != last_muse_note) {
+ stop_note(compute_freq_for_midi_note(last_muse_note));
+ play_note(compute_freq_for_midi_note(muse_note), 0xF);
+ last_muse_note = muse_note;
+ }
+ }
+ muse_counter = (muse_counter + 1) % muse_tempo;
+ } else {
+ if (muse_counter) {
+ stop_all_notes();
+ muse_counter = 0;
}
- }
- muse_counter = (muse_counter + 1) % muse_tempo;
}
- #endif
+#endif
}
bool music_mask_user(uint16_t keycode) {
diff --git a/keyboards/preonic/keymaps/egstad/config.h b/keyboards/preonic/keymaps/egstad/config.h
new file mode 100644
index 000000000..e66743f45
--- /dev/null
+++ b/keyboards/preonic/keymaps/egstad/config.h
@@ -0,0 +1,91 @@
+#pragma once
+#define TAPPING_TERM 200
+#define IGNORE_MOD_TAP_INTERRUPT
+
+
+
+
+
+/* Leader Key
+ ========================================================================== */
+
+// Activates the leader key
+// #define LEADER_PER_KEY_TIMING
+// resets the timeout after each key is tapped
+// #define LEADER_TIMEOUT 240
+
+
+
+
+
+
+/* Autoshifting
+ ========================================================================== */
+
+// This controls how long you have to hold a key before you get the shifted state.
+#define AUTO_SHIFT_TIMEOUT 150
+
+// Do not Auto Shift special keys -_, =+, [{, ]}, ;:, '", ,<, .>, and /?
+// #define NO_AUTO_SHIFT_SPECIAL
+
+// Do not Auto Shift numeric keys, zero through nine.
+#define NO_AUTO_SHIFT_NUMERIC
+
+// Do not Auto Shift alpha characters, which include A through Z.
+// #define NO_AUTO_SHIFT_ALPHA
+
+// Lower the Auto Shift timeout variable (down)
+// KC_ASDN
+
+// Raise the Auto Shift timeout variable (up)
+// KC_ASUP
+
+// Report your current Auto Shift timeout value
+// KC_ASRP
+
+// Turns on the Auto Shift Function
+// KC_ASON
+
+// Turns off the Auto Shift Function
+// KC_ASOFF
+
+// Toggles the state of the Auto Shift feature
+// KC_ASTG
+
+
+#ifdef AUDIO_ENABLE
+ #define STARTUP_SONG SONG(COIN_SOUND)
+ // #define STARTUP_SONG SONG(NO_SOUND)
+
+ #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
+ SONG(COLEMAK_SOUND), \
+ SONG(DVORAK_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
+
diff --git a/keyboards/preonic/keymaps/egstad/keymap.c b/keyboards/preonic/keymaps/egstad/keymap.c
new file mode 100644
index 000000000..07eda6614
--- /dev/null
+++ b/keyboards/preonic/keymaps/egstad/keymap.c
@@ -0,0 +1,229 @@
+#include QMK_KEYBOARD_H
+
+
+
+
+
+
+/* LAYER NAMES
+ ==========================================================================
+ 1. To create a layer, define a (readable) name and set layer value
+ 2. Under "Layer definitions" section, define keymaps
+ ========================================================================== */
+
+enum layer_names {
+ L_QWERTY,
+ L_LOWER,
+ L_RAISE,
+ L_ADJUST,
+};
+
+
+
+
+/* TAP DANCE
+ ==========================================================================
+ 1. Define TD names here
+ 2. Register action in tap_dance_actions[]
+ ========================================================================== */
+
+enum {
+ TD_BRC = 0,
+ TD_MIN,
+ TD_GV_ESC,
+ TD_BS
+};
+
+
+
+
+/* CUSTOM KEYMAPS
+ ========================================================================== */
+
+// Tap dances
+#define TD_ESCP TD(TD_GV_ESC) // Tap for grave, twice for escape
+#define TD_MINS TD(TD_MIN) // Tap for minus, twice for equal
+#define TD_BRAC TD(TD_BRC) // Tap for open brace, twice for close
+
+// Layers
+#define LT2_TAB LT(L_RAISE, KC_TAB) // Tap for tab, hold for RAISE
+#define LT2_ENT LT(L_RAISE, KC_ENT) // Tap for enter, hold for RAISE
+#define LT1_BSP LT(L_LOWER, KC_BSPACE) // Tap for backspace, hold for LOWER
+#define LT1_SPC LT(L_LOWER, KC_SPC) // Tap for space, hold for LOWER
+
+// Modifiers
+#define LG_ZMIN LGUI(KC_EQUAL) // Command + plus (zoom in)
+#define LG_ZMOT LGUI(KC_MINUS) // Command + minus (zoom out)
+#define MT_SHFT MT(MOD_RSFT, KC_ENT) // Tap for enter, hold for shift
+#define MT_HILF S(A(KC_LEFT)) // Press for shift + alt + left
+#define MT_HIRT S(A(KC_RGHT)) // Press for shift + alt + right
+#define MT_UNTB S(KC_TAB) // Press for shift + tab
+
+
+
+
+
+
+/* Layer definitions
+ ========================================================================== */
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+/* QWERTY
+ * ,-----------------------------------------------------------------------------------------------.
+ * | ` ESC | 1 ! | 2 @ | 3 # | 4 $ | 5 % | 6 ^ | 7 & | 8 * | 9 ( | 0 ) | -_ =+ |
+ * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
+ * | TB/RS | Q | W | E | R | T | Y | U | I | O | P | [{ }] |
+ * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
+ * | BS/LW | A | S | D | F | G | H | J | K | L | ; | ' |
+ * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
+ * | SFT | Z | X | C | V | B | N | M | , | . | / | SF/RN |
+ * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
+ * | LEADR | | CTL | ALT | CMD | BSP | SP/LW | RN/RS | ← | ↑ | ↓ | → |
+ * `-----------------------------------------------------------------------------------------------
+ */
+
+[L_QWERTY] = LAYOUT_preonic_grid(
+/*01 02 03 04 05 06 07 08 09 10 11 12 */
+ TD_ESCP, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, TD_MINS, \
+ LT2_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, TD_BRAC, \
+ LT1_BSP, 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, MT_SHFT, \
+ LG_ZMOT, LG_ZMIN, KC_LCTL, KC_LALT, KC_LGUI, KC_BSPACE, LT1_SPC, LT2_ENT, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT \
+),
+
+
+
+
+
+
+ /* LOWER
+ * ,-----------------------------------------------------------------------------------------------.
+ * | ASHFT | | | | | | | | | | | BSP |
+ * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
+ * | UNTAB | | | | | | | - | + | * | / | |
+ * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
+ * | | S+A+← | S+A+→ | | | | | ← | ↑ | ↓ | → | RTN |
+ * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
+ * | | | | | | | | [ { | ] } | ( | ) | \ | |
+ * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
+ * | | | | | | | >|| | | << | Vol-U | Vol-D | >> |
+ * `-----------------------------------------------------------------------------------------------'
+ */
+
+[L_LOWER] = LAYOUT_preonic_grid(
+/*01 02 03 04 05 06 07 08 09 10 11 12 */
+ KC_ASTG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BSPACE, \
+ MT_UNTB, _______, _______, _______, _______, _______, _______, KC_MINUS, KC_PLUS, KC_PAST, KC_PSLS, _______, \
+ _______, MT_HILF, MT_HIRT, _______, _______, _______, _______, KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT, KC_ENTER, \
+ _______, _______, _______, _______, _______, _______, _______, KC_LBRC, KC_RBRC, KC_LPRN, KC_RPRN, KC_BSLASH, \
+ _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MRWD, KC_VOLU, KC_VOLD, KC_MFFD \
+),
+
+
+
+
+
+
+/* RAISE
+ * ,-----------------------------------------------------------------------------------------------.
+ * | ASHFT | BTSDN | BTSUP | VUP | VDN | | | / | * | ( | ) | |
+ * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
+ * | | | | | | | | 7 | 8 | 9 | + | |
+ * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
+ * | | | | | | | | 4 | 5 | 6 | - | |
+ * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
+ * | CAP | | | | | | | 1 | 2 | 3 | / | |
+ * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
+ * | | | | | | | | | 0 | . | , | |
+ * `-----------------------------------------------------------------------------------------------'
+ */
+[L_RAISE] = LAYOUT_preonic_grid(
+/*01 02 03 04 05 06 07 08 09 10 11 12 */
+ KC_ASTG, KC_F1, KC_F2, KC_VOLU, KC_VOLD, _______, _______, KC_PSLS, KC_PAST, KC_LPRN, KC_RPRN, _______, \
+ _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PLUS, _______, \
+ _______, _______, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, KC_MINUS, _______, \
+ KC_CAPS, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, KC_PSLS, _______, \
+ _______, _______, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, KC_COMM, _______ \
+),
+
+
+
+
+
+
+
+/* Adjust (Raise + Lower together)
+ * ,-----------------------------------------------------------------------------------------------.
+ * | F12 | FN2 | FN3 | FN4 | FN5 | FN6 | FN7 | FN8 | FN9 | F10 | F11 | FN1 |
+ * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
+ * | | | | | | | | | | | | |
+ * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
+ * | | | | | | | | | | | | |
+ * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
+ * | TOG SF| | | | | | | | | | | |
+ * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
+ * | DESGN | | | | | | | | | | | |
+ * `-----------------------------------------------------------------------------------------------'
+ */
+
+[L_ADJUST] = LAYOUT_preonic_grid(
+/*01 02 03 04 05 06 07 08 09 10 11 12 */
+ 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_ASTG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
+)
+
+};
+
+// this function
+uint32_t layer_state_set_user(uint32_t state) {
+ return update_tri_layer_state(state, L_LOWER, L_RAISE, L_ADJUST);
+}
+
+
+
+
+
+
+/* BLANK
+ * ,-----------------------------------------------------------------------------------------------.
+ * | | | | | | | | | | | | |
+ * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
+ * | | | | | | | | | | | | |
+ * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
+ * | | | | | | | | | | | | |
+ * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
+ * | | | | | | | | | | | | |
+ * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
+ * | | | | | | | | | | | | |
+ * `-----------------------------------------------------------------------------------------------'
+ */
+/*
+[L_BLANK] = LAYOUT_preonic_grid(
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
+),
+*/
+
+
+
+
+
+
+/* Tap Dance Definitions
+ ========================================================================== */
+
+qk_tap_dance_action_t tap_dance_actions[] = {
+ // Tap once for Left Brace, twice for Right Brace
+ [TD_BRC] = ACTION_TAP_DANCE_DOUBLE(KC_LBRC, KC_RBRC),
+ //Tap once for Minus, twice for Equal
+ [TD_MIN] = ACTION_TAP_DANCE_DOUBLE(KC_MINUS, KC_EQUAL),
+ // Tap once for Grave, tap twice for Escape
+ [TD_GV_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_GRAVE, KC_ESCAPE)
+};
diff --git a/keyboards/preonic/keymaps/egstad/readme.md b/keyboards/preonic/keymaps/egstad/readme.md
new file mode 100644
index 000000000..2c8e095a4
--- /dev/null
+++ b/keyboards/preonic/keymaps/egstad/readme.md
@@ -0,0 +1,11 @@
+# Egstad's Layout
+
+## Build
+
+- Cd into this directory, run `npm start`
+- Cd into root with `npm run qmk`, locate bin file "preonic_rev3_egstad.bin"
+- Drop that bin into QMK Toolbox and flash Keeb
+
+## Learnings
+
+ 1. Combos — Don't fuck with 'em. They made my keys feel sticky and increased typos. Would be great on macropad or something tho!
diff --git a/keyboards/preonic/keymaps/egstad/rules.mk b/keyboards/preonic/keymaps/egstad/rules.mk
new file mode 100644
index 000000000..5348bfdf9
--- /dev/null
+++ b/keyboards/preonic/keymaps/egstad/rules.mk
@@ -0,0 +1,3 @@
+SRC += muse.c
+TAP_DANCE_ENABLE = yes
+AUTO_SHIFT_ENABLE = yes
diff --git a/keyboards/preonic/keymaps/kjwon15/config.h b/keyboards/preonic/keymaps/kjwon15/config.h
new file mode 100644
index 000000000..af7b8bc28
--- /dev/null
+++ b/keyboards/preonic/keymaps/kjwon15/config.h
@@ -0,0 +1,67 @@
+#pragma once
+
+
+#define TAPPING_TERM 200
+
+/* #define MK_3_SPEED */
+#define MK_MOMENTARY_ACCEL
+#define MOUSEKEY_MAX_SPEED 8
+
+// Must raise 5 halftones
+/* #define CUSTOM_STARTUP \ */
+/* Q__NOTE(_FS7), \ */
+/* W__NOTE(_B7), */
+
+#undef MUSICAL_NOTE
+#define MUSICAL_NOTE(note, duration) {((NOTE##note) * 1.3348398541700344), duration}
+
+#define CUSTOM_STARTUP \
+ QD_NOTE(_A6), \
+ QD_NOTE(_C7), \
+ QD_NOTE(_A7), \
+ QD_NOTE(_F7), \
+ QD_NOTE(_G7), \
+ HD_NOTE(_C8),
+
+#undef MUSICAL_NOTE
+#define MUSICAL_NOTE(note, duration) {(NOTE##note), duration}
+
+#ifdef AUDIO_ENABLE
+ #define STARTUP_SONG SONG(CUSTOM_STARTUP)
+ // #define STARTUP_SONG SONG(NO_SOUND)
+
+ #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
+ SONG(COLEMAK_SOUND), \
+ SONG(DVORAK_SOUND) \
+ }
+#endif
+
+#define MUSIC_MASK (keycode != KC_NO)
+
+#define AUDIO_CLICKY
+#define AUDIO_CLICKY_FREQ_DEFAULT 440.f
+
+/*
+ * 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
+
diff --git a/keyboards/preonic/keymaps/kjwon15/keymap.c b/keyboards/preonic/keymaps/kjwon15/keymap.c
new file mode 100644
index 000000000..bca3575fd
--- /dev/null
+++ b/keyboards/preonic/keymaps/kjwon15/keymap.c
@@ -0,0 +1,376 @@
+/* Copyright 2015-2017 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/>.
+ */
+
+#include QMK_KEYBOARD_H
+#include "muse.h"
+
+enum preonic_layers {
+ _QWERTY,
+ _PURE,
+ _BLANK,
+ _LOWER,
+ _RAISE,
+ _ADJUST,
+
+ _MOUSE
+};
+
+enum preonic_keycodes {
+ QWERTY = SAFE_RANGE,
+ PURE,
+ BLANK,
+ LOWER,
+ RAISE,
+ KC_CESC,
+ SPC_MOU
+};
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+/* Qwerty
+ * ,-----------------------------------------------------------------------------------.
+ * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | C/ESC| A | S | D | F | G | H | J | K | L | ; | " |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | Shift| Z | X | C | V | B | N | M | , | . | / | SF/EN|
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Enter| Ctrl | GUI | Alt |Lower | Space |Raise | Left | Down | Up |Right |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_QWERTY] = LAYOUT_preonic_grid(
+ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, 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_CESC, 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_SFTENT, \
+ KC_ENT, KC_LCTL, KC_LGUI, KC_LALT, LOWER, SPC_MOU, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
+),
+
+/* Pure
+ * ,-----------------------------------------------------------------------------------.
+ * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Cntl | A | S | D | F | G | H | J | K | L | ; | " |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | Shift| Z | X | C | V | B | N | M | , | . | / | Shift|
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Enter| Ctrl | GUI | Alt |Lower | Space |Raise | Left | Down | Up |Right |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_PURE] = LAYOUT_preonic_grid(
+ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, 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_LCTL, 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_RSFT, \
+ KC_ENT, KC_LCTL, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
+),
+
+/* Blank
+ * ,-----------------------------------------------------------------------------------.
+ * | | | | | | | | | | | | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | | | | | | | |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | | | | | | | | | | | | |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | | | | | | | | | | | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | |Lower | |Raise | | | | |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_BLANK] = LAYOUT_preonic_grid(
+ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \
+ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \
+ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \
+ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \
+ KC_NO, KC_NO, KC_NO, KC_NO, LOWER, KC_NO, KC_NO, RAISE, KC_NO, KC_NO, KC_NO, KC_NO \
+),
+
+/* Lower
+ * ,-----------------------------------------------------------------------------------.
+ * | ESC | ! | @ | # | $ | % | ^ | & | * | - | = | Bksp |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | HOME | END | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | | | Ralt | Vol- | Vol+ | Play |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_LOWER] = LAYOUT_preonic_grid(
+ KC_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_MINS, KC_EQL , KC_BSPC, \
+ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \
+ _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
+ _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_HOME, KC_END, _______, \
+ _______, _______, _______, _______, _______, _______, _______, _______, KC_RALT, KC_VOLD, KC_VOLU, KC_MPLY \
+),
+
+/* Raise
+ * ,-----------------------------------------------------------------------------------.
+ * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 |PrtScr|
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | | MUTE | VOL- | VOL+ | F4 | F5 | F6 | - | = | [ | ] | \ |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | PLAY | PREV | NEXT | STOP | F11 | F12 |ISO # |ISO / | PGDN | PGUP | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | | | Ralt | Vol- | Vol+ | Mute |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_RAISE] = LAYOUT_preonic_grid(
+ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PSCR, \
+ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \
+ _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \
+ _______, KC_MPLY, KC_MPRV, KC_MNXT, KC_MSTP, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGDN, KC_PGUP, _______, \
+ _______, _______, _______, _______, _______, _______, _______, _______, KC_RALT, KC_VOLD, KC_VOLU, KC_MUTE \
+),
+
+/* Adjust (Lower + Raise)
+ * ,-----------------------------------------------------------------------------------.
+ * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | LOCK | Reset|Clicky|AudMod|Qwerty|Colemk|Dvorak| WHL_D| MS_U | WHL_U| | Del |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | |Aud on|AudOff|Rclick|Lclick|AGnorm|AGswap| MS_L | MS_D | MS_R | | |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| | | | | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | | | | | | |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_ADJUST] = LAYOUT_preonic_grid(
+ 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_LOCK, RESET, CK_TOGG, MU_MOD, QWERTY, PURE, BLANK, KC_WH_D, KC_MS_U, KC_WH_U, _______, KC_DEL, \
+ _______, AU_ON, AU_OFF, KC_BTN2, KC_BTN1, AG_NORM, AG_SWAP, KC_MS_L, KC_MS_D, KC_MS_R, _______, KC_ACL0, \
+ _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, KC_ACL1, \
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_ACL2 \
+),
+
+/* Mouse
+ * ,-----------------------------------------------------------------------------------.
+ * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | WHL_U|Mclick| | | | LCTL | MS_U | WHL_U| | Del |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | | | WHL_D|Rclick|Lclick| | | MS_L | MS_D | MS_R | | ACL0 |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | | | | | | | WHL_D| WHL_L| WHL_R| | ACL1 |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | | | | | | ACL2 |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_MOUSE] = LAYOUT_preonic_grid(
+ 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_WH_U, KC_BTN3, _______, _______, _______, KC_LCTL, KC_MS_U, KC_WH_U, _______, KC_DEL, \
+ _______, _______, KC_WH_D, KC_BTN2, KC_BTN1, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, KC_ACL0, \
+ _______, _______, _______, _______, _______, _______, _______, KC_WH_D, KC_WH_L, KC_WH_R, _______, KC_ACL1, \
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_ACL2 \
+ )
+
+
+};
+
+static bool cntl_interrupted = 0;
+static uint16_t cntl_timer = 0;
+
+static bool mouse_interrupted = 0;
+static uint16_t mouse_timer = 0;
+
+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 PURE:
+ if (record->event.pressed) {
+ set_single_persistent_default_layer(_PURE);
+ }
+ return false;
+ break;
+ case BLANK:
+ if (record->event.pressed) {
+ set_single_persistent_default_layer(_BLANK);
+ }
+ return false;
+ break;
+ case LOWER:
+ if (record->event.pressed) {
+ layer_on(_LOWER);
+ update_tri_layer(_LOWER, _RAISE, _ADJUST);
+ } else {
+ layer_off(_LOWER);
+ update_tri_layer(_LOWER, _RAISE, _ADJUST);
+ }
+ return false;
+ break;
+ case RAISE:
+ if (record->event.pressed) {
+ layer_on(_RAISE);
+ update_tri_layer(_LOWER, _RAISE, _ADJUST);
+ } else {
+ layer_off(_RAISE);
+ update_tri_layer(_LOWER, _RAISE, _ADJUST);
+ }
+ return false;
+ break;
+
+ // BACKLIT is not used. If you want to use, uncomment below
+ /*
+ case BACKLIT:
+ if (record->event.pressed) {
+ register_code(KC_RSFT);
+ #ifdef BACKLIGHT_ENABLE
+ backlight_step();
+ #endif
+ #ifdef __AVR__
+ PORTE &= ~(1<<6);
+ #endif
+ } else {
+ unregister_code(KC_RSFT);
+ #ifdef __AVR__
+ PORTE |= (1<<6);
+ #endif
+ }
+ return false;
+ break;
+ */
+
+ case KC_CESC:
+ if (record->event.pressed) {
+ cntl_interrupted = false;
+ cntl_timer = timer_read();
+ register_mods(MOD_BIT(KC_LCTL));
+ } else if (!cntl_interrupted && timer_elapsed(cntl_timer) < TAPPING_TERM) {
+ unregister_mods(MOD_BIT(KC_LCTL));
+ tap_code(KC_ESC);
+ } else {
+ unregister_mods(MOD_BIT(KC_LCTL));
+ }
+ return false;
+ break;
+
+ case SPC_MOU:
+ if (record->event.pressed) {
+ mouse_interrupted = false;
+ mouse_timer = timer_read();
+
+ cntl_interrupted = true;
+ layer_on(_MOUSE);
+ } else if (!mouse_interrupted && timer_elapsed(mouse_timer) < TAPPING_TERM) {
+ layer_off(_MOUSE);
+ tap_code(KC_SPC);
+ } else {
+ layer_off(_MOUSE);
+ }
+ return false;
+ break;
+
+ default:
+ cntl_interrupted = true;
+ mouse_interrupted = true;
+ break;
+ }
+ return true;
+};
+
+bool muse_mode = false;
+uint8_t last_muse_note = 0;
+uint16_t muse_counter = 0;
+uint8_t muse_offset = 70;
+uint16_t muse_tempo = 50;
+
+void encoder_update_user(uint8_t index, bool clockwise) {
+ if (muse_mode) {
+ if (IS_LAYER_ON(_RAISE)) {
+ if (clockwise) {
+ muse_offset++;
+ } else {
+ muse_offset--;
+ }
+ } else {
+ if (clockwise) {
+ muse_tempo+=1;
+ } else {
+ muse_tempo-=1;
+ }
+ }
+ } else {
+ if (clockwise) {
+ tap_code(KC_PGDN);
+ } else {
+ tap_code(KC_PGUP);
+ }
+ }
+}
+
+void dip_switch_update_user(uint8_t index, bool active) {
+ switch (index) {
+ case 0:
+ if (active) {
+ layer_on(_ADJUST);
+ } else {
+ layer_off(_ADJUST);
+ }
+ break;
+ case 1:
+ if (active) {
+ muse_mode = true;
+ } else {
+ muse_mode = false;
+ }
+ }
+}
+
+void matrix_scan_user(void) {
+#ifdef AUDIO_ENABLE
+ if (muse_mode) {
+ if (muse_counter == 0) {
+ uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()];
+ if (muse_note != last_muse_note) {
+ stop_note(compute_freq_for_midi_note(last_muse_note));
+ play_note(compute_freq_for_midi_note(muse_note), 0xF);
+ last_muse_note = muse_note;
+ }
+ }
+ muse_counter = (muse_counter + 1) % muse_tempo;
+ } else {
+ if (muse_counter) {
+ stop_all_notes();
+ muse_counter = 0;
+ }
+ }
+#endif
+}
+
+bool music_mask_user(uint16_t keycode) {
+ switch (keycode) {
+ case RAISE:
+ case LOWER:
+ return false;
+ default:
+ return true;
+ }
+}
diff --git a/keyboards/preonic/keymaps/kjwon15/readme.md b/keyboards/preonic/keymaps/kjwon15/readme.md
new file mode 100644
index 000000000..5d03a1a0b
--- /dev/null
+++ b/keyboards/preonic/keymaps/kjwon15/readme.md
@@ -0,0 +1,27 @@
+# Kjwon15's Preonic layout
+
+
+## It provides almost full functionality for linux
+
+It has screen capture key which is also used on sysq
+
+
+## Mouse layer
+
+Press left spacebar to activate mouse mode.
+Right hand to move cursor/scroll, Left hand to click
+
+
+## Dual function keys
+
+Right shift is also Enter key. If you press and hold, that key act as shift. But if you tap that key, It is enter key.
+If you want to press and hold enter key, Use left-bottom key. That is pure enter.
+
+## Blank layout
+
+If you want to lock your keyboard, switch to this layout. It also useful when you want to clean your keyboard without disconnecting USB.
+
+
+## Pure mode
+
+Dual function keys are so annoying when you playing game. Then use this layout
diff --git a/keyboards/preonic/keymaps/kjwon15/rules.mk b/keyboards/preonic/keymaps/kjwon15/rules.mk
new file mode 100644
index 000000000..5ffe1ff32
--- /dev/null
+++ b/keyboards/preonic/keymaps/kjwon15/rules.mk
@@ -0,0 +1,2 @@
+SRC += muse.c
+KEY_LOCK_ENABLE = yes
diff --git a/keyboards/preonic/keymaps/laurentlaurent/config.h b/keyboards/preonic/keymaps/laurentlaurent/config.h
new file mode 100644
index 000000000..36944e9c6
--- /dev/null
+++ b/keyboards/preonic/keymaps/laurentlaurent/config.h
@@ -0,0 +1,41 @@
+#pragma once
+
+#ifdef AUDIO_ENABLE
+ #define STARTUP_SONG SONG(PREONIC_SOUND)
+ // #define STARTUP_SONG SONG(NO_SOUND)
+
+ #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
+ SONG(COLEMAK_SOUND), \
+ SONG(DVORAK_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
+
+// Fix Home Row mod keys
+#define IGNORE_MOD_TAP_INTERRUPT
+//#define RETRO_TAPPING \ No newline at end of file
diff --git a/keyboards/preonic/keymaps/laurentlaurent/keymap.c b/keyboards/preonic/keymaps/laurentlaurent/keymap.c
new file mode 100644
index 000000000..c113bcaf6
--- /dev/null
+++ b/keyboards/preonic/keymaps/laurentlaurent/keymap.c
@@ -0,0 +1,603 @@
+/* Laurent's Preonic Layout
+ */
+
+// For IntelliSense
+ #ifdef __INTELLISENSE__
+ #include "../../rev3/config.h"
+ #include "../../rev3/rev3.h"
+ enum dynamic_macro_keycodes {
+ DYN_REC_START1 = DYNAMIC_MACRO_RANGE,
+ DYN_REC_START2,
+ DYN_REC_STOP,
+ DYN_MACRO_PLAY1,
+ DYN_MACRO_PLAY2,
+ };
+ #define QMK_KEYBOARD_H "rev3.h"
+ #endif
+
+ #include QMK_KEYBOARD_H
+ #include "muse.h"
+
+// ==== These keys allows usage of the home row as modifiers (when held) ====
+// Very bad for gaming, switch to gaming layout
+
+ // For _QWERTY_MAC
+ // S and L into Ctrl
+ #define LCT_S LCTL_T(KC_S)
+ #define LCT_L LCTL_T(KC_L)
+ // F, J and Z into CMD
+ #define LWN_F LGUI_T(KC_F)
+ #define LWN_Z LGUI_T(KC_Z)
+ #define LWN_J LGUI_T(KC_J)
+
+ // For _QWERTY_WIN
+ // S and L into WIN
+ #define LWN_S LGUI_T(KC_S)
+ #define LWN_L LGUI_T(KC_L)
+ // F, J and Z into Ctrl
+ #define LCT_F LCTL_T(KC_F)
+ #define LCT_Z LCTL_T(KC_Z)
+ #define LCT_J LCTL_T(KC_J)
+
+// ============================================================================
+
+// ==== For All ====
+
+ // Layout helper
+ #define __LYB__ KC_TRANSPARENT
+
+ // Mod Tap
+ // Changing K and D into Alt
+ #define LAT_D LALT_T(KC_D)
+ #define LAT_K LALT_T(KC_K)
+ // Equal into Ctrl+Alt+Cmd
+ #define LCAGEQ LCAG_T(KC_EQUAL)
+ // Esc into Meh
+ #define LMHESC MEH_T(KC_ESC)
+ // Space into Shift
+ #define LSHFSP SFT_T(KC_SPACE)
+ // Backspace into Shift
+ #define LSHFBK SFT_T(KC_BSPACE)
+
+ // Switching layers
+ #define LTO_BS TO(_QWERTY_MAC) // Go to Base Layer
+ // Go to _NAV
+ #define LLY_SC LT(_NAV, KC_SCLN) // From ;
+ #define LLY_A LT(_NAV, KC_A) // From A
+ // Go to _PUNC
+ #define LLY_TB LT(_PUNC, KC_TAB) // From Tab
+ #define LLY_BK LT(_PUNC, KC_BSPACE) // From Backspace
+ #define LLY_BS LT(_PUNC, KC_BSLASH) // From Backslash
+ // Others
+ #define LLY_GR LT(_ONEHD, KC_GRV) // Go to _ONEHD from `
+ #define LLY_ET LT(_EXTRA, KC_ENT) // Go to _EXTRA from Enter
+ #define LLSWIT MO(_LYSWT) // Layer Switcher
+ #define LLY_DL LT(_NUM, KC_DEL) // Go to _NUM from Delete
+
+ // Shortcuts
+ // Mac Windows Resizing
+ #define LMW_L3 LCA(KC_E) // Resize to 2/3 and move to the left
+ #define LMW_FS LCA(KC_ENTER) // Resize to full screen
+ #define LMW_R3 LCA(KC_T) // Resize to 2/3 and move to the right
+ #define LMW_L1 LCA(KC_D) // Resize to 1/3 and move to the left
+ #define LMW_M1 LCA(KC_F) // Resize to 1/3 and move to middle
+ #define LMW_R1 LCA(KC_G) // Resize to 1/3 and move to right
+ #define LMW_TL LCA(KC_U) // Fit on Top Left corner
+ #define LMW_TR LCA(KC_I) // Fit on Top Left corner
+ #define LMW_BL LCA(KC_J) // Fit on Top Left corner
+ #define LMW_BR LCA(KC_K) // Fit on Top Left corner
+ #define LMW_LT LCA(KC_LEFT) // Resize to 1/2 horizontally and move to the left
+ #define LMW_BT LCA(KC_DOWN) // Resize to 1/2 vertically and move to the bottom
+ #define LMW_TP LCA(KC_UP) // Resize to 1/2 vertically and move to the top
+ #define LMW_RT LCA(KC_RIGHT) // Resize to 1/2 horizontally and move to the right
+
+// ==== Audio ====
+ #ifdef AUDIO_ENABLE
+ #include "audio.h"
+ float tone_macro1_record[][2] = SONG(CAPS_LOCK_ON_SOUND);
+ float tone_macro2_record[][2] = SONG(SCROLL_LOCK_ON_SOUND);
+ float tone_macro_record_stop[][2] = SONG(SCROLL_LOCK_OFF_SOUND);
+ #endif
+
+enum preonic_layers {
+ _QWERTY_MAC,
+ _QWERTY_WIN,
+ _GAMING,
+ _MUSIC,
+ _LOWER,
+ _RAISE,
+ _ADJUST,
+ _PUNC,
+ _EXTRA,
+ _NUM,
+ _NAV,
+ _ONEHD,
+ _LYSWT };
+
+enum preonic_keycodes {
+ QWERTY = SAFE_RANGE,
+ QWWIN,
+ // COLEMAK,
+ // DVORAK,
+ LOWER,
+ RAISE,
+ BACKLIT,
+ DYNAMIC_MACRO_RANGE,
+};
+
+#include "dynamic_macro.h"
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+ /* Qwerty for Mac
+ * ,-----------------------------------------------------------------------------------.
+ * | CAG= | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | LY|TB| Q | W | E | R | T | Y | U | I | O | P | LY|\ |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Hyper| LY|A | CT/S | AT/D | WN/F | G | H | WN/J | AT/K | CT/L | LY|; | " |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | Shift| WN/Z | X | C | V | B | N | M | , | . | / | Sh/Bk|
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | LY|` |ESCMEH| LY|DL|LW|Bkp|LY|Bkp| Shift/Space |LY|ENT|RS|Bkp| [ | ] |LY_SW |
+ * `-----------------------------------------------------------------------------------'
+ * LY|` -> To _NUM
+ * LY|; -> To _NAV
+ * LY|A -> To _NAV
+ * LY|TB -> To _PUNC
+ * LY|\ -> To _PUNC
+ * LY|Bkp -> To _PUNC
+ * LY|ENT -> To_EXTRA
+ */
+ [_QWERTY_MAC] = LAYOUT_preonic_grid( \
+ LCAGEQ, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS,
+ LLY_TB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, LLY_BS,
+ KC_HYPR, LLY_A, LCT_S, LAT_D, LWN_F, KC_G, KC_H, LWN_J, LAT_K, LCT_L, LLY_SC, KC_QUOT,
+ KC_LSFT, LWN_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, LSHFBK,
+ LLY_GR, LMHESC, LLY_DL, LOWER, LLY_BK, LSHFSP, LSHFSP, LLY_ET, RAISE, KC_LBRC, KC_RBRC, LLSWIT
+ ),
+
+ /* Qwerty for Windows
+ * ,-----------------------------------------------------------------------------------.
+ * | CAG= | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | LY|TB| Q | W | E | R | T | Y | U | I | O | P | LY|\ |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Hyper| LY|A | WN/S | AT/D | CT/F | G | H | CT/J | AT/K | WN/L | LY/; | " |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | Shift| CT/Z | X | C | V | B | N | M | , | . | / | Sh/Bk|
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | LY|` |MH/ESC| LY|DL|LW|Bkp|LY|Bk | Space |LY|ENT|RS|Bkp| [ | ] |LY_SW |
+ * `-----------------------------------------------------------------------------------'
+ */
+ [_QWERTY_WIN] = LAYOUT_preonic_grid( \
+ LCAGEQ, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS,
+ LLY_TB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, LLY_BS,
+ KC_HYPR, LLY_A, LWN_S, LAT_D, LCT_F, KC_G, KC_H, LCT_J, LAT_K, LWN_L, LLY_SC, KC_QUOT,
+ KC_LSFT, LCT_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, LSHFBK,
+ LLY_GR, LMHESC, LLY_DL, LOWER, LLY_BK, LSHFSP, LSHFSP, LLY_ET, RAISE, KC_LBRC, KC_RBRC, LLSWIT
+ ),
+
+ /* Gaming
+ * ,-----------------------------------------------------------------------------------.
+ * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Tab | Q | W | E | R | T | Y | U | I | O | P | \ |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Ctrl | A | S | D | F | G | H | J | K | L | LY|; | " |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | Shift| Z | X | C | V | B | N | M | , | . | / | = |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Ctrl | ESC | Alt |LW|Bkp|LY|Bk | Space |LY|ENT|RS|Bkp| [ | ] |LY_SW |
+ * `-----------------------------------------------------------------------------------'
+ */
+ [_GAMING] = LAYOUT_preonic_grid( \
+ 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_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH,
+ KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LLY_SC, 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_EQUAL,
+ KC_LCTL, KC_ESC, KC_LALT, LOWER, LLY_BK, KC_SPC, KC_SPC, LLY_ET, RAISE, KC_LBRC, KC_RBRC, LLSWIT
+ ),
+
+ /* Music Layer (Switch to this layer if want to use music mode)
+ * ,-----------------------------------------------------------------------------------.
+ * | Esc | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | CTRL | ALT | CMD | | XXXX | Space | XXXX | | XXXX | XXXX |LY_SW |
+ * `-----------------------------------------------------------------------------------'
+ */
+ [_MUSIC] = LAYOUT_preonic_grid( \
+ KC_ESC , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
+ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
+ _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
+ _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
+ KC_LCTL, KC_LALT, KC_LGUI, _______, XXXXXXX, KC_SPC, KC_SPC, XXXXXXX, _______, XXXXXXX, XXXXXXX, LLSWIT
+ ),
+
+ /* Lower
+ * ,-----------------------------------------------------------------------------------.
+ * | ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Tab | Home | Up | End | PGUP | XXXX | XXXX | XXXX | PrSc | Home | PGUP | Del |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | " | Left | Down | Right|PGDWN | XXXX | XXXX | XXXX | Pause| End |PGDWN | F12 |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | CTRL | Alt | CMD | XXXX | XXXX | XXXX | XXXX | Prev | Play | Next | INS |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | CTRL | Alt | CMD | !!!! | Bksp | Space | Enter| | Vol- | Vol+ |LY_SW |
+ * `-----------------------------------------------------------------------------------'
+ */
+ [_LOWER] = LAYOUT_preonic_grid( \
+ 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_TAB, KC_HOME, KC_UP, KC_END, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSCR, KC_HOME, KC_PGUP, KC_DEL,
+ KC_DEL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, XXXXXXX, XXXXXXX, XXXXXXX, KC_PAUS, KC_END, KC_PGDN, KC_F12,
+ _______, KC_LCTL, KC_LALT, KC_LGUI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MPRV, KC_MPLY, KC_MNXT, KC_INS,
+ KC_LCTL, KC_LALT, KC_LGUI, __LYB__, KC_BSPC, KC_SPC, KC_SPC, KC_ENT, _______, KC_VOLD, KC_VOLU, LLSWIT\
+ ),
+
+ /* Raise
+ * ,-----------------------------------------------------------------------------------.
+ * | ESC | F1 | F2 | F3 | F4 | F5 | SCLK | & | * | ( | ) | Bksp |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Tab | F7 | F8 | F9 | F10 | F11 | XXXX | & | * | { | } | Del |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Caps | F1 | F2 | F3 | F4 | F5 | XXXX | - | = | [ | ] | XXXX |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | F7 | F8 | F9 | F10 | F11 | XXXX |ISO # |ISO \ | MRC1 | MRC2 | MRSP |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | CTRL | Alt | CMD | | Bksp | Space | Enter| !!!! | MPL1 | MPL2 |LY_SW |
+ * `-----------------------------------------------------------------------------------'
+ */
+ [_RAISE] = LAYOUT_preonic_grid( \
+ KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_SLCK, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
+ KC_TAB, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, KC_AMPR, KC_ASTR, KC_LCBR, KC_RCBR, KC_DEL,
+ KC_CLCK, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, XXXXXXX, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, XXXXXXX,
+ _______, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, XXXXXXX, KC_NUHS, KC_NUBS, DYN_REC_START1, DYN_REC_START2, DYN_REC_STOP,
+ KC_LCTL, KC_LALT, KC_LGUI, _______, KC_BSPC, KC_SPC, KC_SPC, KC_ENT, __LYB__, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, LLSWIT
+ ),
+
+ /* Adjust (Lower + Raise)
+ * ,-----------------------------------------------------------------------------------.
+ * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Tab | Reset| | | | | | | | | | XXXX |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | | | |Aud on|AudOff|QWmac |QWwin |QWmac |QWin | | | F12 |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| | | | | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | | | | | |LY_SW |
+ * `-----------------------------------------------------------------------------------'
+ */
+ [_ADJUST] = LAYOUT_preonic_grid( \
+ 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_TAB, RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, XXXXXXX,
+ /*_______, _______, MU_MOD, AU_ON, AU_OFF, QWERTY, QWWIN, QWERTY, COLEMAK, DVORAK, _______, _______, \ Remove this if adding Colemak and Dvorak*/
+ _______, _______, MU_MOD, AU_ON, AU_OFF, QWERTY, QWWIN, QWERTY, QWWIN, _______, _______, KC_F12,
+ _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, LLSWIT
+ ),
+
+ /* Punctuation Layer
+ * ,-----------------------------------------------------------------------------------.
+ * | + | ! | @ | # | $ | % | ^ | & | * | ( | ) | _ |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | !!!! | & | | | { | } | - | - | XXXX | XXXX | { | } | |(!)|
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | " | / | * | ( | ) | + | + | XXXX | XXXX | [ | ] | " |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | \ | % | [ | ] | = | = | XXXX | < | > | ? | INS |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | ~ | _ | ^ | Del | !!!! | Space | Enter| XXXX | [ | ] |LY_SW |
+ * `-----------------------------------------------------------------------------------'
+ */
+ [_PUNC] = LAYOUT_preonic_grid( \
+ KC_PLUS, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_UNDS,
+ __LYB__, KC_AMPR, KC_PIPE, KC_LCBR, KC_RCBR, KC_MINS, KC_MINS, XXXXXXX, XXXXXXX, KC_LCBR, KC_RCBR, KC_PIPE,
+ KC_DQUO, KC_SLSH, KC_ASTR, KC_LPRN, KC_RPRN, KC_PLUS, KC_PLUS, XXXXXXX, XXXXXXX, KC_LBRC, KC_RBRC, KC_DQUO,
+ _______, KC_BSLS, KC_PERC, KC_LBRC, KC_RBRC, KC_EQL, KC_EQL, XXXXXXX, KC_LABK, KC_RABK, KC_QUES, KC_INS,
+ KC_TILDE, KC_UNDS, KC_CIRC, KC_DEL, __LYB__, KC_SPC, KC_SPC, KC_ENT, XXXXXXX, KC_LBRC, KC_RBRC, LLSWIT
+ ),
+
+ /* Extra Layer
+ * ,-----------------------------------------------------------------------------------.
+ * | ESC | | | | | | SCLK | | | | | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Tab | | | | | | | | | | | Del |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Caps | | | | | | | | | | | |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | | | | | | | | MRC1 | MRC2 | MRSP | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | CTRL | ALT | CMD | Del | Bksp | Space | !!!! | | MPL1 | MPL2 |LY_SW |
+ * `-----------------------------------------------------------------------------------'
+ */
+ [_EXTRA] = LAYOUT_preonic_grid( \
+ KC_ESC, _______, _______, _______, _______, KC_SLCK, _______, _______, _______, _______, _______, _______,
+ KC_TAB, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL,
+ KC_CLCK, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, DYN_REC_START1, DYN_REC_START2, DYN_REC_STOP,
+ KC_LCTL, KC_LALT, KC_LGUI, KC_DEL, KC_BSPC, KC_SPC, KC_SPC, __LYB__, _______, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, LLSWIT
+ ),
+
+ /* Numeric Pad
+ * ,-----------------------------------------------------------------------------------.
+ * | ESC | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | NMLK | NUM/ | NUM* | NUM- | XXXX |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | Home | Up | End | PGUP | XXXX | XXXX | NUM7 | NUM8 | NUM9 | NUM+ | XXXX |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | XXXX | Left | Down | Right| PGDWN| XXXX | XXXX | NUM4 | NUM5 | NUM6 | NUM+ | XXXX |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | CTRL | ALT | CMD | XXXX | XXXX | XXXX | NUM1 | NUM2 | NUM3 | NENT | Bksp |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | XXXX | !!!! | XXXX | Bksp | Space | NUM0 | NUM0 | NUM. | NENT | QMAC |
+ * `-----------------------------------------------------------------------------------'
+ */
+ [_NUM] = LAYOUT_preonic_grid( \
+ KC_ESC , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, XXXXXXX,
+ _______, KC_HOME, KC_UP, KC_END, KC_PGUP, XXXXXXX, XXXXXXX, KC_P7, KC_P8, KC_P9, KC_PPLS, XXXXXXX,
+ KC_DQUO, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, XXXXXXX, XXXXXXX, KC_P4, KC_P5, KC_P6, KC_PPLS, XXXXXXX,
+ _______, KC_LCTL, KC_LALT, KC_LGUI, XXXXXXX, XXXXXXX, XXXXXXX, KC_P1, KC_P2, KC_P3, KC_PENT, KC_BSPC,
+ _______, XXXXXXX, __LYB__, XXXXXXX, KC_BSPC, KC_SPC, KC_SPC, KC_P0, KC_P0, KC_PDOT, KC_PENT, LTO_BS
+ ),
+
+ /* NAV
+ * ,-----------------------------------------------------------------------------------.
+ * | ESC | | | MOB3 | | | | | | | | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | A | MOB2 | MOUP | MOB1 | MOSU | PGUP | Home | Up | End | | Del |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | | !!!! | MOLF | MODN | MORT | MOSD | PGDN | Left | Down | Right| !!!! | |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | | MOB4 | MOB5 | MOSL | MOSR | MOA2 | MOA0 | MPRV | MPLY | MNXT | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | CTRL | ALT | CMD | | Bksp | Space | Enter| VILM | VOLD | VOLU | QMAC |
+ * `-----------------------------------------------------------------------------------'
+ */
+ [_NAV] = LAYOUT_preonic_grid( \
+ KC_ESC, _______, _______, KC_BTN3, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, KC_A, KC_BTN2, KC_MS_U, KC_BTN1, KC_WH_U, KC_PGUP, KC_HOME, KC_UP, KC_END, _______, KC_DEL,
+ _______, __LYB__, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, __LYB__, _______,
+ _______, _______, KC_BTN4, KC_BTN5, KC_WH_L, KC_WH_R, KC_ACL2, KC_ACL0, KC_MPRV, KC_MPLY, KC_MNXT, _______,
+ KC_LCTL, KC_LALT, KC_LGUI, _______, KC_BSPC, KC_SPC, KC_SPC, KC_ENT, KC_MUTE, KC_VOLD, KC_VOLU, LTO_BS
+ ),
+
+ /* One-Handed
+ * ,-----------------------------------------------------------------------------------.
+ * | Esc | 6 | 7 | 8 | 9 | 0 | - | XXXX | XXXX | XXXX | XXXX | XXXX |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | Y | U | I | O | P | MWL3 | MWFS | MWR3 | MWTL | MWTR | XXXX |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | | H | J | K | L | : | MWL1 | MWM1 | MWR1 | MWBL | MWBR | XXXX |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | N | M | , | . | / | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | !!!! | Esc | Del | Ent | Bksp | | MWLT | MWBT | MWUP | MWRT |LY_SW |
+ * `-----------------------------------------------------------------------------------'
+ */
+ [_ONEHD] = LAYOUT_preonic_grid( \
+ KC_ESC , KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
+ _______, KC_Y, KC_U, KC_I, KC_O, KC_P, LMW_L3, LMW_FS, LMW_R3, LMW_TL, LMW_TR, XXXXXXX,
+ _______, KC_H, KC_J, KC_K, KC_L, KC_SCLN, LMW_L1, LMW_M1, LMW_R1, LMW_BL, LMW_BR, XXXXXXX,
+ _______, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
+ __LYB__, KC_ESC, KC_DEL, KC_ENT, KC_BSPACE, KC_SPC, KC_SPC, LMW_LT, LMW_BT, LMW_TP, LMW_RT, LLSWIT
+ ),
+
+ /* Layer Switcher
+ * ,-----------------------------------------------------------------------------------.
+ * | Esc | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |Brite | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | XXXX | XXXX | XXXX | XXXX | XXXX | GAME | XXXX | XXXX | XXXX | XXXX | NAV | XXXX |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | XXXX | XXXX | XXXX | XXXX | QMAC | XXXX | MUSC | XXXX | XXXX | XXXX | XXXX |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | XXXX | XXXX | NUM | XXXX | XXXX | XXXXX | XXXX | XXXX | XXXX | XXXX | !!!! |
+ * `-----------------------------------------------------------------------------------'
+ */
+ [_LYSWT] = LAYOUT_preonic_grid( \
+ KC_ESC , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
+ BACKLIT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
+ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, TO(_GAMING), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, TO(_NAV), XXXXXXX,
+ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, LTO_BS, XXXXXXX, TO(_MUSIC), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
+ XXXXXXX, XXXXXXX, TO(_NUM), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______
+ ) //, //Don't forget to add the comma if going to add more layers here
+};
+
+static uint16_t key_timer;
+static uint16_t timer_thresh = 200;
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ // For dynamic macros
+ if (!process_record_dynamic_macro(keycode, record)) {
+// Play sound on Macro stop
+#ifdef AUDIO_ENABLE
+ switch (keycode) {
+ case DYN_REC_STOP:
+ if (record->event.pressed) {
+ PLAY_SONG(tone_macro_record_stop);
+ }
+ return false;
+ break;
+ }
+#endif
+ return false;
+ }
+
+ switch (keycode) {
+ case QWERTY:
+ if (record->event.pressed) {
+ set_single_persistent_default_layer(_QWERTY_MAC);
+ }
+ return false;
+ break;
+ case QWWIN:
+ if (record->event.pressed) {
+ set_single_persistent_default_layer(_QWERTY_WIN);
+ }
+ return false;
+ break;
+ // Reinstate these cases if COLEMAK, DVORAK are included in the layouts
+ /*case COLEMAK:
+ if (record->event.pressed) {
+ set_single_persistent_default_layer(_COLEMAK);
+ }
+ return false;
+ break;
+ case DVORAK:
+ if (record->event.pressed) {
+ set_single_persistent_default_layer(_DVORAK);
+ }
+ return false;
+ break;
+ */
+ case LOWER:
+ if (record->event.pressed) {
+ key_timer = timer_read(); // For Backspace on tap
+ layer_on(_LOWER);
+ update_tri_layer(_LOWER, _RAISE, _ADJUST);
+ } else {
+ // Backspace on tap
+ if (timer_elapsed(key_timer) < timer_thresh) {
+ tap_code(KC_BSPC);
+ }
+ layer_off(_LOWER);
+ update_tri_layer(_LOWER, _RAISE, _ADJUST);
+ }
+ return false;
+ break;
+ case RAISE:
+ if (record->event.pressed) {
+ key_timer = timer_read(); // For Backspace on tap
+ layer_on(_RAISE);
+ update_tri_layer(_LOWER, _RAISE, _ADJUST);
+ } else {
+ // Backspace on tap
+ if (timer_elapsed(key_timer) < timer_thresh) {
+ tap_code(KC_BSPC);
+ }
+ layer_off(_RAISE);
+ update_tri_layer(_LOWER, _RAISE, _ADJUST);
+ }
+ return false;
+ break;
+ case BACKLIT:
+ if (record->event.pressed) {
+ register_code(KC_RSFT);
+#ifdef BACKLIGHT_ENABLE
+ backlight_step();
+#endif
+#ifdef __AVR__
+ PORTE &= ~(1 << 6);
+#endif
+ } else {
+ unregister_code(KC_RSFT);
+#ifdef __AVR__
+ PORTE |= (1 << 6);
+#endif
+ }
+ return false;
+ break;
+#ifdef AUDIO_ENABLE
+ // Play sound on Macro record start
+ case DYN_REC_START1:
+ if (record->event.pressed) {
+ PLAY_SONG(tone_macro1_record);
+ }
+ return false;
+ break;
+ case DYN_REC_START2:
+ if (record->event.pressed) {
+ PLAY_SONG(tone_macro2_record);
+ }
+ return false;
+ break;
+#endif
+ }
+ return true;
+};
+
+bool muse_mode = false;
+uint8_t last_muse_note = 0;
+uint16_t muse_counter = 0;
+uint8_t muse_offset = 70;
+uint16_t muse_tempo = 50;
+
+void encoder_update_user(uint8_t index, bool clockwise) {
+ if (muse_mode) {
+ if (IS_LAYER_ON(_RAISE)) {
+ if (clockwise) {
+ muse_offset++;
+ } else {
+ muse_offset--;
+ }
+ } else {
+ if (clockwise) {
+ muse_tempo += 1;
+ } else {
+ muse_tempo -= 1;
+ }
+ }
+ } else {
+ if (clockwise) {
+ tap_code(KC_PGDN);
+ } else {
+ tap_code(KC_PGUP);
+ }
+ }
+}
+
+void dip_switch_update_user(uint8_t index, bool active) {
+ switch (index) {
+ case 0:
+ if (active) {
+ layer_on(_ADJUST);
+ } else {
+ layer_off(_ADJUST);
+ }
+ break;
+ case 1:
+ if (active) {
+ muse_mode = true;
+ } else {
+ muse_mode = false;
+ }
+ }
+}
+
+void matrix_scan_user(void) {
+#ifdef AUDIO_ENABLE
+ if (muse_mode) {
+ if (muse_counter == 0) {
+ uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()];
+ if (muse_note != last_muse_note) {
+ stop_note(compute_freq_for_midi_note(last_muse_note));
+ play_note(compute_freq_for_midi_note(muse_note), 0xF);
+ last_muse_note = muse_note;
+ }
+ }
+ muse_counter = (muse_counter + 1) % muse_tempo;
+ } else {
+ if (muse_counter) {
+ stop_all_notes();
+ muse_counter = 0;
+ }
+ }
+#endif
+}
+
+bool music_mask_user(uint16_t keycode) {
+ switch (keycode) {
+ case RAISE:
+ case LOWER:
+ return false;
+ default:
+ return true;
+ }
+}
diff --git a/keyboards/preonic/keymaps/laurentlaurent/readme.md b/keyboards/preonic/keymaps/laurentlaurent/readme.md
new file mode 100644
index 000000000..b1909f8e1
--- /dev/null
+++ b/keyboards/preonic/keymaps/laurentlaurent/readme.md
@@ -0,0 +1,252 @@
+# laurentlaurent's Preonic keyboard
+Largely similar to his [ErgoDox EZ](https://configure.ergodox-ez.com/ergodox-ez/layouts/jZpmo/latest/0)'s layout
+
+## Features
+
+### Special Modifiers for Global Shortcuts
+* Hyper key (Ctrl+Alt+Cmd+Shift)
+* CAG key (Ctrl+Alt+Cmd)
+* Meh key (Ctrl+Alt+Shift)
+
+### Home Row modifiers
+* Home Row modifiers (hold F/J to use CMD/Ctrl, D/L for Alt, ... )
+* Separate layers for Mac and Windows keyboard to improve muscle memory linked to Home Row modifiers (CMD is mapped to F and J on Mac, CTRL for Windows)
+* Extra CMD/CTRL key mapped to Z for one-handed CMD+F/CTRL+F
+
+### Qwerty Layout improvements
+* Backspace and Enter are on bottom row (next to Space bar)
+* = is where Esc would be expected to be
+* "-" is where Backspace would be expected to be
+* Grave is where LCTRL would be expected to be
+* Esc is where Alt (on Mac)/Win (on PC) would be expected to be
+* Del is where CMD (on Mac)/Alt (on PC) would be expected to be
+* Hyper key replaces Caps Lock
+
+### Mod taps
+* Home Row modifiers
+* Lower and Raise are Backspace on tap
+* Holding = is CAG (CTRL+ALT+CMD)
+* Holding Esc is MEH (Ctrl+Shift+Alt)
+* Right Shift is bound to RShift on hold, Backspace on tap
+* Spacebar acts like a LShift on hold, Spacebar on tap
+* In instances where repeated keys is needed:
+ * Tap then tap-hold repeats the key
+ * Lower, Raise (and most other layers) turns off mod-tap on most keys
+* Music layer disables all key mappings, Gaming layer disables modtaps
+
+### Layer Switching
+* Layer switcher key, used to switch layout (allows use of _NAV, _NUM layout without holding their layer keys)
+* **Punctuation layer** accessible by holding Tab, Backslash or Backspace
+* Grave switches to **One-Handed layer** on hold
+* **Mouse and arrow key layer** accessible by holding ; or A
+* Del switches to **Numpad** on hold
+* Enter switches to **Extra layer** on hold
+ * Extra layer will be used for applications shortcuts
+
+## Layers
+
+### Mac Qwerty
+```
+,-----------------------------------------------------------------------------------.
+| CAG/=| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - |
+|------+------+------+------+------+------+------+------+------+------+------+------|
+| LY|TB| Q | W | E | R | T | Y | U | I | O | P | LY|\ |
+|------+------+------+------+------+-------------+------+------+------+------+------|
+| Hyper| LY|A | CT/S | AT/D | WN/F | G | H | WN/J | AT/K | CT/L | LY|; | " |
+|------+------+------+------+------+------|------+------+------+------+------+------|
+| Shift| WN/Z | X | C | V | B | N | M | , | . | / | Sh/Bk|
+|------+------+------+------+------+------+------+------+------+------+------+------|
+| LY|` |MH/ESC| LY|DL|LW|Bkp|LY|Bkp| Shift/Space |LY|ENT|RS|Bkp| [ | ] |LY_SW |
+`-----------------------------------------------------------------------------------'
+```
+* Hold Tab (LY|TB), Backspace (LY|Bkp) or Backslash (LY|\ ) for **Punctuation Layer**
+* Hold Grave (LY|`) for **One-Handed Layer**
+* Hold Del (LY|DL) for **Numpad Layer**
+* Hold A or ; for **Navigation/Mouse Layer**
+* Hold Enter (LY|ENT) for **Extra layer**
+
+### Win Qwerty
+```
+,-----------------------------------------------------------------------------------.
+| CAG= | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - |
+|------+------+------+------+------+------+------+------+------+------+------+------|
+| LY|TB| Q | W | E | R | T | Y | U | I | O | P | LY|\ |
+|------+------+------+------+------+-------------+------+------+------+------+------|
+| Hyper| LY|A | WN/S | AT/D | CT/F | G | H | CT/J | AT/K | WN/L | LY/; | " |
+|------+------+------+------+------+------|------+------+------+------+------+------|
+| Shift| CT/Z | X | C | V | B | N | M | , | . | / | Sh/Bk|
+|------+------+------+------+------+------+------+------+------+------+------+------|
+| LY|` |ESCMEH| LY|DL|LW|Bkp|LY|Bk | Space |LY|ENT|RS|Bkp| [ | ] |LY_SW |
+`-----------------------------------------------------------------------------------'
+```
+* Hold Tab (LY|TB), Backspace (LY|Bkp) or Backslash (LY|\ ) for **Punctuation Layer**
+* Hold Grave (LY|`) for **One-Handed Layer**
+* Hold Del (LY|DL) for **Numpad Layer**
+* Hold A or ; for **Navigation/Mouse Layer**
+* Hold Enter (LY|ENT) for **Extra layer**
+
+### Gaming Qwerty
+```
+,-----------------------------------------------------------------------------------.
+| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - |
+|------+------+------+------+------+------+------+------+------+------+------+------|
+| Tab | Q | W | E | R | T | Y | U | I | O | P | \ |
+|------+------+------+------+------+-------------+------+------+------+------+------|
+| Ctrl | A | S | D | F | G | H | J | K | L | LY|; | " |
+|------+------+------+------+------+------|------+------+------+------+------+------|
+| Shift| Z | X | C | V | B | N | M | , | . | / | = |
+|------+------+------+------+------+------+------+------+------+------+------+------|
+| Ctrl | ESC | Alt |LW|Bkp|LY|Bk | Space |LY|ENT|RS|Bkp| [ | ] |LY_SW |
+`-----------------------------------------------------------------------------------'
+```
+
+### Music Layer
+```
+,-----------------------------------------------------------------------------------.
+| Esc | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX |
+|------+------+------+------+------+------+------+------+------+------+------+------|
+| XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX |
+|------+------+------+------+------+-------------+------+------+------+------+------|
+| | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX |
+|------+------+------+------+------+------|------+------+------+------+------+------|
+| | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX |
+|------+------+------+------+------+------+------+------+------+------+------+------|
+| CTRL | ALT | CMD | | XXXX | Space | XXXX | | XXXX | XXXX |LY_SW |
+`-----------------------------------------------------------------------------------'
+```
+
+### Lower Layer
+```
+,-----------------------------------------------------------------------------------.
+| ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 |
+|------+------+------+------+------+-------------+------+------+------+------+------|
+| Tab | Home | Up | End | PGUP | XXXX | XXXX | XXXX | PrSc | Home | PGUP | Del |
+|------+------+------+------+------+-------------+------+------+------+------+------|
+| " | Left | Down | Right|PGDWN | XXXX | XXXX | XXXX | Pause| End |PGDWN | F12 |
+|------+------+------+------+------+------|------+------+------+------+------+------|
+| | CTRL | Alt | CMD | XXXX | XXXX | XXXX | XXXX | Prev | Play | Next | INS |
+|------+------+------+------+------+------+------+------+------+------+------+------|
+| CTRL | Alt | CMD | !!!! | Bksp | Space | Enter| | Vol- | Vol+ |LY_SW |
+`-----------------------------------------------------------------------------------'
+```
+
+### Raise Layer
+```
+,-----------------------------------------------------------------------------------.
+| ESC | F1 | F2 | F3 | F4 | F5 | SCLK | & | * | ( | ) | Bksp |
+|------+------+------+------+------+------+------+------+------+------+------+------|
+| Tab | F7 | F8 | F9 | F10 | F11 | XXXX | & | * | { | } | Del |
+|------+------+------+------+------+-------------+------+------+------+------+------|
+| Caps | F1 | F2 | F3 | F4 | F5 | XXXX | - | = | [ | ] | XXXX |
+|------+------+------+------+------+------|------+------+------+------+------+------|
+| | F7 | F8 | F9 | F10 | F11 | XXXX |ISO # |ISO \ | MRC1 | MRC2 | MRSP |
+|------+------+------+------+------+------+------+------+------+------+------+------|
+| CTRL | Alt | CMD | | Bksp | Space | Enter| !!!! | MPL1 | MPL2 |LY_SW |
+`-----------------------------------------------------------------------------------'
+```
+
+### Adjust Layer
+```
+,-----------------------------------------------------------------------------------.
+| | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 |
+|------+------+------+------+------+------+------+------+------+------+------+------|
+| Tab | Reset| | | | | | | | | | XXXX |
+|------+------+------+------+------+-------------+------+------+------+------+------|
+| | | |Aud on|AudOff|QWmac |QWwin |QWmac |QWin | | | F12 |
+|------+------+------+------+------+------|------+------+------+------+------+------|
+| |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| | | | | |
+|------+------+------+------+------+------+------+------+------+------+------+------|
+| | | | | | | | | | |LY_SW |
+`-----------------------------------------------------------------------------------'
+```
+
+### Punctuation Layer
+```
+,-----------------------------------------------------------------------------------.
+| + | ! | @ | # | $ | % | ^ | & | * | ( | ) | _ |
+|------+------+------+------+------+------+------+------+------+------+------+------|
+| !!!! | & | | | { | } | - | - | XXXX | XXXX | { | } | |(!)|
+|------+------+------+------+------+-------------+------+------+------+------+------|
+| " | / | * | ( | ) | + | + | XXXX | XXXX | [ | ] | " |
+|------+------+------+------+------+------|------+------+------+------+------+------|
+| | \ | % | [ | ] | = | = | XXXX | < | > | ? | INS |
+|------+------+------+------+------+------+------+------+------+------+------+------|
+| ~ | _ | ^ | Del | !!!! | Space | Enter| XXXX | [ | ] |LY_SW |
+`-----------------------------------------------------------------------------------'
+```
+
+### Extra Layer
+```
+,-----------------------------------------------------------------------------------.
+| ESC | | | | | | SCLK | | | | | |
+|------+------+------+------+------+------+------+------+------+------+------+------|
+| Tab | | | | | | | | | | | Del |
+|------+------+------+------+------+-------------+------+------+------+------+------|
+| Caps | | | | | | | | | | | |
+|------+------+------+------+------+------|------+------+------+------+------+------|
+| | | | | | | | | | MRC1 | MRC2 | MRSP |
+|------+------+------+------+------+------+------+------+------+------+------+------|
+| CTRL | ALT | CMD | Del | Bksp | Space | !!!! | | MPL1 | MPL2 |LY_SW |
+`-----------------------------------------------------------------------------------'
+```
+
+### Numeric Pad Layer
+```
+,-----------------------------------------------------------------------------------.
+| ESC | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | NMLK | NUM/ | NUM* | NUM- | XXXX |
+|------+------+------+------+------+------+------+------+------+------+------+------|
+| | Home | Up | End | PGUP | XXXX | XXXX | NUM7 | NUM8 | NUM9 | NUM+ | XXXX |
+|------+------+------+------+------+-------------+------+------+------+------+------|
+| XXXX | Left | Down | Right| PGDWN| XXXX | XXXX | NUM4 | NUM5 | NUM6 | NUM+ | XXXX |
+|------+------+------+------+------+------|------+------+------+------+------+------|
+| | CTRL | ALT | CMD | XXXX | XXXX | XXXX | NUM1 | NUM2 | NUM3 | NENT | Bksp |
+|------+------+------+------+------+------+------+------+------+------+------+------|
+| | XXXX | !!!! | XXXX | Bksp | Space | NUM0 | NUM0 | NUM. | NENT | QMAC |
+`-----------------------------------------------------------------------------------'
+```
+
+### Navigation Layer
+```
+,-----------------------------------------------------------------------------------.
+| ESC | | | MOB3 | | | | | | | | |
+|------+------+------+------+------+------+------+------+------+------+------+------|
+| | A | MOB2 | MOUP | MOB1 | MOSU | PGUP | Home | Up | End | | Del |
+|------+------+------+------+------+-------------+------+------+------+------+------|
+| | !!!! | MOLF | MODN | MORT | MOSD | PGDN | Left | Down | Right| !!!! | |
+|------+------+------+------+------+------|------+------+------+------+------+------|
+| | | MOB4 | MOB5 | MOSL | MOSR | MOA2 | MOA0 | MPRV | MPLY | MNXT | |
+|------+------+------+------+------+------+------+------+------+------+------+------|
+| CTRL | ALT | CMD | | Bksp | Space | Enter| VILM | VOLD | VOLU | QMAC |
+`-----------------------------------------------------------------------------------'
+```
+
+### One-Handed Layer
+```
+,-----------------------------------------------------------------------------------.
+| Esc | 6 | 7 | 8 | 9 | 0 | - | XXXX | XXXX | XXXX | XXXX | XXXX |
+|------+------+------+------+------+------+------+------+------+------+------+------|
+| | Y | U | I | O | P | MWL3 | MWFS | MWR3 | MWTL | MWTR | XXXX |
+|------+------+------+------+------+-------------+------+------+------+------+------|
+| | H | J | K | L | : | MWL1 | MWM1 | MWR1 | MWBL | MWBR | XXXX |
+|------+------+------+------+------+------|------+------+------+------+------+------|
+| | N | M | , | . | / | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX |
+|------+------+------+------+------+------+------+------+------+------+------+------|
+| !!!! | Esc | Del | Ent | Bksp | | MWLT | MWBT | MWUP | MWRT |LY_SW |
+`-----------------------------------------------------------------------------------'
+```
+The right hand side of the keyboard contains shortcuts for moving windows on Mac (using Magnet)
+
+### Layer Switcher
+```
+,-----------------------------------------------------------------------------------.
+| Esc | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX |
+|------+------+------+------+------+------+------+------+------+------+------+------|
+|Brite | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX |
+|------+------+------+------+------+-------------+------+------+------+------+------|
+| XXXX | XXXX | XXXX | XXXX | XXXX | GAME | XXXX | XXXX | XXXX | XXXX | NAV | XXXX |
+|------+------+------+------+------+------|------+------+------+------+------+------|
+| | XXXX | XXXX | XXXX | XXXX | QMAC | XXXX | MUSC | XXXX | XXXX | XXXX | XXXX |
+|------+------+------+------+------+------+------+------+------+------+------+------|
+| XXXX | XXXX | NUM | XXXX | XXXX | XXXXX | XXXX | XXXX | XXXX | XXXX | !!!! |
+`-----------------------------------------------------------------------------------'
+```
diff --git a/keyboards/preonic/keymaps/laurentlaurent/rules.mk b/keyboards/preonic/keymaps/laurentlaurent/rules.mk
new file mode 100644
index 000000000..3a551bd42
--- /dev/null
+++ b/keyboards/preonic/keymaps/laurentlaurent/rules.mk
@@ -0,0 +1,2 @@
+SRC += muse.c
+MOUSEKEY_ENABLE = yes
diff --git a/keyboards/preonic/keymaps/laurentlaurent/templates.c b/keyboards/preonic/keymaps/laurentlaurent/templates.c
new file mode 100644
index 000000000..0056e088f
--- /dev/null
+++ b/keyboards/preonic/keymaps/laurentlaurent/templates.c
@@ -0,0 +1,89 @@
+// Templates for Preonic Keyboard
+
+/* BLANK Pass through
+ * ,-----------------------------------------------------------------------------------.
+ * | ESC | | | | | | | | | | | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | | | | | | | |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | | | | | | | | | | | | |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | | | | | | | | | | | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | CTRL | ALT | CMD | | | | | | | |LY_SW |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_BLANK] = LAYOUT_preonic_grid( \
+ KC_ESC , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
+ KC_LCTL, KC_LALT, KC_LGUI, _______, _______, _______, _______, _______, _______, _______, _______, LLSWIT \
+),
+
+/* BLANK No Pass through
+ * ,-----------------------------------------------------------------------------------.
+ * | Esc | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX | XXXX |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | CTRL | ALT | CMD | | XXXX | | XXXX | | XXXX | XXXX |LY_SW |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_BLANK] = LAYOUT_preonic_grid( \
+ KC_ESC , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
+ _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
+ _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
+ _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
+ KC_LCTL, KC_LALT, KC_LGUI, _______, XXXXXXX, _______, _______, XXXXXXX, _______, XXXXXXX, XXXXXXX, LLSWIT \
+),
+
+
+//===== From default preonic layouts
+// if you add this, make sure to add _COLEMAK and _DVORAK in the enum
+
+/* Colemak
+ * ,-----------------------------------------------------------------------------------.
+ * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Esc | A | R | S | T | D | H | N | E | I | O | " |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | XXXX | XXXX | XXXX |LY_SW |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_COLEMAK] = LAYOUT_preonic_grid( \
+ 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_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL, \
+ 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, \
+ BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, XXXXXXX, XXXXXXX, XXXXXXX, LLSWIT \
+),
+
+/* Dvorak
+ * ,-----------------------------------------------------------------------------------.
+ * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Tab | " | , | . | P | Y | F | G | C | R | L | Del |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Esc | A | O | E | U | I | D | H | T | N | S | / |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | XXXX | XXXX | XXXX |LY_SW |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_DVORAK] = LAYOUT_preonic_grid( \
+ 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_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, \
+ 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, \
+ BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, XXXXXXX, XXXXXXX, XXXXXXX, LLSWIT \
+),
diff --git a/keyboards/preonic/keymaps/mguterl/config.h b/keyboards/preonic/keymaps/mguterl/config.h
new file mode 100644
index 000000000..40a9524b4
--- /dev/null
+++ b/keyboards/preonic/keymaps/mguterl/config.h
@@ -0,0 +1,37 @@
+#pragma once
+
+#ifdef AUDIO_ENABLE
+ #define STARTUP_SONG SONG(PREONIC_SOUND)
+ // #define STARTUP_SONG SONG(NO_SOUND)
+
+ #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
+ SONG(COLEMAK_SOUND), \
+ SONG(DVORAK_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
diff --git a/keyboards/preonic/keymaps/mguterl/keymap.c b/keyboards/preonic/keymaps/mguterl/keymap.c
new file mode 100644
index 000000000..ecaf26b8d
--- /dev/null
+++ b/keyboards/preonic/keymaps/mguterl/keymap.c
@@ -0,0 +1,323 @@
+/* Copyright 2015-2017 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/>.
+ */
+
+#include QMK_KEYBOARD_H
+#include "muse.h"
+#include "mguterl.h"
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+/* Qwerty
+ * ,-----------------------------------------------------------------------------------.
+ * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |HypTab| Q | W | E | R | T | Y | U | I | O | P | Bksp |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |EscCtl| A | S | D | F | G | H | J | K | L | ; | " |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | GESC | Ctrl | Alt | GUI |Lower |SpcUtl|SpcUtl|Raise | Left | Down | Up |Right |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_QWERTY] = LAYOUT_preonic_grid( \
+ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
+ HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
+ ESC_CTL, 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, SFT_ENT,
+ KC_GESC, KC_LCTL, KC_LALT, KC_LGUI, LOWER, SPC_UTL, SPC_UTL, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
+),
+
+/*
+ * Gaming is very similar to Qwerty. Certain features from Qwerty are disable
+ * for better gaming experience.
+ */
+[_GAMING] = LAYOUT_preonic_grid( \
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ KC_TAB, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ KC_ESC, _______, _______, _______, _______, KC_SPC, KC_SPC, _______, _______, _______, _______, _______
+),
+
+/*
+ * Util is accessed by holding Space. The Util layer contains vimkeys and
+ * shortcuts that I find myself needing often.
+ */
+[_UTIL] = LAYOUT_preonic_grid( \
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, GUI_1, GUI_2, GUI_3, GUI_4, GUI_5, GUI_6, GUI_7, GUI_8, GUI_9, GUI_0, _______,
+ _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, GO_BACK, GO_FWD, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
+),
+
+/* Colemak
+ * ,-----------------------------------------------------------------------------------.
+ * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Esc | A | R | S | T | D | H | N | E | I | O | " |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_COLEMAK] = LAYOUT_preonic_grid( \
+ 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_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL,
+ 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,
+ BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
+),
+
+/* Dvorak
+ * ,-----------------------------------------------------------------------------------.
+ * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Tab | " | , | . | P | Y | F | G | C | R | L | Del |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Esc | A | O | E | U | I | D | H | T | N | S | / |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_DVORAK] = LAYOUT_preonic_grid( \
+ 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_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL,
+ 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,
+ BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
+),
+
+/* Lower
+ * ,-----------------------------------------------------------------------------------.
+ * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | F7 | F8 | F9 | F10 | F11 | F12 | - | = | [ | ] | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | | | Next | Vol- | Vol+ | Play |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_LOWER] = LAYOUT_preonic_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_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,
+ _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
+ _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
+),
+
+/* Raise
+ * ,-----------------------------------------------------------------------------------.
+ * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Del | F1 | F2 | F3 | F4 | F5 | F6 | | | | | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | F7 | F8 | F9 | F10 | F11 | F12 | | |Pg Up |Pg Dn | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | | | Next | Vol- | Vol+ | Play |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_RAISE] = LAYOUT_preonic_grid( \
+ 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_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_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_PGUP, KC_PGDN, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
+),
+
+/* Adjust (Lower + Raise)
+ * ,-----------------------------------------------------------------------------------.
+ * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |ToGame| Reset| | | | | | | | | | Del |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | | | |Aud on|AudOff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| | | | | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | | | | | | |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_ADJUST] = LAYOUT_preonic_grid( \
+ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
+ TG_GAME, RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL,
+ _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______,
+ _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
+)
+
+
+};
+
+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;
+ case DVORAK:
+ if (record->event.pressed) {
+ set_single_persistent_default_layer(_DVORAK);
+ }
+ return false;
+ break;
+ case LOWER:
+ if (record->event.pressed) {
+ layer_on(_LOWER);
+ update_tri_layer(_LOWER, _RAISE, _ADJUST);
+ } else {
+ layer_off(_LOWER);
+ update_tri_layer(_LOWER, _RAISE, _ADJUST);
+ }
+ return false;
+ break;
+ case RAISE:
+ if (record->event.pressed) {
+ layer_on(_RAISE);
+ update_tri_layer(_LOWER, _RAISE, _ADJUST);
+ } else {
+ layer_off(_RAISE);
+ update_tri_layer(_LOWER, _RAISE, _ADJUST);
+ }
+ return false;
+ break;
+ case BACKLIT:
+ if (record->event.pressed) {
+ register_code(KC_RSFT);
+ #ifdef BACKLIGHT_ENABLE
+ backlight_step();
+ #endif
+ #ifdef __AVR__
+ writePinLow(E6);
+ #endif
+ } else {
+ unregister_code(KC_RSFT);
+ #ifdef __AVR__
+ writePinHigh(E6);
+ #endif
+ }
+ return false;
+ break;
+ }
+ return true;
+};
+
+bool muse_mode = false;
+uint8_t last_muse_note = 0;
+uint16_t muse_counter = 0;
+uint8_t muse_offset = 70;
+uint16_t muse_tempo = 50;
+
+void encoder_update_user(uint8_t index, bool clockwise) {
+ if (muse_mode) {
+ if (IS_LAYER_ON(_RAISE)) {
+ if (clockwise) {
+ muse_offset++;
+ } else {
+ muse_offset--;
+ }
+ } else {
+ if (clockwise) {
+ muse_tempo+=1;
+ } else {
+ muse_tempo-=1;
+ }
+ }
+ } else {
+ if (clockwise) {
+ #ifdef MOUSEKEY_ENABLE
+ tap_code(KC_MS_WH_DOWN);
+ #else
+ tap_code(KC_PGDN);
+ #endif
+ } else {
+ #ifdef MOUSEKEY_ENABLE
+ tap_code(KC_MS_WH_UP);
+ #else
+ tap_code(KC_PGUP);
+ #endif
+ }
+ }
+}
+
+void dip_switch_update_user(uint8_t index, bool active) {
+ switch (index) {
+ case 0:
+ if (active) {
+ layer_on(_ADJUST);
+ } else {
+ layer_off(_ADJUST);
+ }
+ break;
+ case 1:
+ if (active) {
+ muse_mode = true;
+ } else {
+ muse_mode = false;
+ }
+ }
+}
+
+
+void matrix_scan_user(void) {
+#ifdef AUDIO_ENABLE
+ if (muse_mode) {
+ if (muse_counter == 0) {
+ uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()];
+ if (muse_note != last_muse_note) {
+ stop_note(compute_freq_for_midi_note(last_muse_note));
+ play_note(compute_freq_for_midi_note(muse_note), 0xF);
+ last_muse_note = muse_note;
+ }
+ }
+ muse_counter = (muse_counter + 1) % muse_tempo;
+ } else {
+ if (muse_counter) {
+ stop_all_notes();
+ muse_counter = 0;
+ }
+ }
+#endif
+}
+
+bool music_mask_user(uint16_t keycode) {
+ switch (keycode) {
+ case RAISE:
+ case LOWER:
+ return false;
+ default:
+ return true;
+ }
+}
diff --git a/keyboards/preonic/keymaps/mguterl/readme.md b/keyboards/preonic/keymaps/mguterl/readme.md
new file mode 100644
index 000000000..f90997601
--- /dev/null
+++ b/keyboards/preonic/keymaps/mguterl/readme.md
@@ -0,0 +1,18 @@
+# Michael Guterl's Preonic Layout
+
+I have a very similar [keymap](/keyboards/planck/keymaps/mguterl) for my
+Planck.
+
+Check out my [userspace](/users/mguterl) for the custom keycodes that are used
+in keymap.c.
+
+At a very high level I use 4 layers:
+
+* Qwerty - Letters
+* Util - Vimkeys for navigation and other convenient things
+* Raise - Numbers and F keys
+* Lower - Symbols
+
+```sh
+make preonic/rev3:mguterl:flash
+```
diff --git a/keyboards/preonic/keymaps/mguterl/rules.mk b/keyboards/preonic/keymaps/mguterl/rules.mk
new file mode 100644
index 000000000..dcf16bef3
--- /dev/null
+++ b/keyboards/preonic/keymaps/mguterl/rules.mk
@@ -0,0 +1 @@
+SRC += muse.c
diff --git a/keyboards/preonic/keymaps/mikethetiger/config.h b/keyboards/preonic/keymaps/mikethetiger/config.h
index 9e5eb83a6..1640f1682 100644
--- a/keyboards/preonic/keymaps/mikethetiger/config.h
+++ b/keyboards/preonic/keymaps/mikethetiger/config.h
@@ -1,4 +1,4 @@
-#pragma once
+#pragma once
#ifdef AUDIO_ENABLE
#define STARTUP_SONG SONG(PREONIC_SOUND)
diff --git a/keyboards/preonic/keymaps/mikethetiger/keymap.c b/keyboards/preonic/keymaps/mikethetiger/keymap.c
index 2f3963f71..621148a6b 100644
--- a/keyboards/preonic/keymaps/mikethetiger/keymap.c
+++ b/keyboards/preonic/keymaps/mikethetiger/keymap.c
@@ -1,4 +1,4 @@
-/* Copyright 2015-2017 Jack Humbert
+/* Copyright 2015-2017 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
diff --git a/keyboards/preonic/keymaps/pitty/config.h b/keyboards/preonic/keymaps/pitty/config.h
new file mode 100644
index 000000000..f87dd8f30
--- /dev/null
+++ b/keyboards/preonic/keymaps/pitty/config.h
@@ -0,0 +1,40 @@
+#pragma once
+
+#ifdef AUDIO_ENABLE
+
+
+# define STARTUP_SONG SONG(PREONIC_SOUND)
+# define GOODBYE_SONG SONG(STARTUP_SOUND)
+# define MUSIC_ON_SONG SONG(TERMINAL_SOUND)
+#endif
+
+#undef TEMPO_DEFAULT
+
+#define TEMPO_DEFAULT 200
+
+
+/*
+ * 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
+
+
diff --git a/keyboards/preonic/keymaps/pitty/keymap.c b/keyboards/preonic/keymaps/pitty/keymap.c
new file mode 100644
index 000000000..10957d8ac
--- /dev/null
+++ b/keyboards/preonic/keymaps/pitty/keymap.c
@@ -0,0 +1,203 @@
+/* Copyright 2015-2017 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/>.
+ */
+
+#include QMK_KEYBOARD_H
+#include "keymap_hungarian.h"
+
+enum preonic_layers {
+ _QWERTY,
+ _GAME,
+ _LOWER,
+ _RAISE,
+ _ADJUST
+};
+
+enum preonic_keycodes {
+ QWERTY = SAFE_RANGE,
+ GAME,
+ LOWER,
+ RAISE,
+};
+
+
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+/* Qwerty
+ * ,-----------------------------------------------------------------------------------.
+ * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Ö | Ü |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | TAB | Q | W | E | R | T | Z | U | I | O | P | Ő |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Esc | A | S | D | F | G | H | J | K | L | É | Á |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | Shift| Y | X | C | V | B | N | M | , | . | - | Shift|
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Ctrl | GUI | ALt |Lower | Space | Bksp | Enter|Raise | Left | Down |Right |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_QWERTY] = LAYOUT_preonic_grid( \
+ HU_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, HU_OE, HU_UE, \
+ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, HU_Z, KC_U, KC_I, KC_O, KC_P, HU_OEE, \
+ KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, HU_EE, HU_AA, \
+ MT(MOD_LSFT, KC_NUBS), HU_Y, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, HU_COMM, HU_DOT, HU_MINS, KC_RSFT, \
+ KC_LCTL, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, KC_ENT, KC_BSPC, KC_RALT, RAISE, KC_INS, KC_DEL \
+),
+
+
+/* Game
+ * ,-----------------------------------------------------------------------------------.
+ * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Ö | Ü |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | TAB | Q | W | E | R | T | Z | U | I | O | P | Ő |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Esc | A | S | D | F | G | H | J | K | L | É | Á |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | Shift| Y | X | C | V | B | N | M | , | . | - | Shift|
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Ctrl | GUI | ALt |Raise | Space | Bksp | Enter|Lower | Left | Down |Right |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_GAME] = LAYOUT_preonic_grid( \
+ HU_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, HU_OE, HU_UE, \
+ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, HU_Z, KC_U, KC_I, KC_O, KC_P, HU_OEE, \
+ KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, HU_EE, HU_AA, \
+ KC_LSFT, HU_Y, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, HU_COMM, HU_DOT, HU_MINS, KC_RSFT, \
+ KC_LCTL, KC_LGUI, KC_LALT, RAISE, KC_SPC, KC_SPC, KC_ENT, KC_BSPC, KC_RALT, LOWER, KC_INS, KC_DEL \
+),
+
+
+/* Lower
+ * ,-----------------------------------------------------------------------------------.
+ * | | | | | | | | 7 | 8 | 9 | + | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | Up | | | | | 4 | 5 | 6 | - | |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | | Left | Down | Right| | | | 1 | 2 | 3 | * | |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | | |Lnxcpy|Lnxpst| | | 0 | | | / | = |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | | | Home |PageDn|PageUp| End |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_LOWER] = LAYOUT_preonic_grid( \
+ _______, _______, _______, _______, _______, _______, _______, HU_7, HU_8, HU_9, HU_PLUS, _______, \
+ _______, _______, KC_UP, _______, _______, KC_HOME, KC_PGUP, HU_4, HU_5, HU_6, HU_MINS, _______, \
+ _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_END, KC_PGDN, HU_1, HU_2, HU_3, HU_ASTR, _______, \
+ _______, _______, _______, _______, _______, _______, _______, HU_0, _______, _______, HU_SLSH, HU_EQL, \
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, TO(_GAME), TO(_QWERTY) \
+),
+
+/* Raise
+ * ,-----------------------------------------------------------------------------------.
+ * | F12 | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | Up | | | | | | | | | |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | | Left | Down | Right| | | | | | | | |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | | | | | | | | | | | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | | | Home |PageDn|PageUp| End |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_RAISE] = LAYOUT_preonic_grid( \
+ 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_UP, _______, _______, KC_HOME, KC_PGUP, _______, _______, _______, _______, _______, \
+ _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_END, KC_PGDN, _______, _______, _______, _______, _______, \
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, TO(_GAME), TO(_QWERTY) \
+),
+
+/* Adjust (Lower + Raise)
+ * ,-----------------------------------------------------------------------------------.
+ * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | Reset| | | | | | | | | | Del |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | | | |Aud on|AudOff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| | | | | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | | | | | | |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_ADJUST] = LAYOUT_preonic_grid( \
+ 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, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL, \
+ _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, \
+ _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, \
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, TO(_QWERTY) \
+)
+
+
+};
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ switch (keycode) {
+ case LOWER:
+ if (record->event.pressed) {
+ layer_on(_LOWER);
+ update_tri_layer(_LOWER, _RAISE, _ADJUST);
+ } else {
+ layer_off(_LOWER);
+ update_tri_layer(_LOWER, _RAISE, _ADJUST);
+ }
+ return false;
+ break;
+ case RAISE:
+ if (record->event.pressed) {
+ layer_on(_RAISE);
+ update_tri_layer(_LOWER, _RAISE, _ADJUST);
+ } else {
+ layer_off(_RAISE);
+ update_tri_layer(_LOWER, _RAISE, _ADJUST);
+ }
+ return false;
+ break;
+ }
+ return true;
+}
+
+#ifdef AUDIO_ENABLE
+
+float raise_low[][2] = SONG(TERMINAL_SOUND);
+float gaming[][2] = SONG(AG_SWAP_SOUND);
+float adjust[][2] = SONG(UNICODE_LINUX);
+float my_song[][2] = SONG(NO_SOUND);
+
+#endif
+
+layer_state_t layer_state_set_user(layer_state_t state) {
+ switch (get_highest_layer(state)) {
+ case _RAISE:
+ PLAY_SONG (raise_low);
+ break;
+ case _LOWER:
+ PLAY_SONG (raise_low);
+ break;
+ case _GAME:
+ PLAY_SONG (gaming);
+ break;
+ case _ADJUST:
+ PLAY_SONG (adjust);
+ break;
+ default: // for any other layers, or the default layer
+ PLAY_SONG (my_song);
+ break;
+ }
+ return state;
+}
diff --git a/keyboards/preonic/keymaps/pitty/readme.md b/keyboards/preonic/keymaps/pitty/readme.md
new file mode 100644
index 000000000..42b307608
--- /dev/null
+++ b/keyboards/preonic/keymaps/pitty/readme.md
@@ -0,0 +1,5 @@
+My Preonic keymap
+
+Including Hungarian characters and layer reactive sound feedback
+
+make preonic/rev3:pitty:dfu-util \ No newline at end of file
diff --git a/keyboards/preonic/keymaps/pitty/rules.mk b/keyboards/preonic/keymaps/pitty/rules.mk
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/keyboards/preonic/keymaps/pitty/rules.mk
diff --git a/keyboards/preonic/keymaps/senseored/config.h b/keyboards/preonic/keymaps/senseored/config.h
new file mode 100644
index 000000000..61f3488c6
--- /dev/null
+++ b/keyboards/preonic/keymaps/senseored/config.h
@@ -0,0 +1,45 @@
+#pragma once
+
+#ifdef AUDIO_ENABLE
+ #define STARTUP_SONG SONG(PREONIC_SOUND)
+ // #define STARTUP_SONG SONG(NO_SOUND)
+
+ #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
+ SONG(COLEMAK_SOUND), \
+ SONG(DVORAK_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
+#define RGBLIGHT_SLEEP
+#define TAPPING_TOGGLE 2
+#define ALT_F4 LALT(KC_F4)
+#define CTALDEL LSFT(LCTL(KC_ESC))
+#define NO_DEBUG
+#define CTLZ LCTL(KC_Z)
+#define CTLX LCTL(KC_X)
+#define CTLC LCTL(KC_C)
+#define CTLV LCTL(KC_V)
+/* 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
diff --git a/keyboards/preonic/keymaps/senseored/keymap.c b/keyboards/preonic/keymaps/senseored/keymap.c
new file mode 100644
index 000000000..6ddf28942
--- /dev/null
+++ b/keyboards/preonic/keymaps/senseored/keymap.c
@@ -0,0 +1,437 @@
+/* Copyright 2015-2017 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/>.
+ */
+
+#include QMK_KEYBOARD_H
+#include "muse.h"
+
+enum preonic_layers {
+ _QWERTY,
+ _FNL1,
+ _LOWER,
+ _RAISE,
+ _FNL2,
+ _ADJUST,
+ _GAMEMODE,
+ _FNL3,
+ _LOWER2,
+ _RAISE2
+};
+
+enum preonic_keycodes {
+ TBMACRO = SAFE_RANGE,
+ DGRMCRO,
+ WRKMOD,
+ BACKLIT,
+ RAISE,
+ LOWER
+};
+
+bool bnumlock = false;
+bool numlock_changed = false;
+bool workmode = true;
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+/* Qwerty
+ * ,-----------------------------------------------------------------------------------.
+ * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | FNL1 | A | S | D | F | G | H | J | K | L | ; | " |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Ctrl | GUI | Alt | Bksp |Lower | Space |Raise | Bksp | AltGr| * | Esc |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_QWERTY] = LAYOUT_preonic_grid( \
+ 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_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, \
+ TT(_FNL1), 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, \
+ KC_LCTL, KC_LGUI, KC_LALT, KC_DEL, TT(_LOWER), KC_SPC, KC_SPC, TT(_RAISE), KC_BSPC, KC_RALT, KC_NUHS, KC_ESC \
+),
+
+/* FNL1
+ * ,-----------------------------------------------------------------------------------.
+ * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |TbMacr| Prev | Play | Next | AltF4| CapsL| Esc | PgUp | Up | PgDn |PrScrn| Bksp |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | | | Vol- | Vol+ | Mute | NumL | Home | Left | Down | Right| | Del |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | | | | | | End | | | | ? | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | | | | | ! | |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_FNL1] = LAYOUT_preonic_grid( \
+ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
+ TBMACRO, KC_MPRV, KC_MPLY, KC_MNXT, ALT_F4, KC_CAPS, KC_ESC, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_BSPC,
+ TT(_FNL1), _______, KC_VOLD, KC_VOLU, KC_MUTE, KC_NLCK, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_DEL,
+ KC_LSFT, CTLZ, CTLX, CTLC, CTLV, _______, KC_END, _______, _______, _______, LSFT(KC_MINS), _______,
+ _______, _______, CTALDEL, _______, _______, _______, _______, _______, _______, _______, LSFT(KC_1), _______
+),
+
+
+/* Raise
+ * ,-----------------------------------------------------------------------------------.
+ * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | § | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | + |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | ´ | ` | @ | £ | $ | € | ¨ | { | [ | ] | } | \ |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | < | | | > | ° | | | µ | ¨ | ^ | ~ | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | AltGr| | | | | | | | BAIL |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_RAISE] = LAYOUT_preonic_grid( \
+ 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_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, S(KC_EQL), RALT(KC_2), RALT(KC_3), RALT(KC_4), RALT(KC_E), KC_RBRC, RALT(KC_7), RALT(KC_8), RALT(KC_9), RALT(KC_0), RALT(KC_MINS),
+ KC_LSFT, KC_NUBS, RALT(KC_NUBS), S(KC_NUBS), DGRMCRO, XXXXXXX, XXXXXXX, RALT(KC_M), KC_RBRC, S(KC_RBRC), RALT(KC_RBRC), _______,
+ _______, _______, KC_RALT, _______,TO(_ADJUST), _______, _______, _______, _______, _______, _______, TO(_QWERTY)
+),
+
+/* Lower
+ * ,-----------------------------------------------------------------------------------.
+ * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Tab | F1 | F2 | F3 | F4 | Esc | Bksp | / | 7 | 8 | 9 | - |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | FNL2 | F5 | F6 | F7 | F8 |Insert| Home | PgUp | 4 | 5 | 6 | + |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | F9 | F10 | F11 | F12 | Del | End | PgDn | 1 | 2 | 3 | Enter|
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | Alt | | | | * | 0 | , | . | BAIL |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_LOWER] = LAYOUT_preonic_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_TAB, KC_F1, KC_F2, KC_F3, KC_F4, KC_ESC, KC_BSPC, KC_PSLS, KC_P7, KC_P8, KC_P9, KC_PMNS,
+ TT(_FNL2), KC_F5, KC_F6, KC_F7, KC_F8, KC_INS, KC_HOME, KC_PGUP, KC_P4, KC_P5, KC_P6, KC_PPLS,
+ KC_LSFT, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_END, KC_PGDN, KC_P1, KC_P2, KC_P3, KC_PENT,
+ _______, _______, KC_LALT, _______, TO(_QWERTY), _______, _______, KC_PAST, KC_P0, KC_PDOT, KC_DOT, TO(_QWERTY)
+),
+
+/* FNL2
+ * ,-----------------------------------------------------------------------------------.
+ * |TbMacr| Prev | Play | Next | AltF4| CapsL| |PrScrn|Insert| Home | PgUp |ScrLck|
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | | | Vol- | Vol+ | Mute | NumL | | | Del | End | PgDn | Pause|
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | | | | | | | | | Up | | Enter|
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | | | Left | Down | Right| BAIL |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_FNL2] = LAYOUT_preonic_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, \
+ TBMACRO, KC_MPRV, KC_MPLY, KC_MNXT, ALT_F4, KC_CAPS, _______, KC_PSCR, KC_INS, KC_HOME, KC_PGUP, KC_SLCK,
+ _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, KC_NLCK, _______, _______, KC_DEL, KC_END, KC_PGDN, KC_PAUS,
+ _______, CTLZ, CTLX, CTLC, CTLV, _______, _______, _______, _______, KC_UP, _______, KC_ENT,
+ _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, TO(_QWERTY)
+),
+
+/* Adjust (Lower + Raise)
+ * ,-----------------------------------------------------------------------------------.
+ * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | GAME | Reset| | | | | | | | | | Del |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | | | |Aud on|AudOff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| | | | | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | | | | | | BAIL |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_ADJUST] = LAYOUT_preonic_grid( \
+ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \
+ TO(_GAMEMODE), RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL, \
+ _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, \
+ _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, \
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, TO(_QWERTY) \
+),
+
+
+/* Game mode
+ * ,-----------------------------------------------------------------------------------.
+ * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | FNL1 | A | S | D | F | G | H | J | K | L | ; | " |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Ctrl | 1 | Lower| Bksp | Alt | Space | Raise| Bksp | BAIL | * | Esc |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_GAMEMODE] = LAYOUT_preonic_grid( \
+ 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_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,
+ TT(_FNL3), 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,
+ KC_LCTL, KC_1, MO(_LOWER2), KC_DEL, KC_LALT, KC_SPC, KC_SPC, MO(_RAISE2), KC_BSPC, TO(_QWERTY), KC_NUHS, KC_ESC
+),
+/* FNL3
+ * ,-----------------------------------------------------------------------------------.
+ * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |TbMacr| Prev | Play | Next | AltF4| CapsL| Esc | PgUp | Up | PgDn |PrScrn| Bksp |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | | | Vol- | Vol+ | Mute | NumL | Home | Left | Down | Right| | Del |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | | | | | | End | | | | | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | | | | | | BAIL |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_FNL3] = LAYOUT_preonic_grid( \
+ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
+ TBMACRO, KC_MPRV, KC_MPLY, KC_MNXT, ALT_F4, KC_CAPS, KC_ESC, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_BSPC,
+ _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, KC_NLCK, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_DEL,
+ KC_LSFT, _______, _______, _______, _______, _______, KC_END, _______, _______, _______, LSFT(KC_MINS), _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, LSFT(KC_1), _______
+),
+
+/* Lower
+ * ,-----------------------------------------------------------------------------------.
+ * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Tab | F1 | F2 | F3 | F4 | Esc | Bksp | / | 7 | 8 | 9 | - |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | FNL2 | F5 | F6 | F7 | F8 |Insert| Home | PgUp | 4 | 5 | 6 | + |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | F9 | F10 | F11 | F12 | Del | End | PgDn | 1 | 2 | 3 | Enter|
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | Alt | | | | * | 0 | , | . | BAIL |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_LOWER2] = LAYOUT_preonic_grid( \
+ 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_TAB, KC_F1, KC_F2, KC_F3, KC_F4, KC_ESC, KC_BSPC, KC_PSLS, KC_P7, KC_P8, KC_P9, KC_PMNS,
+ TT(_FNL2), KC_F5, KC_F6, KC_F7, KC_F8, KC_INS, KC_HOME, KC_PGUP, KC_P4, KC_P5, KC_P6, KC_PPLS,
+ KC_LSFT, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_END, KC_PGDN, KC_P1, KC_P2, KC_P3, KC_PENT,
+ _______, _______, _______, _______, _______, _______, _______, KC_PAST, KC_P0, KC_PDOT, KC_DOT, TO(_GAMEMODE)
+),
+
+/* Raise
+ * ,-----------------------------------------------------------------------------------.
+ * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | § | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | + |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | ´ | ` | @ | £ | $ | € | ¨ | { | [ | ] | } | \ |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | < | | | > | ° | | | µ | ¨ | ^ | ~ | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | AltGr| | | | | | | | BAIL |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_RAISE2] = LAYOUT_preonic_grid( \
+ 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_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, S(KC_EQL), RALT(KC_2), RALT(KC_3), RALT(KC_4), RALT(KC_E), KC_RBRC, RALT(KC_7), RALT(KC_8), RALT(KC_9), RALT(KC_0), RALT(KC_MINS),
+ KC_LSFT, KC_NUBS, RALT(KC_NUBS), S(KC_NUBS), DGRMCRO, XXXXXXX, XXXXXXX, RALT(KC_M), KC_RBRC, S(KC_RBRC), RALT(KC_RBRC), _______,
+ _______, _______, KC_RALT, _______, _______, _______, _______, _______, _______, _______, _______, TO(_GAMEMODE)
+)
+
+
+};
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ if (record->event.pressed) {
+ switch(keycode) {
+ case TBMACRO:
+ SEND_STRING(SS_TAP(X_TAB) SS_DOWN(X_LSHIFT) SS_TAP(X_HOME) SS_UP(X_LSHIFT) SS_TAP(X_DELETE));
+ return false;
+ case DGRMCRO:
+ if(!bnumlock) {
+ tap_code(KC_NLCK);
+ bnumlock = true;
+ }
+ //SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_P0) SS_TAP(X_P1) SS_TAP(X_P7) SS_TAP(X_P6) SS_UP(X_LALT));
+ SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_KP_0) SS_TAP(X_KP_1) SS_TAP(X_KP_7) SS_TAP(X_KP_6) SS_UP(X_LALT) );
+ return false;
+
+ if(bnumlock) {
+ tap_code(KC_NLCK);
+ bnumlock = false;
+ }
+ case WRKMOD:
+ if(!workmode) {
+ workmode = true;
+ return false;
+ }
+ else {
+ workmode = false;
+ return false;
+ }
+ }
+
+ }
+ return true;
+ switch (keycode) {
+
+ case BACKLIT:
+ if (record->event.pressed) {
+ register_code(KC_RSFT);
+ #ifdef BACKLIGHT_ENABLE
+ backlight_step();
+ #endif
+ #ifdef __AVR__
+ PORTE &= ~(1<<6);
+ #endif
+ } else {
+ unregister_code(KC_RSFT);
+ #ifdef __AVR__
+ PORTE |= (1<<6);
+ #endif
+ }
+ return false;
+ break;
+ }
+ return true;
+};
+
+bool muse_mode = false;
+uint8_t last_muse_note = 0;
+uint16_t muse_counter = 0;
+uint8_t muse_offset = 70;
+uint16_t muse_tempo = 50;
+
+void encoder_update_user(uint8_t index, bool clockwise) {
+ if (muse_mode) {
+ if (IS_LAYER_ON(_RAISE)) {
+ if (clockwise) {
+ muse_offset++;
+ } else {
+ muse_offset--;
+ }
+ } else {
+ if (clockwise) {
+ muse_tempo+=1;
+ } else {
+ muse_tempo-=1;
+ }
+ }
+ } else {
+ if (clockwise) {
+ register_code(KC_PGDN);
+ unregister_code(KC_PGDN);
+ } else {
+ register_code(KC_PGUP);
+ unregister_code(KC_PGUP);
+ }
+ }
+}
+
+void dip_switch_update_user(uint8_t index, bool active) {
+ switch (index) {
+ case 0:
+ if (active) {
+ layer_on(_ADJUST);
+ } else {
+ layer_off(_ADJUST);
+ }
+ break;
+ case 1:
+ if (active) {
+ muse_mode = true;
+ } else {
+ muse_mode = false;
+ }
+ }
+}
+
+
+uint32_t layer_state_set_user(uint32_t state) {
+// if(rgblight_get_mode() == 1) {
+ switch (biton32(state)) {
+ case _QWERTY:
+ if(bnumlock) {
+ tap_code(KC_NLCK);
+ }
+ break;
+ case _LOWER:
+ if(!bnumlock) {
+ tap_code(KC_NLCK);
+ }
+
+ break;
+ case _ADJUST:
+ if(bnumlock) {
+ tap_code(KC_NLCK);
+ }
+ break;
+ case _RAISE:
+ if(bnumlock) {
+ tap_code(KC_NLCK);
+ }
+ break;
+ case _FNL1:
+ if(bnumlock) {
+ tap_code(KC_NLCK);
+ }
+ break;
+ case _GAMEMODE:
+ break;
+ default: // for any other layers, or the default layer
+ if(bnumlock) {
+ tap_code(KC_NLCK);
+ }
+
+ break;
+ }
+ // }
+ return state;
+}
+
+void matrix_scan_user(void) {
+#ifdef AUDIO_ENABLE
+ if (muse_mode) {
+ if (muse_counter == 0) {
+ uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()];
+ if (muse_note != last_muse_note) {
+ stop_note(compute_freq_for_midi_note(last_muse_note));
+ play_note(compute_freq_for_midi_note(muse_note), 0xF);
+ last_muse_note = muse_note;
+ }
+ }
+ muse_counter = (muse_counter + 1) % muse_tempo;
+ } else {
+ if (muse_counter) {
+ stop_all_notes();
+ muse_counter = 0;
+ }
+ }
+#endif
+}
+
+bool music_mask_user(uint16_t keycode) {
+ switch (keycode) {
+ case RAISE:
+ case LOWER:
+ return false;
+ default:
+ return true;
+ }
+}
diff --git a/keyboards/preonic/keymaps/senseored/readme.md b/keyboards/preonic/keymaps/senseored/readme.md
new file mode 100644
index 000000000..1b286acc8
--- /dev/null
+++ b/keyboards/preonic/keymaps/senseored/readme.md
@@ -0,0 +1 @@
+# Swedish Preonic layout. Still figuring out what to do with numbers/symbols compared to a Planck-layout. \ No newline at end of file
diff --git a/keyboards/preonic/keymaps/senseored/rules.mk b/keyboards/preonic/keymaps/senseored/rules.mk
new file mode 100644
index 000000000..dcf16bef3
--- /dev/null
+++ b/keyboards/preonic/keymaps/senseored/rules.mk
@@ -0,0 +1 @@
+SRC += muse.c
diff --git a/keyboards/preonic/preonic.c b/keyboards/preonic/preonic.c
index ff07f961f..8d052ea81 100644
--- a/keyboards/preonic/preonic.c
+++ b/keyboards/preonic/preonic.c
@@ -12,7 +12,7 @@ const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
#endif
const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_preonic_grid(
- 48, 49, 50, 51, 52, 53, 53, 55, 56, 57, 58, 59,
+ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
diff --git a/keyboards/preonic/preonic.h b/keyboards/preonic/preonic.h
index e2aa1545c..aa184ccbd 100644
--- a/keyboards/preonic/preonic.h
+++ b/keyboards/preonic/preonic.h
@@ -4,7 +4,7 @@
/**************************************************
** Include headers specific to keyboard revision **
-***************************************************/
+**************************************************/
#ifdef KEYBOARD_preonic_rev1
#include "rev1.h"
#endif
@@ -20,7 +20,7 @@
/**************************************************
** Layout macros aliases common to all revisions **
-
- Name of Alias Matrix Name:
- ----------------- ------------------- ****/
-#define LAYOUT_ortho_5x12 LAYOUT_preonic_grid
+** **
+** Name of Alias Matrix Name: **
+******* ----------------- ------------------- ****/
+#define LAYOUT_ortho_5x12 LAYOUT_preonic_grid
diff --git a/keyboards/preonic/rev1/rev1.c b/keyboards/preonic/rev1/rev1.c
index 4e8779608..fd09d7f2d 100644
--- a/keyboards/preonic/rev1/rev1.c
+++ b/keyboards/preonic/rev1/rev1.c
@@ -18,8 +18,8 @@
void matrix_init_kb(void) {
// Turn status LED on
- DDRE |= (1<<6);
- PORTE |= (1<<6);
+ setPinOutput(E6);
+ writePinHigh(E6);
matrix_init_user();
};
diff --git a/keyboards/preonic/rev1/rules.mk b/keyboards/preonic/rev1/rules.mk
index b0d44db82..2d74f3823 100644
--- a/keyboards/preonic/rev1/rules.mk
+++ b/keyboards/preonic/rev1/rules.mk
@@ -1,56 +1,24 @@
# MCU name
-#MCU = at90usb1287
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)
-
-# Bootloader
-# This definition is optional, and if your keyboard supports multiple bootloaders of
-# different sizes, comment this out, and the correct address will be loaded
-# automatically (+60). See bootloader.mk for all options.
+# Bootloader selection
+# Teensy halfkay
+# Pro Micro caterina
+# Atmel DFU atmel-dfu
+# LUFA DFU lufa-dfu
+# QMK DFU qmk-dfu
+# ATmega32A bootloadHID
+# ATmega328P USBasp
BOOTLOADER = atmel-dfu
-# Interrupt driven control endpoint task(+60)
-OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
-
# Build Options
-# change to "no" to disable the options, or define them in the Makefile in
+# 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 = lite # 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)
+CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE = no # 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 = yes # Enable keyboard backlight functionality
@@ -65,3 +33,5 @@ API_SYSEX_ENABLE = no
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
LAYOUTS = ortho_5x12
+
+LINK_TIME_OPTIMIZATION_ENABLE = yes
diff --git a/keyboards/preonic/rev2/rev2.c b/keyboards/preonic/rev2/rev2.c
index 30e3110e4..785ac3310 100644
--- a/keyboards/preonic/rev2/rev2.c
+++ b/keyboards/preonic/rev2/rev2.c
@@ -18,8 +18,8 @@
void matrix_init_kb(void) {
// Turn status LED on
- DDRE |= (1<<6);
- PORTE |= (1<<6);
+ setPinOutput(E6);
+ writePinHigh(E6);
matrix_init_user();
};
diff --git a/keyboards/preonic/rev2/rules.mk b/keyboards/preonic/rev2/rules.mk
index 748979c79..06315b2c6 100644
--- a/keyboards/preonic/rev2/rules.mk
+++ b/keyboards/preonic/rev2/rules.mk
@@ -1,61 +1,29 @@
# MCU name
-#MCU = at90usb1287
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)
-
-# Bootloader
-# This definition is optional, and if your keyboard supports multiple bootloaders of
-# different sizes, comment this out, and the correct address will be loaded
-# automatically (+60). See bootloader.mk for all options.
+# Bootloader selection
+# Teensy halfkay
+# Pro Micro caterina
+# Atmel DFU atmel-dfu
+# LUFA DFU lufa-dfu
+# QMK DFU qmk-dfu
+# ATmega32A bootloadHID
+# ATmega328P USBasp
BOOTLOADER = qmk-dfu
-# Interrupt driven control endpoint task(+60)
-OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
-
# Build Options
-# change to "no" to disable the options, or define them in the Makefile in
+# 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 = lite # Virtual DIP switch configuration(+1000)
-MOUSEKEY_ENABLE = no # Mouse keys(+4700)
+MOUSEKEY_ENABLE = no # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
-CONSOLE_ENABLE = yes # Console for debug(+400)
-COMMAND_ENABLE = no # Commands for debug and configuration
+CONSOLE_ENABLE = yes # Console for debug(+400)
+COMMAND_ENABLE = no # 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 = yes # Enable keyboard backlight functionality
MIDI_ENABLE = no # MIDI controls
-AUDIO_ENABLE = yes # Audio output on port C6
+AUDIO_ENABLE = yes # 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.
@@ -65,3 +33,5 @@ API_SYSEX_ENABLE = no
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
LAYOUTS = ortho_5x12
+
+LINK_TIME_OPTIMIZATION_ENABLE = yes
diff --git a/keyboards/preonic/rev3/config.h b/keyboards/preonic/rev3/config.h
index b2a53ee65..b5b2ced5a 100644
--- a/keyboards/preonic/rev3/config.h
+++ b/keyboards/preonic/rev3/config.h
@@ -27,26 +27,17 @@
#define MATRIX_ROWS 10
#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)
- *
-*/
-/* Note: These are not used for arm boards. They're here purely as documentation.
- * #define MATRIX_ROW_PINS { PB0, PB1, PB2, PA15, PA10 }
- * #define MATRIX_COL_PINS { PA2, PA3, PA6, PB14, PB15, PA8, PA9, PA7, PB3, PB4, PC14, PC15, PC13, PB5, PB6 }
- * #define UNUSED_PINS
- */
+#undef MATRIX_ROW_PINS
+#undef MATRIX_COL_PINS
+#define MATRIX_ROW_PINS { A10, A9, A8, B15, C13, C14, C15, A2, A3, A6 }
+#define MATRIX_COL_PINS { B11, B10, B2, B1, A7, B0 }
+#define UNUSED_PINS
-#define NUMBER_OF_ENCODERS 1
#define ENCODERS_PAD_A { B12 }
#define ENCODERS_PAD_B { B13 }
+#define DIP_SWITCH_PINS { B14, A15, A0, B9 }
+
#define MUSIC_MAP
#undef AUDIO_VOICES
#undef C6_AUDIO
@@ -121,14 +112,18 @@
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
//#define MIDI_TONE_KEYCODE_OCTAVES 1
-#define WS2812_LED_N 2
-#define RGBLED_NUM WS2812_LED_N
-#define WS2812_TIM_N 2
-#define WS2812_TIM_CH 2
-#define PORT_WS2812 GPIOA
-#define PIN_WS2812 1
-#define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA stream for TIMx_UP (look up in reference manual under DMA Channel selection)
+// #define WS2812_LED_N 2
+// #define RGBLED_NUM WS2812_LED_N
+// #define WS2812_TIM_N 2
+// #define WS2812_TIM_CH 2
+// #define PORT_WS2812 GPIOA
+// #define PIN_WS2812 1
+// #define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA stream for TIMx_UP (look up in reference manual under DMA Channel selection)
//#define WS2812_DMA_CHANNEL 7 // DMA channel for TIMx_UP
//#define WS2812_EXTERNAL_PULLUP
+#define RGB_DI_PIN A1
+#define RGBLED_NUM 9
+#define RGBLIGHT_ANIMATIONS
+
#endif
diff --git a/keyboards/preonic/rev3/matrix.c b/keyboards/preonic/rev3/matrix.c
deleted file mode 100644
index db7a4f2a3..000000000
--- a/keyboards/preonic/rev3/matrix.c
+++ /dev/null
@@ -1,187 +0,0 @@
-#include <stdint.h>
-#include <stdbool.h>
-#include <string.h>
-#include "hal.h"
-#include "timer.h"
-#include "wait.h"
-#include "printf.h"
-#include "backlight.h"
-#include "matrix.h"
-#include "action.h"
-#include "keycode.h"
-#include <string.h>
-
-/*
- * col: { B11, B10, B2, B1, A7, B0 }
- * row: { A10, A9, A8, B15, C13, C14, C15, A2 }
- */
-/* matrix state(1:on, 0:off) */
-static matrix_row_t matrix[MATRIX_ROWS];
-static matrix_col_t matrix_debouncing[MATRIX_COLS];
-static bool debouncing = false;
-static uint16_t debouncing_time = 0;
-
-static bool dip_switch[4] = {0, 0, 0, 0};
-
-__attribute__ ((weak))
-void matrix_init_user(void) {}
-
-__attribute__ ((weak))
-void matrix_scan_user(void) {}
-
-__attribute__ ((weak))
-void matrix_init_kb(void) {
- matrix_init_user();
-}
-
-__attribute__ ((weak))
-void matrix_scan_kb(void) {
- matrix_scan_user();
-}
-
-void matrix_init(void) {
- printf("matrix init\n");
- //debug_matrix = true;
-
- // dip switch setup
- palSetPadMode(GPIOB, 14, PAL_MODE_INPUT_PULLUP);
- palSetPadMode(GPIOA, 15, PAL_MODE_INPUT_PULLUP);
- palSetPadMode(GPIOA, 10, PAL_MODE_INPUT_PULLUP);
- palSetPadMode(GPIOB, 9, PAL_MODE_INPUT_PULLUP);
-
- // actual matrix setup
- palSetPadMode(GPIOB, 11, PAL_MODE_OUTPUT_PUSHPULL);
- palSetPadMode(GPIOB, 10, PAL_MODE_OUTPUT_PUSHPULL);
- palSetPadMode(GPIOB, 2, PAL_MODE_OUTPUT_PUSHPULL);
- palSetPadMode(GPIOB, 1, PAL_MODE_OUTPUT_PUSHPULL);
- palSetPadMode(GPIOA, 7, PAL_MODE_OUTPUT_PUSHPULL);
- palSetPadMode(GPIOB, 0, PAL_MODE_OUTPUT_PUSHPULL);
-
- palSetPadMode(GPIOA, 10, PAL_MODE_INPUT_PULLDOWN);
- palSetPadMode(GPIOA, 9, PAL_MODE_INPUT_PULLDOWN);
- palSetPadMode(GPIOA, 8, PAL_MODE_INPUT_PULLDOWN);
- palSetPadMode(GPIOB, 15, PAL_MODE_INPUT_PULLDOWN);
- palSetPadMode(GPIOC, 13, PAL_MODE_INPUT_PULLDOWN);
- palSetPadMode(GPIOC, 14, PAL_MODE_INPUT_PULLDOWN);
- palSetPadMode(GPIOC, 15, PAL_MODE_INPUT_PULLDOWN);
- palSetPadMode(GPIOA, 2, PAL_MODE_INPUT_PULLDOWN);
- palSetPadMode(GPIOA, 3, PAL_MODE_INPUT_PULLDOWN);
- palSetPadMode(GPIOA, 6, PAL_MODE_INPUT_PULLDOWN);
-
-
- memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t));
- memset(matrix_debouncing, 0, MATRIX_COLS * sizeof(matrix_col_t));
-
-
- matrix_init_quantum();
-}
-
-__attribute__ ((weak))
-void dip_update(uint8_t index, bool active) { }
-
-__attribute__ ((weak))
-void encoder_update(bool clockwise) { }
-
-bool last_dip_switch[4] = {0};
-
-#ifndef ENCODER_RESOLUTION
- #define ENCODER_RESOLUTION 4
-#endif
-
-uint8_t matrix_scan(void) {
- // dip switch
- dip_switch[0] = !palReadPad(GPIOB, 14);
- dip_switch[1] = !palReadPad(GPIOA, 15);
- dip_switch[2] = !palReadPad(GPIOA, 10);
- dip_switch[3] = !palReadPad(GPIOB, 9);
- for (uint8_t i = 0; i < 4; i++) {
- if (last_dip_switch[i] ^ dip_switch[i])
- dip_update(i, dip_switch[i]);
- }
- memcpy(last_dip_switch, dip_switch, sizeof(&dip_switch));
-
- // actual matrix
- for (int col = 0; col < MATRIX_COLS; col++) {
- matrix_col_t data = 0;
-
- // strobe col { B11, B10, B2, B1, A7, B0 }
- switch (col) {
- case 0: palSetPad(GPIOB, 11); break;
- case 1: palSetPad(GPIOB, 10); break;
- case 2: palSetPad(GPIOB, 2); break;
- case 3: palSetPad(GPIOB, 1); break;
- case 4: palSetPad(GPIOA, 7); break;
- case 5: palSetPad(GPIOB, 0); break;
- }
-
- // need wait to settle pin state
- wait_us(20);
-
- // read row data { A10, A9, A8, B15, C13, C14, C15, A2 }
- data = (
- (palReadPad(GPIOA, 10) << 0 ) |
- (palReadPad(GPIOA, 9) << 1 ) |
- (palReadPad(GPIOA, 8) << 2 ) |
- (palReadPad(GPIOB, 15) << 3 ) |
- (palReadPad(GPIOC, 13) << 4 ) |
- (palReadPad(GPIOC, 14) << 5 ) |
- (palReadPad(GPIOC, 15) << 6 ) |
- (palReadPad(GPIOA, 2) << 7 ) |
- (palReadPad(GPIOA, 3) << 8 ) |
- (palReadPad(GPIOA, 6) << 9 )
- );
-
- // unstrobe col { B11, B10, B2, B1, A7, B0 }
- switch (col) {
- case 0: palClearPad(GPIOB, 11); break;
- case 1: palClearPad(GPIOB, 10); break;
- case 2: palClearPad(GPIOB, 2); break;
- case 3: palClearPad(GPIOB, 1); break;
- case 4: palClearPad(GPIOA, 7); break;
- case 5: palClearPad(GPIOB, 0); break;
- }
-
- if (matrix_debouncing[col] != data) {
- matrix_debouncing[col] = data;
- debouncing = true;
- debouncing_time = timer_read();
- }
- }
-
- if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCE) {
- for (int row = 0; row < MATRIX_ROWS; row++) {
- matrix[row] = 0;
- for (int col = 0; col < MATRIX_COLS; col++) {
- matrix[row] |= ((matrix_debouncing[col] & (1 << row) ? 1 : 0) << col);
- }
- }
- debouncing = false;
- }
-
- matrix_scan_quantum();
-
- return 1;
-}
-
-bool matrix_is_on(uint8_t row, uint8_t col) {
- return (matrix[row] & (1<<col));
-}
-
-matrix_row_t matrix_get_row(uint8_t row) {
- return matrix[row];
-}
-
-void matrix_print(void) {
- printf("\nr/c 01234567\n");
- for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
- printf("%X0: ", row);
- matrix_row_t data = matrix_get_row(row);
- for (int col = 0; col < MATRIX_COLS; col++) {
- if (data & (1<<col))
- printf("1");
- else
- printf("0");
- }
- printf("\n");
- }
-}
diff --git a/keyboards/preonic/rev3/rev3.c b/keyboards/preonic/rev3/rev3.c
index b61beec5d..dc4ff66fc 100644
--- a/keyboards/preonic/rev3/rev3.c
+++ b/keyboards/preonic/rev3/rev3.c
@@ -22,3 +22,13 @@ void matrix_init_kb(void) {
void matrix_scan_kb(void) {
matrix_scan_user();
}
+
+#ifdef DIP_SWITCH_ENABLE
+ __attribute__((weak))
+void dip_update(uint8_t index, bool active) {}
+
+ __attribute__((weak))
+void dip_switch_update_user(uint8_t index, bool active) {
+ dip_update(index, active);
+}
+#endif
diff --git a/keyboards/preonic/rev3/rules.mk b/keyboards/preonic/rev3/rules.mk
index 39e69872c..ad8a82967 100644
--- a/keyboards/preonic/rev3/rules.mk
+++ b/keyboards/preonic/rev3/rules.mk
@@ -1,11 +1,8 @@
-# project specific files
-SRC = matrix.c
-
-# Cortex version
-MCU = STM32F303
+# MCU name
+MCU = STM32F303
# Build Options
-# change to "no" to disable the options, or define them in the Makefile in
+# 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)
@@ -20,15 +17,16 @@ MIDI_ENABLE = no # MIDI controls
AUDIO_ENABLE = yes # 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.
+RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
+WS2812_DRIVER = bitbang
API_SYSEX_ENABLE = no
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
#SLEEP_LED_ENABLE = yes
-CUSTOM_MATRIX = yes # Custom matrix file
# SERIAL_LINK_ENABLE = yes
ENCODER_ENABLE = yes
+DIP_SWITCH_ENABLE = yes
LAYOUTS = ortho_5x12