Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/alfrdmalr/keymap update #8174

Merged
merged 44 commits into from
Mar 3, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
5d01cdf
WIP do not merge
alfrdmalr Dec 29, 2019
a8af5bd
first pass at custom preonic layout
alfrdmalr Jan 7, 2020
99ec959
add auto shift and reset via leader key
alfrdmalr Jan 7, 2020
a03b69b
revert WIP changes
alfrdmalr Jan 7, 2020
9a929ca
Update readme
alfrdmalr Jan 12, 2020
01dc84d
update copyright notice
alfrdmalr Jan 12, 2020
795e328
formatting changes
alfrdmalr Jan 13, 2020
e4558f7
fix: use MO instead of process_record_user
alfrdmalr Jan 13, 2020
48b1828
added backslash and moved grave position
alfrdmalr Jan 13, 2020
0b8d7f3
remove extraneous 'j' characer in NUMPAD template
alfrdmalr Jan 13, 2020
3ef6a5a
update template formatting
alfrdmalr Jan 13, 2020
d53a51d
remove process_record_user
alfrdmalr Jan 20, 2020
d58470a
swap "!" with "@"
alfrdmalr Jan 20, 2020
9788639
fix readme formatting
alfrdmalr Jan 20, 2020
2aac6cb
update readme layout image
alfrdmalr Jan 20, 2020
c75f0a3
restore settings layer
alfrdmalr Jan 21, 2020
12eb00b
add windows minimize sequence
alfrdmalr Jan 23, 2020
c723fb9
Merge branch 'master' into feature/userspace-alfrdmalr
alfrdmalr Jan 23, 2020
de7c5ad
fix: switch to correct seq function for three-key sequence
alfrdmalr Jan 23, 2020
d2e50e3
fix: missing semicolon
alfrdmalr Jan 23, 2020
2f0fbb1
refactor: move keymap to userspace and generic 5x12 layout
alfrdmalr Jan 27, 2020
bc10b60
add numlock to numpad layer
alfrdmalr Jan 27, 2020
acd1002
add readme
alfrdmalr Jan 27, 2020
e25cde7
update readme formatting
alfrdmalr Jan 28, 2020
33d160e
Merge branch 'master' into feature/userspace-alfrdmalr
alfrdmalr Jan 28, 2020
b98c72e
remove unused wrappers from layout keymap
alfrdmalr Jan 28, 2020
0a9eacc
update readme title to reflect new location
alfrdmalr Jan 28, 2020
cc035dd
remove alfrdmalr directory from preonic/keymaps
alfrdmalr Jan 28, 2020
d1b7855
add ortho 4x12 support
alfrdmalr Jan 31, 2020
dca932c
add 'trilayer' settings and update keymap
alfrdmalr Feb 4, 2020
13895d4
update SYMBOLS layer to SYMBOL
alfrdmalr Feb 4, 2020
5b48ab7
remove minimize sequence
alfrdmalr Feb 6, 2020
757a627
clean up user config
alfrdmalr Feb 6, 2020
cb9d629
Merge pull request #1 from alfrdmalr/feature/userspace-alfrdmalr
alfrdmalr Feb 6, 2020
95df5f4
Merge branch 'feature/userspace-alfrdmalr' into feature/alfrdmalr/tri…
alfrdmalr Feb 6, 2020
457ff88
add brightness controls
alfrdmalr Feb 7, 2020
d14bc31
Merge branch 'master' of https://github.com/alfrdmalr/qmk_firmware
alfrdmalr Feb 13, 2020
3f9c300
Merge branch 'master' into feature/layouts/community/ortho4x12/alfrdmalr
alfrdmalr Feb 13, 2020
c487df7
Merge branch 'master' into feature/alfrdmalr/trilayer-settings
alfrdmalr Feb 13, 2020
a050a33
Merge pull request #2 from alfrdmalr/feature/layouts/community/ortho4…
alfrdmalr Feb 13, 2020
5948fce
Merge branch 'master' into feature/alfrdmalr/trilayer-settings
alfrdmalr Feb 13, 2020
1e66ac6
Merge pull request #3 from alfrdmalr/feature/alfrdmalr/trilayer-settings
alfrdmalr Feb 13, 2020
2f86688
update settings ascii
alfrdmalr Feb 13, 2020
f68b26f
moved some symbols around to make vim/linux smoother
alfrdmalr Feb 13, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
first pass at custom preonic layout
  • Loading branch information
