summaryrefslogtreecommitdiffstats
path: root/users/alfrdmalr/alfrdmalr.c
diff options
context:
space:
mode:
authorAlfred Maler <alfrdmalr@gmail.com>2020-02-07 21:42:04 -0500
committerGitHub <noreply@github.com>2020-02-07 18:42:04 -0800
commit707c04b4ab588967c803114d7d88ef3fdd934967 (patch)
tree8f786f6371ddbf094d72841749cd40e7e4771b79 /users/alfrdmalr/alfrdmalr.c
parentbe05de6a3de19e5641692651ef03ae16f3bf653e (diff)
[Keymap] Add users/alfrdmalr and switch to layouts (#8030)
* WIP do not merge * first pass at custom preonic layout * add auto shift and reset via leader key * Update readme * update copyright notice * formatting changes * fix: use MO instead of process_record_user * added backslash and moved grave position * remove extraneous 'j' characer in NUMPAD template * update template formatting * remove process_record_user * swap "!" with "@" * fix readme formatting * update readme layout image * restore settings layer * add windows minimize sequence * fix: switch to correct seq function for three-key sequence * fix: missing semicolon * refactor: move keymap to userspace and generic 5x12 layout * add numlock to numpad layer * add readme * update readme formatting * remove unused wrappers from layout keymap * update readme title to reflect new location * remove alfrdmalr directory from preonic/keymaps * clean up user config
Diffstat (limited to 'users/alfrdmalr/alfrdmalr.c')
-rw-r--r--users/alfrdmalr/alfrdmalr.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/users/alfrdmalr/alfrdmalr.c b/users/alfrdmalr/alfrdmalr.c
new file mode 100644
index 0000000000..39d2b62e00
--- /dev/null
+++ b/users/alfrdmalr/alfrdmalr.c
@@ -0,0 +1,44 @@
+#include "alfrdmalr.h"
+#include "muse.h"
+
+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;
+
+LEADER_EXTERNS();
+
+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
+
+ LEADER_DICTIONARY() {
+ leading = false;
+ // reset keyboard to bootloader
+ SEQ_FIVE_KEYS(KC_R, KC_E, KC_S, KC_E, KC_T) {
+ reset_keyboard();
+ }
+ // minimize window (Windows)
+ SEQ_THREE_KEYS(KC_M, KC_I, KC_N) {
+ SEND_STRING(SS_LALT(" ")"n");
+ }
+ leader_end();
+ }
+} \ No newline at end of file