summaryrefslogtreecommitdiff
path: root/keyboards/preonic/keymaps
diff options
context:
space:
mode:
authorGuillermo Aguirre <guillermoaguirre1@gmail.com>2023-03-03 19:01:22 -0300
committerGitHub <noreply@github.com>2023-03-03 15:01:22 -0700
commit95dd5738d2a78a78e8fdc0fc1cf0dc7152e29d7f (patch)
treecce6fa76a9c9a20ee013a16043e3292a36629585 /keyboards/preonic/keymaps
parentd1a430b348a9578307f64823da2aebf36932cc52 (diff)
Add new keymap for Preonic rev3 (#19706)
Diffstat (limited to 'keyboards/preonic/keymaps')
-rw-r--r--keyboards/preonic/keymaps/guillermoap/config.h45
-rw-r--r--keyboards/preonic/keymaps/guillermoap/keymap.c215
-rw-r--r--keyboards/preonic/keymaps/guillermoap/readme.md33
-rw-r--r--keyboards/preonic/keymaps/guillermoap/rules.mk3
4 files changed, 296 insertions, 0 deletions
diff --git a/keyboards/preonic/keymaps/guillermoap/config.h b/keyboards/preonic/keymaps/guillermoap/config.h
new file mode 100644
index 0000000000..d336623c03
--- /dev/null
+++ b/keyboards/preonic/keymaps/guillermoap/config.h
@@ -0,0 +1,45 @@
+/* Copyright 2023 Guillermo Aguirre
+ *
+ * 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/>.
+ */
+
+#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
+ */
+
+/* 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
diff --git a/keyboards/preonic/keymaps/guillermoap/keymap.c b/keyboards/preonic/keymaps/guillermoap/keymap.c
new file mode 100644
index 0000000000..fe17182111
--- /dev/null
+++ b/keyboards/preonic/keymaps/guillermoap/keymap.c
@@ -0,0 +1,215 @@
+/* Copyright 2023 Guillermo Aguirre
+ *
+ * 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 {
+ _BASE,
+ _GAMING,
+ _LOWER,
+ _RAISE,
+ _CONFIG,
+};
+
+enum preonic_keycodes {
+ BASE = SAFE_RANGE,
+ GAMING,
+ LOWER,
+ RAISE,
+ CONFIG,
+};
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+/* Base
+ * ,------------------------------------------------------------------------------------------.
+ * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
+ * |-------------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Tab | Q | W | E | R | T | Y | U | I | O | P | \ |
+ * |-------------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' |
+ * |-------------+------+------+------+------+------|------+------+------+------+------+------|
+ * | HOLD Shift | Z | X | C | V | B | N | M | , | . | Up | / |
+ * | TOGGLE Caps | | | | | | | | | | | |
+ * |-------------+------+------+------+------+------+------+------+------+------+------+------|
+ * | GUI | ` | Alt |Lower |Enter |Enter |Space |Space |Raise | Left | Down |Right |
+ * `------------------------------------------------------------------------------------------'
+ */
+[_BASE] = 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_BSLS,
+ KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
+ LSFT_T(KC_CAPS), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_SLSH,
+ KC_LGUI, KC_GRV, LALT_T(KC_RALT), MO(2), KC_ENT, KC_ENT, KC_SPC, KC_SPC, MO(3), KC_LEFT, KC_DOWN, KC_RGHT
+),
+
+/* Gaming
+ * ,-----------------------------------------------------------------------------------.
+ * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Tab | Q | W | E | R | T | Y | U | I | O | P | \ |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | ` | A | S | D | F | G | H | J | K | L | ; | ' |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | Shift| Z | X | C | V | B | N | M | , | . | Up | / |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Ctrl | GUI | Alt |Lower |Space |Space |Enter |Enter |Raise | Left | Down |Right |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_GAMING] = 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_BSLS,
+ KC_GRV, 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_SLSH,
+ KC_LCTL, KC_LGUI, KC_LALT, MO(2), KC_SPC, KC_SPC, KC_ENT, KC_ENT, MO(3), KC_LEFT, KC_DOWN, KC_RGHT
+),
+
+/* Lower
+ * ,-----------------------------------------------------------------------------------.
+ * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | ▽ | ▽ | Mute |Vol + | Play | ▽ | ▽ | _ | + | { | } | \ |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | ▽ | ▽ | Prev |Vol - | Next | ▽ | ▽ | - | = | [ | ] | ▽ |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | ▽ |CTRL_Z| ▽ |CTRL_C| ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | ▽ | ▽ | ▽ | ▽ | ▽ |CONFIG| ▽ | ▽ | ▽ | ▽ | ▽ | ▽ |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_LOWER] = 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_TRNS, KC_TRNS, KC_MUTE, KC_VOLU, KC_MPLY, KC_TRNS, KC_TRNS, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_BSLS,
+ KC_TRNS, KC_TRNS, KC_MPRV, KC_VOLD, KC_MNXT, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_TRNS,
+ KC_TRNS, LCTL(KC_Z), KC_TRNS, LCTL(KC_C), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, TG(4), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
+),
+
+/* Raise
+ * ,-----------------------------------------------------------------------------------.
+ * | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | { | } | Del |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | ▽ | 6 | 7 | 8 | 9 | 0 | ▽ | ▽ | Up | [ | ] | ▽ |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Ctrl | 1 | 2 | 3 | 4 | 5 | ▽ | Left | Down |Right | ▽ | ▽ |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | Shift| ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | Home | End | PgUp |PgDown| ▽ |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | GUI |PrntSc|R Alt | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_RAISE] = LAYOUT_preonic_grid(
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_DEL,
+ KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, KC_TRNS, KC_UP, KC_LBRC, KC_RBRC, KC_TRNS,
+ KC_LCTL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS,
+ KC_RSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_END, KC_PGUP, KC_PGDN, KC_TRNS,
+ KC_RGUI, KC_PSCR, KC_RALT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
+),
+
+/* Config
+ * ,-----------------------------------------------------------------------------------.
+ * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | ▽ | Reset| Debug| ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | Del |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | ▽ | ▽ | ▽ |Aud on|AudOff|CGnorm|CGswap| Base |Gaming| ▽ | ▽ | ▽ |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | ▽ |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| ▽ | ▽ | ▽ | ▽ | ▽ |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ | ▽ |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_CONFIG] = 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_TRNS, QK_BOOT, DB_TOGG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL,
+ KC_TRNS, KC_TRNS, MU_MOD, AU_ON, AU_OFF, CG_NORM, CG_SWAP, DF(0), DF(1), KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
+)
+};
+
+/* Encoder
+ * Currently using ENCONDER_MAP_ENABLE
+ */
+#if defined(ENCODER_MAP_ENABLE)
+const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
+ [_BASE] = { ENCODER_CCW_CW(KC_MS_WH_DOWN, KC_MS_WH_UP) }, // Mouse Scroll Down | Mouse Scroll Up
+ [_GAMING] = { ENCODER_CCW_CW(KC_MS_WH_DOWN, KC_MS_WH_UP) }, // Mouse Scroll Down | Mouse Scroll Up
+ [_LOWER] = { ENCODER_CCW_CW(LCTL(KC_TAB), LCTL(LSFT(KC_TAB))) }, // Ctrl + Tab | Ctrl + Shift + Tab
+ [_RAISE] = { ENCODER_CCW_CW(KC_MS_WH_LEFT, KC_MS_WH_RIGHT) }, // Mouse Scroll Left | Mouse Scroll Right
+ [_CONFIG] = { },
+};
+#endif
+
+/* Default music config
+ * Don't really understand what this does
+ */
+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;
+
+bool dip_switch_update_user(uint8_t index, bool active) {
+ switch (index) {
+ case 0:
+ if (active) {
+ layer_on(_CONFIG);
+ } else {
+ layer_off(_CONFIG);
+ }
+ break;
+ case 1:
+ if (active) {
+ muse_mode = true;
+ } else {
+ muse_mode = false;
+ }
+ }
+ return true;
+}
+
+
+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/guillermoap/readme.md b/keyboards/preonic/keymaps/guillermoap/readme.md
new file mode 100644
index 0000000000..2907652338
--- /dev/null
+++ b/keyboards/preonic/keymaps/guillermoap/readme.md
@@ -0,0 +1,33 @@
+# Preonic Double Spacebar HHKB layout mainly for programming
+This layout is highly curated to my needs and what I like. I mainly use it for programming in macOS, but also gaming in Windows.
+
+The main concept behind every key position is to be able to maximize how many things I can do without lifting my hands from the home row.
+## Layers
+### Base
+- Ctrl/Cmd is on the Caps Lock place (HHKB like)
+- Enter and Space are in the double space bar
+- Normal arrows position (not vim-like)
+- Left Shift on hold - Caps Lock Toggle on tap
+- Vertical scroll on encoder
+### Gaming
+- Switched Enter and Space to reach more easily when gaming
+- Left Shift doesn't have Caps Lock toggle
+- ` is in Ctrl space, mainly used for Push To Talk in games
+### Lower
+- Main programming symbols with right hand
+- Media controls with left hand
+- Full F1..F12 Function keys on number row
+- Ctrl + C | Ctrl + Z Macros to avoid having to constantly press encoder
+- Ctrl + Tab | Ctrl + Shift + Tab on encoder
+### Raise
+- Arrow keys on JKLI
+- Home End PgUp PgDown on M,.Up
+- Numbers on asdfgqwert
+- Del on BackSpace
+- Horizontal scroll on encoder
+### Config
+- Swap Ctrl and GUI on H so I have Cmd next to KC_A when on MacOS
+- Unswap Ctrl and GUI on G so I have Ctrl next to KC_A when on Windows
+- J switches to BASE layer
+- K switches to GAMING layer
+- Default Config for Preonic
diff --git a/keyboards/preonic/keymaps/guillermoap/rules.mk b/keyboards/preonic/keymaps/guillermoap/rules.mk
new file mode 100644
index 0000000000..da6657c8bd
--- /dev/null
+++ b/keyboards/preonic/keymaps/guillermoap/rules.mk
@@ -0,0 +1,3 @@
+SRC += muse.c
+ENCODER_ENABLE = yes
+ENCODER_MAP_ENABLE = yes