alfrdmalr committed Jan 7, 2020
commit a8af5bd6131ea7923cd533f5a30901f1c8bb1402
37 changes: 37 additions & 0 deletions keyboards/preonic/keymaps/alfrdmalr/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#pragma once

#ifdef AUDIO_ENABLE
#define STARTUP_SONG SONG(PREONIC_SOUND)
// #define STARTUP_SONG SONG(NO_SOUND)

#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
SONG(COLEMAK_SOUND), \
SONG(DVORAK_SOUND) \
}
#endif

#define MUSIC_MASK (keycode != KC_NO)

/*
* MIDI options
*/

/* Prevent use of disabled MIDI features in the keymap */
//#define MIDI_ENABLE_STRICT 1

/* enable basic MIDI features:
- MIDI notes can be sent when in Music mode is on
*/

#define MIDI_BASIC

/* enable advanced MIDI features:
- MIDI notes can be added to the keymap
- Octave shift and transpose
- Virtual sustain, portamento, and modulation wheel
- etc.
*/
//#define MIDI_ADVANCED

/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
//#define MIDI_TONE_KEYCODE_OCTAVES 2
304 changes: 304 additions & 0 deletions keyboards/preonic/keymaps/alfrdmalr/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,304 @@
/* Copyright 2015-2017 Jack Humbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include QMK_KEYBOARD_H
#include "muse.h"

enum preonic_layers {
_QWERTY,
// _COLEMAK,
// _DVORAK,
_SETTINGS,
_SYMBOLS,
_NAVIGATION,
_NUMPAD,
};

enum preonic_keycodes {
QWERTY = SAFE_RANGE,
// COLEMAK,
// DVORAK,
// BACKLIT,
SYMBOLS,
NAVIGATION,
NUMPAD,
SETTINGS
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

/* Qwerty
* ,-----------------------------------------------------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Del |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | NAV | A | S | D | F | G | H | J | K | L | ; | " |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | SHIFT| Z | X | C | V | B | N | M | , | . | / |SHIFT |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | CTRL | HYPR | LGUI | LALT | SYMB | SPACE/NUM | SYMB | RALT | num? |mu tog| CTRL |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = LAYOUT_preonic_grid( \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, \
NAVIGATION, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \
KC_LCTL, NUMPAD, KC_LGUI, KC_LALT, SYMBOLS, LT(_NUMPAD, KC_SPC), LT(_NUMPAD, KC_SPC), SYMBOLS, KC_RALT, SETTINGS, MU_TOG, KC_RCTRL \
),

/* SYMBOLS
* ,-----------------------------------------------------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Tab | # | $ | { | } | | | ^ | * | | | ~ | Del |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Esc | < | > | ( | ) | | | - | + | & | ` |ENTER |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Shift| @ | ! | [ | ] | | | _ | = | % | / |SHIFT |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS |
* `-----------------------------------------------------------------------------------'
*/
[_SYMBOLS] = 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_HASH, KC_DOLLAR, KC_LCBR, KC_RCBR, KC_NO, KC_NO, KC_CIRC, KC_ASTR, KC_PIPE, KC_TILD, KC_DEL, \
KC_NO, KC_LABK, KC_RABK, KC_LPRN, KC_RPRN, KC_NO, KC_NO, KC_MINS, KC_PLUS, KC_AMPR, KC_GRV, KC_ENT, \
KC_LSFT, KC_AT, KC_EXCLAIM, KC_LBRC, KC_RBRC, KC_NO, KC_NO, KC_UNDS, KC_EQL, KC_PERC, KC_SLSH, KC_RSFT, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \
),

/* NAVIGATION
* ,-----------------------------------------------------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | TRNS | | | SPC | F5 | | | HOME | END | TAB | | Del |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | NAV | SHIFT| CTRl | ALT | GUI | | LEFT | DOWN | UP | RIGHT| | ENTER|
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | SHIFT| | CUT | COPY | PASTE| | SPC | PGDO | PGUP | | | SHIFT|
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | TRNS | TRNS | TRNS | TRNS | TRNS | ESC | TRNS | TRNS | TRNS | TRNS | TRNS |
* `-----------------------------------------------------------------------------------'
*/
[_NAVIGATION] = 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_TRNS, KC_NO, KC_NO, KC_SPC, KC_F5, KC_NO, KC_NO, KC_HOME, KC_END, KC_TAB, KC_NO, KC_DEL, \
KC_TRNS, KC_LSFT, KC_LCTRL, KC_LALT, KC_LGUI, KC_NO, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_NO, KC_ENT, \
KC_TRNS, KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_NO, KC_SPC, KC_PGDN, KC_PGUP, KC_NO, KC_NO, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_ESC, KC_ESC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \
),

