summaryrefslogtreecommitdiff
path: root/keyboards/preonic
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/preonic')
-rw-r--r--keyboards/preonic/keymaps/juno/keymap.c313
-rw-r--r--keyboards/preonic/keymaps/juno/readme.md1
-rw-r--r--keyboards/preonic/keymaps/juno/rules.mk0
-rw-r--r--keyboards/preonic/keymaps/kjwon15/keymap.c18
-rw-r--r--keyboards/preonic/keymaps/mverteuil/config.h (renamed from keyboards/preonic/keymaps/juno/config.h)22
-rw-r--r--keyboards/preonic/keymaps/mverteuil/keymap.c508
-rw-r--r--keyboards/preonic/keymaps/mverteuil/readme.md2
-rw-r--r--keyboards/preonic/keymaps/mverteuil/rules.mk5
-rw-r--r--keyboards/preonic/keymaps/mverteuil_2x2u/config.h39
-rw-r--r--keyboards/preonic/keymaps/mverteuil_2x2u/keymap.c413
-rw-r--r--keyboards/preonic/keymaps/mverteuil_2x2u/rules.mk6
-rw-r--r--keyboards/preonic/preonic.c11
-rw-r--r--keyboards/preonic/rev1/rev1.c11
-rw-r--r--keyboards/preonic/rev2/rev2.c11
-rw-r--r--keyboards/preonic/rev3/rev3.c16
15 files changed, 1032 insertions, 344 deletions
diff --git a/keyboards/preonic/keymaps/juno/keymap.c b/keyboards/preonic/keymaps/juno/keymap.c
deleted file mode 100644
index 2e3152d299..0000000000
--- a/keyboards/preonic/keymaps/juno/keymap.c
+++ /dev/null
@@ -1,313 +0,0 @@
-/* Juno's Preonic Layout */
-
-#include QMK_KEYBOARD_H
-
-enum preonic_layers {
- _QWERTY,
- _COLEMAK,
- _DVORAK,
- _LOWER,
- _RAISE,
- _ADJUST,
-
- _FN1,
- _DPAD
-};
-
-enum preonic_keycodes {
- QWERTY = SAFE_RANGE,
- COLEMAK,
- DVORAK,
- LOWER,
- RAISE,
- BACKLIT,
-
- FN1,
- DP_ON,
- DP_OFF
-};
-
-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 | Del |
- * |------+------+------+------+------+-------------+------+------+------+------+------|
- * | FN1 | A | S | D | F | G | H | J | K | L | ; | " |
- * |------+------+------+------+------+------|------+------+------+------+------+------|
- * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
- * |------+------+------+------+------+------+------+------+------+------+------+------|
- * | Brite| Ctrl | Alt | GUI |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_DEL, \
- MO(_FN1),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 , \
- BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
-),
-
-/* 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 |
- * |------+------+------+------+------+-------------+------+------+------+------+------|
- * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del |
- * |------+------+------+------+------+-------------+------+------+------+------+------|
- * | 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_DEL, \
- 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_HOME, KC_END, _______, \
- _______, _______, _______, _______, _______, _______, _______, _______, 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 | Del |
- * |------+------+------+------+------+-------------+------+------+------+------+------|
- * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
- * |------+------+------+------+------+------|------+------+------+------+------+------|
- * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | | |
- * |------+------+------+------+------+------+------+------+------+------+------+------|
- * | | | | | | | | 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_DEL, \
- KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \
- _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, 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 |
- * |------+------+------+------+------+------+------+------+------+------+------+------|
- * | | 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, QWERTY, COLEMAK, DVORAK, _______, _______, \
- _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, \
- _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
-),
-
-/* Function (personal function layer)
- * ,-----------------------------------------------------------------------------------.
- * | | | | | | | | | | | | |
- * |------+------+------+------+------+------+------+------+------+------+------+------|
- * | | Vol- | | Vol+ | | | | PgUp | Up | PgDn | PScr | Del |
- * |------+------+------+------+------+-------------+------+------+------+------+------|
- * | | | | | | | Home | Left | Down |Right | Ins | Del |
- * |------+------+------+------+------+------|------+------+------+------+------+------|
- * | Shift| Prev | Play | Next | Brite| | End | | Vol- | Vol+ | Mute | |
- * |------+------+------+------+------+------+------+------+------+------+------+------|
- * | Ctrl | GUI | Alt | Caps | | Space | | DP_ON| | | |
- * `-----------------------------------------------------------------------------------'
- */
-[_FN1] = LAYOUT_preonic_grid( \
- _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
- _______, KC_VOLD, _______, KC_VOLU, _______, _______, _______, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_DEL , \
- _______, _______, _______, _______, _______, _______, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_INS, KC_DEL , \
- KC_LSFT, KC_MPRV, KC_MPLY, KC_MNXT, BACKLIT, _______, KC_END, _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, \
- KC_LCTL, KC_LGUI, KC_LALT, KC_CAPS, _______, KC_SPC, KC_SPC, _______, DP_ON, _______, _______, _______ \
-),
-
-/* DPAD layer, for active arrow cluster at the bottom right corner
- * Use TG() to enable, but FUNC() to disable (defined at end of file)
- * All layers clearing required
- * ,-----------------------------------------------------------------------------------.
- * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
- * |------+------+------+------+------+------+------+------+------+------+------+------|
- * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del |
- * |------+------+------+------+------+-------------+------+------+------+------+------|
- * | Caps | A | S | D | F | G | H | J | K | L | ; | " |
- * |------+------+------+------+------+------|------+------+------+------+------+------|
- * | Shift| Z | X | C | V | B | N | M | , | . | Up |Enter |
- * |------+------+------+------+------+------+------+------+------+------+------+------|
- * | Ctrl | GUI | Alt | |Lower | Space |Raise |DP_OFF| Left | Down |Right |
- * `-----------------------------------------------------------------------------------'
- */
-[_DPAD] = 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_DEL, \
- KC_CAPS, 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_UP, KC_ENT , \
- KC_LCTL, KC_LGUI, KC_LALT, _______, LOWER, KC_SPC, KC_SPC, RAISE, DP_OFF, KC_LEFT, KC_DOWN, KC_RGHT \
-)
-
-};
-
-#ifdef AUDIO_ENABLE
- float plover_song[][2] = SONG(PLOVER_SOUND);
- float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND);
-
- float caps_song_on[][2] = SONG(NUM_LOCK_ON_SOUND);
- float caps_song_off[][2] = SONG(SCROLL_LOCK_ON_SOUND);
-
- float dpad_song_on[][2] = SONG(ZELDA_PUZZLE);
- float dpad_song_off[][2] = SONG(SONIC_RING);
-#endif
-
-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
- PORTE &= ~(1<<6);
- } else {
- unregister_code(KC_RSFT);
- PORTE |= (1<<6);
- }
- return false;
- break;
-
-
-
- // Additional personal custom functions
-
- case KC_CAPS:
- if (record->event.pressed) {
- #ifdef AUDIO_ENABLE
- if (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) {
- PLAY_SONG(caps_song_off);
- } else {
- PLAY_SONG(caps_song_on);
- }
- #endif
- }
- return true; // process the actual function of Caps Lock
- //break;
-
- case DP_ON:
- if (record->event.pressed) {
-
- } else {
- // activated upon release
- #ifdef AUDIO_ENABLE
- PLAY_SONG(dpad_song_on);
- #endif
-
- layer_off(_FN1);
- layer_on(_DPAD);
- }
-
- case DP_OFF:
- if (record->event.pressed) {
- // deactivated upon pressdown
- #ifdef AUDIO_ENABLE
- PLAY_SONG(dpad_song_off);
- #endif
-
- //layer_off(_FN1); // do not put in this line
- layer_off(_DPAD);
- }
-
- }
- return true;
-};
diff --git a/keyboards/preonic/keymaps/juno/readme.md b/keyboards/preonic/keymaps/juno/readme.md
deleted file mode 100644
index e911968dd9..0000000000
--- a/keyboards/preonic/keymaps/juno/readme.md
+++ /dev/null
@@ -1 +0,0 @@
-# The default Preonic layout - largely based on the Planck's \ No newline at end of file
diff --git a/keyboards/preonic/keymaps/juno/rules.mk b/keyboards/preonic/keymaps/juno/rules.mk
deleted file mode 100644
index e69de29bb2..0000000000
--- a/keyboards/preonic/keymaps/juno/rules.mk
+++ /dev/null
diff --git a/keyboards/preonic/keymaps/kjwon15/keymap.c b/keyboards/preonic/keymaps/kjwon15/keymap.c
index bca3575fdd..cfc89f3b66 100644
--- a/keyboards/preonic/keymaps/kjwon15/keymap.c
+++ b/keyboards/preonic/keymaps/kjwon15/keymap.c
@@ -50,7 +50,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | N | M | , | . | / | SF/EN|
* |------+------+------+------+------+------+------+------+------+------+------+------|
- * | Enter| Ctrl | GUI | Alt |Lower | Space |Raise | Left | Down | Up |Right |
+ * | Enter| Ctrl | GUI | Alt |Lower |Mouse |Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = LAYOUT_preonic_grid(
@@ -160,30 +160,30 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
[_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, \
+ 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
+/* Mouse / LED
* ,-----------------------------------------------------------------------------------.
* | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
* |------+------+------+------+------+------+------+------+------+------+------+------|
- * | | | WHL_U|Mclick| | | | LCTL | MS_U | WHL_U| | Del |
+ * |RGB_TO| | WHL_U|Mclick| | HU_D | HU_I | LCTL | MS_U | WHL_U| | Del |
* |------+------+------+------+------+-------------+------+------+------+------+------|
- * | | | WHL_D|Rclick|Lclick| | | MS_L | MS_D | MS_R | | ACL0 |
+ * |RGB_MO| | WHL_D|Rclick|Lclick| SA_D | SA_I | MS_L | MS_D | MS_R | | ACL0 |
* |------+------+------+------+------+------|------+------+------+------+------+------|
- * | | | | | | | | WHL_D| WHL_L| WHL_R| | ACL1 |
+ * |RGB_MR| | | | | VA_D | VA_I | 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, \
+ RGB_TOG, _______, KC_WH_U, KC_BTN3, _______, RGB_HUD, RGB_HUI, KC_LCTL, KC_MS_U, KC_WH_U, _______, KC_DEL, \
+ RGB_MOD, _______, KC_WH_D, KC_BTN2, KC_BTN1, RGB_SAD, RGB_SAI, KC_MS_L, KC_MS_D, KC_MS_R, _______, KC_ACL0, \
+ RGB_RMOD,_______, _______, _______, _______, RGB_VAD, RGB_VAI, KC_WH_D, KC_WH_L, KC_WH_R, _______, KC_ACL1, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_ACL2 \
)
diff --git a/keyboards/preonic/keymaps/juno/config.h b/keyboards/preonic/keymaps/mverteuil/config.h
index 6387debbb1..51b278f647 100644
--- a/keyboards/preonic/keymaps/juno/config.h
+++ b/keyboards/preonic/keymaps/mverteuil/config.h
@@ -1,13 +1,15 @@
-#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) \
- }
+# if __has_include("copyright.h")
+# include "copyright.h"
+# endif
+
+# define AUDIO_CLICKY_DELAY_DURATION 0
+# define AUDIO_CLICKY_FREQ_DEFAULT 100.0f
+# define AUDIO_CLICKY_FREQ_MIN 61.0f
+# define AUDIO_CLICKY_FREQ_RANDOMNESS 0.2f
+# define DAC_SAMPLE_MAX 7000U
+# define STARTUP_SONG SONG(WORKMAN_SOUND)
+# define GOODBYE_SONG SONG(COIN_SOUND)
#endif
#define MUSIC_MASK (keycode != KC_NO)
@@ -34,4 +36,4 @@
//#define MIDI_ADVANCED
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
-//#define MIDI_TONE_KEYCODE_OCTAVES 2 \ No newline at end of file
+//#define MIDI_TONE_KEYCODE_OCTAVES 2
diff --git a/keyboards/preonic/keymaps/mverteuil/keymap.c b/keyboards/preonic/keymaps/mverteuil/keymap.c
new file mode 100644
index 0000000000..621d60be6a
--- /dev/null
+++ b/keyboards/preonic/keymaps/mverteuil/keymap.c
@@ -0,0 +1,508 @@
+/* Copyright 2015-2017 Jack Humbert, 2019 Matthew de Verteuil
+ *
+ * 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 "mverteuil.h"
+
+/* TapDance Aliases */
+#define TD_LBRK TD(TD_BRACKETS_LEFT)
+#define TD_RBRK TD(TD_BRACKETS_RIGHT)
+#define TD_CLES TD(TD_CONTROL_ESCAPE)
+#define TD_NPFR TD(TD_NUMPAD_FUNCTIONROW)
+#define TD_PLEQ TD(TD_PLUS_EQUALS)
+#define TD_SCOL TD(TD_SEMICOLON_COLON)
+#define TD_SLQU TD(TD_SLASH_QUESTION)
+#define TD_SQDQ TD(TD_QUOTE_DOUBLEQUOTE)
+#define TD_USMI TD(TD_UNDERSCORE_MINUS)
+
+/* Sentinel value for invalid tap dance exit */
+#define TAP_DANCE_NO_MATCH 64
+
+enum preonic_layers {
+ _QWERTY,
+ _FUNCTIONROW,
+ _NUMPAD,
+ _LOWER,
+ _RAISE,
+ _ADJUST,
+};
+
+enum preonic_keycodes {
+ QWERTY = SAFE_RANGE,
+ NUMPAD,
+ LOWER,
+ RAISE,
+ BACKLIT,
+};
+
+enum tapdance_keycodes {
+ TD_BRACKETS_LEFT,
+ TD_BRACKETS_RIGHT,
+ TD_CONTROL_ESCAPE,
+ TD_NUMPAD_FUNCTIONROW,
+ TD_PLUS_EQUALS,
+ TD_QUOTE_DOUBLEQUOTE,
+ TD_SEMICOLON_COLON,
+ TD_SLASH_QUESTION,
+ TD_UNDERSCORE_MINUS,
+};
+
+typedef enum {
+ SINGLE_TAP,
+ SINGLE_HOLD,
+ DOUBLE_TAP,
+ DOUBLE_HOLD,
+ TRIPLE_TAP,
+ TRIPLE_HOLD,
+} t_tap_state;
+
+typedef struct {
+ t_tap_state left_brackets;
+ t_tap_state numpad_funcrow;
+ t_tap_state right_brackets;
+} t_tap;
+
+t_tap_state get_tapdance_state(qk_tap_dance_state_t *state);
+
+void td_numpad_funcrow_finished(qk_tap_dance_state_t *state, void *user_data);
+void td_numpad_funcrow_reset(qk_tap_dance_state_t *state, void *user_data);
+void td_brackets_left_finished(qk_tap_dance_state_t *state, void *user_data);
+void td_brackets_left_reset(qk_tap_dance_state_t *state, void *user_data);
+void td_brackets_right_finished(qk_tap_dance_state_t *state, void *user_data);
+void td_brackets_right_reset(qk_tap_dance_state_t *state, void *user_data);
+
+/* Tap Dance Definitions */
+qk_tap_dance_action_t tap_dance_actions[] = {
+ /* Tap once for left parenthesis, twice for left bracket, thrice for left brace */
+ [TD_BRACKETS_LEFT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, td_brackets_left_finished, td_brackets_left_reset),
+ /* Tap once for right parenthesis, twice for right bracket, thrice for right brace */
+ [TD_BRACKETS_RIGHT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, td_brackets_right_finished, td_brackets_right_reset),
+ /* Tap once for control, twice for escape */
+ [TD_CONTROL_ESCAPE] = ACTION_TAP_DANCE_DOUBLE(KC_LCTRL, KC_ESCAPE),
+ /* Tap once for plus, twice for equals */
+ [TD_PLUS_EQUALS] = ACTION_TAP_DANCE_DOUBLE(KC_PLUS, KC_EQUAL),
+ /* Hold for numpad, tap twice to toggle function row, double hold for temporary function row */
+ [TD_NUMPAD_FUNCTIONROW] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, td_numpad_funcrow_finished, td_numpad_funcrow_reset),
+ /* Tap once for single quote, twice for double quote */
+ [TD_QUOTE_DOUBLEQUOTE] = ACTION_TAP_DANCE_DOUBLE(KC_QUOTE, KC_DOUBLE_QUOTE),
+ /* Tap once for semicolon, twice for colon */
+ [TD_SEMICOLON_COLON] = ACTION_TAP_DANCE_DOUBLE(KC_SCOLON, KC_COLON),
+ /* Tap once for slash, twice for question mark */
+ [TD_SLASH_QUESTION] = ACTION_TAP_DANCE_DOUBLE(KC_SLASH, KC_QUESTION),
+ /* Tap once for underscore, twice for minus */
+ [TD_UNDERSCORE_MINUS] = ACTION_TAP_DANCE_DOUBLE(KC_UNDERSCORE, KC_MINUS),
+};
+
+/* clang-format off */
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+/* Qwerty
+ * ,-----------------------------------------------------------------------------------.
+ * | ` | ! | @ | # | $ | % | ^ | & | * | _ - | + = | Bksp |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Tab | Q | W | E | R | T | Y | U | I | O | P | ' " |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * |CtlEsc| A | S | D | F | G | H | J | K | L | ; : | Enter|
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | Shift| Z | X | C | V | B | N | M | , | . | Up | GUI |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |NP FRw| Ctrl | Alt | GUI |Lower | Space |Raise | / ? | Left | Down |Right |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_QWERTY] = LAYOUT_preonic_1x2uC (
+ KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, TD_USMI, TD_PLEQ, KC_BSPC,
+ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, TD_SQDQ,
+ TD_CLES, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, TD_SCOL, KC_ENT,
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_RGUI,
+ TD_NPFR, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, RAISE, TD_SLQU, KC_LEFT, KC_DOWN, KC_RGHT
+),
+
+/* Function Row
+ * ,-----------------------------------------------------------------------------------.
+ * | F12 | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | | | | | | | |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | | | | | | | | | | | | |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | | | | | | | | | | | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | | | | | | |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_FUNCTIONROW] = LAYOUT_preonic_1x2uC (
+ KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
+),
+
+/* Numpad
+ * ,------+------+------+------+------+------|------+------+------+------+------+------.
+ * | | | | | | | | Tab | / | * |Bksp | |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | | | | | | | 7 | 8 | 9 | - | |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | | | | | | | 4 | 5 | 6 | + | |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | | | | | | | 1 | 2 | 3 |Enter | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | | | 0 | . |Enter | |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_NUMPAD] = LAYOUT_preonic_1x2uC (
+ _______, _______, _______, _______, _______, _______, _______, KC_TAB, KC_SLSH, KC_PAST, KC_BSPC, _______,
+ _______, _______, _______, _______, _______, _______, _______, KC_KP_7, KC_KP_8, KC_KP_9, KC_PMNS, _______,
+ _______, _______, _______, _______, _______, _______, _______, KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, _______,
+ _______, _______, _______, _______, _______, _______, _______, KC_KP_1, KC_KP_2, KC_KP_3, KC_PENT, _______,
+ _______, _______, _______, _______, _______, _______, _______, KC_KP_0, KC_PDOT, KC_PENT, _______
+),
+
+/* Lower
+ * ,-----------------------------------------------------------------------------------.
+ * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | | | Vol+ | | | | | | | | Play | |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | | Prev | Vol- | Next | | | ? | _ | + | | | |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | | | | | | | Mute | | | PgUp | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |RGBmod| | | | | | | \ | Home | PgDn | End |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_LOWER] = LAYOUT_preonic_1x2uC (
+ 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_VOLU, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, _______,
+ _______, KC_MPRV, KC_VOLD, KC_MNXT, _______, _______, KC_QUES, KC_UNDS, KC_PLUS, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, _______, KC_PGUP, _______,
+ _______, _______, _______, _______, _______, _______, _______, KC_BSLS, KC_HOME, KC_PGDN, KC_END
+),
+
+/* Raise
+ * ,-----------------------------------------------------------------------------------.
+ * | ~ | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | | | | | | | |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | | | | | | | | | | [ { (| ) } ]| |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | | | | | | | | | | | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | | | | | | | |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_RAISE] = LAYOUT_preonic_1x2uC (
+ KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, TD_LBRK, TD_RBRK, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, KC_PIPE, _______, _______, _______
+),
+
+/* Adjust (Lower + Raise)
+ * ,-----------------------------------------------------------------------------------.
+ * |AudTog|XXXXXX|XXXXXX|XXXXXX|XXXXXX|XXXXXX|XXXXXX|XXXXXX|XXXXXX|XXXXXX| Debug| Reset|
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |ClkTog|ClkFq-|ClkFq+|XXXXXX|XXXXXX|XXXXXX|XXXXXX|XXXXXX|XXXXXX|XXXXXX|TermOn|TermOf|
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * |MusTog|Voice- Voice+|XXXXXX|XXXXXX|XXXXXX|XXXXXX|XXXXXX|XXXXXX|XXXXXX|AGnorm|AGswap|
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * |MidTog|Rplain|Rbreat|Rrainb|Rswirl|Rsnake|Rkridr|Rxmas |Rgrad |RGBtst|XXXXXX|Shift |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |RGBmod|RGBhue|RBGsat|RGBval| | | |XXXXXX|XXXXXX|XXXXXX|XXXXXX|
+ * `-----------------------------------------------------------------------------------'
+ */
+[_ADJUST] = LAYOUT_preonic_1x2uC (
+ AU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, RGB_HUD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DEBUG, RESET,
+ CK_TOGG, CK_DOWN, CK_UP, XXXXXXX, RGB_SAI, RGB_SAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, TERM_ON, TERM_OFF,
+ MU_TOG, MUV_DE, MUV_IN, XXXXXXX, RGB_VAI, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, AG_NORM, AG_SWAP,
+ MI_TOG, RGB_M_P, RGB_M_B, RGB_M_R,RGB_M_SW,RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G, RGB_M_T, RGB_SPI, KC_LSHIFT,
+ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, RGB_TOG, _______, XXXXXXX,RGB_RMOD, RGB_SPD, RGB_MOD
+)
+
+};
+/* clang-format on */
+
+float s_audio_on[][2] = AUDIO_ON_SONG;
+float s_layer_lower[][2] = LAYER_LOWER_SONG;
+float s_layer_raise[][2] = LAYER_RAISE_SONG;
+
+void audio_on_user() { PLAY_SONG(s_audio_on); };
+
+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);
+ PLAY_SONG(s_layer_lower);
+ } 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);
+ PLAY_SONG(s_layer_raise);
+ } 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;
+};
+
+/* Global TapDance State */
+static t_tap qk_tap_state = {
+ .left_brackets = 0,
+ .numpad_funcrow = 0,
+ .right_brackets = 0,
+};
+
+float s_functionrow_on[][2] = LAYER_FUNCROW_ON_SONG;
+float s_functionrow_off[][2] = LAYER_FUNCROW_OFF_SONG;
+float s_numpad_toggle[][2] = LAYER_NMPAD_SONG;
+
+t_tap_state get_tapdance_state(qk_tap_dance_state_t *state) {
+ if (state->count == 1) {
+ if (state->interrupted || !state->pressed) {
+ return SINGLE_TAP;
+ } else {
+ return SINGLE_HOLD;
+ }
+ } else if (state->count == 2) {
+ if (state->interrupted || !state->pressed) {
+ return DOUBLE_TAP;
+ } else {
+ return DOUBLE_HOLD;
+ }
+ } else if (state->count == 3) {
+ if (state->interrupted || !state->pressed) {
+ return TRIPLE_TAP;
+ } else {
+ return TRIPLE_HOLD;
+ }
+ } else
+ return TAP_DANCE_NO_MATCH;
+}
+
+void td_numpad_funcrow_finished(qk_tap_dance_state_t *state, void *user_data) {
+ qk_tap_state.numpad_funcrow = get_tapdance_state(state);
+ switch (qk_tap_state.numpad_funcrow) {
+ case SINGLE_TAP ... SINGLE_HOLD:
+ layer_on(_NUMPAD);
+ PLAY_SONG(s_numpad_toggle);
+ break;
+ case DOUBLE_HOLD:
+ layer_on(_FUNCTIONROW);
+ break;
+ case DOUBLE_TAP:
+ if (layer_state_is(_FUNCTIONROW)) {
+ layer_off(_FUNCTIONROW);
+ PLAY_SONG(s_functionrow_off);
+ } else {
+ layer_on(_FUNCTIONROW);
+ PLAY_SONG(s_functionrow_on);
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+void td_numpad_funcrow_reset(qk_tap_dance_state_t *state, void *user_data) {
+ switch (qk_tap_state.numpad_funcrow) {
+ case SINGLE_HOLD:
+ layer_off(_NUMPAD);
+ break;
+ case DOUBLE_HOLD:
+ layer_off(_FUNCTIONROW);
+ break;
+ default:
+ break;
+ }
+}
+
+void td_brackets_left_finished(qk_tap_dance_state_t *state, void *user_data) {
+ qk_tap_state.left_brackets = get_tapdance_state(state);
+ switch (qk_tap_state.left_brackets) {
+ case SINGLE_TAP:
+ register_code16(KC_LEFT_PAREN);
+ break;
+ case DOUBLE_TAP:
+ register_code(KC_LBRACKET);
+ break;
+ case TRIPLE_TAP:
+ register_code16(KC_LEFT_CURLY_BRACE);
+ break;
+ default:
+ break;
+ }
+}
+
+void td_brackets_left_reset(qk_tap_dance_state_t *state, void *user_data) {
+ switch (qk_tap_state.left_brackets) {
+ case SINGLE_TAP:
+ unregister_code16(KC_LEFT_PAREN);
+ break;
+ case DOUBLE_TAP:
+ unregister_code(KC_LBRACKET);
+ break;
+ case TRIPLE_TAP:
+ unregister_code16(KC_LEFT_CURLY_BRACE);
+ break;
+ default:
+ break;
+ }
+ qk_tap_state.left_brackets = 0;
+}
+
+void td_brackets_right_finished(qk_tap_dance_state_t *state, void *user_data) {
+ qk_tap_state.right_brackets = get_tapdance_state(state);
+ switch (qk_tap_state.right_brackets) {
+ case SINGLE_TAP:
+ register_code16(KC_RIGHT_PAREN);
+ break;
+ case DOUBLE_TAP:
+ register_code(KC_RBRACKET);
+ break;
+ case TRIPLE_TAP:
+ register_code16(KC_RIGHT_CURLY_BRACE);
+ break;
+ default:
+ break;
+ }
+}
+
+void td_brackets_right_reset(qk_tap_dance_state_t *state, void *user_data) {
+ switch (qk_tap_state.right_brackets) {
+ case SINGLE_TAP:
+ unregister_code16(KC_RIGHT_PAREN);
+ break;
+ case DOUBLE_TAP:
+ unregister_code(KC_RBRACKET);
+ break;
+ case TRIPLE_TAP:
+ unregister_code16(KC_RIGHT_CURLY_BRACE);
+ break;
+ default:
+ break;
+ }
+ qk_tap_state.right_brackets = 0;
+}
+
+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/mverteuil/readme.md b/keyboards/preonic/keymaps/mverteuil/readme.md
new file mode 100644
index 0000000000..b21df3f8fa
--- /dev/null
+++ b/keyboards/preonic/keymaps/mverteuil/readme.md
@@ -0,0 +1,2 @@
+# mverteuil does olkb preonic
+## 1x2u: One 2u spacebar on bottom row
diff --git a/keyboards/preonic/keymaps/mverteuil/rules.mk b/keyboards/preonic/keymaps/mverteuil/rules.mk
new file mode 100644
index 0000000000..a29a3cad79
--- /dev/null
+++ b/keyboards/preonic/keymaps/mverteuil/rules.mk
@@ -0,0 +1,5 @@
+SRC += muse.c
+
+AUDIO_ENABLE = yes
+MIDI_ENABLE = yes
+TAP_DANCE_ENABLE = yes
diff --git a/keyboards/preonic/keymaps/mverteuil_2x2u/config.h b/keyboards/preonic/keymaps/mverteuil_2x2u/config.h
new file mode 100644
index 0000000000..51b278f647
--- /dev/null
+++ b/keyboards/preonic/keymaps/mverteuil_2x2u/config.h
@@ -0,0 +1,39 @@
+#ifdef AUDIO_ENABLE
+# if __has_include("copyright.h")
+# include "copyright.h"
+# endif
+
+# define AUDIO_CLICKY_DELAY_DURATION 0
+# define AUDIO_CLICKY_FREQ_DEFAULT 100.0f
+# define AUDIO_CLICKY_FREQ_MIN 61.0f
+# define AUDIO_CLICKY_FREQ_RANDOMNESS 0.2f
+# define DAC_SAMPLE_MAX 7000U
+# define STARTUP_SONG SONG(WORKMAN_SOUND)
+# define GOODBYE_SONG SONG(COIN_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/mverteuil_2x2u/keymap.c b/keyboards/preonic/keymaps/mverteuil_2x2u/keymap.c
new file mode 100644
index 0000000000..232b853114
--- /dev/null
+++ b/keyboards/preonic/keymaps/mverteuil_2x2u/keymap.c
@@ -0,0 +1,413 @@
+/* Copyright 2015-2017 Jack Humbert, 2019 Matthew de Verteuil
+ *
+ * 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 "mverteuil.h"
+
+/* Layer Aliases */
+#define LT_LWSP LT(_LOWER, KC_SPACE)
+#define LT_RSRT LT(_RAISE, KC_ENTER)
+#define MO_NUMS MO(_NUMPAD)
+
+/* Mod-Tap Aliases */
+#define MT_CESC CTL_T(KC_ESCAPE)
+
+/* TapDance Aliases */
+#define TD_LBRK TD(TD_BRACKETS_LEFT)
+#define TD_RBRK TD(TD_BRACKETS_RIGHT)
+#define TD_PLEQ TD(TD_PLUS_EQUALS)
+#define TD_SCOL TD(TD_SEMICOLON_COLON)
+#define TD_SLQU TD(TD_SLASH_QUESTION)
+#define TD_SQDQ TD(TD_QUOTE_DOUBLEQUOTE)
+#define TD_USMI TD(TD_UNDERSCORE_MINUS)
+
+/* Sentinel value for invalid tap dance exit */
+#define TAP_DANCE_NO_MATCH 64
+
+enum preonic_layers {
+ _QWERTY,
+ _NUMPAD,
+ _LOWER,
+ _RAISE,
+ _ADJUST,
+};
+
+enum preonic_keycodes {
+ QWERTY = SAFE_RANGE,
+ NUMPAD,
+ LOWER,
+ RAISE,
+ BACKLIT,
+};
+
+enum tapdance_keycodes {
+ TD_BRACKETS_LEFT,
+ TD_BRACKETS_RIGHT,
+ TD_CONTROL_ESCAPE,
+ TD_PLUS_EQUALS,
+ TD_QUOTE_DOUBLEQUOTE,
+ TD_SEMICOLON_COLON,
+ TD_SLASH_QUESTION,
+ TD_UNDERSCORE_MINUS,
+};
+
+typedef enum {
+ SINGLE_TAP,
+ SINGLE_HOLD,
+ DOUBLE_TAP,
+ DOUBLE_HOLD,
+ TRIPLE_TAP,
+ TRIPLE_HOLD,
+} t_tap_state;
+
+typedef struct {
+ t_tap_state left_brackets;
+ t_tap_state right_brackets;
+} t_tap;
+
+t_tap_state get_tapdance_state(qk_tap_dance_state_t *state);
+
+void td_brackets_left_finished(qk_tap_dance_state_t *state, void *user_data);
+void td_brackets_left_reset(qk_tap_dance_state_t *state, void *user_data);
+void td_brackets_right_finished(qk_tap_dance_state_t *state, void *user_data);
+void td_brackets_right_reset(qk_tap_dance_state_t *state, void *user_data);
+
+/* Tap Dance Definitions */
+qk_tap_dance_action_t tap_dance_actions[] = {
+ /* Tap once for left parenthesis, twice for left bracket, thrice for left brace */
+ [TD_BRACKETS_LEFT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, td_brackets_left_finished, td_brackets_left_reset),
+ /* Tap once for right parenthesis, twice for right bracket, thrice for right brace */
+ [TD_BRACKETS_RIGHT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, td_brackets_right_finished, td_brackets_right_reset),
+ /* Tap once for plus, twice for equals */
+ [TD_PLUS_EQUALS] = ACTION_TAP_DANCE_DOUBLE(KC_PLUS, KC_EQUAL),
+ /* Tap once for single quote, twice for double quote */
+ [TD_QUOTE_DOUBLEQUOTE] = ACTION_TAP_DANCE_DOUBLE(KC_QUOTE, KC_DOUBLE_QUOTE),
+ /* Tap once for semicolon, twice for colon */
+ [TD_SEMICOLON_COLON] = ACTION_TAP_DANCE_DOUBLE(KC_SCOLON, KC_COLON),
+ /* Tap once for slash, twice for question mark */
+ [TD_SLASH_QUESTION] = ACTION_TAP_DANCE_DOUBLE(KC_SLASH, KC_QUESTION),
+ /* Tap once for underscore, twice for minus */
+ [TD_UNDERSCORE_MINUS] = ACTION_TAP_DANCE_DOUBLE(KC_UNDERSCORE, KC_MINUS),
+};
+
+/* clang-format off */
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+/* Qwerty
+ * ,-------+-------+-------+-------+-------+-------|-------+-------+-------+-------+-------+-------.
+ * | ` | ! | @ | # | $ | % | ^ | & | * | _ - | + = | Bksp |
+ * |-------+-------+-------+-------+-------+-------|-------+-------+-------+-------+-------+-------|
+ * | Tab | Q | W | E | R | T | Y | U | I | O | P | ' " |
+ * |-------+-------+-------+-------+-------+-------|-------+-------+-------+-------+-------+-------|
+ * |CtrlEsc| A | S | D | F | G | H | J | K | L | ; : | / ? |
+ * |-------+-------+-------+-------+-------+-------|-------+-------+-------+-------+-------+-------|
+ * | Shift | Z | X | C | V | B | N | M | , | . | ↑ | RShift|
+ * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
+ * |NumPad | Ctrl | Alt | GUI | Lower/Space | Raise/Enter | GUI | ← | ↓ | → |
+ * `-----------------------------------------------------------------------------------------------'
+ */
+[_QWERTY] = LAYOUT_preonic_2x2u (
+ KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, TD_USMI, TD_PLEQ, KC_BSPC,
+ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, TD_SQDQ,
+ MT_CESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, TD_SCOL, TD_SLQU,
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_RSFT,
+ MO_NUMS, KC_LCTL, KC_LALT, KC_LGUI, LT_LWSP, LT_RSRT, KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT
+),
+
+/* Numpad
+ * ,-------+-------+-------+-------+-------+-------|-------+-------+-------+-------+-------+-------.
+ * | | | | | | | | Tab | / | * | Bksp | |
+ * |-------+-------+-------+-------+-------+-------|-------+-------+-------+-------+-------+-------|
+ * | | | | | | | | 7 | 8 | 9 | - | |
+ * |-------+-------+-------+-------+-------+-------|-------+-------+-------+-------+-------+-------|
+ * | | | | | | | | 4 | 5 | 6 | + | |
+ * |-------+-------+-------+-------+-------+-------|-------+-------+-------+-------+-------+-------|
+ * | | | | | | | | 1 | 2 | 3 | Enter | |
+ * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
+ * | | | | | | | 0 | . | Enter | |
+ * `-----------------------------------------------------------------------------------------------'
+ */
+[_NUMPAD] = LAYOUT_preonic_2x2u (
+ _______, _______, _______, _______, _______, _______, _______, KC_TAB, KC_SLSH, KC_PAST, KC_BSPC, _______,
+ _______, _______, _______, _______, _______, _______, _______, KC_KP_7, KC_KP_8, KC_KP_9, KC_PMNS, _______,
+ _______, _______, _______, _______, _______, _______, _______, KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, _______,
+ _______, _______, _______, _______, _______, _______, _______, KC_KP_1, KC_KP_2, KC_KP_3, KC_PENT, _______,
+ _______, _______, _______, _______, _______, _______, KC_KP_0, KC_PDOT, KC_PENT, _______
+),
+
+/* Lower
+ * ,-------+-------+-------+-------+-------+-------|-------+-------+-------+-------+-------+-------.
+ * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 |Delete |
+ * |-------+-------+-------+-------+-------+-------|-------+-------+-------+-------+-------+-------|
+ * | | | Vol+ | | | | | | | | MPlay | |
+ * |-------+-------+-------+-------+-------+-------|-------+-------+-------+-------+-------+-------|
+ * | | MPrev | Vol- | MNext | | | | | | | | \ |
+ * |-------+-------+-------+-------+-------+-------|-------+-------+-------+-------+-------+-------|
+ * | | | | | | | | Mute | | | PgUp | |
+ * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
+ * | | | | | | | | Home | PgDn | End |
+ * `-----------------------------------------------------------------------------------------------'
+ */
+[_LOWER] = LAYOUT_preonic_2x2u (
+ 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_VOLU, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, _______,
+ _______, KC_MPRV, KC_VOLD, KC_MNXT, _______, _______, _______, _______, _______, _______, _______, KC_BSLS,
+ _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, _______, KC_PGUP, _______,
+ _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END
+),
+
+/* Raise
+ * ,-------+-------+-------+-------+-------+-------|-------+-------+-------+-------+-------+-------.
+ * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | |
+ * |-------+-------+-------+-------+-------+-------|-------+-------+-------+-------+-------+-------|
+ * | | | | | | | | | | | | |
+ * |-------+-------+-------+-------+-------+-------|-------+-------+-------+-------+-------+-------|
+ * | | | | | | | | | [ { ( | ) } ] | | | |
+ * |-------+-------+-------+-------+-------+-------|-------+-------+-------+-------+-------+-------|
+ * | | | | | | | | | | | | |
+ * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
+ * | | | | | | | | | | |
+ * `-----------------------------------------------------------------------------------------------'
+ */
+[_RAISE] = LAYOUT_preonic_2x2u (
+ _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, TD_LBRK, TD_RBRK, _______, KC_PIPE,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
+),
+
+/* Adjust (Lower + Raise)
+ * ,-------+-------+-------+-------+-------+-------|-------+-------+-------+-------+-------+-------.
+ * |AudTog |███████|███████|███████|███████|███████|███████|███████|███████|███████| Debug | Reset |
+ * |-------+-------+-------+-------+-------+-------|-------+-------+-------+-------+-------+-------|
+ * |Clicky |ClkFrq-|ClkFrq+|███████|███████|███████|███████|███████|███████|███████|TermOn |TermOff|
+ * |-------+-------+-------+-------+-------+-------|-------+-------+-------+-------+-------+-------|
+ * | Music |Voice- |Voice+ |███████|███████|███████|███████|███████|███████|███████|AGnorm |AGswap |
+ * |-------+-------+-------+-------+-------+-------|-------+-------+-------+-------+-------+-------|
+ * | MIDI |R plain|R breat|R rnbow|R swirl|R snake|R knigt|R xmas |R grade|RGBtest|███████| Shift |
+ * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------|
+ * |RGBmode|RGBhue+|RGBsat+|RGBval+| | |███████|███████|███████|███████|
+ * `-----------------------------------------------------------------------------------------------'
+ */
+[_ADJUST] = LAYOUT_preonic_2x2u (
+ AU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, RGB_HUD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DEBUG, RESET,
+ CK_TOGG, CK_DOWN, CK_UP, XXXXXXX, RGB_SAI, RGB_SAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, TERM_ON, TERM_OFF,
+ MU_TOG, MUV_DE, MUV_IN, XXXXXXX, RGB_VAI, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, AG_NORM, AG_SWAP,
+ MI_TOG, RGB_M_P, RGB_M_B, RGB_M_R,RGB_M_SW,RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G, RGB_M_T, RGB_SPI, KC_LSHIFT,
+ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX,RGB_RMOD, RGB_SPD, RGB_MOD
+)
+
+};
+/* clang-format on */
+
+float s_audio_on[][2] = AUDIO_ON_SONG;
+float s_layer_lower[][2] = LAYER_LOWER_SONG;
+float s_layer_raise[][2] = LAYER_RAISE_SONG;
+
+void audio_on_user() { PLAY_SONG(s_audio_on); };
+
+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);
+ PLAY_SONG(s_layer_lower);
+ } 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);
+ PLAY_SONG(s_layer_raise);
+ } 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;
+};
+
+/* Global TapDance State */
+static t_tap qk_tap_state = {
+ .left_brackets = 0,
+ .right_brackets = 0,
+};
+
+float s_numpad_toggle[][2] = LAYER_NMPAD_SONG;
+
+t_tap_state get_tapdance_state(qk_tap_dance_state_t *state) {
+ if (state->count == 1) {
+ if (state->interrupted || !state->pressed) {
+ return SINGLE_TAP;
+ } else {
+ return SINGLE_HOLD;
+ }
+ } else if (state->count == 2) {
+ if (state->interrupted || !state->pressed) {
+ return DOUBLE_TAP;
+ } else {
+ return DOUBLE_HOLD;
+ }
+ } else if (state->count == 3) {
+ if (state->interrupted || !state->pressed) {
+ return TRIPLE_TAP;
+ } else {
+ return TRIPLE_HOLD;
+ }
+ } else
+ return TAP_DANCE_NO_MATCH;
+}
+
+void td_brackets_left_finished(qk_tap_dance_state_t *state, void *user_data) {
+ qk_tap_state.left_brackets = get_tapdance_state(state);
+ switch (qk_tap_state.left_brackets) {
+ case SINGLE_TAP:
+ register_code16(KC_LEFT_PAREN);
+ break;
+ case DOUBLE_TAP:
+ register_code(KC_LBRACKET);
+ break;
+ case TRIPLE_TAP:
+ register_code16(KC_LEFT_CURLY_BRACE);
+ break;
+ default:
+ break;
+ }
+}
+
+void td_brackets_left_reset(qk_tap_dance_state_t *state, void *user_data) {
+ switch (qk_tap_state.left_brackets) {
+ case SINGLE_TAP:
+ unregister_code16(KC_LEFT_PAREN);
+ break;
+ case DOUBLE_TAP:
+ unregister_code(KC_LBRACKET);
+ break;
+ case TRIPLE_TAP:
+ unregister_code16(KC_LEFT_CURLY_BRACE);
+ break;
+ default:
+ break;
+ }
+ qk_tap_state.left_brackets = 0;
+}
+
+void td_brackets_right_finished(qk_tap_dance_state_t *state, void *user_data) {
+ qk_tap_state.right_brackets = get_tapdance_state(state);
+ switch (qk_tap_state.right_brackets) {
+ case SINGLE_TAP:
+ register_code16(KC_RIGHT_PAREN);
+ break;
+ case DOUBLE_TAP:
+ register_code(KC_RBRACKET);
+ break;
+ case TRIPLE_TAP:
+ register_code16(KC_RIGHT_CURLY_BRACE);
+ break;
+ default:
+ break;
+ }
+}
+
+void td_brackets_right_reset(qk_tap_dance_state_t *state, void *user_data) {
+ switch (qk_tap_state.right_brackets) {
+ case SINGLE_TAP:
+ unregister_code16(KC_RIGHT_PAREN);
+ break;
+ case DOUBLE_TAP:
+ unregister_code(KC_RBRACKET);
+ break;
+ case TRIPLE_TAP:
+ unregister_code16(KC_RIGHT_CURLY_BRACE);
+ break;
+ default:
+ break;
+ }
+ qk_tap_state.right_brackets = 0;
+}
+
+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;
+ }
+ }
+}
diff --git a/keyboards/preonic/keymaps/mverteuil_2x2u/rules.mk b/keyboards/preonic/keymaps/mverteuil_2x2u/rules.mk
new file mode 100644
index 0000000000..9e55d0aa67
--- /dev/null
+++ b/keyboards/preonic/keymaps/mverteuil_2x2u/rules.mk
@@ -0,0 +1,6 @@
+USER_NAME := mverteuil
+SRC += muse.c
+
+AUDIO_ENABLE = yes
+MIDI_ENABLE = yes
+TAP_DANCE_ENABLE = yes
diff --git a/keyboards/preonic/preonic.c b/keyboards/preonic/preonic.c
index 8d052ea81f..16c99d9a80 100644
--- a/keyboards/preonic/preonic.c
+++ b/keyboards/preonic/preonic.c
@@ -1,16 +1,5 @@
#include "preonic.h"
-#ifdef SWAP_HANDS_ENABLE
-__attribute__ ((weak))
-const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
- {{11, 0}, {10, 0}, {9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}},
- {{11, 1}, {10, 1}, {9, 1}, {8, 1}, {7, 1}, {6, 1}, {5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}},
- {{11, 2}, {10, 2}, {9, 2}, {8, 2}, {7, 2}, {6, 2}, {5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}},
- {{11, 3}, {10, 3}, {9, 3}, {8, 3}, {7, 3}, {6, 3}, {5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}},
- {{11, 4}, {10, 4}, {9, 4}, {8, 4}, {7, 4}, {6, 4}, {5, 4}, {4, 4}, {3, 4}, {2, 4}, {1, 4}, {0, 4}},
-};
-#endif
-
const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_preonic_grid(
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
diff --git a/keyboards/preonic/rev1/rev1.c b/keyboards/preonic/rev1/rev1.c
index fd09d7f2d8..c9fd8330ef 100644
--- a/keyboards/preonic/rev1/rev1.c
+++ b/keyboards/preonic/rev1/rev1.c
@@ -23,3 +23,14 @@ void matrix_init_kb(void) {
matrix_init_user();
};
+
+#ifdef SWAP_HANDS_ENABLE
+ __attribute__ ((weak))
+ const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
+ {{11, 0}, {10, 0}, {9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}},
+ {{11, 1}, {10, 1}, {9, 1}, {8, 1}, {7, 1}, {6, 1}, {5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}},
+ {{11, 2}, {10, 2}, {9, 2}, {8, 2}, {7, 2}, {6, 2}, {5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}},
+ {{11, 3}, {10, 3}, {9, 3}, {8, 3}, {7, 3}, {6, 3}, {5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}},
+ {{11, 4}, {10, 4}, {9, 4}, {8, 4}, {7, 4}, {6, 4}, {5, 4}, {4, 4}, {3, 4}, {2, 4}, {1, 4}, {0, 4}},
+ };
+#endif
diff --git a/keyboards/preonic/rev2/rev2.c b/keyboards/preonic/rev2/rev2.c
index 785ac3310b..c0e72620ed 100644
--- a/keyboards/preonic/rev2/rev2.c
+++ b/keyboards/preonic/rev2/rev2.c
@@ -23,3 +23,14 @@ void matrix_init_kb(void) {
matrix_init_user();
};
+
+#ifdef SWAP_HANDS_ENABLE
+ __attribute__ ((weak))
+ const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
+ {{11, 0}, {10, 0}, {9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}},
+ {{11, 1}, {10, 1}, {9, 1}, {8, 1}, {7, 1}, {6, 1}, {5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}},
+ {{11, 2}, {10, 2}, {9, 2}, {8, 2}, {7, 2}, {6, 2}, {5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}},
+ {{11, 3}, {10, 3}, {9, 3}, {8, 3}, {7, 3}, {6, 3}, {5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}},
+ {{11, 4}, {10, 4}, {9, 4}, {8, 4}, {7, 4}, {6, 4}, {5, 4}, {4, 4}, {3, 4}, {2, 4}, {1, 4}, {0, 4}},
+ };
+#endif
diff --git a/keyboards/preonic/rev3/rev3.c b/keyboards/preonic/rev3/rev3.c
index dc4ff66fc0..04b691f405 100644
--- a/keyboards/preonic/rev3/rev3.c
+++ b/keyboards/preonic/rev3/rev3.c
@@ -32,3 +32,19 @@ void dip_switch_update_user(uint8_t index, bool active) {
dip_update(index, active);
}
#endif
+
+#ifdef SWAP_HANDS_ENABLE
+__attribute__ ((weak))
+const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
+ {{5, 4}, {4, 4}, {3, 4}, {2, 4}, {1, 4}, {0, 4}},
+ {{5, 5}, {4, 5}, {3, 5}, {2, 5}, {1, 5}, {0, 5}},
+ {{5, 6}, {4, 6}, {3, 6}, {2, 6}, {1, 6}, {0, 6}},
+ {{5, 7}, {4, 7}, {3, 7}, {2, 7}, {1, 7}, {0, 7}},
+ {{5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}},
+ {{5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}},
+ {{5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}},
+ {{5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}},
+ {{5, 8}, {4, 8}, {3, 8}, {2, 8}, {1, 8}, {0, 8}},
+ {{5, 9}, {4, 9}, {3, 9}, {2, 9}, {1, 9}, {0, 9}},
+};
+#endif