summaryrefslogtreecommitdiffstats
path: root/keyboards/preonic
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/preonic')
-rw-r--r--keyboards/preonic/keymaps/0xdec/keymap.c10
-rw-r--r--keyboards/preonic/keymaps/CMD-Preonic/keymap.c16
-rw-r--r--keyboards/preonic/keymaps/dale/Makefile25
-rw-r--r--keyboards/preonic/keymaps/dale/config.h29
-rw-r--r--keyboards/preonic/keymaps/dale/keymap.c296
-rw-r--r--keyboards/preonic/keymaps/dale/readme.md2
-rw-r--r--keyboards/preonic/keymaps/jacwib/keymap.c6
-rw-r--r--keyboards/preonic/keymaps/kinesis/keymap.c6
-rw-r--r--keyboards/preonic/keymaps/nikchi/keymap.c8
-rw-r--r--keyboards/preonic/keymaps/smt/keymap.c12
-rw-r--r--keyboards/preonic/keymaps/xyverz/keymap.c12
-rw-r--r--keyboards/preonic/keymaps/zach/zach_common_functions.c32
-rw-r--r--keyboards/preonic/preonic.c2
-rw-r--r--keyboards/preonic/preonic.h2
-rw-r--r--keyboards/preonic/rules.mk4
15 files changed, 409 insertions, 53 deletions
diff --git a/keyboards/preonic/keymaps/0xdec/keymap.c b/keyboards/preonic/keymaps/0xdec/keymap.c
index 2f06c8c31..a273f4ed5 100644
--- a/keyboards/preonic/keymaps/0xdec/keymap.c
+++ b/keyboards/preonic/keymaps/0xdec/keymap.c
@@ -109,10 +109,10 @@ float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
void startup_user() {
_delay_ms(20); // gets rid of tick
- PLAY_NOTE_ARRAY(tone_startup, false, 0);
+ PLAY_SONG(tone_startup);
}
void shutdown_user() {
- PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
+ PLAY_SONG(tone_goodbye);
_delay_ms(150);
stop_all_notes();
}
@@ -121,7 +121,7 @@ void music_on_user(void) {
music_scale_user();
}
void music_scale_user(void) {
- PLAY_NOTE_ARRAY(music_scale, false, 0);
+ PLAY_SONG(music_scale);
}
#endif
@@ -144,7 +144,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
case COLEMAK:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
- PLAY_NOTE_ARRAY(tone_colemak, false, 0);
+ PLAY_SONG(tone_colemak);
#endif
persistent_default_layer_set(1UL<<_COLEMAK);
}
@@ -152,7 +152,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
case GAME:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
- PLAY_NOTE_ARRAY(tone_game, false, STACCATO);
+ PLAY_SONG(tone_game);
#endif
persistent_default_layer_set(1UL<<_GAME);
}
diff --git a/keyboards/preonic/keymaps/CMD-Preonic/keymap.c b/keyboards/preonic/keymaps/CMD-Preonic/keymap.c
index 7b5be0734..1cbb99caa 100644
--- a/keyboards/preonic/keymaps/CMD-Preonic/keymap.c
+++ b/keyboards/preonic/keymaps/CMD-Preonic/keymap.c
@@ -236,7 +236,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
case _QWERTY:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
- PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
+ PLAY_SONG(tone_qwerty);
#endif
persistent_default_layer_set(1UL<<_QWERTY);
}
@@ -244,7 +244,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
case _COLEMAK:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
- PLAY_NOTE_ARRAY(tone_colemak, false, 0);
+ PLAY_SONG(tone_colemak);
#endif
persistent_default_layer_set(1UL<<_COLEMAK);
}
@@ -252,7 +252,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
case _DVORAK:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
- PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
+ PLAY_SONG(tone_dvorak);
#endif
persistent_default_layer_set(1UL<<_DVORAK);
}
@@ -260,7 +260,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
case _GAME:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
- PLAY_NOTE_ARRAY(tone_colemak, false, 0);
+ PLAY_SONG(tone_colemak);
#endif
persistent_default_layer_set(1UL<<_GAME);
}
@@ -268,7 +268,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
case _NUMPAD:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
- PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
+ PLAY_SONG(tone_dvorak);
#endif
persistent_default_layer_set(1UL<<_NUMPAD);
}
@@ -276,7 +276,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
case _ARROW:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
- PLAY_NOTE_ARRAY(tone_colemak, false, 0);
+ PLAY_SONG(tone_colemak);
#endif
persistent_default_layer_set(1UL<<_LOWER);
}
@@ -317,7 +317,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
void matrix_init_user(void) {
#ifdef AUDIO_ENABLE
_delay_ms(20); // gets rid of tick
- PLAY_NOTE_ARRAY(start_up, false, 0);
+ PLAY_SONG(start_up);
#endif
}
@@ -325,7 +325,7 @@ void matrix_init_user(void) {
void play_goodbye_tone(void)
{
- PLAY_NOTE_ARRAY(goodbye, false, 0);
+ PLAY_SONG(goodbye);
_delay_ms(150);
}
diff --git a/keyboards/preonic/keymaps/dale/Makefile b/keyboards/preonic/keymaps/dale/Makefile
new file mode 100644
index 000000000..156a3a0a9
--- /dev/null
+++ b/keyboards/preonic/keymaps/dale/Makefile
@@ -0,0 +1,25 @@
+
+
+# Build Options
+# 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 = no # Virtual DIP switch configuration(+1000)
+MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
+EXTRAKEY_ENABLE = no # Audio control and System control(+450)
+CONSOLE_ENABLE = no # Console for debug(+400)
+COMMAND_ENABLE = yes # Commands for debug and configuration
+NKRO_ENABLE = yes # 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
+UNICODE_ENABLE = no # Unicode
+BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
+RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
+
+# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
+SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
+
+ifndef QUANTUM_DIR
+ include ../../../../Makefile
+endif
diff --git a/keyboards/preonic/keymaps/dale/config.h b/keyboards/preonic/keymaps/dale/config.h
new file mode 100644
index 000000000..4c6158199
--- /dev/null
+++ b/keyboards/preonic/keymaps/dale/config.h
@@ -0,0 +1,29 @@
+#ifndef CONFIG_USER_H
+#define CONFIG_USER_H
+
+#include "../../config.h"
+
+/*
+ * 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
+
+#endif \ No newline at end of file
diff --git a/keyboards/preonic/keymaps/dale/keymap.c b/keyboards/preonic/keymaps/dale/keymap.c
new file mode 100644
index 000000000..3c9fb558e
--- /dev/null
+++ b/keyboards/preonic/keymaps/dale/keymap.c
@@ -0,0 +1,296 @@
+#include "preonic.h"
+#include "action_layer.h"
+#include "eeconfig.h"
+#ifdef AUDIO_ENABLE
+ #include "audio.h"
+#endif
+
+// Each layer gets a name for readability, which is then used in the keymap matrix below.
+// The underscores don't mean anything - you can have a layer called STUFF or any other name.
+// Layer names don't all need to be of the same length, obviously, and you can also skip them
+// entirely and just use numbers.
+
+enum preonic_layers {
+ _QWERTY,
+ _COLEMAK,
+ _DVORAK,
+ _LOWER,
+ _RAISE,
+ _ADJUST
+};
+
+enum preonic_keycodes {
+ QWERTY = SAFE_RANGE,
+ COLEMAK,
+ DVORAK,
+ LOWER,
+ RAISE,
+ BACKLIT
+};
+
+// Fillers to make layering more clear
+#define _______ KC_TRNS
+#define XXXXXXX KC_NO
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+/* Qwerty
+ * ,-----------------------------------------------------------------------------------.
+ * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Tab | A | S | D | F | G | H | J | K | L | ; | " |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Ctrl | GUI | \ | Alt |Lower | Space |Raise | [ | - | = | ] |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_QWERTY] = {
+ {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_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
+ {KC_TAB, 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(MOD_RSFT, KC_ENT) },
+ {KC_LCTL, KC_LGUI, KC_BSLS, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, LT(_LOWER, KC_LBRC), KC_MINS, KC_EQL, MT(MOD_RCTL, KC_RBRC)}
+},
+
+/* 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] = {
+ {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] = {
+ {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
+ * ,-----------------------------------------------------------------------------------.
+ * | ` | 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 | 4 | 5 | 6 | . | * |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | F7 | F8 | F9 | F10 | F11 | F12 | 1 | 2 | 3 | / | Ent |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | 0 | | [ | - | + | ] |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_LOWER] = {
+ {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_4, KC_5, KC_6, KC_DOT, KC_ASTR},
+ {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_1, KC_2, KC_3, _______, _______},
+ {_______, _______, _______, _______, _______, KC_0, KC_0, _______, _______, _______, KC_PLUS, _______}
+},
+
+/* Raise
+ * ,-----------------------------------------------------------------------------------.
+ * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Del | Wh Up|RightC| M-Up | LeftC|QWERTY| Left | Down | Up | Right| | | ` |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | Wh Dn| M-L | M-Dn | M-R | PrScr| Sc Lk| Break| | | \ | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | App | | | | Ins | | Home | PGDN | PGUP | End |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_RAISE] = {
+ {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_WH_U, KC_BTN2, KC_MS_U, KC_BTN1, QWERTY, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_PIPE, KC_GRV},
+ {_______, KC_WH_D, KC_MS_L, KC_MS_D, KC_MS_R, KC_PSCR, KC_SLCK, KC_PAUS, _______, _______, KC_BSLASH, _______},
+ {_______, KC_APP, _______, _______, _______, KC_INS, KC_INS, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END}
+},
+
+
+/* Adjust (Lower + Raise)
+ * ,-----------------------------------------------------------------------------------.
+ * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | C-A-I|Qwerty| | |Reset |Macro0| | | | | |C-A-D |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | | | |Aud on|Audoff| |AGswap|AGnorm| | | | |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Brite| | | | | | | BL_T |BL_DEC|BL_INC|BL_ST |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_ADJUST] = {
+ {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12},
+ {LALT(LCTL(KC_INS)), QWERTY, _______, _______, RESET, M(0), _______, _______, _______, _______, _______, LALT(LCTL(KC_DEL))},
+ {_______, _______, _______, AU_ON, AU_OFF, _______, AG_SWAP, AG_NORM, _______, _______, _______, _______},
+ {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______},
+ {BACKLIT, _______, _______, _______, _______, _______, _______, _______, BL_TOGG, BL_DEC , BL_INC , BL_STEP}
+}
+
+
+};
+
+const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // this is the function signature -- just copy/paste it into your keymap file as it is.
+{
+ switch(id) {
+ case 0: // this would trigger when you hit a key mapped as M(0)
+ if (record->event.pressed) {
+ return MACRO( D(LSFT), T(LEFT), U(LSFT), D(LCTL), T(X), U(LCTL), T(RIGHT), D(LCTL), T(V), U(LCTL), T(LEFT), END ); // this swaps the characters on either side of the cursor when the macro executes
+ }
+ break;
+ }
+ return MACRO_NONE;
+};
+
+#ifdef AUDIO_ENABLE
+float tone_startup[][2] = {
+ {NOTE_B5, 20},
+ {NOTE_B6, 8},
+ {NOTE_DS6, 20},
+ {NOTE_B6, 8}
+};
+
+float tone_qwerty[][2] = SONG(QWERTY_SOUND);
+float tone_dvorak[][2] = SONG(DVORAK_SOUND);
+float tone_colemak[][2] = SONG(COLEMAK_SOUND);
+
+float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
+
+float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
+#endif
+
+void persistent_default_layer_set(uint16_t default_layer) {
+ eeconfig_update_default_layer(default_layer);
+ default_layer_set(default_layer);
+}
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ switch (keycode) {
+ case QWERTY:
+ if (record->event.pressed) {
+ #ifdef AUDIO_ENABLE
+ PLAY_SONG(tone_qwerty);
+ #endif
+ persistent_default_layer_set(1UL<<_QWERTY);
+ }
+ return false;
+ break;
+ case COLEMAK:
+ if (record->event.pressed) {
+ #ifdef AUDIO_ENABLE
+ PLAY_SONG(tone_colemak);
+ #endif
+ persistent_default_layer_set(1UL<<_COLEMAK);
+ }
+ return false;
+ break;
+ case DVORAK:
+ if (record->event.pressed) {
+ #ifdef AUDIO_ENABLE
+ PLAY_SONG(tone_dvorak);
+ #endif
+ persistent_default_layer_set(1UL<<_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
+ } else {
+ unregister_code(KC_RSFT);
+ }
+ return false;
+ break;
+ }
+ return true;
+};
+
+void matrix_init_user(void) {
+ #ifdef AUDIO_ENABLE
+ startup_user();
+ #endif
+}
+
+#ifdef AUDIO_ENABLE
+
+void startup_user()
+{
+ _delay_ms(20); // gets rid of tick
+ PLAY_SONG(tone_startup);
+}
+
+void shutdown_user()
+{
+ PLAY_SONG(tone_goodbye);
+ _delay_ms(150);
+ stop_all_notes();
+}
+
+void music_on_user(void)
+{
+ music_scale_user();
+}
+
+void music_scale_user(void)
+{
+ PLAY_SONG(music_scale);
+}
+
+#endif
diff --git a/keyboards/preonic/keymaps/dale/readme.md b/keyboards/preonic/keymaps/dale/readme.md
new file mode 100644
index 000000000..ea044cbfa
--- /dev/null
+++ b/keyboards/preonic/keymaps/dale/readme.md
@@ -0,0 +1,2 @@
+# Dale's Preonic layout - largely based on his Planck.
+# The hardware number row is mostly to avoid inherent context switching delay while he is receiving auditory input.
diff --git a/keyboards/preonic/keymaps/jacwib/keymap.c b/keyboards/preonic/keymaps/jacwib/keymap.c
index 09f465de1..37a7dbd9b 100644
--- a/keyboards/preonic/keymaps/jacwib/keymap.c
+++ b/keyboards/preonic/keymaps/jacwib/keymap.c
@@ -270,12 +270,12 @@ void matrix_init_user(void) {
void startup_user()
{
_delay_ms(20); // gets rid of tick
- PLAY_NOTE_ARRAY(tone_startup, false, 0);
+ PLAY_SONG(tone_startup);
}
void shutdown_user()
{
- PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
+ PLAY_SONG(tone_goodbye);
_delay_ms(150);
stop_all_notes();
}
@@ -287,7 +287,7 @@ void music_on_user(void)
void music_scale_user(void)
{
- PLAY_NOTE_ARRAY(music_scale, false, 0);
+ PLAY_SONG(music_scale);
}
#endif
diff --git a/keyboards/preonic/keymaps/kinesis/keymap.c b/keyboards/preonic/keymaps/kinesis/keymap.c
index 214f51a46..69c33472e 100644
--- a/keyboards/preonic/keymaps/kinesis/keymap.c
+++ b/keyboards/preonic/keymaps/kinesis/keymap.c
@@ -102,12 +102,12 @@ void matrix_init_user(void) {
void startup_user()
{
_delay_ms(20); // gets rid of tick
- PLAY_NOTE_ARRAY(tone_startup, false, 0);
+ PLAY_SONG(tone_startup);
}
void shutdown_user()
{
- PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
+ PLAY_SONG(tone_goodbye);
_delay_ms(150);
stop_all_notes();
}
@@ -119,7 +119,7 @@ void music_on_user(void)
void music_scale_user(void)
{
- PLAY_NOTE_ARRAY(music_scale, false, 0);
+ PLAY_SONG(music_scale);
}
diff --git a/keyboards/preonic/keymaps/nikchi/keymap.c b/keyboards/preonic/keymaps/nikchi/keymap.c
index 249dd1e64..4c2bf1fcf 100644
--- a/keyboards/preonic/keymaps/nikchi/keymap.c
+++ b/keyboards/preonic/keymaps/nikchi/keymap.c
@@ -146,7 +146,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
case QWERTY:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
- PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
+ PLAY_SONG(tone_qwerty);
#endif
persistent_default_layer_set(1UL<<_QWERTY);
}
@@ -198,12 +198,12 @@ void matrix_init_user(void) {
void startup_user()
{
_delay_ms(20); // gets rid of tick
- PLAY_NOTE_ARRAY(tone_startup, false, 0);
+ PLAY_SONG(tone_startup);
}
void shutdown_user()
{
- PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
+ PLAY_SONG(tone_goodbye);
_delay_ms(150);
stop_all_notes();
}
@@ -215,7 +215,7 @@ void music_on_user(void)
void music_scale_user(void)
{
- PLAY_NOTE_ARRAY(music_scale, false, 0);
+ PLAY_SONG(music_scale);
}
#endif
diff --git a/keyboards/preonic/keymaps/smt/keymap.c b/keyboards/preonic/keymaps/smt/keymap.c
index 5972e918c..b27033b1b 100644
--- a/keyboards/preonic/keymaps/smt/keymap.c
+++ b/keyboards/preonic/keymaps/smt/keymap.c
@@ -193,7 +193,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
case QWERTY:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
- PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
+ PLAY_SONG(tone_qwerty);
#endif
persistent_default_layer_set(1UL<<_QWERTY);
}
@@ -202,7 +202,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
case COLEMAK:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
- PLAY_NOTE_ARRAY(tone_colemak, false, 0);
+ PLAY_SONG(tone_colemak);
#endif
persistent_default_layer_set(1UL<<_COLEMAK);
}
@@ -211,7 +211,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
case DVORAK:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
- PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
+ PLAY_SONG(tone_dvorak);
#endif
persistent_default_layer_set(1UL<<_DVORAK);
}
@@ -263,12 +263,12 @@ void matrix_init_user(void) {
void startup_user()
{
_delay_ms(20); // gets rid of tick
- PLAY_NOTE_ARRAY(tone_startup, false, 0);
+ PLAY_SONG(tone_startup);
}
void shutdown_user()
{
- PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
+ PLAY_SONG(tone_goodbye);
_delay_ms(150);
stop_all_notes();
}
@@ -280,7 +280,7 @@ void music_on_user(void)
void music_scale_user(void)
{
- PLAY_NOTE_ARRAY(music_scale, false, 0);
+ PLAY_SONG(music_scale);
}
#endif
diff --git a/keyboards/preonic/keymaps/xyverz/keymap.c b/keyboards/preonic/keymaps/xyverz/keymap.c
index 1275aa18f..e905c458f 100644
--- a/keyboards/preonic/keymaps/xyverz/keymap.c
+++ b/keyboards/preonic/keymaps/xyverz/keymap.c
@@ -187,7 +187,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
case QWERTY:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
- PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
+ PLAY_SONG(tone_qwerty);
#endif
persistent_default_layer_set(1UL<<_QWERTY);
}
@@ -196,7 +196,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
case COLEMAK:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
- PLAY_NOTE_ARRAY(tone_colemak, false, 0);
+ PLAY_SONG(tone_colemak);
#endif
persistent_default_layer_set(1UL<<_COLEMAK);
}
@@ -205,7 +205,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
case DVORAK:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
- PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
+ PLAY_SONG(tone_dvorak);
#endif
persistent_default_layer_set(1UL<<_DVORAK);
}
@@ -257,12 +257,12 @@ void matrix_init_user(void) {
void startup_user()
{
_delay_ms(20); // gets rid of tick
- PLAY_NOTE_ARRAY(tone_startup, false, 0);
+ PLAY_SONG(tone_startup);
}
void shutdown_user()
{
- PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
+ PLAY_SONG(tone_goodbye);
_delay_ms(150);
stop_all_notes();
}
@@ -274,7 +274,7 @@ void music_on_user(void)
void music_scale_user(void)
{
- PLAY_NOTE_ARRAY(music_scale, false, 0);
+ PLAY_SONG(music_scale);
}
#endif
diff --git a/keyboards/preonic/keymaps/zach/zach_common_functions.c b/keyboards/preonic/keymaps/zach/zach_common_functions.c
index 0b1dd7619..f824b4033 100644
--- a/keyboards/preonic/keymaps/zach/zach_common_functions.c
+++ b/keyboards/preonic/keymaps/zach/zach_common_functions.c
@@ -110,7 +110,7 @@ void dance_lower_lift(qk_tap_dance_state_t *state, void *user_data){ // Called o
update_tri_layer(_LOWER, _RAISE, _ADJUST);
layer_on(_UNICODES);
#ifdef AUDIO_ENABLE
- PLAY_NOTE_ARRAY(tone_ctrl_mod, false, 0);
+ PLAY_SONG(tone_ctrl_mod);
#endif
break;
}
@@ -202,7 +202,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if(record->event.pressed){
persistent_default_layer_set(1UL<<_COLEMAK);
#ifdef AUDIO_ENABLE
- PLAY_NOTE_ARRAY(tone_colemak, false, 0);
+ PLAY_SONG(tone_colemak);
#endif
}
return false;
@@ -211,7 +211,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if(record->event.pressed){
persistent_default_layer_set(1UL<<_SWCOLE);
#ifdef AUDIO_ENABLE
- PLAY_NOTE_ARRAY(tone_swcole, false, 0);
+ PLAY_SONG(tone_swcole);
#endif
}
return false;
@@ -236,7 +236,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
return false;
break;
- case SHFT_CAP:
+ case SHFT_CAP:
if(record->event.pressed){
key_timer = timer_read(); // if the key is being pressed, we start the timer.
register_code(KC_LSHIFT);
@@ -246,12 +246,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if(caps_status == 0){
caps_status = 1;
#ifdef AUDIO_ENABLE
- PLAY_NOTE_ARRAY(tone_capslock_on, false, 0);
+ PLAY_SONG(tone_capslock_on);
#endif
} else {
caps_status = 0;
#ifdef AUDIO_ENABLE
- PLAY_NOTE_ARRAY(tone_capslock_off, false, 0);
+ PLAY_SONG(tone_capslock_off);
#endif
}
}
@@ -267,7 +267,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (timer_elapsed(key_timer) < 152) { // Time in ms, the threshold we pick for counting something as a tap.
tap(KC_B);
#ifdef AUDIO_ENABLE
- PLAY_NOTE_ARRAY(tone_ctrl_mod, false, 0);
+ PLAY_SONG(tone_ctrl_mod);
#endif
#ifdef BACKLIGHT_BREATHING
breathing_speed_set(2);
@@ -287,14 +287,14 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
tap(KC_C);
unregister_code(KC_LCTL);
#ifdef AUDIO_ENABLE
- PLAY_NOTE_ARRAY(tone_copy, false, 0);
+ PLAY_SONG(tone_copy);
#endif
} else { // Tap, paste
register_code(KC_LCTL);
tap(KC_V);
unregister_code(KC_LCTL);
#ifdef AUDIO_ENABLE
- PLAY_NOTE_ARRAY(tone_paste, false, 0);
+ PLAY_SONG(tone_paste);
#endif
}
}
@@ -305,7 +305,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if(record->event.pressed){
set_unicode_input_mode(UC_WIN);
#ifdef AUDIO_ENABLE
- PLAY_NOTE_ARRAY(uniwin, false, 0);
+ PLAY_SONG(uniwin);
#endif
}
return false;
@@ -314,7 +314,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if(record->event.pressed){
set_unicode_input_mode(UC_LNX);
#ifdef AUDIO_ENABLE
- PLAY_NOTE_ARRAY(unilin, false, 0);
+ PLAY_SONG(unilin);
#endif
}
return false;
@@ -419,28 +419,28 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
void matrix_init_user(void){ // Run once at startup
#ifdef AUDIO_ENABLE
_delay_ms(50); // gets rid of tick
- PLAY_NOTE_ARRAY(tone_startup, false, 0);
+ PLAY_SONG(tone_startup);
#endif
}
#ifdef AUDIO_ENABLE
void play_goodbye_tone(void){
- PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
+ PLAY_SONG(tone_goodbye);
_delay_ms(150);
}
void shutdown_user(){
- PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
+ PLAY_SONG(tone_goodbye);
_delay_ms(150);
stop_all_notes();
}
void music_on_user(void){ // Run when the music layer is turned on
- PLAY_NOTE_ARRAY(tone_startup, false, 0);
+ PLAY_SONG(tone_startup);
}
void music_off_user(void){ // Run when music is turned off
- PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
+ PLAY_SONG(tone_goodbye);
}
#endif
diff --git a/keyboards/preonic/preonic.c b/keyboards/preonic/preonic.c
index d9c119b8d..cd765fe4a 100644
--- a/keyboards/preonic/preonic.c
+++ b/keyboards/preonic/preonic.c
@@ -1,4 +1,4 @@
-#include "preonic.h"
+#include QMK_KEYBOARD_H
#ifdef ONEHAND_ENABLE
__attribute__ ((weak))
diff --git a/keyboards/preonic/preonic.h b/keyboards/preonic/preonic.h
index 0e0b101e4..02845a549 100644
--- a/keyboards/preonic/preonic.h
+++ b/keyboards/preonic/preonic.h
@@ -33,4 +33,6 @@
{ k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b } \
}
+#define LAYOUT_ortho_5x12 PREONIC_GRID
+
#endif
diff --git a/keyboards/preonic/rules.mk b/keyboards/preonic/rules.mk
index b46c20193..51104e68b 100644
--- a/keyboards/preonic/rules.mk
+++ b/keyboards/preonic/rules.mk
@@ -67,4 +67,6 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
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 \ No newline at end of file
+SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
+
+LAYOUTS = ortho_5x12 \ No newline at end of file