/* NUMPAD
* By not having r5/c11 be transparent, we can soft lock the layer by using that key from the base
* layer to get here. can always untoggle with one of the other keys (space, r5/c2)
* ,-----------------------------------------------------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | TRNS | F9 | F10 | F11 | F12 | | | 7 | 8 | 9 | - | DEL |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | ESC | F5 | F6 | F7 | F8 | SPC | SPC | 4 | 5 | 6 | + | ENTR |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | TRNS | F1 | F2 | F3 | F4 | ALT | CAPS | 1 | 2 | 3 | / | TRNS |
* |------+------+------+------+------+------+------+------+------+------+------+------|
*j | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | 0 | , | . | * | TRNS |
* `-----------------------------------------------------------------------------------'
*/
[_NUMPAD] = 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_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, KC_7, KC_8, KC_9, KC_MINS, KC_DEL, \
KC_ESC, KC_F5, KC_F6, KC_F7, KC_F8, KC_SPC, KC_SPC, KC_4, KC_5, KC_6, KC_PLUS, KC_ENT, \
KC_LSFT, KC_F1, KC_F2, KC_F3, KC_F4, KC_LALT, KC_CAPS, KC_1, KC_2, KC_3, KC_SLSH, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_0, KC_COMM, KC_DOT, KC_ASTR, KC_TRNS \
),

/* SETTINGS
* ,-----------------------------------------------------------------------------------.
* | 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| | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_SETTINGS] = 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, _______, _______, _______, _______, \
_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
)
};

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
set_single_persistent_default_layer(_QWERTY);
}
return false;
break;
// case COLEMAK:
// if (record->event.pressed) {
// set_single_persistent_default_layer(_COLEMAK);
// }
// return false;
// break;
// case DVORAK:
// if (record->event.pressed) {
// set_single_persistent_default_layer(_DVORAK);
// }
// return false;
// break;
case SYMBOLS:
if (record->event.pressed) {
layer_on(_SYMBOLS);
} else {
layer_off(_SYMBOLS);
}
return false;
break;
case NUMPAD:
if (record->event.pressed) {
layer_on(_NUMPAD);
} else {
layer_off(_NUMPAD);
}
return false;
break;
case NAVIGATION:
if (record->event.pressed) {
layer_on(_NAVIGATION);
} else {
layer_off(_NAVIGATION);
}
return false;
break;
case SETTINGS:
if (record->event.pressed) {
layer_on(_SETTINGS);
} else {
layer_off(_SETTINGS);
}
return false;
break;

// case BACKLIT:
// if (record->event.pressed) {
// register_code(KC_RSFT);
// #ifdef BACKLIGHT_ENABLE
// backlight_step();
// #endif
// #ifdef __AVR__
// writePinLow(E6);
// #endif
// } else {
// unregister_code(KC_RSFT);
// #ifdef __AVR__
// writePinHigh(E6);
// #endif
// }
// return false;
// break;
}
return true;
};

bool muse_mode = false;
uint8_t last_muse_note = 0;
uint16_t muse_counter = 0;
uint8_t muse_offset = 70;
uint16_t muse_tempo = 50;

// void encoder_update_user(uint8_t index, bool clockwise) {
// if (muse_mode) {
// if (IS_LAYER_ON(_RAISE)) {
// if (clockwise) {
// muse_offset++;
// } else {
// muse_offset--;
// }
// } else {
// if (clockwise) {
// muse_tempo+=1;
// } else {
// muse_tempo-=1;
// }
// }
// } else {
// if (clockwise) {
// register_code(KC_PGDN);
// unregister_code(KC_PGDN);
// } else {
// register_code(KC_PGUP);
// unregister_code(KC_PGUP);
// }
// }
// }

void dip_switch_update_user(uint8_t index, bool active) {
switch (index) {
case 0:
// if (active) {
// layer_on(_ADJUST);
// } else {
// layer_off(_ADJUST);
// }
break;
case 1:
if (active) {
muse_mode = true;
} else {
muse_mode = false;
}
}
}

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;
}
}
1 change: 1 addition & 0 deletions keyboards/preonic/keymaps/alfrdmalr/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# The default Preonic layout - largely based on the Planck's
1 change: 1 addition & 0 deletions keyboards/preonic/keymaps/alfrdmalr/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SRC += muse.c
Loading