From f006ebebbd0d4f9c3e57e299fc5e3e0326560702 Mon Sep 17 00:00:00 2001 From: Ante Laurijssen Date: Sun, 14 May 2017 16:07:44 -0400 Subject: Initial push of my keymap --- keyboards/s60_x/keymaps/bluebear/Makefile | 18 ++++ keyboards/s60_x/keymaps/bluebear/config.h | 122 +++++++++++++++++++++++ keyboards/s60_x/keymaps/bluebear/keymap.c | 154 +++++++++++++++++++++++++++++ keyboards/s60_x/keymaps/bluebear/readme.md | 25 +++++ 4 files changed, 319 insertions(+) create mode 100644 keyboards/s60_x/keymaps/bluebear/Makefile create mode 100644 keyboards/s60_x/keymaps/bluebear/config.h create mode 100644 keyboards/s60_x/keymaps/bluebear/keymap.c create mode 100644 keyboards/s60_x/keymaps/bluebear/readme.md (limited to 'keyboards/s60_x') diff --git a/keyboards/s60_x/keymaps/bluebear/Makefile b/keyboards/s60_x/keymaps/bluebear/Makefile new file mode 100644 index 0000000000..dfefad39da --- /dev/null +++ b/keyboards/s60_x/keymaps/bluebear/Makefile @@ -0,0 +1,18 @@ +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 = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = yes # MIDI controls +AUDIO_ENABLE = no # 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. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +TAP_DANCE_ENABLE = no # Enable tap dancing keys + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/s60_x/keymaps/bluebear/config.h b/keyboards/s60_x/keymaps/bluebear/config.h new file mode 100644 index 0000000000..2cf96383c1 --- /dev/null +++ b/keyboards/s60_x/keymaps/bluebear/config.h @@ -0,0 +1,122 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0003 +#define MANUFACTURER Sentraq +#define PRODUCT S60-RGB +#define DESCRIPTION QMK keyboard firmware for Sentraq S60-RGB + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +// ROWS: Top to bottom, COLS: Left to right + +#define MATRIX_ROW_PINS { B5, B4, D7, D6, D4 } +#define MATRIX_COL_PINS { D0, D1, D2, D3, D5, B6, C6, C7, F1, F0, E6, B3, B2, B1, B0 } +#define UNUSED_PINS + +#define BACKLIGHT_PIN B7 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* Backlight configuration + */ +#define BACKLIGHT_LEVELS 3 + +/* Underlight configuration + */ + +#define RGB_DI_PIN F6 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 10 // Number of LEDs +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +// For Tap Dancing + +#define TAPPING_TOGGLE 1 +#define TAPPING_TERM 300 + +/* + * 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 diff --git a/keyboards/s60_x/keymaps/bluebear/keymap.c b/keyboards/s60_x/keymaps/bluebear/keymap.c new file mode 100644 index 0000000000..3861ad04f0 --- /dev/null +++ b/keyboards/s60_x/keymaps/bluebear/keymap.c @@ -0,0 +1,154 @@ +#include "s60_x.h" + +// Keyboard Layers + +enum keyboard_layers { + BASE = 0, //Base Layer + ARROW, //Arrow/FN Layer + MOUSE, //Mouse Layer + MIDI, //Midi Layer +}; + +// Midi Chord Keycodes + +enum midi_chord_keycodes { + + //Major Chords + + MI_CH_C = SAFE_RANGE, + MI_CH_Cs, + MI_CH_Db = MI_CH_Cs, + MI_CH_D, + MI_CH_Ds, + MI_CH_Eb = MI_CH_Ds, + MI_CH_E, + MI_CH_F, + MI_CH_Fs, + MI_CH_Gb = MI_CH_Fs, + MI_CH_G, + MI_CH_Gs, + MI_CH_Ab = MI_CH_Gs, + MI_CH_A, + MI_CH_As, + MI_CH_Bb = MI_CH_As, + MI_CH_B, + + //Minor Chords + + MI_CH_Cm, + MI_CH_Csm, + MI_CH_Dbm = MI_CH_Csm, + MI_CH_Dm, + MI_CH_Dsm, + MI_CH_Ebm = MI_CH_Dsm, + MI_CH_Em, + MI_CH_Fm, + MI_CH_Fsm, + MI_CH_Gbm = MI_CH_Fsm, + MI_CH_Gm, + MI_CH_Gsm, + MI_CH_Abm = MI_CH_Gsm, + MI_CH_Am, + MI_CH_Asm, + MI_CH_Bbm = MI_CH_Asm, + MI_CH_Bm, +}; + +//Keymaps + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* 0: Custom Dvorak/HHKBish Base Layer + + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ [ │ ] │ \ │ ` │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ TAB │ ' │ , │ . │ P │ Y │ F │ G │ C │ R │ L │ / │ = │BSPC │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │CT/ES│ A │ O │ E │ U │ I │ D │ H │ T │ N │ S │ - │▒▒▒▒▒│CT/EN│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LSPO │▒▒▒▒▒│ ; │ Q │ J │ K │ X │ B │ M │ W │ V │ Z │▒▒▒▒▒│RSPC │▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │MO(2)│L_GUI│L_ALT│█████│█████│█████│SPFN1│█████│█████│█████│AG/AP│R_GUI│CT|S │CT|AL│█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + [BASE] = KEYMAP( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSLS, KC_GRV, \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSPC, \ + CTL_T(KC_ESC), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_NO, MT(MOD_RCTL, KC_ENT), \ + KC_LSPO, KC_NO, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_NO, KC_RSPC, KC_NO, \ + MO(2), KC_LGUI, KC_LALT, LT(1, KC_SPACE), ALGR_T(KC_APP), KC_RGUI, OSM(MOD_LCTL | MOD_LSFT), OSM(MOD_LCTL | MOD_LALT) + ), + + /* 1: Arrow/Missing Keys Layer + + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │TG(3)│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ │ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │CAPS │ │ │ │ │ │ │PGUP │ UP │HOME │ END │ │ INS │ DEL │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │ │ │ │ │LEFT │DOWN │RIGHT│ │ │▒▒▒▒▒│ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │▒▒▒▒▒│ │ │ │ │ │SPACE│PGDN │PSCR │SLCK │PAUSE│▒▒▒▒▒│ │▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + [ARROW] = KEYMAP( + TG(3), 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_NO, KC_NO, \ + KC_CAPS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PGUP, KC_UP, KC_HOME, KC_END, KC_NO, KC_INS, KC_DEL, \ + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RIGHT, KC_NO, KC_NO, KC_NO, KC_TRNS, \ + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_SPACE, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, KC_NO, KC_TRNS, KC_NO, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + + /* 2: Mouse Keys Layer + + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │RESET│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ │ │ │ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │ │ │ │ │BTN1 │MS_UP│BTN2 │WH_UP│ │ │ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │ │ │ │ │MS_LT│MS_DN│MS_RT│WH_DN│BTN3 │▒▒▒▒▒│ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │█████│█████│█████│ PWR │█████│█████│█████│ │ │ │ │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + [MOUSE] = KEYMAP( + + RESET, 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_NO, KC_NO, \ + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_BTN1, KC_MS_UP, KC_BTN2, KC_WH_U, KC_NO, KC_NO, KC_NO, \ + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_WH_D, KC_BTN3, KC_NO, KC_NO, \ + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_TRNS, KC_NO, KC_NO, KC_POWER, KC_NO, KC_NO, KC_NO, KC_NO + ), + + /* 3: Midi Layer + + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │TG(0)│ Cmaj│ Gmaj│ Dmaj│ Amaj│ Emaj│ Bmaj│Gbmaj│Dbmaj│Abmaj│Ebmaj│Bbmaj│ Fmaj│ │ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ C# │ D# │ │ F# │ G# │ A# │ │ C# │ D# │ │ │ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │OCT- │ C │ D │ E │ F │ G │ A │ B │ C │ D │ E │ F │▒▒▒▒▒│OCT+ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ Am │▒▒▒▒▒│ Em │ Bm │ F#m │ C#m │ G#m │ D#m │ Bbm │ Fm │ Cm │ Gm │▒▒▒▒▒│ Dm │▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │█████│█████│█████│A-OFF│█████│█████│█████│ │ │ │ │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + [MIDI] = KEYMAP( + TO(0), MI_CH_C, MI_CH_G, MI_CH_D, MI_CH_A, MI_CH_E, MI_CH_B, MI_CH_Gb, MI_CH_Db, MI_CH_Ab, MI_CH_Eb, MI_CH_Bb, MI_CH_F, KC_NO, KC_NO, \ + KC_NO, KC_NO, MI_Cs, MI_Ds, KC_NO, MI_Fs, MI_Gs, MI_As, KC_NO, MI_Cs_1, MI_Ds_1, KC_NO, KC_NO, KC_NO, \ + MI_OCTD, MI_C, MI_D, MI_E, MI_F, MI_G, MI_A, MI_B, MI_C_1, MI_D_1, MI_E_1, MI_F_1, KC_NO, MI_OCTU, \ + MI_CH_Am, KC_NO, MI_CH_Em, MI_CH_Bm, MI_CH_Fsm, MI_CH_Csm, MI_CH_Gsm, MI_CH_Dsm, MI_CH_Bbm, MI_CH_Fm, MI_CH_Cm, MI_CH_Gm, KC_NO, MI_CH_Dm, KC_NO, \ + KC_NO, KC_NO, KC_NO, MI_ALLOFF, KC_NO, KC_NO, KC_NO, KC_NO + ), + +}; diff --git a/keyboards/s60_x/keymaps/bluebear/readme.md b/keyboards/s60_x/keymaps/bluebear/readme.md new file mode 100644 index 0000000000..579683abcb --- /dev/null +++ b/keyboards/s60_x/keymaps/bluebear/readme.md @@ -0,0 +1,25 @@ +## Bluebear’s custom S60X layout + +Custom keyboard layout for my S60X, my first ever custom mechanical keyboard kit. + +This layout was inspired in part by the HHKB line of keyboards and a quest to find the perfect ergonomic, logical layout for what I do. If you like this layout, please feel free to use it, modify it and share it. + +## Base Layer + +-Hold left control key for LCTL, and tap it for ESC +-Hold enter key for RCTL and tap for ENT +-Hold the space key to momentarily switch to [ARROW] layer +-Left bottom key acts as momentary switch to the [MOUSE] layer +-Hold right alt key for AltGr and tap for APP(which I have mapped to Compose in OS) +-Hold left shift key for LSFT and tap for ( (Space Cadet style) +-Hold right shift key for RSFT and tap for ) (Space Cadet style) +-Tap key on bottom row, second from the right (where APP usually is) to get CTL-Shift (one shot modifier - next key pressed will be modified by ctl-shift) +-Tap key on bottom right to get CTL-Alt (one shot modifier - next key pressed will be modified by ctl-alt) + +## Mouse Layer + +-Hitting the escape key in this layer will give RESET, which puts the controller into dfu mode for flashing firmware onto it +-Hitting the space key in this layer is like hitting power button on computer + + + -- cgit v1.2.3 From ee0b34feaf99debbc47fe736001181dffa3cd6b1 Mon Sep 17 00:00:00 2001 From: Ante Laurijssen Date: Sun, 14 May 2017 20:07:35 -0400 Subject: Started working on custom midi chord function --- keyboards/s60_x/keymaps/bluebear/keymap.c | 68 +++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) (limited to 'keyboards/s60_x') diff --git a/keyboards/s60_x/keymaps/bluebear/keymap.c b/keyboards/s60_x/keymaps/bluebear/keymap.c index 3861ad04f0..f963043c19 100644 --- a/keyboards/s60_x/keymaps/bluebear/keymap.c +++ b/keyboards/s60_x/keymaps/bluebear/keymap.c @@ -11,6 +11,13 @@ enum keyboard_layers { // Midi Chord Keycodes +bool midi_chord(uint8_t mode, uint16_t root); + +enum midi_chord_modes { + major = 0, + minor, +}; + enum midi_chord_keycodes { //Major Chords @@ -152,3 +159,64 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; + +// Midi Chord Function + +bool midi_chord(uint8_t mode, uint16_t root) { + switch (mode) { + case 0: + uint8_t channel = midi_config.channel; + uint8_t tone = root - MIDI_TONE_MIN; + uint8_t velocity = compute_velocity(midi_config.velocity); + if (record->event.pressed) { + uint8_t root_note = midi_compute_note(root); + uint8_t major_third = midi_compute_note(root) + 4; + uint8_t fifth = midi_compute_note(root) + 7; + midi_send_noteon(&midi_device, channel, root_note, velocity); + midi_send_noteon(&midi_device, channel, major_third, velocity); + midi_send_noteon(&midi_device, channel, fifth, velocity); + tone_status[tone] = root_note; + } + else { + uint8_t root_note = tone_status[tone]; + uint8_t major_third = root_note + 4; + uint8_t fifth = root_note + 7; + if (root_note != MIDI_INVALID_NOTE) + { + midi_send_noteoff(&midi_device, channel, root_note, velocity); + midi_send_noteoff(&midi_device, channel, major_third, velocity); + midi_send_noteoff(&midi_device, channel, fifth, velocity); + } + tone_status[tone] = MIDI_INVALID_NOTE; + } + return false; + case 1: + uint8_t channel = midi_config.channel; + uint8_t tone = root - MIDI_TONE_MIN; + uint8_t velocity = compute_velocity(midi_config.velocity); + if (record->event.pressed) { + uint8_t root_note = midi_compute_note(root); + uint8_t minor_third = midi_compute_note(root) + 3; + uint8_t fifth = midi_compute_note(root) + 7; + midi_send_noteon(&midi_device, channel, root_note, velocity); + midi_send_noteon(&midi_device, channel, major_third, velocity); + midi_send_noteon(&midi_device, channel, fifth, velocity); + tone_status[tone] = root_note; + } + else { + uint8_t root_note = tone_status[tone]; + uint8_t minor_third = root_note + 3; + uint8_t fifth = root_note + 7; + if (root_note != MIDI_INVALID_NOTE) + { + midi_send_noteoff(&midi_device, channel, root_note, velocity); + midi_send_noteoff(&midi_device, channel, minor_third, velocity); + midi_send_noteoff(&midi_device, channel, fifth, velocity); + } + tone_status[tone] = MIDI_INVALID_NOTE; + } + return false; + }; + return true; +}; + -- cgit v1.2.3 From 814b570ba1f2f9a12996c50844b7c8861ec1e919 Mon Sep 17 00:00:00 2001 From: Ante Laurijssen Date: Mon, 15 May 2017 22:56:33 -0400 Subject: Working on keymap.c file... --- keyboards/s60_x/keymaps/bluebear/keymap.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'keyboards/s60_x') diff --git a/keyboards/s60_x/keymaps/bluebear/keymap.c b/keyboards/s60_x/keymaps/bluebear/keymap.c index f963043c19..124c482b2c 100644 --- a/keyboards/s60_x/keymaps/bluebear/keymap.c +++ b/keyboards/s60_x/keymaps/bluebear/keymap.c @@ -9,15 +9,16 @@ enum keyboard_layers { MIDI, //Midi Layer }; -// Midi Chord Keycodes +// Midi Chord Keycodes +/* bool midi_chord(uint8_t mode, uint16_t root); enum midi_chord_modes { major = 0, minor, }; - +*/ enum midi_chord_keycodes { //Major Chords @@ -160,6 +161,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; +/* // Midi Chord Function bool midi_chord(uint8_t mode, uint16_t root) { @@ -199,7 +201,7 @@ bool midi_chord(uint8_t mode, uint16_t root) { uint8_t minor_third = midi_compute_note(root) + 3; uint8_t fifth = midi_compute_note(root) + 7; midi_send_noteon(&midi_device, channel, root_note, velocity); - midi_send_noteon(&midi_device, channel, major_third, velocity); + midi_send_noteon(&midi_device, channel, minor_third, velocity); midi_send_noteon(&midi_device, channel, fifth, velocity); tone_status[tone] = root_note; } @@ -219,4 +221,4 @@ bool midi_chord(uint8_t mode, uint16_t root) { }; return true; }; - +*/ -- cgit v1.2.3 From 26c6f6a85c9c16a3be27e6c61609b3da99ec3f73 Mon Sep 17 00:00:00 2001 From: Ante Laurijssen Date: Tue, 16 May 2017 22:08:45 -0400 Subject: Added Space Cadet Rollover Disable to config.h --- keyboards/s60_x/keymaps/bluebear/config.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'keyboards/s60_x') diff --git a/keyboards/s60_x/keymaps/bluebear/config.h b/keyboards/s60_x/keymaps/bluebear/config.h index 2cf96383c1..94438bdc9f 100644 --- a/keyboards/s60_x/keymaps/bluebear/config.h +++ b/keyboards/s60_x/keymaps/bluebear/config.h @@ -119,4 +119,7 @@ along with this program. If not, see . /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ #define MIDI_TONE_KEYCODE_OCTAVES 2 +// Space Cadet Rollover - if set, allows to tap opposite shift key to cancel erroneous press +#define DISABLE_SPACE_CADET_ROLLOVER + #endif -- cgit v1.2.3 From b766407cbe07e78f5cf5ce2ec77694541d598e0e Mon Sep 17 00:00:00 2001 From: Ante Laurijssen Date: Sun, 21 May 2017 08:40:42 -0400 Subject: Continuing work on keymap.c --- keyboards/s60_x/keymaps/bluebear/keymap.c | 450 +++++++++++++++++++++++++++--- 1 file changed, 416 insertions(+), 34 deletions(-) (limited to 'keyboards/s60_x') diff --git a/keyboards/s60_x/keymaps/bluebear/keymap.c b/keyboards/s60_x/keymaps/bluebear/keymap.c index 124c482b2c..0b3b8b65b9 100644 --- a/keyboards/s60_x/keymaps/bluebear/keymap.c +++ b/keyboards/s60_x/keymaps/bluebear/keymap.c @@ -4,62 +4,140 @@ enum keyboard_layers { BASE = 0, //Base Layer - ARROW, //Arrow/FN Layer + ARROWFN, //Arrow/FN Layer MOUSE, //Mouse Layer MIDI, //Midi Layer + MORSE, //Morse Code Layer }; +// Midi Chords -// Midi Chord Keycodes -/* -bool midi_chord(uint8_t mode, uint16_t root); - -enum midi_chord_modes { +enum midi_chord_modes { //ACTION_FUNCTION id major = 0, minor, }; -*/ + +enum midi_chord_root { //ACTION_FUNCTION opt + C = 0, + Cs, + Db = Cs, + D, + Ds, + Eb = Ds, + E, + F, + Fs, + Gb = Fs, + G, + Gs, + Ab = Gs, + A, + As, + Bb = As, + B, +}; + enum midi_chord_keycodes { //Major Chords - MI_CH_C = SAFE_RANGE, - MI_CH_Cs, + MI_CH_C = ACTION_FUNCTION(0, 0), + MI_CH_Cs = ACTION_FUNCTION(0, 1), MI_CH_Db = MI_CH_Cs, - MI_CH_D, - MI_CH_Ds, + MI_CH_D = ACTION_FUNCTION(0, 2), + MI_CH_Ds = ACTION_FUNCTION(0, 3), MI_CH_Eb = MI_CH_Ds, - MI_CH_E, - MI_CH_F, - MI_CH_Fs, + MI_CH_E = ACTION_FUNCTION(0, 4), + MI_CH_F = ACTION_FUNCTION(0, 5), + MI_CH_Fs = ACTION_FUNCTION(0, 6), MI_CH_Gb = MI_CH_Fs, - MI_CH_G, - MI_CH_Gs, + MI_CH_G = ACTION_FUNCTION(0, 7), + MI_CH_Gs = ACTION_FUNCTION(0, 8), MI_CH_Ab = MI_CH_Gs, - MI_CH_A, - MI_CH_As, + MI_CH_A = ACTION_FUNCTION(0, 9), + MI_CH_As = ACTION_FUNCTION(0, 10), MI_CH_Bb = MI_CH_As, - MI_CH_B, + MI_CH_B = ACTION_FUNCTION(0, 11), //Minor Chords - MI_CH_Cm, - MI_CH_Csm, + MI_CH_Cm = ACTION_FUNCTION(1, 0), + MI_CH_Csm = ACTION_FUNCTION(1, 1), MI_CH_Dbm = MI_CH_Csm, - MI_CH_Dm, - MI_CH_Dsm, + MI_CH_Dm = ACTION_FUNCTION(1, 2), + MI_CH_Dsm = ACTION_FUNCTION(1, 3), MI_CH_Ebm = MI_CH_Dsm, - MI_CH_Em, - MI_CH_Fm, - MI_CH_Fsm, + MI_CH_Em = ACTION_FUNCTION(1, 4), + MI_CH_Fm = ACTION_FUNCTION(1, 5), + MI_CH_Fsm = ACTION_FUNCTION(1, 6), MI_CH_Gbm = MI_CH_Fsm, - MI_CH_Gm, - MI_CH_Gsm, + MI_CH_Gm = ACTION_FUNCTION(1, 7), + MI_CH_Gsm= ACTION_FUNCTION(1, 8), MI_CH_Abm = MI_CH_Gsm, - MI_CH_Am, - MI_CH_Asm, + MI_CH_Am = ACTION_FUNCTION(1, 9), + MI_CH_Asm = ACTION_FUNCTION(1, 10), MI_CH_Bbm = MI_CH_Asm, - MI_CH_Bm, + MI_CH_Bm = ACTION_FUNCTION(1, 11), +}; + +//Morse Code Macro Keys + +enum morse_macros { + MC_0 = M(0), + MC_1 = M(1), + MC_2 = M(2), + MC_3 = M(3), + MC_4 = M(4), + MC_5 = M(5), + MC_6 = M(6), + MC_7 = M(7), + MC_8 = M(8), + MC_9 = M(9), + MC_A = M(10), + MC_B = M(11), + MC_C = M(12), + MC_D = M(13), + MC_E = M(14), + MC_F = M(15), + MC_G = M(16), + MC_H = M(17), + MC_I = M(18), + MC_J = M(19), + MC_K = M(20), + MC_L = M(21), + MC_M = M(22), + MC_N = M(23), + MC_O = M(24), + MC_P = M(25), + MC_Q = M(26), + MC_R = M(27), + MC_S = M(28), + MC_T = M(29), + MC_U = M(30), + MC_V = M(31), + MC_W = M(32), + MC_X = M(33), + MC_Y = M(34), + MC_Z = M(35), + MC_DOT = M(36), + MC_COMM = M(37), + MC_QUES = M(38), + MC_APOS = M(39), + MC_EXCL = M(40), + MC_SLSH = M(41), + MC_PARO = M(42), + MC_PARC = M(43), + MC_AMP = M(44), + MC_COL = M(45), + MC_SCLN = M(46), + MC_EQL = M(47), + MC_PLUS = M(48), + MC_MINS = M(49), + MC_QUOT = M(50), + MC_DOLR = M(51), + MC_AT = M(52), + MC_UNDS = M(53), + MC_SPACE = M(54), }; //Keymaps @@ -89,7 +167,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { MO(2), KC_LGUI, KC_LALT, LT(1, KC_SPACE), ALGR_T(KC_APP), KC_RGUI, OSM(MOD_LCTL | MOD_LSFT), OSM(MOD_LCTL | MOD_LALT) ), - /* 1: Arrow/Missing Keys Layer + /* 1: Arrow/FN Layer ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ │TG(3)│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ │ │ @@ -104,7 +182,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - [ARROW] = KEYMAP( + [ARROWFN] = KEYMAP( TG(3), 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_NO, KC_NO, \ KC_CAPS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PGUP, KC_UP, KC_HOME, KC_END, KC_NO, KC_INS, KC_DEL, \ KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RIGHT, KC_NO, KC_NO, KC_NO, KC_TRNS, \ @@ -159,12 +237,316 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_NO, KC_NO, KC_NO, MI_ALLOFF, KC_NO, KC_NO, KC_NO, KC_NO ), + /* 4: Morse Code Layer + + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ │ │ │ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ ' │ , │ . │ P │ Y │ F │ G │ C │ R │ L │ / │ = │BSPC │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ A │ O │ E │ U │ I │ D │ H │ T │ N │ S │ - │▒▒▒▒▒│ENTER│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │SHIFT│▒▒▒▒▒│ ; │ Q │ J │ K │ X │ B │ M │ W │ V │ Z │▒▒▒▒▒│SHIFT│▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │█████│█████│█████│SPACE│█████│█████│█████│ │ │ │ │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + [MORSE] = KEYMAP( + KC_NO, MC_1, MC_2, MC_3, MC_4, MC_5, MC_6, MC_7, MC_8, MC_9, MC_0, KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_NO, MC_APOS, MC_COMM, MC_DOT, MC_P, MC_Y, MC_F, MC_G, MC_C, MC_R, MC_L, MC_SLSH, MC_EQL, KC_BSPC, \ + KC_NO, MC_A, MC_O, MC_E, MC_U, MC_I, MC_D, MC_H, MC_T, MC_N, MC_S, MC_MINS, KC_NO, KC_ENT, \ + KC_LSFT, KC_NO, MC_SCLN, MC_Q, MC_J, MC_K, MC_X, MC_B, MC_M, MC_W, MC_V, MC_Z, KC_NO, KC_RSFT, KC_NO, \ + KC_NO, KC_NO, KC_NO, MC_SPACE, KC_NO, KC_NO, KC_NO, KC_NO + ), + +}; + +// Morse Code Macros + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case 0: //Number 0 + if (record->event.pressed) { + return MACRO(T(MINS), T(MINS), T(MINS), T(MINS), T(MINS), T(SPACE), END); //----- + } + break; + case 1: //Number 1 + if (record->event.pressed) { + return MACRO(T(DOT), T(MINS), T(MINS), T(MINS), T(MINS), T(SPACE), END); //.---- + } + break; + case 2: //Number 2 + if (record->event.pressed) { + return MACRO(T(DOT), T(DOT), T(MINS), T(MINS), T(MINS), T(SPACE), END); //..--- + } + break; + case 3: // Number 3 + if (record->event.pressed) { + return MACRO(T(DOT), T(DOT), T(DOT), T(MINS), T(MINS), T(SPACE), END); //...-- + } + break; + case 4: //Number 4 + if (record->event.pressed) { + return MACRO(T(DOT), T(DOT), T(DOT), T(DOT), T(MINS), T(SPACE), END); //....- + } + break; + case 5: //Number 5 + if (record->event.pressed) { + return MACRO(T(DOT), T(DOT), T(DOT), T(DOT), T(DOT), T(SPACE), END); //..... + } + break; + case 6: //Number 6 + if (record->event.pressed) { + return MACRO(T(MINS), T(DOT), T(DOT), T(DOT), T(DOT), T(SPACE), END); //-.... + } + break; + case 7: //Number 7 + if (record->event.pressed) { + return MACRO(T(MINS), T(MINS), T(DOT), T(DOT), T(DOT), T(SPACE), END); //--... + } + break; + case 8: //Number 8 + if (record->event.pressed) { + return MACRO(T(MINS), T(MINS), T(MINS), T(DOT), T(DOT), T(SPACE), END); //---.. + } + break; + case 9: //Number 9 + if (record->event.pressed) { + return MACRO(T(MINS), T(MINS), T(MINS), T(MINS), T(DOT), T(SPACE), END); //----. + } + break; + case 10: //Letter A + if (record->event.pressed) { + return MACRO(T(DOT), T(MINS), T(SPACE), END); //.- + } + break; + case 11: //Letter B + if (record->event.pressed) { + return MACRO(T(MINS), T(DOT), T(DOT), T(DOT), T(SPACE), END); //-... + } + break; + case 12: //Letter C + if (record->event.pressed) { + return MACRO(T(MINS), T(DOT), T(MINS), T(DOT), T(SPACE), END); //-.-. + } + break; + case 13: //Letter D + if (record->event.pressed) { + return MACRO(T(MINS), T(DOT), T(DOT), T(SPACE), END); //-.. + } + break; + case 14: //Letter E + if (record->event.pressed) { + return MACRO(T(DOT), T(SPACE), END); //. + } + break; + case 15: //Letter F + if (record->event.pressed) { + return MACRO(T(DOT), T(DOT), T(MINS), T(DOT), T(SPACE), END); //..-. + } + break; + case 16: //Letter G + if (record->event.pressed) { + return MACRO(T(MINS), T(MINS), T(DOT), T(SPACE), END); //--. + } + break; + case 17: //Letter H + if (record->event.pressed) { + return MACRO(T(DOT), T(DOT), T(DOT), T(DOT), T(SPACE), END); //.... + } + break; + case 18: //Letter I + if (record->event.pressed) { + return MACRO(T(DOT), T(DOT), T(SPACE), END); //.. + } + break; + case 19: //Letter J + if (record->event.pressed) { + return MACRO(T(DOT), T(MINS), T(MINS), T(MINS), T(SPACE), END); //.--- + } + break; + case 20: //Letter K + if (record->event.pressed) { + return MACRO(T(MINS), T(DOT), T(MINS), T(SPACE), END); //-.- + } + break; + case 21: //Letter L + if (record->event.pressed) { + return MACRO(T(DOT), T(MINS), T(DOT), T(DOT), T(SPACE), END); //.-.. + } + break; + case 22: //Letter M + if (record->event.pressed) { + return MACRO(T(MINS), T(MINS), T(SPACE), END); //-- + } + break; + case 23: //Letter N + if (record->event.pressed) { + return MACRO(T(MINS), T(DOT), T(SPACE), END); //-. + } + break; + case 24: //Letter O + if (record->event.pressed) { + return MACRO(T(MINS), T(MINS), T(MINS), T(SPACE), END); //--- + } + break; + case 25: //Letter P + if (record->event.pressed) { + return MACRO(T(DOT), T(MINS), T(MINS), T(DOT), T(SPACE), END); //.--. + } + break; + case 26: //Letter Q + if (record->event.pressed) { + return MACRO(T(MINS), T(MINS), T(DOT), T(MINS), T(SPACE), END); //--.- + } + break; + case 27: //Letter R + if (record->event.pressed) { + return MACRO(T(DOT), T(MINS), T(DOT), T(SPACE), END); //.-. + } + break; + case 28: //Letter S + if (record->event.pressed) { + return MACRO(T(DOT), T(DOT), T(DOT), T(SPACE), END); //... + } + break; + case 29: //Letter T + if (record->event.pressed) { + return MACRO(T(MINS), T(SPACE), END); //- + } + break; + case 30: //Letter U + if (record->event.pressed) { + return MACRO(T(DOT), T(DOT), T(MINS), T(SPACE), END); //..- + } + break; + case 31: //Letter V + if (record->event.pressed) { + return MACRO(T(DOT), T(DOT), T(DOT), T(MINS), T(SPACE), END); //...- + } + break; + case 32: //Letter W + if (record->event.pressed) { + return MACRO(T(DOT), T(MINS), T(MINS), T(SPACE), END); //.-- + } + break; + case 33: //Letter X + if (record->event.pressed) { + return MACRO(T(MINS), T(DOT), T(DOT), T(MINS), T(SPACE), END); //-..- + } + break; + case 34: //Letter Y + if (record->event.pressed) { + return MACRO(T(MINS), T(DOT), T(MINS), T(MINS), T(SPACE), END); //-.-- + } + break; + case 35: //Letter Z + if (record->event.pressed) { + return MACRO(T(MINS), T(MINS), T(DOT), T(DOT), T(SPACE), END); //--.. + } + break; + case 36: //Punctuation . + if (record->event.pressed) { + return MACRO(T(DOT), T(MINS), T(DOT), T(MINS), T(DOT), T(MINS), T(SPACE), END); //.-.-.- + } + break; + case 37: //Punctuation , + if (record->event.pressed) { + return MACRO(T(MINS), T(MINS), T(DOT), T(DOT), T(MINS), T(MINS), T(SPACE), END); //--..-- + } + break; + case 38: //Punctuation ? + if (record->event.pressed) { + return MACRO(T(DOT), T(DOT), T(MINS), T(MINS), T(DOT), T(DOT), T(SPACE), END); //..--.. + } + break; + case 39: //Punctuation ' + if (record->event.pressed) { + return MACRO(T(DOT), T(MINS), T(MINS), T(MINS), T(MINS), T(DOT), T(SPACE), END); //-....- + } + break; + case 40: //Punctuation ! + if (record->event.pressed) { + return MACRO(T(MINS), T(DOT), T(MINS), T(DOT), T(MINS), T(MINS), T(SPACE), END); //-.-.-- + } + break; + case 41: //Punctuation / + if (record->event.pressed) { + return MACRO(T(MINS), T(DOT), T(DOT), T(MINS), T(DOT), T(SPACE), END); //-..-. + } + break; + case 42: //Punctuation ( + if (record->event.pressed) { + return MACRO(T(MINS), T(DOT), T(MINS), T(MINS), T(DOT), T(SPACE), END); //-.--. + } + break; + case 43: //Punctuation ) + if (record->event.pressed) { + return MACRO(T(MINS), T(DOT), T(MINS), T(MINS), T(DOT), T(MINS), T(SPACE), END); //-.--.- + } + break; + case 44: //Punctuation & + if (record->event.pressed) { + return MACRO(T(DOT), T(MINS), T(DOT), T(DOT), T(DOT), T(SPACE), END); //.-... + } + break; + case 45: //Punctuation : + if (record->event.pressed) { + return MACRO(T(MINS), T(MINS), T(MINS), T(DOT), T(DOT), T(DOT), T(SPACE), END); //---... + } + break; + case 46: //Punctuation ; + if (record->event.pressed) { + return MACRO(T(MINS), T(DOT), T(MINS), T(DOT), T(MINS), T(DOT), T(SPACE), END); //-.-.-. + } + break; + case 47: //Punctuation = + if (record->event.pressed) { + return MACRO(T(MINS), T(DOT), T(DOT), T(DOT), T(MINS), T(SPACE), END); //-...- + } + break; + case 48: //Punctuation + + if (record->event.pressed) { + return MACRO(T(DOT), T(MINS), T(DOT), T(MINS), T(DOT), T(SPACE), END); //.-.-. + } + break; + case 49: //Punctuation - + if (record->event.pressed) { + return MACRO(T(MINS), T(DOT), T(DOT), T(DOT), T(DOT), T(MINS), T(SPACE), END); //-....- + } + break; + case 50: //Punctuation " + if (record->event.pressed) { + return MACRO(T(DOT), T(MINS), T(DOT), T(DOT), T(MINS), T(DOT), T(SPACE), END); //.-..-. + } + break; + case 51: //Punctuation $ + if (record->event.pressed) { + return MACRO(T(DOT), T(DOT), T(DOT), T(MINS), T(DOT), T(DOT), T(MINS), T(SPACE), END); //...-..- + } + break; + case 52: //Punctuation @ + if (record->event.pressed) { + return MACRO(T(DOT), T(MINS), T(MINS), T(DOT), T(MINS), T(DOT), T(SPACE), END); //.--.-. + } + break; + case 53: //Punctuation _ + if (record->event.pressed) { + return MACRO(T(DOT), T(DOT), T(MINS), T(MINS), T(DOT), T(MINS), T(SPACE), END); //..--.- + case 54: //Morse Space + if (record->event.pressed) { + return MACRO(T(BSLS), T(SPACE), END); //When pressed, this sends a slash followed by a space, making it easier to distinguish words in Morse + } + break; + } + return MACRO_NONE; }; /* // Midi Chord Function -bool midi_chord(uint8_t mode, uint16_t root) { switch (mode) { case 0: uint8_t channel = midi_config.channel; -- cgit v1.2.3 From 06433eb1a0563fe8c17bdd31c42d5f6b94a6e508 Mon Sep 17 00:00:00 2001 From: Ante Laurijssen Date: Sun, 21 May 2017 22:37:20 -0400 Subject: More work on keymap.c and config.h --- keyboards/s60_x/keymaps/bluebear/config.h | 5 +- keyboards/s60_x/keymaps/bluebear/keymap.c | 296 +++++++++++++++++++----------- 2 files changed, 197 insertions(+), 104 deletions(-) (limited to 'keyboards/s60_x') diff --git a/keyboards/s60_x/keymaps/bluebear/config.h b/keyboards/s60_x/keymaps/bluebear/config.h index 94438bdc9f..5c0d08833f 100644 --- a/keyboards/s60_x/keymaps/bluebear/config.h +++ b/keyboards/s60_x/keymaps/bluebear/config.h @@ -121,5 +121,8 @@ along with this program. If not, see . // Space Cadet Rollover - if set, allows to tap opposite shift key to cancel erroneous press #define DISABLE_SPACE_CADET_ROLLOVER - + +// Prevent stuck modifiers +#define PREVENT_STUCK_MODIFIERS + #endif diff --git a/keyboards/s60_x/keymaps/bluebear/keymap.c b/keyboards/s60_x/keymaps/bluebear/keymap.c index 0b3b8b65b9..d383d2e284 100644 --- a/keyboards/s60_x/keymaps/bluebear/keymap.c +++ b/keyboards/s60_x/keymaps/bluebear/keymap.c @@ -3,7 +3,7 @@ // Keyboard Layers enum keyboard_layers { - BASE = 0, //Base Layer + BASE, //Base Layer ARROWFN, //Arrow/FN Layer MOUSE, //Mouse Layer MIDI, //Midi Layer @@ -13,12 +13,12 @@ enum keyboard_layers { // Midi Chords enum midi_chord_modes { //ACTION_FUNCTION id - major = 0, + major, minor, }; enum midi_chord_root { //ACTION_FUNCTION opt - C = 0, + C, Cs, Db = Cs, D, @@ -41,43 +41,43 @@ enum midi_chord_keycodes { //Major Chords - MI_CH_C = ACTION_FUNCTION(0, 0), - MI_CH_Cs = ACTION_FUNCTION(0, 1), + MI_CH_C = ACTION_FUNCTION_OPT(major,C), + MI_CH_Cs = ACTION_FUNCTION_OPT(major,Cs), MI_CH_Db = MI_CH_Cs, - MI_CH_D = ACTION_FUNCTION(0, 2), - MI_CH_Ds = ACTION_FUNCTION(0, 3), + MI_CH_D = ACTION_FUNCTION_OPT(major,D), + MI_CH_Ds = ACTION_FUNCTION_OPT(major,Ds), MI_CH_Eb = MI_CH_Ds, - MI_CH_E = ACTION_FUNCTION(0, 4), - MI_CH_F = ACTION_FUNCTION(0, 5), - MI_CH_Fs = ACTION_FUNCTION(0, 6), + MI_CH_E = ACTION_FUNCTION_OPT(major,E), + MI_CH_F = ACTION_FUNCTION_OPT(major,F), + MI_CH_Fs = ACTION_FUNCTION_OPT(major,Fs), MI_CH_Gb = MI_CH_Fs, - MI_CH_G = ACTION_FUNCTION(0, 7), - MI_CH_Gs = ACTION_FUNCTION(0, 8), + MI_CH_G = ACTION_FUNCTION_OPT(major,G), + MI_CH_Gs = ACTION_FUNCTION_OPT(major,Gs), MI_CH_Ab = MI_CH_Gs, - MI_CH_A = ACTION_FUNCTION(0, 9), - MI_CH_As = ACTION_FUNCTION(0, 10), + MI_CH_A = ACTION_FUNCTION_OPT(major,A), + MI_CH_As = ACTION_FUNCTION_OPT(major,As), MI_CH_Bb = MI_CH_As, - MI_CH_B = ACTION_FUNCTION(0, 11), + MI_CH_B = ACTION_FUNCTION_OPT(major,B), //Minor Chords - MI_CH_Cm = ACTION_FUNCTION(1, 0), - MI_CH_Csm = ACTION_FUNCTION(1, 1), + MI_CH_Cm = ACTION_FUNCTION_OPT(minor,C), + MI_CH_Csm = ACTION_FUNCTION_OPT(minor,Cs), MI_CH_Dbm = MI_CH_Csm, - MI_CH_Dm = ACTION_FUNCTION(1, 2), - MI_CH_Dsm = ACTION_FUNCTION(1, 3), + MI_CH_Dm = ACTION_FUNCTION_OPT(minor,D), + MI_CH_Dsm = ACTION_FUNCTION_OPT(minor,Ds), MI_CH_Ebm = MI_CH_Dsm, - MI_CH_Em = ACTION_FUNCTION(1, 4), - MI_CH_Fm = ACTION_FUNCTION(1, 5), - MI_CH_Fsm = ACTION_FUNCTION(1, 6), + MI_CH_Em = ACTION_FUNCTION_OPT(minor,E), + MI_CH_Fm = ACTION_FUNCTION_OPT(minor,F), + MI_CH_Fsm = ACTION_FUNCTION_OPT(minor,Fs), MI_CH_Gbm = MI_CH_Fsm, - MI_CH_Gm = ACTION_FUNCTION(1, 7), - MI_CH_Gsm= ACTION_FUNCTION(1, 8), + MI_CH_Gm = ACTION_FUNCTION_OPT(minor,G), + MI_CH_Gsm= ACTION_FUNCTION_OPT(minor,Gs), MI_CH_Abm = MI_CH_Gsm, - MI_CH_Am = ACTION_FUNCTION(1, 9), - MI_CH_Asm = ACTION_FUNCTION(1, 10), + MI_CH_Am = ACTION_FUNCTION_OPT(minor,A), + MI_CH_Asm = ACTION_FUNCTION_OPT(minor,As), MI_CH_Bbm = MI_CH_Asm, - MI_CH_Bm = ACTION_FUNCTION(1, 11), + MI_CH_Bm = ACTION_FUNCTION_OPT(minor,B), }; //Morse Code Macro Keys @@ -166,11 +166,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSPO, KC_NO, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_NO, KC_RSPC, KC_NO, \ MO(2), KC_LGUI, KC_LALT, LT(1, KC_SPACE), ALGR_T(KC_APP), KC_RGUI, OSM(MOD_LCTL | MOD_LSFT), OSM(MOD_LCTL | MOD_LALT) ), - + /* 1: Arrow/FN Layer ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - │TG(3)│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ │ │ + │ │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │TO(3)│TO(4)│ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │CAPS │ │ │ │ │ │ │PGUP │ UP │HOME │ END │ │ INS │ DEL │█████│ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ @@ -183,17 +183,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [ARROWFN] = KEYMAP( - TG(3), 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_NO, KC_NO, \ - KC_CAPS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PGUP, KC_UP, KC_HOME, KC_END, KC_NO, KC_INS, KC_DEL, \ - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RIGHT, KC_NO, KC_NO, KC_NO, KC_TRNS, \ - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_SPACE, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, KC_NO, KC_TRNS, KC_NO, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS - ), + KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, TO(3), TO(4), \ + KC_CAPS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PGUP, KC_UP, KC_HOME, KC_END, KC_NO, KC_INS, KC_DEL, \ + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RIGHT, KC_NO, KC_NO, KC_NO, KC_TRNS, \ + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_SPACE, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, KC_NO, KC_TRNS, KC_NO, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), /* 2: Mouse Keys Layer ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - │RESET│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ │ │ │ │ + │RESET│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ │ │ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │ │ │ │ │ │ │ │BTN1 │MS_UP│BTN2 │WH_UP│ │ │ │█████│ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ @@ -217,7 +217,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* 3: Midi Layer ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - │TG(0)│ Cmaj│ Gmaj│ Dmaj│ Amaj│ Emaj│ Bmaj│Gbmaj│Dbmaj│Abmaj│Ebmaj│Bbmaj│ Fmaj│ │ │ + │TO(0)│ Cmaj│ Gmaj│ Dmaj│ Amaj│ Emaj│ Bmaj│Gbmaj│Dbmaj│Abmaj│Ebmaj│Bbmaj│ Fmaj│ │ │ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │ │ │ C# │ D# │ │ F# │ G# │ A# │ │ C# │ D# │ │ │ │█████│ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ @@ -240,7 +240,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* 4: Morse Code Layer ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - │ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ │ │ │ │ + │TO(0)│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ │ │ │ │ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │ │ ' │ , │ . │ P │ Y │ F │ G │ C │ R │ L │ / │ = │BSPC │█████│ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ @@ -253,19 +253,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [MORSE] = KEYMAP( - KC_NO, MC_1, MC_2, MC_3, MC_4, MC_5, MC_6, MC_7, MC_8, MC_9, MC_0, KC_NO, KC_NO, KC_NO, KC_NO, \ - KC_NO, MC_APOS, MC_COMM, MC_DOT, MC_P, MC_Y, MC_F, MC_G, MC_C, MC_R, MC_L, MC_SLSH, MC_EQL, KC_BSPC, \ - KC_NO, MC_A, MC_O, MC_E, MC_U, MC_I, MC_D, MC_H, MC_T, MC_N, MC_S, MC_MINS, KC_NO, KC_ENT, \ - KC_LSFT, KC_NO, MC_SCLN, MC_Q, MC_J, MC_K, MC_X, MC_B, MC_M, MC_W, MC_V, MC_Z, KC_NO, KC_RSFT, KC_NO, \ - KC_NO, KC_NO, KC_NO, MC_SPACE, KC_NO, KC_NO, KC_NO, KC_NO - ), + TO(0), MC_1, MC_2, MC_3, MC_4, MC_5, MC_6, MC_7, MC_8, MC_9, MC_0, KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_TAB, MC_APOS, MC_COMM, MC_DOT, MC_P, MC_Y, MC_F, MC_G, MC_C, MC_R, MC_L, MC_SLSH, MC_EQL, KC_BSPC, \ + KC_NO, MC_A, MC_O, MC_E, MC_U, MC_I, MC_D, MC_H, MC_T, MC_N, MC_S, MC_MINS, KC_NO, KC_ENT, \ + KC_LSFT, KC_NO, MC_SCLN, MC_Q, MC_J, MC_K, MC_X, MC_B, MC_M, MC_W, MC_V, MC_Z, KC_NO, KC_RSFT, KC_NO, \ + KC_NO, KC_NO, KC_NO, MC_SPACE, KC_NO, KC_NO, KC_NO, KC_NO + ), }; // Morse Code Macros -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { switch(id) { case 0: //Number 0 if (record->event.pressed) { @@ -319,131 +318,209 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) break; case 10: //Letter A if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + } return MACRO(T(DOT), T(MINS), T(SPACE), END); //.- } break; case 11: //Letter B if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + } return MACRO(T(MINS), T(DOT), T(DOT), T(DOT), T(SPACE), END); //-... } break; case 12: //Letter C if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + } return MACRO(T(MINS), T(DOT), T(MINS), T(DOT), T(SPACE), END); //-.-. } break; case 13: //Letter D if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + } return MACRO(T(MINS), T(DOT), T(DOT), T(SPACE), END); //-.. } break; case 14: //Letter E if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + } return MACRO(T(DOT), T(SPACE), END); //. } break; case 15: //Letter F if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + } return MACRO(T(DOT), T(DOT), T(MINS), T(DOT), T(SPACE), END); //..-. } break; case 16: //Letter G if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + } return MACRO(T(MINS), T(MINS), T(DOT), T(SPACE), END); //--. } break; case 17: //Letter H - if (record->event.pressed) { - return MACRO(T(DOT), T(DOT), T(DOT), T(DOT), T(SPACE), END); //.... + if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); } + return MACRO(T(DOT), T(DOT), T(DOT), T(DOT), T(SPACE), END); //.... + } break; case 18: //Letter I if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + } return MACRO(T(DOT), T(DOT), T(SPACE), END); //.. } break; case 19: //Letter J if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + } return MACRO(T(DOT), T(MINS), T(MINS), T(MINS), T(SPACE), END); //.--- } break; case 20: //Letter K if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + } return MACRO(T(MINS), T(DOT), T(MINS), T(SPACE), END); //-.- } break; case 21: //Letter L if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + } return MACRO(T(DOT), T(MINS), T(DOT), T(DOT), T(SPACE), END); //.-.. } break; case 22: //Letter M if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + } return MACRO(T(MINS), T(MINS), T(SPACE), END); //-- } break; case 23: //Letter N if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + } return MACRO(T(MINS), T(DOT), T(SPACE), END); //-. } break; case 24: //Letter O if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + } return MACRO(T(MINS), T(MINS), T(MINS), T(SPACE), END); //--- } break; case 25: //Letter P if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + } return MACRO(T(DOT), T(MINS), T(MINS), T(DOT), T(SPACE), END); //.--. } break; case 26: //Letter Q if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + } return MACRO(T(MINS), T(MINS), T(DOT), T(MINS), T(SPACE), END); //--.- } break; case 27: //Letter R if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + } return MACRO(T(DOT), T(MINS), T(DOT), T(SPACE), END); //.-. } break; case 28: //Letter S if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + } return MACRO(T(DOT), T(DOT), T(DOT), T(SPACE), END); //... } break; case 29: //Letter T if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + } return MACRO(T(MINS), T(SPACE), END); //- } break; case 30: //Letter U if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + } return MACRO(T(DOT), T(DOT), T(MINS), T(SPACE), END); //..- } break; case 31: //Letter V if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + } return MACRO(T(DOT), T(DOT), T(DOT), T(MINS), T(SPACE), END); //...- } break; case 32: //Letter W if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + } return MACRO(T(DOT), T(MINS), T(MINS), T(SPACE), END); //.-- } break; case 33: //Letter X if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + } return MACRO(T(MINS), T(DOT), T(DOT), T(MINS), T(SPACE), END); //-..- } break; case 34: //Letter Y if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + } return MACRO(T(MINS), T(DOT), T(MINS), T(MINS), T(SPACE), END); //-.-- } break; case 35: //Letter Z if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + } return MACRO(T(MINS), T(MINS), T(DOT), T(DOT), T(SPACE), END); //--.. } break; @@ -535,6 +612,8 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) case 53: //Punctuation _ if (record->event.pressed) { return MACRO(T(DOT), T(DOT), T(MINS), T(MINS), T(DOT), T(MINS), T(SPACE), END); //..--.- + } + break; case 54: //Morse Space if (record->event.pressed) { return MACRO(T(BSLS), T(SPACE), END); //When pressed, this sends a slash followed by a space, making it easier to distinguish words in Morse @@ -547,60 +626,71 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) /* // Midi Chord Function - switch (mode) { - case 0: - uint8_t channel = midi_config.channel; - uint8_t tone = root - MIDI_TONE_MIN; - uint8_t velocity = compute_velocity(midi_config.velocity); - if (record->event.pressed) { - uint8_t root_note = midi_compute_note(root); - uint8_t major_third = midi_compute_note(root) + 4; - uint8_t fifth = midi_compute_note(root) + 7; - midi_send_noteon(&midi_device, channel, root_note, velocity); - midi_send_noteon(&midi_device, channel, major_third, velocity); - midi_send_noteon(&midi_device, channel, fifth, velocity); - tone_status[tone] = root_note; - } - else { - uint8_t root_note = tone_status[tone]; - uint8_t major_third = root_note + 4; - uint8_t fifth = root_note + 7; - if (root_note != MIDI_INVALID_NOTE) - { - midi_send_noteoff(&midi_device, channel, root_note, velocity); - midi_send_noteoff(&midi_device, channel, major_third, velocity); - midi_send_noteoff(&midi_device, channel, fifth, velocity); - } - tone_status[tone] = MIDI_INVALID_NOTE; - } - return false; - case 1: - uint8_t channel = midi_config.channel; - uint8_t tone = root - MIDI_TONE_MIN; - uint8_t velocity = compute_velocity(midi_config.velocity); - if (record->event.pressed) { - uint8_t root_note = midi_compute_note(root); - uint8_t minor_third = midi_compute_note(root) + 3; - uint8_t fifth = midi_compute_note(root) + 7; - midi_send_noteon(&midi_device, channel, root_note, velocity); - midi_send_noteon(&midi_device, channel, minor_third, velocity); - midi_send_noteon(&midi_device, channel, fifth, velocity); - tone_status[tone] = root_note; - } - else { - uint8_t root_note = tone_status[tone]; - uint8_t minor_third = root_note + 3; - uint8_t fifth = root_note + 7; - if (root_note != MIDI_INVALID_NOTE) - { - midi_send_noteoff(&midi_device, channel, root_note, velocity); - midi_send_noteoff(&midi_device, channel, minor_third, velocity); - midi_send_noteoff(&midi_device, channel, fifth, velocity); - } - tone_status[tone] = MIDI_INVALID_NOTE; - } - return false; - }; - return true; +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { +uint16_t root_note; +uint8_t channel = midi_config.channel; +uint8_t velocity = compute_velocity(midi_config.velocity); +switch (opt) { +case 0: //Root note C +root_note = MI_C; +case 1: //Root note C#/Db +root_note = MI_Cs; +case 2: // Root note D +root_note = MI_D; +case 3: // Root note D#/Eb +root_note = MI_Ds; +case 4: // Root note E +root_note = MI_E; +case 5: // Root note F +root_note = MI_F; +case 6: // Root note F#/Gb +root_note = MI_Fs; +case 7: // Root note G +root_note = MI_G; +case 8: // Root note G#/Ab +root_note = MI_Gs; +case 9: // Root note A +root_note = MI_A; +case 10: // Root note A#/Bb +root_note = MI_As; +case 11: // Root note B +root_note = MI_B; +switch (id) { +uint8_t tone = root_note - MIDI_TONE_MIN; +uint8_t root = midi_compute_note(root_note); +uint8_t major_third = midi_compute_note(root_note) + 4; +uint8_t minor_third = midi_compute_note(root_note) + 3; +uint8_t fifth = midi_compute_note(root_note) + 7; +case 0: //Major chord +if (record->event.pressed) { +midi_send_noteon(&midi_device, channel, root, velocity); +midi_send_noteon(&midi_device, channel, major_third, velocity); +midi_send_noteon(&midi_device, channel, fifth, velocity); +tone_status[tone] = root; +} +else { +uint8_t root = tone_status[tone]; +if (root != MIDI_INVALID_NOTE) +{ +midi_send_noteoff(&midi_device, channel, root, velocity); +} +tone_status[tone] = MIDI_INVALID_NOTE; +} +case 1: //Minor chord +if (record->event.pressed) { +midi_send_noteon(&midi_device, channel, root_note, velocity); +midi_send_noteon(&midi_device, channel, minor_third, velocity); +midi_send_noteon(&midi_device, channel, fifth, velocity); +} +else { +uint8_t root = tone_status[tone]; +if (root != MIDI_INVALID_NOTE) +{ +midi_send_noteoff(&midi_device, channel, root, velocity); +} +tone_status[tone] = MIDI_INVALID_NOTE; +} +} +} }; */ -- cgit v1.2.3 From 4d783d0e69444a660c53c95e83bf6ca011bc6c8e Mon Sep 17 00:00:00 2001 From: Ante Laurijssen Date: Mon, 22 May 2017 23:30:25 -0400 Subject: More work on my keymap.c and added .png images of my different layers. --- .../bluebear/S60X-Bluebear-ARROWFN-Layer.png | Bin 0 -> 17938 bytes .../keymaps/bluebear/S60X-Bluebear-BASE-Layer.png | Bin 0 -> 28068 bytes .../keymaps/bluebear/S60X-Bluebear-MIDI-Layer.png | Bin 0 -> 21329 bytes .../keymaps/bluebear/S60X-Bluebear-MORSE-Layer.png | Bin 0 -> 14330 bytes .../keymaps/bluebear/S60X-Bluebear-MOUSE-Layer.png | Bin 0 -> 16119 bytes keyboards/s60_x/keymaps/bluebear/keymap.c | 219 +++++++++++---------- 6 files changed, 120 insertions(+), 99 deletions(-) create mode 100644 keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-ARROWFN-Layer.png create mode 100644 keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-BASE-Layer.png create mode 100644 keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MIDI-Layer.png create mode 100644 keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MORSE-Layer.png create mode 100644 keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MOUSE-Layer.png (limited to 'keyboards/s60_x') diff --git a/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-ARROWFN-Layer.png b/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-ARROWFN-Layer.png new file mode 100644 index 0000000000..a7c6df5044 Binary files /dev/null and b/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-ARROWFN-Layer.png differ diff --git a/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-BASE-Layer.png b/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-BASE-Layer.png new file mode 100644 index 0000000000..e77287a0f1 Binary files /dev/null and b/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-BASE-Layer.png differ diff --git a/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MIDI-Layer.png b/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MIDI-Layer.png new file mode 100644 index 0000000000..c8df0a9e9e Binary files /dev/null and b/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MIDI-Layer.png differ diff --git a/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MORSE-Layer.png b/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MORSE-Layer.png new file mode 100644 index 0000000000..0e72d10326 Binary files /dev/null and b/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MORSE-Layer.png differ diff --git a/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MOUSE-Layer.png b/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MOUSE-Layer.png new file mode 100644 index 0000000000..c74348389d Binary files /dev/null and b/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MOUSE-Layer.png differ diff --git a/keyboards/s60_x/keymaps/bluebear/keymap.c b/keyboards/s60_x/keymaps/bluebear/keymap.c index d383d2e284..32a65a5937 100644 --- a/keyboards/s60_x/keymaps/bluebear/keymap.c +++ b/keyboards/s60_x/keymaps/bluebear/keymap.c @@ -121,23 +121,12 @@ enum morse_macros { MC_Z = M(35), MC_DOT = M(36), MC_COMM = M(37), - MC_QUES = M(38), - MC_APOS = M(39), - MC_EXCL = M(40), - MC_SLSH = M(41), - MC_PARO = M(42), - MC_PARC = M(43), - MC_AMP = M(44), - MC_COL = M(45), - MC_SCLN = M(46), - MC_EQL = M(47), - MC_PLUS = M(48), - MC_MINS = M(49), - MC_QUOT = M(50), - MC_DOLR = M(51), - MC_AT = M(52), - MC_UNDS = M(53), - MC_SPACE = M(54), + MC_APOS = M(38), + MC_SLSH = M(39), + MC_SCLN = M(40), + MC_EQL = M(41), + MC_MINS = M(42), + MC_SPACE = M(43), }; //Keymaps @@ -183,11 +172,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [ARROWFN] = KEYMAP( - KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, TO(3), TO(4), \ + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, TO(3), TO(4), \ KC_CAPS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PGUP, KC_UP, KC_HOME, KC_END, KC_NO, KC_INS, KC_DEL, \ - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RIGHT, KC_NO, KC_NO, KC_NO, KC_TRNS, \ - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_SPACE, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, KC_NO, KC_TRNS, KC_NO, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RIGHT, KC_NO, KC_NO, KC_NO, KC_TRNS, \ + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_SPACE, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, KC_NO, KC_NO, KC_NO, \ + KC_NO, KC_NO, KC_NO, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_TRNS ), /* 2: Mouse Keys Layer @@ -266,54 +255,102 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { switch(id) { - case 0: //Number 0 + case 0: //Number 0-) if (record->event.pressed) { - return MACRO(T(MINS), T(MINS), T(MINS), T(MINS), T(MINS), T(SPACE), END); //----- + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + return MACRO(T(MINS), T(DOT), T(MINS), T(MINS), T(DOT), T(MINS), T(SPACE), END); //-.--.- + } + else { + return MACRO(T(MINS), T(MINS), T(MINS), T(MINS), T(MINS), T(SPACE), END); //----- + } } break; - case 1: //Number 1 + case 1: //Number 1-! if (record->event.pressed) { - return MACRO(T(DOT), T(MINS), T(MINS), T(MINS), T(MINS), T(SPACE), END); //.---- + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + return MACRO(T(MINS), T(DOT), T(MINS), T(DOT), T(MINS), T(MINS), T(SPACE), END); //-.-.-- + } + else { + return MACRO(T(DOT), T(MINS), T(MINS), T(MINS), T(MINS), T(SPACE), END); //.---- + } } break; - case 2: //Number 2 + case 2: //Number 2-@ if (record->event.pressed) { - return MACRO(T(DOT), T(DOT), T(MINS), T(MINS), T(MINS), T(SPACE), END); //..--- + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + return MACRO(T(DOT), T(MINS), T(MINS), T(DOT), T(MINS), T(DOT), T(SPACE), END); //.--.-. + } + else { + return MACRO(T(DOT), T(DOT), T(MINS), T(MINS), T(MINS), T(SPACE), END); //..--- + } } break; case 3: // Number 3 if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + } return MACRO(T(DOT), T(DOT), T(DOT), T(MINS), T(MINS), T(SPACE), END); //...-- } break; - case 4: //Number 4 + case 4: //Number 4-$ if (record->event.pressed) { - return MACRO(T(DOT), T(DOT), T(DOT), T(DOT), T(MINS), T(SPACE), END); //....- + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + return MACRO(T(DOT), T(DOT), T(DOT), T(MINS), T(DOT), T(DOT), T(MINS), T(SPACE), END); //...-..- + } + else { + return MACRO(T(DOT), T(DOT), T(DOT), T(DOT), T(MINS), T(SPACE), END); //....- + } } break; case 5: //Number 5 if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + } return MACRO(T(DOT), T(DOT), T(DOT), T(DOT), T(DOT), T(SPACE), END); //..... } break; case 6: //Number 6 if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + } return MACRO(T(MINS), T(DOT), T(DOT), T(DOT), T(DOT), T(SPACE), END); //-.... } break; - case 7: //Number 7 + case 7: //Number 7-& if (record->event.pressed) { - return MACRO(T(MINS), T(MINS), T(DOT), T(DOT), T(DOT), T(SPACE), END); //--... + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + return MACRO(T(DOT), T(MINS), T(DOT), T(DOT), T(DOT), T(SPACE), END); //.-... + } + else { + return MACRO(T(MINS), T(MINS), T(DOT), T(DOT), T(DOT), T(SPACE), END); //--... + } } break; case 8: //Number 8 if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + } return MACRO(T(MINS), T(MINS), T(MINS), T(DOT), T(DOT), T(SPACE), END); //---.. } break; - case 9: //Number 9 + case 9: //Number 9-( if (record->event.pressed) { - return MACRO(T(MINS), T(MINS), T(MINS), T(MINS), T(DOT), T(SPACE), END); //----. + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + return MACRO(T(MINS), T(DOT), T(MINS), T(MINS), T(DOT), T(SPACE), END); //-.--. + } + else { + return MACRO(T(MINS), T(MINS), T(MINS), T(MINS), T(DOT), T(SPACE), END); //----. + } } break; case 10: //Letter A @@ -526,96 +563,80 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 36: //Punctuation . if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + } return MACRO(T(DOT), T(MINS), T(DOT), T(MINS), T(DOT), T(MINS), T(SPACE), END); //.-.-.- } break; case 37: //Punctuation , if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + } return MACRO(T(MINS), T(MINS), T(DOT), T(DOT), T(MINS), T(MINS), T(SPACE), END); //--..-- } break; - case 38: //Punctuation ? - if (record->event.pressed) { - return MACRO(T(DOT), T(DOT), T(MINS), T(MINS), T(DOT), T(DOT), T(SPACE), END); //..--.. - } - break; - case 39: //Punctuation ' - if (record->event.pressed) { - return MACRO(T(DOT), T(MINS), T(MINS), T(MINS), T(MINS), T(DOT), T(SPACE), END); //-....- - } - break; - case 40: //Punctuation ! + case 38: //Punctuation '-" if (record->event.pressed) { - return MACRO(T(MINS), T(DOT), T(MINS), T(DOT), T(MINS), T(MINS), T(SPACE), END); //-.-.-- - } - break; - case 41: //Punctuation / - if (record->event.pressed) { - return MACRO(T(MINS), T(DOT), T(DOT), T(MINS), T(DOT), T(SPACE), END); //-..-. - } - break; - case 42: //Punctuation ( - if (record->event.pressed) { - return MACRO(T(MINS), T(DOT), T(MINS), T(MINS), T(DOT), T(SPACE), END); //-.--. - } - break; - case 43: //Punctuation ) - if (record->event.pressed) { - return MACRO(T(MINS), T(DOT), T(MINS), T(MINS), T(DOT), T(MINS), T(SPACE), END); //-.--.- - } - break; - case 44: //Punctuation & - if (record->event.pressed) { - return MACRO(T(DOT), T(MINS), T(DOT), T(DOT), T(DOT), T(SPACE), END); //.-... - } - break; - case 45: //Punctuation : - if (record->event.pressed) { - return MACRO(T(MINS), T(MINS), T(MINS), T(DOT), T(DOT), T(DOT), T(SPACE), END); //---... - } - break; - case 46: //Punctuation ; - if (record->event.pressed) { - return MACRO(T(MINS), T(DOT), T(MINS), T(DOT), T(MINS), T(DOT), T(SPACE), END); //-.-.-. - } - break; - case 47: //Punctuation = - if (record->event.pressed) { - return MACRO(T(MINS), T(DOT), T(DOT), T(DOT), T(MINS), T(SPACE), END); //-...- - } - break; - case 48: //Punctuation + - if (record->event.pressed) { - return MACRO(T(DOT), T(MINS), T(DOT), T(MINS), T(DOT), T(SPACE), END); //.-.-. + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + return MACRO(T(DOT), T(MINS), T(DOT), T(DOT), T(MINS), T(DOT), T(SPACE), END); //.-..-. + } + else { + return MACRO(T(DOT), T(MINS), T(MINS), T(MINS), T(MINS), T(DOT), T(SPACE), END); //-....- + } } break; - case 49: //Punctuation - + case 39: //Punctuation /-? if (record->event.pressed) { - return MACRO(T(MINS), T(DOT), T(DOT), T(DOT), T(DOT), T(MINS), T(SPACE), END); //-....- + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + return MACRO(T(DOT), T(DOT), T(MINS), T(MINS), T(DOT), T(DOT), T(SPACE), END); //..--.. + } + else { + return MACRO(T(MINS), T(DOT), T(DOT), T(MINS), T(DOT), T(SPACE), END); //-..-. + } } break; - case 50: //Punctuation " + case 40: //Punctuation ;-: if (record->event.pressed) { - return MACRO(T(DOT), T(MINS), T(DOT), T(DOT), T(MINS), T(DOT), T(SPACE), END); //.-..-. + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + return MACRO(T(MINS), T(MINS), T(MINS), T(DOT), T(DOT), T(DOT), T(SPACE), END); //---... + } + else { + return MACRO(T(MINS), T(DOT), T(MINS), T(DOT), T(MINS), T(DOT), T(SPACE), END); //-.-.-. + } } break; - case 51: //Punctuation $ + case 41: //Punctuation =-+ if (record->event.pressed) { - return MACRO(T(DOT), T(DOT), T(DOT), T(MINS), T(DOT), T(DOT), T(MINS), T(SPACE), END); //...-..- + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + return MACRO(T(DOT), T(MINS), T(DOT), T(MINS), T(DOT), T(SPACE), END); //.-.-. + } + else { + return MACRO(T(MINS), T(DOT), T(DOT), T(DOT), T(MINS), T(SPACE), END); //-...- + } } break; - case 52: //Punctuation @ + case 42: //Punctuation --_ if (record->event.pressed) { - return MACRO(T(DOT), T(MINS), T(MINS), T(DOT), T(MINS), T(DOT), T(SPACE), END); //.--.-. - } - break; - case 53: //Punctuation _ - if (record->event.pressed) { - return MACRO(T(DOT), T(DOT), T(MINS), T(MINS), T(DOT), T(MINS), T(SPACE), END); //..--.- + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + return MACRO(T(DOT), T(DOT), T(MINS), T(MINS), T(DOT), T(MINS), T(SPACE), END); //..--.- + } + else { + return MACRO(T(MINS), T(DOT), T(DOT), T(DOT), T(DOT), T(MINS), T(SPACE), END); //-....- + } } break; - case 54: //Morse Space + case 43: //Morse Space if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + } return MACRO(T(BSLS), T(SPACE), END); //When pressed, this sends a slash followed by a space, making it easier to distinguish words in Morse } break; -- cgit v1.2.3 From 1a0dfbbc96b32aeae27ace398282c18227fc4b4e Mon Sep 17 00:00:00 2001 From: Ante Laurijssen Date: Wed, 24 May 2017 21:15:41 -0400 Subject: More updates to keymap.c - still errors with midi when trying to compile --- keyboards/s60_x/keymaps/bluebear/keymap.c | 132 ++++++++++++++---------------- 1 file changed, 61 insertions(+), 71 deletions(-) (limited to 'keyboards/s60_x') diff --git a/keyboards/s60_x/keymaps/bluebear/keymap.c b/keyboards/s60_x/keymaps/bluebear/keymap.c index 32a65a5937..dfb0b966a3 100644 --- a/keyboards/s60_x/keymaps/bluebear/keymap.c +++ b/keyboards/s60_x/keymaps/bluebear/keymap.c @@ -161,9 +161,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ │ │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │TO(3)│TO(4)│ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - │CAPS │ │ │ │ │ │ │PGUP │ UP │HOME │ END │ │ INS │ DEL │█████│ + │ │ │ │ │ │ │ │PGUP │ UP │ │ │ │ INS │ DEL │█████│ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - │ │ │ │ │ │ │ │LEFT │DOWN │RIGHT│ │ │▒▒▒▒▒│ │█████│ + │CAPS │HOME │ │ END │ │ │ │LEFT │DOWN │RIGHT│ │ │▒▒▒▒▒│ │█████│ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │ │▒▒▒▒▒│ │ │ │ │ │SPACE│PGDN │PSCR │SLCK │PAUSE│▒▒▒▒▒│ │▒▒▒▒▒│ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ @@ -173,8 +173,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [ARROWFN] = KEYMAP( KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, TO(3), TO(4), \ - KC_CAPS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PGUP, KC_UP, KC_HOME, KC_END, KC_NO, KC_INS, KC_DEL, \ - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RIGHT, KC_NO, KC_NO, KC_NO, KC_TRNS, \ + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PGUP, KC_UP, KC_NO, KC_NO, KC_NO, KC_INS, KC_DEL, \ + KC_CAPS, KC_HOME, KC_NO, KC_END, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RIGHT, KC_NO, KC_NO, KC_NO, KC_TRNS, \ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_SPACE, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, KC_NO, KC_NO, KC_NO, \ KC_NO, KC_NO, KC_NO, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_TRNS ), @@ -644,74 +644,64 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { return MACRO_NONE; }; -/* // Midi Chord Function void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { -uint16_t root_note; -uint8_t channel = midi_config.channel; -uint8_t velocity = compute_velocity(midi_config.velocity); -switch (opt) { -case 0: //Root note C -root_note = MI_C; -case 1: //Root note C#/Db -root_note = MI_Cs; -case 2: // Root note D -root_note = MI_D; -case 3: // Root note D#/Eb -root_note = MI_Ds; -case 4: // Root note E -root_note = MI_E; -case 5: // Root note F -root_note = MI_F; -case 6: // Root note F#/Gb -root_note = MI_Fs; -case 7: // Root note G -root_note = MI_G; -case 8: // Root note G#/Ab -root_note = MI_Gs; -case 9: // Root note A -root_note = MI_A; -case 10: // Root note A#/Bb -root_note = MI_As; -case 11: // Root note B -root_note = MI_B; -switch (id) { -uint8_t tone = root_note - MIDI_TONE_MIN; -uint8_t root = midi_compute_note(root_note); -uint8_t major_third = midi_compute_note(root_note) + 4; -uint8_t minor_third = midi_compute_note(root_note) + 3; -uint8_t fifth = midi_compute_note(root_note) + 7; -case 0: //Major chord -if (record->event.pressed) { -midi_send_noteon(&midi_device, channel, root, velocity); -midi_send_noteon(&midi_device, channel, major_third, velocity); -midi_send_noteon(&midi_device, channel, fifth, velocity); -tone_status[tone] = root; -} -else { -uint8_t root = tone_status[tone]; -if (root != MIDI_INVALID_NOTE) -{ -midi_send_noteoff(&midi_device, channel, root, velocity); -} -tone_status[tone] = MIDI_INVALID_NOTE; -} -case 1: //Minor chord -if (record->event.pressed) { -midi_send_noteon(&midi_device, channel, root_note, velocity); -midi_send_noteon(&midi_device, channel, minor_third, velocity); -midi_send_noteon(&midi_device, channel, fifth, velocity); -} -else { -uint8_t root = tone_status[tone]; -if (root != MIDI_INVALID_NOTE) -{ -midi_send_noteoff(&midi_device, channel, root, velocity); -} -tone_status[tone] = MIDI_INVALID_NOTE; -} -} + uint16_t root_note; + uint8_t channel = midi_config.channel; + uint8_t velocity = compute_velocity(midi_config.velocity); + switch (opt) { + case 0: //Root note C + root_note = MI_C; + case 1: //Root note C#/Db + root_note = MI_Cs; + case 2: // Root note D + root_note = MI_D; + case 3: // Root note D#/Eb + root_note = MI_Ds; + case 4: // Root note E + root_note = MI_E; + case 5: // Root note F + root_note = MI_F; + case 6: // Root note F#/Gb + root_note = MI_Fs; + case 7: // Root note G + root_note = MI_G; + case 8: // Root note G#/Ab + root_note = MI_Gs; + case 9: // Root note A + root_note = MI_A; + case 10: // Root note A#/Bb + root_note = MI_As; + case 11: // Root note B + root_note = MI_B; + switch (id) { + uint8_t root = midi_compute_note(root_note); + uint8_t major_third = midi_compute_note(root_note) + 4; + uint8_t minor_third = midi_compute_note(root_note) + 3; + uint8_t fifth = midi_compute_note(root_note) + 7; + case 0: //Major chord + if (record->event.pressed) { + midi_send_noteon(&midi_device, channel, root, velocity); + midi_send_noteon(&midi_device, channel, major_third, velocity); + midi_send_noteon(&midi_device, channel, fifth, velocity); + } + else { + midi_send_noteoff(&midi_device, channel, root, velocity); + midi_send_noteoff(&midi_device, channel, major_third, velocity); + midi_send_noteoff(&midi_device, channel, fifth, velocity); + } + case 1: //Minor chord + if (record->event.pressed) { + midi_send_noteon(&midi_device, channel, root_note, velocity); + midi_send_noteon(&midi_device, channel, minor_third, velocity); + midi_send_noteon(&midi_device, channel, fifth, velocity); + } + else { + midi_send_noteoff(&midi_device, channel, root, velocity); + midi_send_noteoff(&midi_device, channel, minor_third, velocity); + midi_send_noteoff(&midi_device, channel, fifth, velocity); + } + } + } } -}; -*/ -- cgit v1.2.3 From b4b06f81b5024bb5963753edfc07f9e2e0054cfd Mon Sep 17 00:00:00 2001 From: Ante Laurijssen Date: Thu, 25 May 2017 23:03:33 -0400 Subject: More changes to keymap.c to try and get midi chords to work --- keyboards/s60_x/keymaps/bluebear/keymap.c | 160 ++++++++++++++++-------------- 1 file changed, 86 insertions(+), 74 deletions(-) (limited to 'keyboards/s60_x') diff --git a/keyboards/s60_x/keymaps/bluebear/keymap.c b/keyboards/s60_x/keymaps/bluebear/keymap.c index dfb0b966a3..2dc7500cdd 100644 --- a/keyboards/s60_x/keymaps/bluebear/keymap.c +++ b/keyboards/s60_x/keymaps/bluebear/keymap.c @@ -258,7 +258,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 0: //Number 0-) if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); return MACRO(T(MINS), T(DOT), T(MINS), T(MINS), T(DOT), T(MINS), T(SPACE), END); //-.--.- } else { @@ -269,7 +269,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 1: //Number 1-! if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); return MACRO(T(MINS), T(DOT), T(MINS), T(DOT), T(MINS), T(MINS), T(SPACE), END); //-.-.-- } else { @@ -280,7 +280,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 2: //Number 2-@ if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); return MACRO(T(DOT), T(MINS), T(MINS), T(DOT), T(MINS), T(DOT), T(SPACE), END); //.--.-. } else { @@ -291,7 +291,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 3: // Number 3 if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); } return MACRO(T(DOT), T(DOT), T(DOT), T(MINS), T(MINS), T(SPACE), END); //...-- } @@ -299,7 +299,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 4: //Number 4-$ if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); return MACRO(T(DOT), T(DOT), T(DOT), T(MINS), T(DOT), T(DOT), T(MINS), T(SPACE), END); //...-..- } else { @@ -310,7 +310,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 5: //Number 5 if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); } return MACRO(T(DOT), T(DOT), T(DOT), T(DOT), T(DOT), T(SPACE), END); //..... } @@ -318,7 +318,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 6: //Number 6 if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); } return MACRO(T(MINS), T(DOT), T(DOT), T(DOT), T(DOT), T(SPACE), END); //-.... } @@ -326,7 +326,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 7: //Number 7-& if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); return MACRO(T(DOT), T(MINS), T(DOT), T(DOT), T(DOT), T(SPACE), END); //.-... } else { @@ -337,7 +337,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 8: //Number 8 if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); } return MACRO(T(MINS), T(MINS), T(MINS), T(DOT), T(DOT), T(SPACE), END); //---.. } @@ -345,7 +345,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 9: //Number 9-( if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); return MACRO(T(MINS), T(DOT), T(MINS), T(MINS), T(DOT), T(SPACE), END); //-.--. } else { @@ -356,7 +356,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 10: //Letter A if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); } return MACRO(T(DOT), T(MINS), T(SPACE), END); //.- } @@ -364,7 +364,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 11: //Letter B if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); } return MACRO(T(MINS), T(DOT), T(DOT), T(DOT), T(SPACE), END); //-... } @@ -372,7 +372,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 12: //Letter C if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); } return MACRO(T(MINS), T(DOT), T(MINS), T(DOT), T(SPACE), END); //-.-. } @@ -380,7 +380,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 13: //Letter D if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); } return MACRO(T(MINS), T(DOT), T(DOT), T(SPACE), END); //-.. } @@ -388,7 +388,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 14: //Letter E if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); } return MACRO(T(DOT), T(SPACE), END); //. } @@ -396,7 +396,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 15: //Letter F if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); } return MACRO(T(DOT), T(DOT), T(MINS), T(DOT), T(SPACE), END); //..-. } @@ -404,7 +404,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 16: //Letter G if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); } return MACRO(T(MINS), T(MINS), T(DOT), T(SPACE), END); //--. } @@ -412,7 +412,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 17: //Letter H if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); } return MACRO(T(DOT), T(DOT), T(DOT), T(DOT), T(SPACE), END); //.... } @@ -420,7 +420,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 18: //Letter I if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); } return MACRO(T(DOT), T(DOT), T(SPACE), END); //.. } @@ -428,7 +428,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 19: //Letter J if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); } return MACRO(T(DOT), T(MINS), T(MINS), T(MINS), T(SPACE), END); //.--- } @@ -436,7 +436,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 20: //Letter K if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); } return MACRO(T(MINS), T(DOT), T(MINS), T(SPACE), END); //-.- } @@ -444,7 +444,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 21: //Letter L if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); } return MACRO(T(DOT), T(MINS), T(DOT), T(DOT), T(SPACE), END); //.-.. } @@ -452,7 +452,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 22: //Letter M if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); } return MACRO(T(MINS), T(MINS), T(SPACE), END); //-- } @@ -460,7 +460,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 23: //Letter N if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); } return MACRO(T(MINS), T(DOT), T(SPACE), END); //-. } @@ -468,7 +468,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 24: //Letter O if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); } return MACRO(T(MINS), T(MINS), T(MINS), T(SPACE), END); //--- } @@ -476,7 +476,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 25: //Letter P if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); } return MACRO(T(DOT), T(MINS), T(MINS), T(DOT), T(SPACE), END); //.--. } @@ -484,7 +484,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 26: //Letter Q if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); } return MACRO(T(MINS), T(MINS), T(DOT), T(MINS), T(SPACE), END); //--.- } @@ -492,7 +492,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 27: //Letter R if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); } return MACRO(T(DOT), T(MINS), T(DOT), T(SPACE), END); //.-. } @@ -500,7 +500,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 28: //Letter S if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); } return MACRO(T(DOT), T(DOT), T(DOT), T(SPACE), END); //... } @@ -508,7 +508,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 29: //Letter T if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); } return MACRO(T(MINS), T(SPACE), END); //- } @@ -516,7 +516,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 30: //Letter U if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); } return MACRO(T(DOT), T(DOT), T(MINS), T(SPACE), END); //..- } @@ -524,7 +524,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 31: //Letter V if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); } return MACRO(T(DOT), T(DOT), T(DOT), T(MINS), T(SPACE), END); //...- } @@ -532,7 +532,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 32: //Letter W if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); } return MACRO(T(DOT), T(MINS), T(MINS), T(SPACE), END); //.-- } @@ -540,7 +540,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 33: //Letter X if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); } return MACRO(T(MINS), T(DOT), T(DOT), T(MINS), T(SPACE), END); //-..- } @@ -548,7 +548,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 34: //Letter Y if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); } return MACRO(T(MINS), T(DOT), T(MINS), T(MINS), T(SPACE), END); //-.-- } @@ -556,7 +556,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 35: //Letter Z if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); } return MACRO(T(MINS), T(MINS), T(DOT), T(DOT), T(SPACE), END); //--.. } @@ -564,7 +564,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 36: //Punctuation . if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); } return MACRO(T(DOT), T(MINS), T(DOT), T(MINS), T(DOT), T(MINS), T(SPACE), END); //.-.-.- } @@ -572,7 +572,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 37: //Punctuation , if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); } return MACRO(T(MINS), T(MINS), T(DOT), T(DOT), T(MINS), T(MINS), T(SPACE), END); //--..-- } @@ -580,7 +580,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 38: //Punctuation '-" if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); return MACRO(T(DOT), T(MINS), T(DOT), T(DOT), T(MINS), T(DOT), T(SPACE), END); //.-..-. } else { @@ -591,7 +591,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 39: //Punctuation /-? if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); return MACRO(T(DOT), T(DOT), T(MINS), T(MINS), T(DOT), T(DOT), T(SPACE), END); //..--.. } else { @@ -602,7 +602,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 40: //Punctuation ;-: if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); return MACRO(T(MINS), T(MINS), T(MINS), T(DOT), T(DOT), T(DOT), T(SPACE), END); //---... } else { @@ -613,7 +613,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 41: //Punctuation =-+ if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); return MACRO(T(DOT), T(MINS), T(DOT), T(MINS), T(DOT), T(SPACE), END); //.-.-. } else { @@ -624,7 +624,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 42: //Punctuation --_ if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); return MACRO(T(DOT), T(DOT), T(MINS), T(MINS), T(DOT), T(MINS), T(SPACE), END); //..--.- } else { @@ -635,7 +635,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { case 43: //Morse Space if (record->event.pressed) { if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + clear_mods(); } return MACRO(T(BSLS), T(SPACE), END); //When pressed, this sends a slash followed by a space, making it easier to distinguish words in Morse } @@ -647,61 +647,73 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // Midi Chord Function void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - uint16_t root_note; - uint8_t channel = midi_config.channel; - uint8_t velocity = compute_velocity(midi_config.velocity); + uint16_t root_note = MIDI_INVALID_NOTE; switch (opt) { case 0: //Root note C root_note = MI_C; + break; case 1: //Root note C#/Db root_note = MI_Cs; + break; case 2: // Root note D root_note = MI_D; + break; case 3: // Root note D#/Eb root_note = MI_Ds; + break; case 4: // Root note E root_note = MI_E; + break; case 5: // Root note F root_note = MI_F; + break; case 6: // Root note F#/Gb root_note = MI_Fs; + break; case 7: // Root note G root_note = MI_G; + break; case 8: // Root note G#/Ab root_note = MI_Gs; + break; case 9: // Root note A root_note = MI_A; + break; case 10: // Root note A#/Bb root_note = MI_As; + break; case 11: // Root note B root_note = MI_B; - switch (id) { - uint8_t root = midi_compute_note(root_note); - uint8_t major_third = midi_compute_note(root_note) + 4; - uint8_t minor_third = midi_compute_note(root_note) + 3; - uint8_t fifth = midi_compute_note(root_note) + 7; - case 0: //Major chord - if (record->event.pressed) { - midi_send_noteon(&midi_device, channel, root, velocity); - midi_send_noteon(&midi_device, channel, major_third, velocity); - midi_send_noteon(&midi_device, channel, fifth, velocity); - } - else { - midi_send_noteoff(&midi_device, channel, root, velocity); - midi_send_noteoff(&midi_device, channel, major_third, velocity); - midi_send_noteoff(&midi_device, channel, fifth, velocity); - } - case 1: //Minor chord - if (record->event.pressed) { - midi_send_noteon(&midi_device, channel, root_note, velocity); - midi_send_noteon(&midi_device, channel, minor_third, velocity); - midi_send_noteon(&midi_device, channel, fifth, velocity); - } - else { - midi_send_noteoff(&midi_device, channel, root, velocity); - midi_send_noteoff(&midi_device, channel, minor_third, velocity); - midi_send_noteoff(&midi_device, channel, fifth, velocity); - } + break; + } + // uint8_t root = midi_compute_note(root_note); + uint8_t major_third = root_note + 4; + uint8_t minor_third = root_note + 3; + uint8_t fifth = root_note + 7; + switch (id) { + case 0: //Major chord + if (record->event.pressed) { + register_code16(root_note); + register_code16(major_third); + register_code16(fifth); } + else { + unregister_code16(root_note); + unregister_code16(major_third); + unregister_code16(fifth); + } + break; + case 1: //Minor chord + if (record->event.pressed) { + register_code16(root_note); + register_code16(minor_third); + register_code16(fifth); + } + else { + unregister_code16(root_note); + unregister_code16(minor_third); + unregister_code16(fifth); + } + break; } } -- cgit v1.2.3 From 6b1f707ce9431abfff6e6f8aa5730c77578fbc08 Mon Sep 17 00:00:00 2001 From: Ante Laurijssen Date: Fri, 26 May 2017 09:54:40 -0400 Subject: Still working on these MIDI CHORDS! --- keyboards/s60_x/keymaps/bluebear/Makefile | 4 ++-- keyboards/s60_x/keymaps/bluebear/keymap.c | 33 +++++++++---------------------- 2 files changed, 11 insertions(+), 26 deletions(-) (limited to 'keyboards/s60_x') diff --git a/keyboards/s60_x/keymaps/bluebear/Makefile b/keyboards/s60_x/keymaps/bluebear/Makefile index dfefad39da..a444eeb7f4 100644 --- a/keyboards/s60_x/keymaps/bluebear/Makefile +++ b/keyboards/s60_x/keymaps/bluebear/Makefile @@ -1,8 +1,8 @@ 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 = no # Commands for debug and configuration +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality MIDI_ENABLE = yes # MIDI controls diff --git a/keyboards/s60_x/keymaps/bluebear/keymap.c b/keyboards/s60_x/keymaps/bluebear/keymap.c index 2dc7500cdd..0047a87d31 100644 --- a/keyboards/s60_x/keymaps/bluebear/keymap.c +++ b/keyboards/s60_x/keymaps/bluebear/keymap.c @@ -184,7 +184,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ │RESET│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ │ │ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - │ │ │ │ │ │ │ │BTN1 │MS_UP│BTN2 │WH_UP│ │ │ │█████│ + │DEBUG│ │ │ │ │ │ │BTN1 │MS_UP│BTN2 │WH_UP│ │ │ │█████│ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │ │ │ │ │ │ │ │MS_LT│MS_DN│MS_RT│WH_DN│BTN3 │▒▒▒▒▒│ │█████│ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ @@ -197,7 +197,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [MOUSE] = KEYMAP( RESET, 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_NO, KC_NO, \ - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_BTN1, KC_MS_UP, KC_BTN2, KC_WH_U, KC_NO, KC_NO, KC_NO, \ + DEBUG, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_BTN1, KC_MS_UP, KC_BTN2, KC_WH_U, KC_NO, KC_NO, KC_NO, \ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_WH_D, KC_BTN3, KC_NO, KC_NO, \ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ KC_TRNS, KC_NO, KC_NO, KC_POWER, KC_NO, KC_NO, KC_NO, KC_NO @@ -646,7 +646,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // Midi Chord Function -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { +void action_function_opt(keyrecord_t *record, uint8_t id, uint8_t opt) { uint16_t root_note = MIDI_INVALID_NOTE; switch (opt) { case 0: //Root note C @@ -686,34 +686,19 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { root_note = MI_B; break; } - // uint8_t root = midi_compute_note(root_note); uint8_t major_third = root_note + 4; uint8_t minor_third = root_note + 3; uint8_t fifth = root_note + 7; switch (id) { case 0: //Major chord - if (record->event.pressed) { - register_code16(root_note); - register_code16(major_third); - register_code16(fifth); - } - else { - unregister_code16(root_note); - unregister_code16(major_third); - unregister_code16(fifth); - } + process_midi(root_note, record); + process_midi(major_third, record); + process_midi(fifth, record); break; case 1: //Minor chord - if (record->event.pressed) { - register_code16(root_note); - register_code16(minor_third); - register_code16(fifth); - } - else { - unregister_code16(root_note); - unregister_code16(minor_third); - unregister_code16(fifth); - } + process_midi(root_note, record); + process_midi(minor_third, record); + process_midi(fifth, record); break; } } -- cgit v1.2.3 From a5846757359a27f9e5ed67cfe96f1d92e72b1b4b Mon Sep 17 00:00:00 2001 From: Ante Laurijssen Date: Sun, 28 May 2017 08:14:17 -0400 Subject: Midi Chord Function is now working! But some chords lag... --- keyboards/s60_x/keymaps/bluebear/Makefile | 4 +- keyboards/s60_x/keymaps/bluebear/keymap.c | 166 ++++++++++++++++++++++-------- 2 files changed, 124 insertions(+), 46 deletions(-) (limited to 'keyboards/s60_x') diff --git a/keyboards/s60_x/keymaps/bluebear/Makefile b/keyboards/s60_x/keymaps/bluebear/Makefile index a444eeb7f4..dfefad39da 100644 --- a/keyboards/s60_x/keymaps/bluebear/Makefile +++ b/keyboards/s60_x/keymaps/bluebear/Makefile @@ -1,8 +1,8 @@ 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 = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality MIDI_ENABLE = yes # MIDI controls diff --git a/keyboards/s60_x/keymaps/bluebear/keymap.c b/keyboards/s60_x/keymaps/bluebear/keymap.c index 0047a87d31..3be39c3fa2 100644 --- a/keyboards/s60_x/keymaps/bluebear/keymap.c +++ b/keyboards/s60_x/keymaps/bluebear/keymap.c @@ -37,47 +37,90 @@ enum midi_chord_root { //ACTION_FUNCTION opt B, }; -enum midi_chord_keycodes { +enum midi_chord_id { //ACTION_FUNCTION Progmem Id //Major Chords - MI_CH_C = ACTION_FUNCTION_OPT(major,C), - MI_CH_Cs = ACTION_FUNCTION_OPT(major,Cs), + CMajor, + CsMajor, + DbMajor = CsMajor, + DMajor, + DsMajor, + EbMajor = DsMajor, + EMajor, + FMajor, + FsMajor, + GbMajor = FsMajor, + GMajor, + GsMajor, + AbMajor = GsMajor, + AMajor, + AsMajor, + BbMajor = AsMajor, + BMajor, + + //Minor Chords + + CMinor, + CsMinor, + DbMinor = CsMinor, + DMinor, + DsMinor, + EbMinor = DsMinor, + EMinor, + FMinor, + FsMinor, + GbMinor = FsMinor, + GMinor, + GsMinor, + AbMinor = GsMinor, + AMinor, + AsMinor, + BbMinor = AsMinor, + BMinor, +}; + +enum midi_chord_keycodes { //Midi Chocd Keycodes + + //Major Chord Keycodes + + MI_CH_C = F(CMajor), + MI_CH_Cs = F(CsMajor), MI_CH_Db = MI_CH_Cs, - MI_CH_D = ACTION_FUNCTION_OPT(major,D), - MI_CH_Ds = ACTION_FUNCTION_OPT(major,Ds), + MI_CH_D = F(DMajor), + MI_CH_Ds = F(DsMajor), MI_CH_Eb = MI_CH_Ds, - MI_CH_E = ACTION_FUNCTION_OPT(major,E), - MI_CH_F = ACTION_FUNCTION_OPT(major,F), - MI_CH_Fs = ACTION_FUNCTION_OPT(major,Fs), + MI_CH_E = F(EMajor), + MI_CH_F = F(FMajor), + MI_CH_Fs = F(FsMajor), MI_CH_Gb = MI_CH_Fs, - MI_CH_G = ACTION_FUNCTION_OPT(major,G), - MI_CH_Gs = ACTION_FUNCTION_OPT(major,Gs), + MI_CH_G = F(GMajor), + MI_CH_Gs = F(GsMajor), MI_CH_Ab = MI_CH_Gs, - MI_CH_A = ACTION_FUNCTION_OPT(major,A), - MI_CH_As = ACTION_FUNCTION_OPT(major,As), + MI_CH_A = F(AMajor), + MI_CH_As = F(AsMajor), MI_CH_Bb = MI_CH_As, - MI_CH_B = ACTION_FUNCTION_OPT(major,B), + MI_CH_B = F(BMajor), - //Minor Chords + //Minor Chord Keycodes - MI_CH_Cm = ACTION_FUNCTION_OPT(minor,C), - MI_CH_Csm = ACTION_FUNCTION_OPT(minor,Cs), + MI_CH_Cm = F(CMinor), + MI_CH_Csm = F(CsMinor), MI_CH_Dbm = MI_CH_Csm, - MI_CH_Dm = ACTION_FUNCTION_OPT(minor,D), - MI_CH_Dsm = ACTION_FUNCTION_OPT(minor,Ds), + MI_CH_Dm = F(DMinor), + MI_CH_Dsm = F(DsMinor), MI_CH_Ebm = MI_CH_Dsm, - MI_CH_Em = ACTION_FUNCTION_OPT(minor,E), - MI_CH_Fm = ACTION_FUNCTION_OPT(minor,F), - MI_CH_Fsm = ACTION_FUNCTION_OPT(minor,Fs), + MI_CH_Em = F(EMinor), + MI_CH_Fm = F(FMinor), + MI_CH_Fsm = F(FsMinor), MI_CH_Gbm = MI_CH_Fsm, - MI_CH_Gm = ACTION_FUNCTION_OPT(minor,G), - MI_CH_Gsm= ACTION_FUNCTION_OPT(minor,Gs), + MI_CH_Gm = F(GMinor), + MI_CH_Gsm = F(GsMinor), MI_CH_Abm = MI_CH_Gsm, - MI_CH_Am = ACTION_FUNCTION_OPT(minor,A), - MI_CH_Asm = ACTION_FUNCTION_OPT(minor,As), + MI_CH_Am = F(AMinor), + MI_CH_Asm = F(AsMinor), MI_CH_Bbm = MI_CH_Asm, - MI_CH_Bm = ACTION_FUNCTION_OPT(minor,B), + MI_CH_Bm = F(BMinor), }; //Morse Code Macro Keys @@ -646,56 +689,91 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // Midi Chord Function -void action_function_opt(keyrecord_t *record, uint8_t id, uint8_t opt) { +const uint16_t PROGMEM fn_actions[] = { + + //Major Chords + + [CMajor] = ACTION_FUNCTION_OPT(major, C), + [CsMajor] = ACTION_FUNCTION_OPT(major, Cs), + [DMajor] = ACTION_FUNCTION_OPT(major, D), + [DsMajor] = ACTION_FUNCTION_OPT(major, Ds), + [EMajor] = ACTION_FUNCTION_OPT(major, E), + [FMajor] = ACTION_FUNCTION_OPT(major, F), + [FsMajor] = ACTION_FUNCTION_OPT(major, Fs), + [GMajor] = ACTION_FUNCTION_OPT(major, G), + [GsMajor] = ACTION_FUNCTION_OPT(major, Gs), + [AMajor] = ACTION_FUNCTION_OPT(major, A), + [AsMajor] = ACTION_FUNCTION_OPT(major, As), + [BMajor] = ACTION_FUNCTION_OPT(major, B), + + //Minor Chords + + [CMinor] = ACTION_FUNCTION_OPT(minor, C), + [CsMinor] = ACTION_FUNCTION_OPT(minor, Cs), + [DMinor] = ACTION_FUNCTION_OPT(minor, D), + [DsMinor] = ACTION_FUNCTION_OPT(minor, Ds), + [EMinor] = ACTION_FUNCTION_OPT(minor, E), + [FMinor] = ACTION_FUNCTION_OPT(minor, F), + [FsMinor] = ACTION_FUNCTION_OPT(minor, Fs), + [GMinor] = ACTION_FUNCTION_OPT(minor, G), + [GsMinor] = ACTION_FUNCTION_OPT(minor, Gs), + [AMinor] = ACTION_FUNCTION_OPT(minor, A), + [AsMinor] = ACTION_FUNCTION_OPT(minor, As), + [BMinor] = ACTION_FUNCTION_OPT(minor, B), +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { uint16_t root_note = MIDI_INVALID_NOTE; switch (opt) { - case 0: //Root note C + case C: //Root note C root_note = MI_C; break; - case 1: //Root note C#/Db + case Cs: //Root note C#/Db root_note = MI_Cs; break; - case 2: // Root note D + case D: // Root note D root_note = MI_D; break; - case 3: // Root note D#/Eb + case Ds: // Root note D#/Eb root_note = MI_Ds; break; - case 4: // Root note E + case E: // Root note E root_note = MI_E; break; - case 5: // Root note F + case F: // Root note F root_note = MI_F; break; - case 6: // Root note F#/Gb + case Fs: // Root note F#/Gb root_note = MI_Fs; break; - case 7: // Root note G + case G: // Root note G root_note = MI_G; break; - case 8: // Root note G#/Ab + case Gs: // Root note G#/Ab root_note = MI_Gs; break; - case 9: // Root note A + case A: // Root note A root_note = MI_A; break; - case 10: // Root note A#/Bb + case As: // Root note A#/Bb root_note = MI_As; break; - case 11: // Root note B + case B: // Root note B root_note = MI_B; break; } - uint8_t major_third = root_note + 4; - uint8_t minor_third = root_note + 3; - uint8_t fifth = root_note + 7; + uint16_t major_third = root_note + 4; + uint16_t minor_third = root_note + 3; + uint16_t fifth = root_note + 7; switch (id) { - case 0: //Major chord + case major: //Major chord + dprintf("Root Note:%d - Major Third:%d - Fifth:%d\n", root_note, major_third, fifth); process_midi(root_note, record); process_midi(major_third, record); process_midi(fifth, record); break; - case 1: //Minor chord + case minor: //Minor chord + dprintf("Root Note:%d - Minor Third:%d - Fifth:%d\n", root_note, minor_third, fifth); process_midi(root_note, record); process_midi(minor_third, record); process_midi(fifth, record); -- cgit v1.2.3 From 4c48c29c0e65f66f95290a6f056d0af5b3cc5ab0 Mon Sep 17 00:00:00 2001 From: Ante Laurijssen Date: Mon, 29 May 2017 22:09:06 -0400 Subject: Added MIDI_CHORD layer and other little fixes. Updated readme.md --- .../bluebear/S60X-Bluebear-ARROWFN-Layer.png | Bin 17938 -> 18499 bytes .../keymaps/bluebear/S60X-Bluebear-MIDI-Layer.png | Bin 21329 -> 0 bytes .../keymaps/bluebear/S60X-Bluebear-MOUSE-Layer.png | Bin 16119 -> 16499 bytes keyboards/s60_x/keymaps/bluebear/keymap.c | 195 ++++++++++++++++++--- keyboards/s60_x/keymaps/bluebear/readme.md | 60 ++++++- 5 files changed, 226 insertions(+), 29 deletions(-) delete mode 100644 keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MIDI-Layer.png (limited to 'keyboards/s60_x') diff --git a/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-ARROWFN-Layer.png b/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-ARROWFN-Layer.png index a7c6df5044..1f659d184d 100644 Binary files a/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-ARROWFN-Layer.png and b/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-ARROWFN-Layer.png differ diff --git a/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MIDI-Layer.png b/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MIDI-Layer.png deleted file mode 100644 index c8df0a9e9e..0000000000 Binary files a/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MIDI-Layer.png and /dev/null differ diff --git a/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MOUSE-Layer.png b/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MOUSE-Layer.png index c74348389d..4e92a60c76 100644 Binary files a/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MOUSE-Layer.png and b/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MOUSE-Layer.png differ diff --git a/keyboards/s60_x/keymaps/bluebear/keymap.c b/keyboards/s60_x/keymaps/bluebear/keymap.c index 3be39c3fa2..44ebb5aada 100644 --- a/keyboards/s60_x/keymaps/bluebear/keymap.c +++ b/keyboards/s60_x/keymaps/bluebear/keymap.c @@ -3,11 +3,12 @@ // Keyboard Layers enum keyboard_layers { - BASE, //Base Layer - ARROWFN, //Arrow/FN Layer - MOUSE, //Mouse Layer - MIDI, //Midi Layer - MORSE, //Morse Code Layer + BASE, //Base Layer + ARROWFN, //Arrow/FN Layer + MOUSE, //Mouse Layer + MIDI_BASE, //Midi Layer + MIDI_CHORDS, //Midi Chord Layer + MORSE, //Morse Code Layer }; // Midi Chords @@ -15,6 +16,8 @@ enum keyboard_layers { enum midi_chord_modes { //ACTION_FUNCTION id major, minor, + dom_seventh, + dim_seventh, }; enum midi_chord_root { //ACTION_FUNCTION opt @@ -78,6 +81,46 @@ enum midi_chord_id { //ACTION_FUNCTION Progmem Id AsMinor, BbMinor = AsMinor, BMinor, + + //Dominant Seventh Chords + + CDom7, + CsDom7, + DbDom7 = CsDom7, + DDom7, + DsDom7, + EbDom7 = DsDom7, + EDom7, + FDom7, + FsDom7, + GbDom7 = FsDom7, + GDom7, + GsDom7, + AbDom7 = GsDom7, + ADom7, + AsDom7, + BbDom7 = AsDom7, + BDom7, + + //Diminished Seventh Chords + + CDim7, + CsDim7, + DbDim7 = CsDim7, + DDim7, + DsDim7, + EbDim7 = DsDim7, + EDim7, + FDim7, + FsDim7, + GbDim7 = FsDim7, + GDim7, + GsDim7, + AbDim7 = GsDim7, + ADim7, + AsDim7, + BbDim7 = AsDim7, + BDim7, }; enum midi_chord_keycodes { //Midi Chocd Keycodes @@ -121,6 +164,46 @@ enum midi_chord_keycodes { //Midi Chocd Keycodes MI_CH_Asm = F(AsMinor), MI_CH_Bbm = MI_CH_Asm, MI_CH_Bm = F(BMinor), + + //Dominant Seventh Keycodes + + MI_CH_CDom7 = F(CDom7), + MI_CH_CsDom7 = F(CsDom7), + MI_CH_DbDom7 = MI_CH_CsDom7, + MI_CH_DDom7 = F(DDom7), + MI_CH_DsDom7 = F(DsDom7), + MI_CH_EbDom7 = MI_CH_DsDom7, + MI_CH_EDom7 = F(EDom7), + MI_CH_FDom7 = F(FDom7), + MI_CH_FsDom7 = F(FsDom7), + MI_CH_GbDom7 = MI_CH_FsDom7, + MI_CH_GDom7 = F(GDom7), + MI_CH_GsDom7 = F(GsDom7), + MI_CH_AbDom7 = MI_CH_GsDom7, + MI_CH_ADom7 = F(ADom7), + MI_CH_AsDom7 = F(AsDom7), + MI_CH_BbDom7 = MI_CH_AsDom7, + MI_CH_BDom7 = F(BDom7), + + //Diminished Seventh Keycodes + + MI_CH_CDim7 = F(CDim7), + MI_CH_CsDim7 = F(CsDim7), + MI_CH_DbDim7 = MI_CH_CsDim7, + MI_CH_DDim7 = F(DDim7), + MI_CH_DsDim7 = F(DsDim7), + MI_CH_EbDim7 = MI_CH_DsDim7, + MI_CH_EDim7 = F(EDim7), + MI_CH_FDim7 = F(FDim7), + MI_CH_FsDim7 = F(FsDim7), + MI_CH_GbDim7 = MI_CH_FsDim7, + MI_CH_GDim7 = F(GDim7), + MI_CH_GsDim7 = F(GsDim7), + MI_CH_AbDim7 = MI_CH_GsDim7, + MI_CH_ADim7 = F(ADim7), + MI_CH_AsDim7 = F(AsDim7), + MI_CH_BbDim7 = MI_CH_AsDim7, + MI_CH_BDim7 = F(BDim7), }; //Morse Code Macro Keys @@ -202,7 +285,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* 1: Arrow/FN Layer ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - │ │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │TO(3)│TO(4)│ + │ │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │TO(3)│TO(5)│ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │ │ │ │ │ │ │ │PGUP │ UP │ │ │ │ INS │ DEL │█████│ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ @@ -215,7 +298,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [ARROWFN] = KEYMAP( - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, TO(3), TO(4), \ + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, TO(3), TO(5), \ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PGUP, KC_UP, KC_NO, KC_NO, KC_NO, KC_INS, KC_DEL, \ KC_CAPS, KC_HOME, KC_NO, KC_END, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RIGHT, KC_NO, KC_NO, KC_NO, KC_TRNS, \ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_SPACE, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, KC_NO, KC_NO, KC_NO, \ @@ -225,7 +308,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* 2: Mouse Keys Layer ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - │RESET│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ │ │ + │RESET│ F13 │ F14 │ F15 │ F16 │ F17 │ F18 │ F19 │ F20 │ F21 │ F22 │ F23 │ F24 │ │ │ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │DEBUG│ │ │ │ │ │ │BTN1 │MS_UP│BTN2 │WH_UP│ │ │ │█████│ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ @@ -239,37 +322,60 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [MOUSE] = KEYMAP( - RESET, 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_NO, KC_NO, \ + RESET, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_NO, KC_NO, \ DEBUG, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_BTN1, KC_MS_UP, KC_BTN2, KC_WH_U, KC_NO, KC_NO, KC_NO, \ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_WH_D, KC_BTN3, KC_NO, KC_NO, \ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ KC_TRNS, KC_NO, KC_NO, KC_POWER, KC_NO, KC_NO, KC_NO, KC_NO ), - /* 3: Midi Layer + /* 3: Midi Base Layer ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - │TO(0)│ Cmaj│ Gmaj│ Dmaj│ Amaj│ Emaj│ Bmaj│Gbmaj│Dbmaj│Abmaj│Ebmaj│Bbmaj│ Fmaj│ │ │ + │TO(0)│ Cmaj│ Gmaj│ Dmaj│ Amaj│ Emaj│ Bmaj│Gbmaj│Dbmaj│Abmaj│Ebmaj│Bbmaj│ Fmaj│ │TO(4)│ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - │ │ │ C# │ D# │ │ F# │ G# │ A# │ │ C# │ D# │ │ │ │█████│ + │OCT+ │ │ C# │ D# │ │ F# │ G# │ A# │ │ C# │ D# │ │ │ │█████│ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - │OCT- │ C │ D │ E │ F │ G │ A │ B │ C │ D │ E │ F │▒▒▒▒▒│OCT+ │█████│ + │OCT- │ C │ D │ E │ F │ G │ A │ B │ C │ D │ E │ F │▒▒▒▒▒│ │█████│ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - │ Am │▒▒▒▒▒│ Em │ Bm │ F#m │ C#m │ G#m │ D#m │ Bbm │ Fm │ Cm │ Gm │▒▒▒▒▒│ Dm │▒▒▒▒▒│ + │ Cm │▒▒▒▒▒│ Gm │ Dm │ Am │ Em │ Bm │ Gbm │ Dbm │ Abm │ Ebm │ Bbm │▒▒▒▒▒│ Fm │▒▒▒▒▒│ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │ │ │ │█████│█████│█████│A-OFF│█████│█████│█████│ │ │ │ │█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - [MIDI] = KEYMAP( - TO(0), MI_CH_C, MI_CH_G, MI_CH_D, MI_CH_A, MI_CH_E, MI_CH_B, MI_CH_Gb, MI_CH_Db, MI_CH_Ab, MI_CH_Eb, MI_CH_Bb, MI_CH_F, KC_NO, KC_NO, \ - KC_NO, KC_NO, MI_Cs, MI_Ds, KC_NO, MI_Fs, MI_Gs, MI_As, KC_NO, MI_Cs_1, MI_Ds_1, KC_NO, KC_NO, KC_NO, \ - MI_OCTD, MI_C, MI_D, MI_E, MI_F, MI_G, MI_A, MI_B, MI_C_1, MI_D_1, MI_E_1, MI_F_1, KC_NO, MI_OCTU, \ - MI_CH_Am, KC_NO, MI_CH_Em, MI_CH_Bm, MI_CH_Fsm, MI_CH_Csm, MI_CH_Gsm, MI_CH_Dsm, MI_CH_Bbm, MI_CH_Fm, MI_CH_Cm, MI_CH_Gm, KC_NO, MI_CH_Dm, KC_NO, \ - KC_NO, KC_NO, KC_NO, MI_ALLOFF, KC_NO, KC_NO, KC_NO, KC_NO - ), + [MIDI_BASE] = KEYMAP( + TO(0), MI_CH_C, MI_CH_G, MI_CH_D, MI_CH_A, MI_CH_E, MI_CH_B, MI_CH_Gb, MI_CH_Db, MI_CH_Ab, MI_CH_Eb, MI_CH_Bb, MI_CH_F, KC_NO, TO(4), \ + MI_OCTU, KC_NO, MI_Cs, MI_Ds, KC_NO, MI_Fs, MI_Gs, MI_As, KC_NO, MI_Cs_1, MI_Ds_1, KC_NO, KC_NO, KC_NO, \ + MI_OCTD, MI_C, MI_D, MI_E, MI_F, MI_G, MI_A, MI_B, MI_C_1, MI_D_1, MI_E_1, MI_F_1, KC_NO, KC_NO, \ + MI_CH_Cm, KC_NO, MI_CH_Gm, MI_CH_Dm, MI_CH_Am, MI_CH_Em, MI_CH_Bm, MI_CH_Gbm, MI_CH_Dbm, MI_CH_Abm, MI_CH_Ebm, MI_CH_Bbm, KC_NO, MI_CH_Fm, KC_NO, \ + KC_NO, KC_NO, KC_NO, MI_ALLOFF, KC_NO, KC_NO, KC_NO, KC_NO + ), + + /* 4: Midi Chord Layer - /* 4: Morse Code Layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │TO(0)│ Cmaj│ Gmaj│ Dmaj│ Amaj│ Emaj│ Bmaj│Gbmaj│Dbmaj│Abmaj│Ebmaj│Bbmaj│ Fmaj│TO(3)│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │OCT+ │ Cm │ Gm │ Dm │ Am │ Em │ Bbm │ Gbm │ Dbm │ Abm │ Ebm │ Bbm │ Fm │ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │OCT- │Cdom7│Gdom7│Ddom7│Adom7│Edom7│Bdom7│Gbdo7│Dbdo7│Abdo7│Ebdo7│Bbdo7│▒▒▒▒▒│Fdom7│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Cdim7│▒▒▒▒▒│Gdim7│Ddim7│Adim7│Edim7│Bdim7│Gbdi7│Dbdi7│Abdi7│Ebdi7│Bbdi7│▒▒▒▒▒│Fdim7│▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │█████│█████│█████│A-OFF│█████│█████│█████│ │ │ │ │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + [MIDI_CHORDS] = KEYMAP( + TO(0), MI_CH_C, MI_CH_G, MI_CH_D, MI_CH_A, MI_CH_E, MI_CH_B, MI_CH_Gb, MI_CH_Db, MI_CH_Ab, MI_CH_Eb, MI_CH_Bb, MI_CH_F, TO(3), KC_NO, \ + MI_OCTU, MI_CH_Cm, MI_CH_Gm, MI_CH_Dm, MI_CH_Am, MI_CH_Em, MI_CH_Bbm, MI_CH_Gbm, MI_CH_Dbm, MI_CH_Abm, MI_CH_Ebm, MI_CH_Bbm, MI_CH_Fm, KC_NO, \ + MI_OCTD, MI_CH_CDom7, MI_CH_GDom7, MI_CH_DDom7, MI_CH_ADom7, MI_CH_EDom7, MI_CH_BDom7, MI_CH_GbDom7, MI_CH_DbDom7, MI_CH_AbDom7, MI_CH_EbDom7, MI_CH_BbDom7, KC_NO, MI_CH_FDom7, \ + MI_CH_CDim7, KC_NO, MI_CH_GDim7, MI_CH_DDim7, MI_CH_ADim7, MI_CH_EDim7, MI_CH_BDim7, MI_CH_GbDim7, MI_CH_DbDim7, MI_CH_AbDim7, MI_CH_EbDim7, MI_CH_BbDim7, KC_NO, MI_CH_FDim7, KC_NO, \ + KC_NO, KC_NO, KC_NO, MI_ALLOFF, KC_NO, KC_NO, KC_NO, KC_NO + ), + + /* 5: Morse Code Layer ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ │TO(0)│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ │ │ │ │ @@ -720,6 +826,36 @@ const uint16_t PROGMEM fn_actions[] = { [AMinor] = ACTION_FUNCTION_OPT(minor, A), [AsMinor] = ACTION_FUNCTION_OPT(minor, As), [BMinor] = ACTION_FUNCTION_OPT(minor, B), + + //Dominant 7th + + [CDom7] = ACTION_FUNCTION_OPT(dom_seventh, C), + [CsDom7] = ACTION_FUNCTION_OPT(dom_seventh, Cs), + [DDom7] = ACTION_FUNCTION_OPT(dom_seventh, D), + [DsDom7] = ACTION_FUNCTION_OPT(dom_seventh, Ds), + [EDom7] = ACTION_FUNCTION_OPT(dom_seventh, E), + [FDom7] = ACTION_FUNCTION_OPT(dom_seventh, F), + [FsDom7] = ACTION_FUNCTION_OPT(dom_seventh, Fs), + [GDom7] = ACTION_FUNCTION_OPT(dom_seventh, G), + [GsDom7] = ACTION_FUNCTION_OPT(dom_seventh, Gs), + [ADom7] = ACTION_FUNCTION_OPT(dom_seventh, A), + [AsDom7] = ACTION_FUNCTION_OPT(dom_seventh, As), + [BDom7] = ACTION_FUNCTION_OPT(dom_seventh, B), + + //Diminished 7th + + [CDim7] = ACTION_FUNCTION_OPT(dim_seventh, C), + [CsDim7] = ACTION_FUNCTION_OPT(dim_seventh, Cs), + [DDim7] = ACTION_FUNCTION_OPT(dim_seventh, D), + [DsDim7] = ACTION_FUNCTION_OPT(dim_seventh, Ds), + [EDim7] = ACTION_FUNCTION_OPT(dim_seventh, E), + [FDim7] = ACTION_FUNCTION_OPT(dim_seventh, F), + [FsDim7] = ACTION_FUNCTION_OPT(dim_seventh, Fs), + [GDim7] = ACTION_FUNCTION_OPT(dim_seventh, G), + [GsDim7] = ACTION_FUNCTION_OPT(dim_seventh, Gs), + [ADim7] = ACTION_FUNCTION_OPT(dim_seventh, A), + [AsDim7] = ACTION_FUNCTION_OPT(dim_seventh, As), + [BDim7] = ACTION_FUNCTION_OPT(dim_seventh, B), }; void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { @@ -764,19 +900,30 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { } uint16_t major_third = root_note + 4; uint16_t minor_third = root_note + 3; + //uint16_t flat_fifth = root_note + 6; uint16_t fifth = root_note + 7; + uint16_t minor_seventh = root_note + 10; + uint16_t diminished_seventh = root_note -3; switch (id) { case major: //Major chord - dprintf("Root Note:%d - Major Third:%d - Fifth:%d\n", root_note, major_third, fifth); process_midi(root_note, record); process_midi(major_third, record); process_midi(fifth, record); break; case minor: //Minor chord - dprintf("Root Note:%d - Minor Third:%d - Fifth:%d\n", root_note, minor_third, fifth); process_midi(root_note, record); process_midi(minor_third, record); process_midi(fifth, record); break; + case dom_seventh: //Dominant Seventh chord + process_midi(root_note, record); + process_midi(major_third, record); + process_midi(minor_seventh, record); + break; + case dim_seventh: //Diminished Seventh Chord + process_midi(root_note, record); + process_midi(minor_third, record); + process_midi(diminished_seventh, record); + break; } } diff --git a/keyboards/s60_x/keymaps/bluebear/readme.md b/keyboards/s60_x/keymaps/bluebear/readme.md index 579683abcb..9a70cde96a 100644 --- a/keyboards/s60_x/keymaps/bluebear/readme.md +++ b/keyboards/s60_x/keymaps/bluebear/readme.md @@ -1,25 +1,75 @@ -## Bluebear’s custom S60X layout +# Bluebear’s custom S60X layout Custom keyboard layout for my S60X, my first ever custom mechanical keyboard kit. This layout was inspired in part by the HHKB line of keyboards and a quest to find the perfect ergonomic, logical layout for what I do. If you like this layout, please feel free to use it, modify it and share it. -## Base Layer +## BASE Layer +![BASE Layer](S60X-Bluebear-BASE-Layer.png) + +-Dvorak keyboard layout -Hold left control key for LCTL, and tap it for ESC -Hold enter key for RCTL and tap for ENT --Hold the space key to momentarily switch to [ARROW] layer --Left bottom key acts as momentary switch to the [MOUSE] layer +-Hold the space key to momentarily switch to ARROWFN layer +-Left bottom key acts as momentary switch to the MOUSE layer -Hold right alt key for AltGr and tap for APP(which I have mapped to Compose in OS) -Hold left shift key for LSFT and tap for ( (Space Cadet style) -Hold right shift key for RSFT and tap for ) (Space Cadet style) -Tap key on bottom row, second from the right (where APP usually is) to get CTL-Shift (one shot modifier - next key pressed will be modified by ctl-shift) -Tap key on bottom right to get CTL-Alt (one shot modifier - next key pressed will be modified by ctl-alt) -## Mouse Layer +## ARROWFN Layer + +![ARROWFN Layer](S60X-Bluebear-ARROWFN-Layer.png) + +-Number row becomes F1 to F12 +-C, T, H, N keys become Up, Down, Left, Right +-Access to various other keys normally found on a full sized keyboard +-Top right button toggles MORSE layer +-Second from right, top row, toggles MIDI_BASE layer +## MOUSE Layer + +![MOUSE Layer](S60X-Bluebear-MOUSE-Layer.png) + +-Move the mouse with mouse keys -Hitting the escape key in this layer will give RESET, which puts the controller into dfu mode for flashing firmware onto it -Hitting the space key in this layer is like hitting power button on computer +-Hitting the tab button toggles caps lock +-Number row becomes F13 to F24 + +## MIDI_BASE Layer + +![MIDI_BASE Layer](S60X-Bluebear-MIDI_BASE-Layer.png) + +This layer was inspired by the Satan Midi layout (https://github.com/qmk/qmk_firmware/tree/master/keyboards/satan/keymaps/midi) and gives access to basic MIDI notes. What I added were two layers of MIDI chords (major and minor triads) arranged in a circle of fifths pattern. Thanks to @fredizzimo for helping me with the code for these chords. + +-Top right button toggles MORSE_CHORDS layer +-Escape brings you back to the BASE layer + +## MIDI_CHORDS Layer + +![MIDI_CHORDS Layer](S60X-Bluebear-MIDI_CHORDS-Layer.png) + +After figuring out how to code my MIDI chord function, I decided to dedicate a full layer to these chords. This chord layout was inspired by the Stradella Base system (https://en.wikipedia.org/wiki/Stradella_bass_system) found on accordions. This layer is a tool for musical composition and songwriting. + +-Second from right, top row, toggles MIDI_BASE layer +-Escape brings you back to the BASE layer + +## MORSE LAYER + +![MORSE Layer](S60X-Bluebear-MORSE-Layer.png) + +This layer is really just for fun, and because I am a ham radio operator and morse code enthusiast. Hitting the alphanumerical keys in this layer will send a series of dits (.) and dahs (-) representing that character in morse code. + +-Escape brings you back to the BASE layer + +### THIS IS STILL A WORK IN PROGRESS + +This keyboard layout is still a work in progress and there are a couple of kinks left to iron out. But it is still very usable and the midi and morse code layers are lots of fun to use. Please feel free to use, share and improve all, or part of this layout. + + -- cgit v1.2.3 From 1ef911d150e361668be72e0082ade728a199e889 Mon Sep 17 00:00:00 2001 From: Ante Laurijssen Date: Mon, 29 May 2017 22:11:48 -0400 Subject: Added a few images --- .../bluebear/120-button_Stradella_chart.svg | 5190 ++++++++++++++++++++ .../bluebear/S60X-Bluebear-MIDI_BASE-Layer.png | Bin 0 -> 22521 bytes .../bluebear/S60X-Bluebear-MIDI_CHORD-Layer.png | Bin 0 -> 23687 bytes 3 files changed, 5190 insertions(+) create mode 100644 keyboards/s60_x/keymaps/bluebear/120-button_Stradella_chart.svg create mode 100644 keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MIDI_BASE-Layer.png create mode 100644 keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MIDI_CHORD-Layer.png (limited to 'keyboards/s60_x') diff --git a/keyboards/s60_x/keymaps/bluebear/120-button_Stradella_chart.svg b/keyboards/s60_x/keymaps/bluebear/120-button_Stradella_chart.svg new file mode 100644 index 0000000000..bd878faa1f --- /dev/null +++ b/keyboards/s60_x/keymaps/bluebear/120-button_Stradella_chart.svg @@ -0,0 +1,5190 @@ + + + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MIDI_BASE-Layer.png b/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MIDI_BASE-Layer.png new file mode 100644 index 0000000000..58ad1605f0 Binary files /dev/null and b/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MIDI_BASE-Layer.png differ diff --git a/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MIDI_CHORD-Layer.png b/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MIDI_CHORD-Layer.png new file mode 100644 index 0000000000..74a373ae22 Binary files /dev/null and b/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MIDI_CHORD-Layer.png differ -- cgit v1.2.3 From cd4ccee703770bf5dce977f539e53f30e139313d Mon Sep 17 00:00:00 2001 From: Ante Laurijssen Date: Mon, 29 May 2017 22:13:52 -0400 Subject: Corrected typo in readme.md --- keyboards/s60_x/keymaps/bluebear/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'keyboards/s60_x') diff --git a/keyboards/s60_x/keymaps/bluebear/readme.md b/keyboards/s60_x/keymaps/bluebear/readme.md index 9a70cde96a..50af6d835c 100644 --- a/keyboards/s60_x/keymaps/bluebear/readme.md +++ b/keyboards/s60_x/keymaps/bluebear/readme.md @@ -48,9 +48,9 @@ This layer was inspired by the Satan Midi layout (https://github.com/qmk/qmk_fir -Top right button toggles MORSE_CHORDS layer -Escape brings you back to the BASE layer -## MIDI_CHORDS Layer +## MIDI_CHORD Layer -![MIDI_CHORDS Layer](S60X-Bluebear-MIDI_CHORDS-Layer.png) +![MIDI_CHORD Layer](S60X-Bluebear-MIDI_CHORDS-Layer.png) After figuring out how to code my MIDI chord function, I decided to dedicate a full layer to these chords. This chord layout was inspired by the Stradella Base system (https://en.wikipedia.org/wiki/Stradella_bass_system) found on accordions. This layer is a tool for musical composition and songwriting. -- cgit v1.2.3 From 06684555d21059e55a549fc6c24936920e35f965 Mon Sep 17 00:00:00 2001 From: Ante Laurijssen Date: Mon, 29 May 2017 22:16:17 -0400 Subject: Another typo... --- keyboards/s60_x/keymaps/bluebear/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'keyboards/s60_x') diff --git a/keyboards/s60_x/keymaps/bluebear/readme.md b/keyboards/s60_x/keymaps/bluebear/readme.md index 50af6d835c..6f54d4d580 100644 --- a/keyboards/s60_x/keymaps/bluebear/readme.md +++ b/keyboards/s60_x/keymaps/bluebear/readme.md @@ -50,7 +50,7 @@ This layer was inspired by the Satan Midi layout (https://github.com/qmk/qmk_fir ## MIDI_CHORD Layer -![MIDI_CHORD Layer](S60X-Bluebear-MIDI_CHORDS-Layer.png) +![MIDI_CHORD Layer](S60X-Bluebear-MIDI_CHORD-Layer.png) After figuring out how to code my MIDI chord function, I decided to dedicate a full layer to these chords. This chord layout was inspired by the Stradella Base system (https://en.wikipedia.org/wiki/Stradella_bass_system) found on accordions. This layer is a tool for musical composition and songwriting. -- cgit v1.2.3 From fbaf964a854a8fc754871730deb219ab48fd6937 Mon Sep 17 00:00:00 2001 From: Ante Laurijssen Date: Tue, 30 May 2017 21:27:00 -0400 Subject: Improvements to Midi and keymap --- keyboards/s60_x/keymaps/bluebear/keymap.c | 114 +++++++++++++++--------------- 1 file changed, 57 insertions(+), 57 deletions(-) (limited to 'keyboards/s60_x') diff --git a/keyboards/s60_x/keymaps/bluebear/keymap.c b/keyboards/s60_x/keymaps/bluebear/keymap.c index 44ebb5aada..87a792a015 100644 --- a/keyboards/s60_x/keymaps/bluebear/keymap.c +++ b/keyboards/s60_x/keymaps/bluebear/keymap.c @@ -13,14 +13,14 @@ enum keyboard_layers { // Midi Chords -enum midi_chord_modes { //ACTION_FUNCTION id +enum midi_chord_modes { //ACTION_FUNCTION opt major, minor, dom_seventh, dim_seventh, }; -enum midi_chord_root { //ACTION_FUNCTION opt +enum midi_chord_root { //ACTION_FUNCTION id C, Cs, Db = Cs, @@ -301,8 +301,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, TO(3), TO(5), \ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PGUP, KC_UP, KC_NO, KC_NO, KC_NO, KC_INS, KC_DEL, \ KC_CAPS, KC_HOME, KC_NO, KC_END, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RIGHT, KC_NO, KC_NO, KC_NO, KC_TRNS, \ - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_SPACE, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, KC_NO, KC_NO, KC_NO, \ - KC_NO, KC_NO, KC_NO, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_TRNS + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_SPACE, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, KC_NO, KC_TRNS, KC_NO, \ + KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), /* 2: Mouse Keys Layer @@ -324,9 +324,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { RESET, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_NO, KC_NO, \ DEBUG, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_BTN1, KC_MS_UP, KC_BTN2, KC_WH_U, KC_NO, KC_NO, KC_NO, \ - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_WH_D, KC_BTN3, KC_NO, KC_NO, \ - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - KC_TRNS, KC_NO, KC_NO, KC_POWER, KC_NO, KC_NO, KC_NO, KC_NO + KC_LCTL, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_WH_D, KC_BTN3, KC_NO, KC_TRNS, \ + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_NO, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_POWER, KC_TRNS, KC_TRNS, KC_NO, KC_NO ), /* 3: Midi Base Layer @@ -799,68 +799,68 @@ const uint16_t PROGMEM fn_actions[] = { //Major Chords - [CMajor] = ACTION_FUNCTION_OPT(major, C), - [CsMajor] = ACTION_FUNCTION_OPT(major, Cs), - [DMajor] = ACTION_FUNCTION_OPT(major, D), - [DsMajor] = ACTION_FUNCTION_OPT(major, Ds), - [EMajor] = ACTION_FUNCTION_OPT(major, E), - [FMajor] = ACTION_FUNCTION_OPT(major, F), - [FsMajor] = ACTION_FUNCTION_OPT(major, Fs), - [GMajor] = ACTION_FUNCTION_OPT(major, G), - [GsMajor] = ACTION_FUNCTION_OPT(major, Gs), - [AMajor] = ACTION_FUNCTION_OPT(major, A), - [AsMajor] = ACTION_FUNCTION_OPT(major, As), - [BMajor] = ACTION_FUNCTION_OPT(major, B), + [CMajor] = ACTION_FUNCTION_OPT(C, major), + [CsMajor] = ACTION_FUNCTION_OPT(Cs, major), + [DMajor] = ACTION_FUNCTION_OPT(D, major), + [DsMajor] = ACTION_FUNCTION_OPT(Ds, major), + [EMajor] = ACTION_FUNCTION_OPT(E, major), + [FMajor] = ACTION_FUNCTION_OPT(F, major), + [FsMajor] = ACTION_FUNCTION_OPT(Fs, major), + [GMajor] = ACTION_FUNCTION_OPT(G, major), + [GsMajor] = ACTION_FUNCTION_OPT(Gs, major), + [AMajor] = ACTION_FUNCTION_OPT(A, major), + [AsMajor] = ACTION_FUNCTION_OPT(As, major), + [BMajor] = ACTION_FUNCTION_OPT(B, major), //Minor Chords - [CMinor] = ACTION_FUNCTION_OPT(minor, C), - [CsMinor] = ACTION_FUNCTION_OPT(minor, Cs), - [DMinor] = ACTION_FUNCTION_OPT(minor, D), - [DsMinor] = ACTION_FUNCTION_OPT(minor, Ds), - [EMinor] = ACTION_FUNCTION_OPT(minor, E), - [FMinor] = ACTION_FUNCTION_OPT(minor, F), - [FsMinor] = ACTION_FUNCTION_OPT(minor, Fs), - [GMinor] = ACTION_FUNCTION_OPT(minor, G), - [GsMinor] = ACTION_FUNCTION_OPT(minor, Gs), - [AMinor] = ACTION_FUNCTION_OPT(minor, A), - [AsMinor] = ACTION_FUNCTION_OPT(minor, As), - [BMinor] = ACTION_FUNCTION_OPT(minor, B), + [CMinor] = ACTION_FUNCTION_OPT(C, minor), + [CsMinor] = ACTION_FUNCTION_OPT(Cs, minor), + [DMinor] = ACTION_FUNCTION_OPT(D, minor), + [DsMinor] = ACTION_FUNCTION_OPT(Ds, minor), + [EMinor] = ACTION_FUNCTION_OPT(E, minor), + [FMinor] = ACTION_FUNCTION_OPT(F, minor), + [FsMinor] = ACTION_FUNCTION_OPT(Fs, minor), + [GMinor] = ACTION_FUNCTION_OPT(G, minor), + [GsMinor] = ACTION_FUNCTION_OPT(Gs, minor), + [AMinor] = ACTION_FUNCTION_OPT(A, minor), + [AsMinor] = ACTION_FUNCTION_OPT(As, minor), + [BMinor] = ACTION_FUNCTION_OPT(B, minor), //Dominant 7th - [CDom7] = ACTION_FUNCTION_OPT(dom_seventh, C), - [CsDom7] = ACTION_FUNCTION_OPT(dom_seventh, Cs), - [DDom7] = ACTION_FUNCTION_OPT(dom_seventh, D), - [DsDom7] = ACTION_FUNCTION_OPT(dom_seventh, Ds), - [EDom7] = ACTION_FUNCTION_OPT(dom_seventh, E), - [FDom7] = ACTION_FUNCTION_OPT(dom_seventh, F), - [FsDom7] = ACTION_FUNCTION_OPT(dom_seventh, Fs), - [GDom7] = ACTION_FUNCTION_OPT(dom_seventh, G), - [GsDom7] = ACTION_FUNCTION_OPT(dom_seventh, Gs), - [ADom7] = ACTION_FUNCTION_OPT(dom_seventh, A), - [AsDom7] = ACTION_FUNCTION_OPT(dom_seventh, As), - [BDom7] = ACTION_FUNCTION_OPT(dom_seventh, B), + [CDom7] = ACTION_FUNCTION_OPT(C, dom_seventh), + [CsDom7] = ACTION_FUNCTION_OPT(Cs, dom_seventh), + [DDom7] = ACTION_FUNCTION_OPT(D, dom_seventh), + [DsDom7] = ACTION_FUNCTION_OPT(Ds, dom_seventh), + [EDom7] = ACTION_FUNCTION_OPT(E, dom_seventh), + [FDom7] = ACTION_FUNCTION_OPT(F, dom_seventh), + [FsDom7] = ACTION_FUNCTION_OPT(Fs, dom_seventh), + [GDom7] = ACTION_FUNCTION_OPT(G, dom_seventh), + [GsDom7] = ACTION_FUNCTION_OPT(Gs, dom_seventh), + [ADom7] = ACTION_FUNCTION_OPT(A, dom_seventh), + [AsDom7] = ACTION_FUNCTION_OPT(As, dom_seventh), + [BDom7] = ACTION_FUNCTION_OPT(B, dom_seventh), //Diminished 7th - [CDim7] = ACTION_FUNCTION_OPT(dim_seventh, C), - [CsDim7] = ACTION_FUNCTION_OPT(dim_seventh, Cs), - [DDim7] = ACTION_FUNCTION_OPT(dim_seventh, D), - [DsDim7] = ACTION_FUNCTION_OPT(dim_seventh, Ds), - [EDim7] = ACTION_FUNCTION_OPT(dim_seventh, E), - [FDim7] = ACTION_FUNCTION_OPT(dim_seventh, F), - [FsDim7] = ACTION_FUNCTION_OPT(dim_seventh, Fs), - [GDim7] = ACTION_FUNCTION_OPT(dim_seventh, G), - [GsDim7] = ACTION_FUNCTION_OPT(dim_seventh, Gs), - [ADim7] = ACTION_FUNCTION_OPT(dim_seventh, A), - [AsDim7] = ACTION_FUNCTION_OPT(dim_seventh, As), - [BDim7] = ACTION_FUNCTION_OPT(dim_seventh, B), + [CDim7] = ACTION_FUNCTION_OPT(C, dim_seventh), + [CsDim7] = ACTION_FUNCTION_OPT(Cs, dim_seventh), + [DDim7] = ACTION_FUNCTION_OPT(D, dim_seventh), + [DsDim7] = ACTION_FUNCTION_OPT(Ds, dim_seventh), + [EDim7] = ACTION_FUNCTION_OPT(E, dim_seventh), + [FDim7] = ACTION_FUNCTION_OPT(F, dim_seventh), + [FsDim7] = ACTION_FUNCTION_OPT(Fs, dim_seventh), + [GDim7] = ACTION_FUNCTION_OPT(G, dim_seventh), + [GsDim7] = ACTION_FUNCTION_OPT(Gs, dim_seventh), + [ADim7] = ACTION_FUNCTION_OPT(A, dim_seventh), + [AsDim7] = ACTION_FUNCTION_OPT(As, dim_seventh), + [BDim7] = ACTION_FUNCTION_OPT(B, dim_seventh), }; void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { uint16_t root_note = MIDI_INVALID_NOTE; - switch (opt) { + switch (id) { case C: //Root note C root_note = MI_C; break; @@ -904,7 +904,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { uint16_t fifth = root_note + 7; uint16_t minor_seventh = root_note + 10; uint16_t diminished_seventh = root_note -3; - switch (id) { + switch (opt) { case major: //Major chord process_midi(root_note, record); process_midi(major_third, record); -- cgit v1.2.3 From 9cfa37bb3dba3a93edb47c0b08075aa05ea6b492 Mon Sep 17 00:00:00 2001 From: Ante Laurijssen Date: Fri, 2 Jun 2017 22:57:57 -0400 Subject: Improvements and corrections to morse code macros layer --- keyboards/s60_x/keymaps/bluebear/keymap.c | 88 +++++++++++++++---------------- 1 file changed, 44 insertions(+), 44 deletions(-) (limited to 'keyboards/s60_x') diff --git a/keyboards/s60_x/keymaps/bluebear/keymap.c b/keyboards/s60_x/keymaps/bluebear/keymap.c index 87a792a015..c4baadfc6e 100644 --- a/keyboards/s60_x/keymaps/bluebear/keymap.c +++ b/keyboards/s60_x/keymaps/bluebear/keymap.c @@ -406,7 +406,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { switch(id) { case 0: //Number 0-) if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); return MACRO(T(MINS), T(DOT), T(MINS), T(MINS), T(DOT), T(MINS), T(SPACE), END); //-.--.- } @@ -417,7 +417,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 1: //Number 1-! if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); return MACRO(T(MINS), T(DOT), T(MINS), T(DOT), T(MINS), T(MINS), T(SPACE), END); //-.-.-- } @@ -428,7 +428,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 2: //Number 2-@ if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); return MACRO(T(DOT), T(MINS), T(MINS), T(DOT), T(MINS), T(DOT), T(SPACE), END); //.--.-. } @@ -439,7 +439,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 3: // Number 3 if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); } return MACRO(T(DOT), T(DOT), T(DOT), T(MINS), T(MINS), T(SPACE), END); //...-- @@ -447,7 +447,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 4: //Number 4-$ if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); return MACRO(T(DOT), T(DOT), T(DOT), T(MINS), T(DOT), T(DOT), T(MINS), T(SPACE), END); //...-..- } @@ -458,7 +458,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 5: //Number 5 if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); } return MACRO(T(DOT), T(DOT), T(DOT), T(DOT), T(DOT), T(SPACE), END); //..... @@ -466,7 +466,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 6: //Number 6 if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); } return MACRO(T(MINS), T(DOT), T(DOT), T(DOT), T(DOT), T(SPACE), END); //-.... @@ -474,7 +474,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 7: //Number 7-& if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); return MACRO(T(DOT), T(MINS), T(DOT), T(DOT), T(DOT), T(SPACE), END); //.-... } @@ -485,7 +485,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 8: //Number 8 if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); } return MACRO(T(MINS), T(MINS), T(MINS), T(DOT), T(DOT), T(SPACE), END); //---.. @@ -493,7 +493,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 9: //Number 9-( if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); return MACRO(T(MINS), T(DOT), T(MINS), T(MINS), T(DOT), T(SPACE), END); //-.--. } @@ -504,7 +504,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 10: //Letter A if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); } return MACRO(T(DOT), T(MINS), T(SPACE), END); //.- @@ -512,7 +512,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 11: //Letter B if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); } return MACRO(T(MINS), T(DOT), T(DOT), T(DOT), T(SPACE), END); //-... @@ -520,7 +520,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 12: //Letter C if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); } return MACRO(T(MINS), T(DOT), T(MINS), T(DOT), T(SPACE), END); //-.-. @@ -528,7 +528,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 13: //Letter D if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); } return MACRO(T(MINS), T(DOT), T(DOT), T(SPACE), END); //-.. @@ -536,7 +536,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 14: //Letter E if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); } return MACRO(T(DOT), T(SPACE), END); //. @@ -544,7 +544,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 15: //Letter F if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); } return MACRO(T(DOT), T(DOT), T(MINS), T(DOT), T(SPACE), END); //..-. @@ -552,7 +552,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 16: //Letter G if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); } return MACRO(T(MINS), T(MINS), T(DOT), T(SPACE), END); //--. @@ -560,7 +560,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 17: //Letter H if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); } return MACRO(T(DOT), T(DOT), T(DOT), T(DOT), T(SPACE), END); //.... @@ -568,7 +568,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 18: //Letter I if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); } return MACRO(T(DOT), T(DOT), T(SPACE), END); //.. @@ -576,7 +576,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 19: //Letter J if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); } return MACRO(T(DOT), T(MINS), T(MINS), T(MINS), T(SPACE), END); //.--- @@ -584,7 +584,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 20: //Letter K if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); } return MACRO(T(MINS), T(DOT), T(MINS), T(SPACE), END); //-.- @@ -592,7 +592,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 21: //Letter L if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); } return MACRO(T(DOT), T(MINS), T(DOT), T(DOT), T(SPACE), END); //.-.. @@ -600,7 +600,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 22: //Letter M if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); } return MACRO(T(MINS), T(MINS), T(SPACE), END); //-- @@ -608,7 +608,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 23: //Letter N if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); } return MACRO(T(MINS), T(DOT), T(SPACE), END); //-. @@ -616,7 +616,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 24: //Letter O if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); } return MACRO(T(MINS), T(MINS), T(MINS), T(SPACE), END); //--- @@ -624,7 +624,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 25: //Letter P if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); } return MACRO(T(DOT), T(MINS), T(MINS), T(DOT), T(SPACE), END); //.--. @@ -632,7 +632,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 26: //Letter Q if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); } return MACRO(T(MINS), T(MINS), T(DOT), T(MINS), T(SPACE), END); //--.- @@ -640,7 +640,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 27: //Letter R if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); } return MACRO(T(DOT), T(MINS), T(DOT), T(SPACE), END); //.-. @@ -648,7 +648,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 28: //Letter S if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); } return MACRO(T(DOT), T(DOT), T(DOT), T(SPACE), END); //... @@ -656,7 +656,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 29: //Letter T if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); } return MACRO(T(MINS), T(SPACE), END); //- @@ -664,7 +664,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 30: //Letter U if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); } return MACRO(T(DOT), T(DOT), T(MINS), T(SPACE), END); //..- @@ -672,7 +672,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 31: //Letter V if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); } return MACRO(T(DOT), T(DOT), T(DOT), T(MINS), T(SPACE), END); //...- @@ -680,7 +680,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 32: //Letter W if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); } return MACRO(T(DOT), T(MINS), T(MINS), T(SPACE), END); //.-- @@ -688,7 +688,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 33: //Letter X if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); } return MACRO(T(MINS), T(DOT), T(DOT), T(MINS), T(SPACE), END); //-..- @@ -696,7 +696,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 34: //Letter Y if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); } return MACRO(T(MINS), T(DOT), T(MINS), T(MINS), T(SPACE), END); //-.-- @@ -704,7 +704,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 35: //Letter Z if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); } return MACRO(T(MINS), T(MINS), T(DOT), T(DOT), T(SPACE), END); //--.. @@ -712,7 +712,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 36: //Punctuation . if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); } return MACRO(T(DOT), T(MINS), T(DOT), T(MINS), T(DOT), T(MINS), T(SPACE), END); //.-.-.- @@ -720,7 +720,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 37: //Punctuation , if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); } return MACRO(T(MINS), T(MINS), T(DOT), T(DOT), T(MINS), T(MINS), T(SPACE), END); //--..-- @@ -728,7 +728,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 38: //Punctuation '-" if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); return MACRO(T(DOT), T(MINS), T(DOT), T(DOT), T(MINS), T(DOT), T(SPACE), END); //.-..-. } @@ -739,7 +739,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 39: //Punctuation /-? if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); return MACRO(T(DOT), T(DOT), T(MINS), T(MINS), T(DOT), T(DOT), T(SPACE), END); //..--.. } @@ -750,7 +750,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 40: //Punctuation ;-: if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); return MACRO(T(MINS), T(MINS), T(MINS), T(DOT), T(DOT), T(DOT), T(SPACE), END); //---... } @@ -761,7 +761,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 41: //Punctuation =-+ if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); return MACRO(T(DOT), T(MINS), T(DOT), T(MINS), T(DOT), T(SPACE), END); //.-.-. } @@ -772,7 +772,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 42: //Punctuation --_ if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); return MACRO(T(DOT), T(DOT), T(MINS), T(MINS), T(DOT), T(MINS), T(SPACE), END); //..--.- } @@ -783,7 +783,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 43: //Morse Space if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || MOD_BIT(KC_RSFT)) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); } return MACRO(T(BSLS), T(SPACE), END); //When pressed, this sends a slash followed by a space, making it easier to distinguish words in Morse -- cgit v1.2.3 From 1b8ed53f21702d279dc5b5bffc2d0213943a22ad Mon Sep 17 00:00:00 2001 From: Ante Laurijssen Date: Mon, 5 Jun 2017 22:17:35 -0400 Subject: Added a couple of custom keys and updated layer image --- .../keymaps/bluebear/S60X-Bluebear-MOUSE-Layer.png | Bin 16499 -> 18972 bytes keyboards/s60_x/keymaps/bluebear/keymap.c | 43 +++++++++++++++++---- 2 files changed, 36 insertions(+), 7 deletions(-) (limited to 'keyboards/s60_x') diff --git a/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MOUSE-Layer.png b/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MOUSE-Layer.png index 4e92a60c76..f37249b811 100644 Binary files a/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MOUSE-Layer.png and b/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MOUSE-Layer.png differ diff --git a/keyboards/s60_x/keymaps/bluebear/keymap.c b/keyboards/s60_x/keymaps/bluebear/keymap.c index c4baadfc6e..22356db2b3 100644 --- a/keyboards/s60_x/keymaps/bluebear/keymap.c +++ b/keyboards/s60_x/keymaps/bluebear/keymap.c @@ -255,6 +255,13 @@ enum morse_macros { MC_SPACE = M(43), }; +// Custom Keys + +enum custom_keys { + MAGSYS, // Magic SysRq key - Sends Alt-PSCR + TFS = LCTL(LALT(KC_DEL)), // Three Finger Salute - Sends Ctl-Alt-Del +}; + //Keymaps const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -312,9 +319,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │DEBUG│ │ │ │ │ │ │BTN1 │MS_UP│BTN2 │WH_UP│ │ │ │█████│ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - │ │ │ │ │ │ │ │MS_LT│MS_DN│MS_RT│WH_DN│BTN3 │▒▒▒▒▒│ │█████│ + │TFS │ │ │ │ │ │ │MS_LT│MS_DN│MS_RT│WH_DN│BTN3 │▒▒▒▒▒│ │█████│ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - │ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ + │MAGSYS▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │ │ │ │█████│█████│█████│ PWR │█████│█████│█████│ │ │ │ │█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ @@ -324,8 +331,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { RESET, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_NO, KC_NO, \ DEBUG, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_BTN1, KC_MS_UP, KC_BTN2, KC_WH_U, KC_NO, KC_NO, KC_NO, \ - KC_LCTL, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_WH_D, KC_BTN3, KC_NO, KC_TRNS, \ - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_NO, \ + TFS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_WH_D, KC_BTN3, KC_NO, KC_TRNS, \ + MAGSYS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_NO, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_POWER, KC_TRNS, KC_TRNS, KC_NO, KC_NO ), @@ -400,13 +407,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -// Morse Code Macros +// Macros const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { switch(id) { + + // Morse Code Macros + case 0: //Number 0-) if (record->event.pressed) { - if (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { clear_mods(); return MACRO(T(MINS), T(DOT), T(MINS), T(MINS), T(DOT), T(MINS), T(SPACE), END); //-.--.- } @@ -791,7 +801,26 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; } return MACRO_NONE; -}; +} + +// Custom Keys + +bool process_record_user (uint16_t keycode, keyrecord_t *record) { + switch(keycode) { + case MAGSYS: //Magic SysRq function - Toggles key on and off depending on state of LALT key + if (record->event.pressed) { + if (keyboard_report->mods & (MOD_BIT(KC_LALT))) { + unregister_code(KC_PSCR); + unregister_code(KC_LALT); + } else { + register_code(KC_LALT); + register_code(KC_PSCR); + } + } + break; + } + return true; +} // Midi Chord Function -- cgit v1.2.3 From 8f80f35186353801b960d536339b70f43f484c46 Mon Sep 17 00:00:00 2001 From: Ante Laurijssen Date: Wed, 7 Jun 2017 22:01:28 -0400 Subject: Working on Morse Code Macros --- keyboards/s60_x/keymaps/bluebear/keymap.c | 33 ++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) (limited to 'keyboards/s60_x') diff --git a/keyboards/s60_x/keymaps/bluebear/keymap.c b/keyboards/s60_x/keymaps/bluebear/keymap.c index 22356db2b3..1ecddb8d5b 100644 --- a/keyboards/s60_x/keymaps/bluebear/keymap.c +++ b/keyboards/s60_x/keymaps/bluebear/keymap.c @@ -407,21 +407,36 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -// Macros +// Custom Function - Check if shift is pressed + +bool check_shift(void); + +bool check_shift() { + if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT))) { + return KC_LSHIFT; + } + if (keyboard_report->mods & (MOD_BIT(KC_RSHIFT))) { + return KC_RSHIFT; + } + else { + return false; + } +} + +// Morse Code Macros const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + uint16_t is_shift = check_shift(); switch(id) { - - // Morse Code Macros - case 0: //Number 0-) if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); - return MACRO(T(MINS), T(DOT), T(MINS), T(MINS), T(DOT), T(MINS), T(SPACE), END); //-.--.- - } + if (is_shift == false) { + return MACRO(T(MINS), T(MINS), T(MINS), T(MINS), T(MINS), T(SPACE), END); //----- + } else { - return MACRO(T(MINS), T(MINS), T(MINS), T(MINS), T(MINS), T(SPACE), END); //----- + unregister_mods(MOD_BIT(is_shift)); + return MACRO(T(MINS), T(DOT), T(MINS), T(MINS), T(DOT), T(MINS), T(SPACE), END); //-.--.- + register_code(is_shift); } } break; -- cgit v1.2.3 From 7146dfea6e564660e525c5c8280d5c73a73697f3 Mon Sep 17 00:00:00 2001 From: Ante Laurijssen Date: Wed, 7 Jun 2017 23:57:14 -0400 Subject: =?UTF-8?q?Created=20special=20shift=20keys=20for=20Morse=20layer?= =?UTF-8?q?=20that=20change=20variable=20value,=20enabling=20to=20send=20?= =?UTF-8?q?=E2=80=9Cshifted=E2=80=9D=20special=20morse=20code=20characters?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- keyboards/s60_x/keymaps/bluebear/keymap.c | 172 +++++------------------------- 1 file changed, 29 insertions(+), 143 deletions(-) (limited to 'keyboards/s60_x') diff --git a/keyboards/s60_x/keymaps/bluebear/keymap.c b/keyboards/s60_x/keymaps/bluebear/keymap.c index 1ecddb8d5b..878a54e285 100644 --- a/keyboards/s60_x/keymaps/bluebear/keymap.c +++ b/keyboards/s60_x/keymaps/bluebear/keymap.c @@ -258,7 +258,9 @@ enum morse_macros { // Custom Keys enum custom_keys { - MAGSYS, // Magic SysRq key - Sends Alt-PSCR + MAGSYS = SAFE_RANGE, // Magic SysRq key - Sends Alt-PSCR + MC_LSFT, + MC_RSFT, TFS = LCTL(LALT(KC_DEL)), // Three Finger Salute - Sends Ctl-Alt-Del }; @@ -401,49 +403,31 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TO(0), MC_1, MC_2, MC_3, MC_4, MC_5, MC_6, MC_7, MC_8, MC_9, MC_0, KC_NO, KC_NO, KC_NO, KC_NO, \ KC_TAB, MC_APOS, MC_COMM, MC_DOT, MC_P, MC_Y, MC_F, MC_G, MC_C, MC_R, MC_L, MC_SLSH, MC_EQL, KC_BSPC, \ KC_NO, MC_A, MC_O, MC_E, MC_U, MC_I, MC_D, MC_H, MC_T, MC_N, MC_S, MC_MINS, KC_NO, KC_ENT, \ - KC_LSFT, KC_NO, MC_SCLN, MC_Q, MC_J, MC_K, MC_X, MC_B, MC_M, MC_W, MC_V, MC_Z, KC_NO, KC_RSFT, KC_NO, \ + MC_LSFT, KC_NO, MC_SCLN, MC_Q, MC_J, MC_K, MC_X, MC_B, MC_M, MC_W, MC_V, MC_Z, KC_NO, MC_RSFT, KC_NO, \ KC_NO, KC_NO, KC_NO, MC_SPACE, KC_NO, KC_NO, KC_NO, KC_NO ), }; -// Custom Function - Check if shift is pressed - -bool check_shift(void); - -bool check_shift() { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT))) { - return KC_LSHIFT; - } - if (keyboard_report->mods & (MOD_BIT(KC_RSHIFT))) { - return KC_RSHIFT; - } - else { - return false; - } -} - // Morse Code Macros +int mc_shift_on = false; + const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - uint16_t is_shift = check_shift(); switch(id) { case 0: //Number 0-) if (record->event.pressed) { - if (is_shift == false) { - return MACRO(T(MINS), T(MINS), T(MINS), T(MINS), T(MINS), T(SPACE), END); //----- - } - else { - unregister_mods(MOD_BIT(is_shift)); + if (mc_shift_on == true) { return MACRO(T(MINS), T(DOT), T(MINS), T(MINS), T(DOT), T(MINS), T(SPACE), END); //-.--.- - register_code(is_shift); + } + else { + return MACRO(T(MINS), T(MINS), T(MINS), T(MINS), T(MINS), T(SPACE), END); //----- } } break; case 1: //Number 1-! if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); + if (mc_shift_on == true) { return MACRO(T(MINS), T(DOT), T(MINS), T(DOT), T(MINS), T(MINS), T(SPACE), END); //-.-.-- } else { @@ -453,8 +437,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 2: //Number 2-@ if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); + if (mc_shift_on == true) { return MACRO(T(DOT), T(MINS), T(MINS), T(DOT), T(MINS), T(DOT), T(SPACE), END); //.--.-. } else { @@ -464,16 +447,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 3: // Number 3 if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); - } return MACRO(T(DOT), T(DOT), T(DOT), T(MINS), T(MINS), T(SPACE), END); //...-- } break; case 4: //Number 4-$ if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); + if (mc_shift_on == true) { return MACRO(T(DOT), T(DOT), T(DOT), T(MINS), T(DOT), T(DOT), T(MINS), T(SPACE), END); //...-..- } else { @@ -483,24 +462,17 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 5: //Number 5 if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); - } return MACRO(T(DOT), T(DOT), T(DOT), T(DOT), T(DOT), T(SPACE), END); //..... } break; case 6: //Number 6 if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); - } return MACRO(T(MINS), T(DOT), T(DOT), T(DOT), T(DOT), T(SPACE), END); //-.... } break; case 7: //Number 7-& if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); + if (mc_shift_on == true) { return MACRO(T(DOT), T(MINS), T(DOT), T(DOT), T(DOT), T(SPACE), END); //.-... } else { @@ -510,16 +482,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 8: //Number 8 if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); - } return MACRO(T(MINS), T(MINS), T(MINS), T(DOT), T(DOT), T(SPACE), END); //---.. } break; case 9: //Number 9-( if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); + if (mc_shift_on == true) { return MACRO(T(MINS), T(DOT), T(MINS), T(MINS), T(DOT), T(SPACE), END); //-.--. } else { @@ -529,232 +497,149 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 10: //Letter A if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); - } return MACRO(T(DOT), T(MINS), T(SPACE), END); //.- } break; case 11: //Letter B if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); - } return MACRO(T(MINS), T(DOT), T(DOT), T(DOT), T(SPACE), END); //-... } break; case 12: //Letter C if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); - } return MACRO(T(MINS), T(DOT), T(MINS), T(DOT), T(SPACE), END); //-.-. } break; case 13: //Letter D if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); - } return MACRO(T(MINS), T(DOT), T(DOT), T(SPACE), END); //-.. } break; case 14: //Letter E if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); - } return MACRO(T(DOT), T(SPACE), END); //. } break; case 15: //Letter F if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); - } return MACRO(T(DOT), T(DOT), T(MINS), T(DOT), T(SPACE), END); //..-. } break; case 16: //Letter G if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); - } return MACRO(T(MINS), T(MINS), T(DOT), T(SPACE), END); //--. } break; case 17: //Letter H if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); - } return MACRO(T(DOT), T(DOT), T(DOT), T(DOT), T(SPACE), END); //.... } break; case 18: //Letter I if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); - } return MACRO(T(DOT), T(DOT), T(SPACE), END); //.. } break; case 19: //Letter J if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); - } return MACRO(T(DOT), T(MINS), T(MINS), T(MINS), T(SPACE), END); //.--- } break; case 20: //Letter K if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); - } return MACRO(T(MINS), T(DOT), T(MINS), T(SPACE), END); //-.- } break; case 21: //Letter L if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); - } return MACRO(T(DOT), T(MINS), T(DOT), T(DOT), T(SPACE), END); //.-.. } break; case 22: //Letter M if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); - } return MACRO(T(MINS), T(MINS), T(SPACE), END); //-- } break; case 23: //Letter N if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); - } return MACRO(T(MINS), T(DOT), T(SPACE), END); //-. } break; case 24: //Letter O if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); - } return MACRO(T(MINS), T(MINS), T(MINS), T(SPACE), END); //--- } break; case 25: //Letter P if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); - } return MACRO(T(DOT), T(MINS), T(MINS), T(DOT), T(SPACE), END); //.--. } break; case 26: //Letter Q if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); - } return MACRO(T(MINS), T(MINS), T(DOT), T(MINS), T(SPACE), END); //--.- } break; case 27: //Letter R if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); - } return MACRO(T(DOT), T(MINS), T(DOT), T(SPACE), END); //.-. } break; case 28: //Letter S if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); - } return MACRO(T(DOT), T(DOT), T(DOT), T(SPACE), END); //... } break; case 29: //Letter T if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); - } return MACRO(T(MINS), T(SPACE), END); //- } break; case 30: //Letter U if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); - } return MACRO(T(DOT), T(DOT), T(MINS), T(SPACE), END); //..- } break; case 31: //Letter V if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); - } return MACRO(T(DOT), T(DOT), T(DOT), T(MINS), T(SPACE), END); //...- } break; case 32: //Letter W if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); - } return MACRO(T(DOT), T(MINS), T(MINS), T(SPACE), END); //.-- } break; case 33: //Letter X if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); - } return MACRO(T(MINS), T(DOT), T(DOT), T(MINS), T(SPACE), END); //-..- } break; case 34: //Letter Y if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); + if (mc_shift_on == true) { } return MACRO(T(MINS), T(DOT), T(MINS), T(MINS), T(SPACE), END); //-.-- } break; case 35: //Letter Z if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); - } return MACRO(T(MINS), T(MINS), T(DOT), T(DOT), T(SPACE), END); //--.. } break; case 36: //Punctuation . if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); - } return MACRO(T(DOT), T(MINS), T(DOT), T(MINS), T(DOT), T(MINS), T(SPACE), END); //.-.-.- } break; case 37: //Punctuation , if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); - } return MACRO(T(MINS), T(MINS), T(DOT), T(DOT), T(MINS), T(MINS), T(SPACE), END); //--..-- } break; case 38: //Punctuation '-" if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); + if (mc_shift_on == true) { return MACRO(T(DOT), T(MINS), T(DOT), T(DOT), T(MINS), T(DOT), T(SPACE), END); //.-..-. } else { @@ -764,8 +649,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 39: //Punctuation /-? if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); + if (mc_shift_on == true) { return MACRO(T(DOT), T(DOT), T(MINS), T(MINS), T(DOT), T(DOT), T(SPACE), END); //..--.. } else { @@ -775,8 +659,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 40: //Punctuation ;-: if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); + if (mc_shift_on == true) { return MACRO(T(MINS), T(MINS), T(MINS), T(DOT), T(DOT), T(DOT), T(SPACE), END); //---... } else { @@ -786,8 +669,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 41: //Punctuation =-+ if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); + if (mc_shift_on == true) { return MACRO(T(DOT), T(MINS), T(DOT), T(MINS), T(DOT), T(SPACE), END); //.-.-. } else { @@ -797,8 +679,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 42: //Punctuation --_ if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); + if (mc_shift_on == true) { return MACRO(T(DOT), T(DOT), T(MINS), T(MINS), T(DOT), T(MINS), T(SPACE), END); //..--.- } else { @@ -808,9 +689,6 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { break; case 43: //Morse Space if (record->event.pressed) { - if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { - clear_mods(); - } return MACRO(T(BSLS), T(SPACE), END); //When pressed, this sends a slash followed by a space, making it easier to distinguish words in Morse } break; @@ -833,6 +711,14 @@ bool process_record_user (uint16_t keycode, keyrecord_t *record) { } } break; + case MC_LSFT ... MC_RSFT: + if (record->event.pressed) { + mc_shift_on = true; + } + else { + mc_shift_on = false; + } + break; } return true; } -- cgit v1.2.3 From 54d48140cd4e0f03876b336c170a15076e123c69 Mon Sep 17 00:00:00 2001 From: Ante Laurijssen Date: Sun, 11 Jun 2017 16:00:40 -0400 Subject: -MIDI Chords now using process_record_user instead of F(n) keys -Morse Code shift keys implemented --- keyboards/s60_x/keymaps/bluebear/keymap.c | 492 ++++++++++-------------------- 1 file changed, 164 insertions(+), 328 deletions(-) (limited to 'keyboards/s60_x') diff --git a/keyboards/s60_x/keymaps/bluebear/keymap.c b/keyboards/s60_x/keymaps/bluebear/keymap.c index 878a54e285..cfd8d4b556 100644 --- a/keyboards/s60_x/keymaps/bluebear/keymap.c +++ b/keyboards/s60_x/keymaps/bluebear/keymap.c @@ -11,202 +11,7 @@ enum keyboard_layers { MORSE, //Morse Code Layer }; -// Midi Chords - -enum midi_chord_modes { //ACTION_FUNCTION opt - major, - minor, - dom_seventh, - dim_seventh, -}; - -enum midi_chord_root { //ACTION_FUNCTION id - C, - Cs, - Db = Cs, - D, - Ds, - Eb = Ds, - E, - F, - Fs, - Gb = Fs, - G, - Gs, - Ab = Gs, - A, - As, - Bb = As, - B, -}; - -enum midi_chord_id { //ACTION_FUNCTION Progmem Id - - //Major Chords - - CMajor, - CsMajor, - DbMajor = CsMajor, - DMajor, - DsMajor, - EbMajor = DsMajor, - EMajor, - FMajor, - FsMajor, - GbMajor = FsMajor, - GMajor, - GsMajor, - AbMajor = GsMajor, - AMajor, - AsMajor, - BbMajor = AsMajor, - BMajor, - - //Minor Chords - - CMinor, - CsMinor, - DbMinor = CsMinor, - DMinor, - DsMinor, - EbMinor = DsMinor, - EMinor, - FMinor, - FsMinor, - GbMinor = FsMinor, - GMinor, - GsMinor, - AbMinor = GsMinor, - AMinor, - AsMinor, - BbMinor = AsMinor, - BMinor, - - //Dominant Seventh Chords - - CDom7, - CsDom7, - DbDom7 = CsDom7, - DDom7, - DsDom7, - EbDom7 = DsDom7, - EDom7, - FDom7, - FsDom7, - GbDom7 = FsDom7, - GDom7, - GsDom7, - AbDom7 = GsDom7, - ADom7, - AsDom7, - BbDom7 = AsDom7, - BDom7, - - //Diminished Seventh Chords - - CDim7, - CsDim7, - DbDim7 = CsDim7, - DDim7, - DsDim7, - EbDim7 = DsDim7, - EDim7, - FDim7, - FsDim7, - GbDim7 = FsDim7, - GDim7, - GsDim7, - AbDim7 = GsDim7, - ADim7, - AsDim7, - BbDim7 = AsDim7, - BDim7, -}; - -enum midi_chord_keycodes { //Midi Chocd Keycodes - - //Major Chord Keycodes - - MI_CH_C = F(CMajor), - MI_CH_Cs = F(CsMajor), - MI_CH_Db = MI_CH_Cs, - MI_CH_D = F(DMajor), - MI_CH_Ds = F(DsMajor), - MI_CH_Eb = MI_CH_Ds, - MI_CH_E = F(EMajor), - MI_CH_F = F(FMajor), - MI_CH_Fs = F(FsMajor), - MI_CH_Gb = MI_CH_Fs, - MI_CH_G = F(GMajor), - MI_CH_Gs = F(GsMajor), - MI_CH_Ab = MI_CH_Gs, - MI_CH_A = F(AMajor), - MI_CH_As = F(AsMajor), - MI_CH_Bb = MI_CH_As, - MI_CH_B = F(BMajor), - - //Minor Chord Keycodes - - MI_CH_Cm = F(CMinor), - MI_CH_Csm = F(CsMinor), - MI_CH_Dbm = MI_CH_Csm, - MI_CH_Dm = F(DMinor), - MI_CH_Dsm = F(DsMinor), - MI_CH_Ebm = MI_CH_Dsm, - MI_CH_Em = F(EMinor), - MI_CH_Fm = F(FMinor), - MI_CH_Fsm = F(FsMinor), - MI_CH_Gbm = MI_CH_Fsm, - MI_CH_Gm = F(GMinor), - MI_CH_Gsm = F(GsMinor), - MI_CH_Abm = MI_CH_Gsm, - MI_CH_Am = F(AMinor), - MI_CH_Asm = F(AsMinor), - MI_CH_Bbm = MI_CH_Asm, - MI_CH_Bm = F(BMinor), - - //Dominant Seventh Keycodes - - MI_CH_CDom7 = F(CDom7), - MI_CH_CsDom7 = F(CsDom7), - MI_CH_DbDom7 = MI_CH_CsDom7, - MI_CH_DDom7 = F(DDom7), - MI_CH_DsDom7 = F(DsDom7), - MI_CH_EbDom7 = MI_CH_DsDom7, - MI_CH_EDom7 = F(EDom7), - MI_CH_FDom7 = F(FDom7), - MI_CH_FsDom7 = F(FsDom7), - MI_CH_GbDom7 = MI_CH_FsDom7, - MI_CH_GDom7 = F(GDom7), - MI_CH_GsDom7 = F(GsDom7), - MI_CH_AbDom7 = MI_CH_GsDom7, - MI_CH_ADom7 = F(ADom7), - MI_CH_AsDom7 = F(AsDom7), - MI_CH_BbDom7 = MI_CH_AsDom7, - MI_CH_BDom7 = F(BDom7), - - //Diminished Seventh Keycodes - - MI_CH_CDim7 = F(CDim7), - MI_CH_CsDim7 = F(CsDim7), - MI_CH_DbDim7 = MI_CH_CsDim7, - MI_CH_DDim7 = F(DDim7), - MI_CH_DsDim7 = F(DsDim7), - MI_CH_EbDim7 = MI_CH_DsDim7, - MI_CH_EDim7 = F(EDim7), - MI_CH_FDim7 = F(FDim7), - MI_CH_FsDim7 = F(FsDim7), - MI_CH_GbDim7 = MI_CH_FsDim7, - MI_CH_GDim7 = F(GDim7), - MI_CH_GsDim7 = F(GsDim7), - MI_CH_AbDim7 = MI_CH_GsDim7, - MI_CH_ADim7 = F(ADim7), - MI_CH_AsDim7 = F(AsDim7), - MI_CH_BbDim7 = MI_CH_AsDim7, - MI_CH_BDim7 = F(BDim7), -}; - -//Morse Code Macro Keys +// Morse Code Macro Keys enum morse_macros { MC_0 = M(0), @@ -258,10 +63,94 @@ enum morse_macros { // Custom Keys enum custom_keys { + + // Miscellaneous Keycodes + + TFS = LCTL(LALT(KC_DEL)), // Three Finger Salute - Sends Ctl-Alt-Del MAGSYS = SAFE_RANGE, // Magic SysRq key - Sends Alt-PSCR - MC_LSFT, - MC_RSFT, - TFS = LCTL(LALT(KC_DEL)), // Three Finger Salute - Sends Ctl-Alt-Del + MC_LSFT, // Morse Code Left Shift + MC_RSFT, // Morse Code Right Shift + + // MIDI Chord Keycodes - Major + + MI_CH_C, + MI_CH_Cs, + MI_CH_Db = MI_CH_Cs, + MI_CH_D, + MI_CH_Ds, + MI_CH_Eb = MI_CH_Ds, + MI_CH_E, + MI_CH_F, + MI_CH_Fs, + MI_CH_Gb = MI_CH_Fs, + MI_CH_G , + MI_CH_Gs, + MI_CH_Ab = MI_CH_Gs, + MI_CH_A, + MI_CH_As, + MI_CH_Bb = MI_CH_As, + MI_CH_B, + + // MIDI Chord Keycodes Minor + + MI_CH_Cm, + MI_CH_Csm, + MI_CH_Dbm = MI_CH_Csm, + MI_CH_Dm, + MI_CH_Dsm, + MI_CH_Ebm = MI_CH_Dsm, + MI_CH_Em, + MI_CH_Fm, + MI_CH_Fsm, + MI_CH_Gbm = MI_CH_Fsm, + MI_CH_Gm, + MI_CH_Gsm, + MI_CH_Abm = MI_CH_Gsm, + MI_CH_Am, + MI_CH_Asm, + MI_CH_Bbm = MI_CH_Asm, + MI_CH_Bm, + + //MIDI Chord Keycodes Dominant Seventh + + MI_CH_CDom7, + MI_CH_CsDom7, + MI_CH_DbDom7 = MI_CH_CsDom7, + MI_CH_DDom7, + MI_CH_DsDom7, + MI_CH_EbDom7 = MI_CH_DsDom7, + MI_CH_EDom7, + MI_CH_FDom7, + MI_CH_FsDom7, + MI_CH_GbDom7 = MI_CH_FsDom7, + MI_CH_GDom7, + MI_CH_GsDom7, + MI_CH_AbDom7 = MI_CH_GsDom7, + MI_CH_ADom7, + MI_CH_AsDom7, + MI_CH_BbDom7 = MI_CH_AsDom7, + MI_CH_BDom7, + + // MIDI Chord Keycodes Diminished Seventh + + MI_CH_CDim7, + MI_CH_CsDim7, + MI_CH_DbDim7 = MI_CH_CsDim7, + MI_CH_DDim7, + MI_CH_DsDim7, + MI_CH_EbDim7 = MI_CH_DsDim7, + MI_CH_EDim7, + MI_CH_FDim7, + MI_CH_FsDim7, + MI_CH_GbDim7 = MI_CH_FsDim7, + MI_CH_GDim7, + MI_CH_GsDim7, + MI_CH_AbDim7 = MI_CH_GsDim7, + MI_CH_ADim7, + MI_CH_AsDim7, + MI_CH_BbDim7 = MI_CH_AsDim7, + MI_CH_BDim7, + }; //Keymaps @@ -378,7 +267,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [MIDI_CHORDS] = KEYMAP( TO(0), MI_CH_C, MI_CH_G, MI_CH_D, MI_CH_A, MI_CH_E, MI_CH_B, MI_CH_Gb, MI_CH_Db, MI_CH_Ab, MI_CH_Eb, MI_CH_Bb, MI_CH_F, TO(3), KC_NO, \ - MI_OCTU, MI_CH_Cm, MI_CH_Gm, MI_CH_Dm, MI_CH_Am, MI_CH_Em, MI_CH_Bbm, MI_CH_Gbm, MI_CH_Dbm, MI_CH_Abm, MI_CH_Ebm, MI_CH_Bbm, MI_CH_Fm, KC_NO, \ + MI_OCTU, MI_CH_Cm, MI_CH_Gm, MI_CH_Dm, MI_CH_Am, MI_CH_Em, MI_CH_Bm, MI_CH_Gbm, MI_CH_Dbm, MI_CH_Abm, MI_CH_Ebm, MI_CH_Bbm, MI_CH_Fm, KC_NO, \ MI_OCTD, MI_CH_CDom7, MI_CH_GDom7, MI_CH_DDom7, MI_CH_ADom7, MI_CH_EDom7, MI_CH_BDom7, MI_CH_GbDom7, MI_CH_DbDom7, MI_CH_AbDom7, MI_CH_EbDom7, MI_CH_BbDom7, KC_NO, MI_CH_FDom7, \ MI_CH_CDim7, KC_NO, MI_CH_GDim7, MI_CH_DDim7, MI_CH_ADim7, MI_CH_EDim7, MI_CH_BDim7, MI_CH_GbDim7, MI_CH_DbDim7, MI_CH_AbDim7, MI_CH_EbDim7, MI_CH_BbDim7, KC_NO, MI_CH_FDim7, KC_NO, \ KC_NO, KC_NO, KC_NO, MI_ALLOFF, KC_NO, KC_NO, KC_NO, KC_NO @@ -411,10 +300,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Morse Code Macros -int mc_shift_on = false; +int mc_shift_on = false; // Variable that defines whether MC_LSFT or MC_RSFT are pressed const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + switch(id) { + case 0: //Number 0-) if (record->event.pressed) { if (mc_shift_on == true) { @@ -425,6 +316,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { } } break; + case 1: //Number 1-! if (record->event.pressed) { if (mc_shift_on == true) { @@ -435,6 +327,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { } } break; + case 2: //Number 2-@ if (record->event.pressed) { if (mc_shift_on == true) { @@ -445,11 +338,13 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { } } break; + case 3: // Number 3 if (record->event.pressed) { return MACRO(T(DOT), T(DOT), T(DOT), T(MINS), T(MINS), T(SPACE), END); //...-- } break; + case 4: //Number 4-$ if (record->event.pressed) { if (mc_shift_on == true) { @@ -460,16 +355,19 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { } } break; + case 5: //Number 5 if (record->event.pressed) { return MACRO(T(DOT), T(DOT), T(DOT), T(DOT), T(DOT), T(SPACE), END); //..... } break; + case 6: //Number 6 if (record->event.pressed) { return MACRO(T(MINS), T(DOT), T(DOT), T(DOT), T(DOT), T(SPACE), END); //-.... } break; + case 7: //Number 7-& if (record->event.pressed) { if (mc_shift_on == true) { @@ -480,11 +378,13 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { } } break; + case 8: //Number 8 if (record->event.pressed) { return MACRO(T(MINS), T(MINS), T(MINS), T(DOT), T(DOT), T(SPACE), END); //---.. } break; + case 9: //Number 9-( if (record->event.pressed) { if (mc_shift_on == true) { @@ -495,126 +395,151 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { } } break; + case 10: //Letter A if (record->event.pressed) { return MACRO(T(DOT), T(MINS), T(SPACE), END); //.- } break; + case 11: //Letter B if (record->event.pressed) { return MACRO(T(MINS), T(DOT), T(DOT), T(DOT), T(SPACE), END); //-... } break; + case 12: //Letter C if (record->event.pressed) { return MACRO(T(MINS), T(DOT), T(MINS), T(DOT), T(SPACE), END); //-.-. } break; + case 13: //Letter D if (record->event.pressed) { return MACRO(T(MINS), T(DOT), T(DOT), T(SPACE), END); //-.. } break; + case 14: //Letter E if (record->event.pressed) { return MACRO(T(DOT), T(SPACE), END); //. } break; + case 15: //Letter F if (record->event.pressed) { return MACRO(T(DOT), T(DOT), T(MINS), T(DOT), T(SPACE), END); //..-. } break; + case 16: //Letter G if (record->event.pressed) { return MACRO(T(MINS), T(MINS), T(DOT), T(SPACE), END); //--. } break; + case 17: //Letter H if (record->event.pressed) { return MACRO(T(DOT), T(DOT), T(DOT), T(DOT), T(SPACE), END); //.... } break; + case 18: //Letter I if (record->event.pressed) { return MACRO(T(DOT), T(DOT), T(SPACE), END); //.. } break; + case 19: //Letter J if (record->event.pressed) { return MACRO(T(DOT), T(MINS), T(MINS), T(MINS), T(SPACE), END); //.--- } break; + case 20: //Letter K if (record->event.pressed) { return MACRO(T(MINS), T(DOT), T(MINS), T(SPACE), END); //-.- } break; + case 21: //Letter L if (record->event.pressed) { return MACRO(T(DOT), T(MINS), T(DOT), T(DOT), T(SPACE), END); //.-.. } break; + case 22: //Letter M if (record->event.pressed) { return MACRO(T(MINS), T(MINS), T(SPACE), END); //-- } break; + case 23: //Letter N if (record->event.pressed) { return MACRO(T(MINS), T(DOT), T(SPACE), END); //-. } break; + case 24: //Letter O if (record->event.pressed) { return MACRO(T(MINS), T(MINS), T(MINS), T(SPACE), END); //--- } break; + case 25: //Letter P if (record->event.pressed) { return MACRO(T(DOT), T(MINS), T(MINS), T(DOT), T(SPACE), END); //.--. } break; + case 26: //Letter Q if (record->event.pressed) { return MACRO(T(MINS), T(MINS), T(DOT), T(MINS), T(SPACE), END); //--.- } break; + case 27: //Letter R if (record->event.pressed) { return MACRO(T(DOT), T(MINS), T(DOT), T(SPACE), END); //.-. } break; + case 28: //Letter S if (record->event.pressed) { return MACRO(T(DOT), T(DOT), T(DOT), T(SPACE), END); //... } break; + case 29: //Letter T if (record->event.pressed) { return MACRO(T(MINS), T(SPACE), END); //- } break; + case 30: //Letter U if (record->event.pressed) { return MACRO(T(DOT), T(DOT), T(MINS), T(SPACE), END); //..- } break; + case 31: //Letter V if (record->event.pressed) { return MACRO(T(DOT), T(DOT), T(DOT), T(MINS), T(SPACE), END); //...- } break; + case 32: //Letter W if (record->event.pressed) { return MACRO(T(DOT), T(MINS), T(MINS), T(SPACE), END); //.-- } break; + case 33: //Letter X if (record->event.pressed) { return MACRO(T(MINS), T(DOT), T(DOT), T(MINS), T(SPACE), END); //-..- } break; + case 34: //Letter Y if (record->event.pressed) { if (mc_shift_on == true) { @@ -622,21 +547,25 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { return MACRO(T(MINS), T(DOT), T(MINS), T(MINS), T(SPACE), END); //-.-- } break; + case 35: //Letter Z if (record->event.pressed) { return MACRO(T(MINS), T(MINS), T(DOT), T(DOT), T(SPACE), END); //--.. } break; + case 36: //Punctuation . if (record->event.pressed) { return MACRO(T(DOT), T(MINS), T(DOT), T(MINS), T(DOT), T(MINS), T(SPACE), END); //.-.-.- } break; + case 37: //Punctuation , if (record->event.pressed) { return MACRO(T(MINS), T(MINS), T(DOT), T(DOT), T(MINS), T(MINS), T(SPACE), END); //--..-- } break; + case 38: //Punctuation '-" if (record->event.pressed) { if (mc_shift_on == true) { @@ -647,6 +576,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { } } break; + case 39: //Punctuation /-? if (record->event.pressed) { if (mc_shift_on == true) { @@ -657,6 +587,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { } } break; + case 40: //Punctuation ;-: if (record->event.pressed) { if (mc_shift_on == true) { @@ -667,6 +598,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { } } break; + case 41: //Punctuation =-+ if (record->event.pressed) { if (mc_shift_on == true) { @@ -677,6 +609,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { } } break; + case 42: //Punctuation --_ if (record->event.pressed) { if (mc_shift_on == true) { @@ -687,6 +620,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { } } break; + case 43: //Morse Space if (record->event.pressed) { return MACRO(T(BSLS), T(SPACE), END); //When pressed, this sends a slash followed by a space, making it easier to distinguish words in Morse @@ -699,7 +633,13 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // Custom Keys bool process_record_user (uint16_t keycode, keyrecord_t *record) { + + uint16_t root_note = MIDI_INVALID_NOTE; // Starting value for the root note of each chord + switch(keycode) { + + // Miscellaneous Keycodes + case MAGSYS: //Magic SysRq function - Toggles key on and off depending on state of LALT key if (record->event.pressed) { if (keyboard_report->mods & (MOD_BIT(KC_LALT))) { @@ -711,6 +651,7 @@ bool process_record_user (uint16_t keycode, keyrecord_t *record) { } } break; + case MC_LSFT ... MC_RSFT: if (record->event.pressed) { mc_shift_on = true; @@ -719,141 +660,36 @@ bool process_record_user (uint16_t keycode, keyrecord_t *record) { mc_shift_on = false; } break; - } - return true; -} - -// Midi Chord Function - -const uint16_t PROGMEM fn_actions[] = { - - //Major Chords - - [CMajor] = ACTION_FUNCTION_OPT(C, major), - [CsMajor] = ACTION_FUNCTION_OPT(Cs, major), - [DMajor] = ACTION_FUNCTION_OPT(D, major), - [DsMajor] = ACTION_FUNCTION_OPT(Ds, major), - [EMajor] = ACTION_FUNCTION_OPT(E, major), - [FMajor] = ACTION_FUNCTION_OPT(F, major), - [FsMajor] = ACTION_FUNCTION_OPT(Fs, major), - [GMajor] = ACTION_FUNCTION_OPT(G, major), - [GsMajor] = ACTION_FUNCTION_OPT(Gs, major), - [AMajor] = ACTION_FUNCTION_OPT(A, major), - [AsMajor] = ACTION_FUNCTION_OPT(As, major), - [BMajor] = ACTION_FUNCTION_OPT(B, major), - - //Minor Chords - - [CMinor] = ACTION_FUNCTION_OPT(C, minor), - [CsMinor] = ACTION_FUNCTION_OPT(Cs, minor), - [DMinor] = ACTION_FUNCTION_OPT(D, minor), - [DsMinor] = ACTION_FUNCTION_OPT(Ds, minor), - [EMinor] = ACTION_FUNCTION_OPT(E, minor), - [FMinor] = ACTION_FUNCTION_OPT(F, minor), - [FsMinor] = ACTION_FUNCTION_OPT(Fs, minor), - [GMinor] = ACTION_FUNCTION_OPT(G, minor), - [GsMinor] = ACTION_FUNCTION_OPT(Gs, minor), - [AMinor] = ACTION_FUNCTION_OPT(A, minor), - [AsMinor] = ACTION_FUNCTION_OPT(As, minor), - [BMinor] = ACTION_FUNCTION_OPT(B, minor), - - //Dominant 7th - - [CDom7] = ACTION_FUNCTION_OPT(C, dom_seventh), - [CsDom7] = ACTION_FUNCTION_OPT(Cs, dom_seventh), - [DDom7] = ACTION_FUNCTION_OPT(D, dom_seventh), - [DsDom7] = ACTION_FUNCTION_OPT(Ds, dom_seventh), - [EDom7] = ACTION_FUNCTION_OPT(E, dom_seventh), - [FDom7] = ACTION_FUNCTION_OPT(F, dom_seventh), - [FsDom7] = ACTION_FUNCTION_OPT(Fs, dom_seventh), - [GDom7] = ACTION_FUNCTION_OPT(G, dom_seventh), - [GsDom7] = ACTION_FUNCTION_OPT(Gs, dom_seventh), - [ADom7] = ACTION_FUNCTION_OPT(A, dom_seventh), - [AsDom7] = ACTION_FUNCTION_OPT(As, dom_seventh), - [BDom7] = ACTION_FUNCTION_OPT(B, dom_seventh), - - //Diminished 7th - - [CDim7] = ACTION_FUNCTION_OPT(C, dim_seventh), - [CsDim7] = ACTION_FUNCTION_OPT(Cs, dim_seventh), - [DDim7] = ACTION_FUNCTION_OPT(D, dim_seventh), - [DsDim7] = ACTION_FUNCTION_OPT(Ds, dim_seventh), - [EDim7] = ACTION_FUNCTION_OPT(E, dim_seventh), - [FDim7] = ACTION_FUNCTION_OPT(F, dim_seventh), - [FsDim7] = ACTION_FUNCTION_OPT(Fs, dim_seventh), - [GDim7] = ACTION_FUNCTION_OPT(G, dim_seventh), - [GsDim7] = ACTION_FUNCTION_OPT(Gs, dim_seventh), - [ADim7] = ACTION_FUNCTION_OPT(A, dim_seventh), - [AsDim7] = ACTION_FUNCTION_OPT(As, dim_seventh), - [BDim7] = ACTION_FUNCTION_OPT(B, dim_seventh), -}; -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - uint16_t root_note = MIDI_INVALID_NOTE; - switch (id) { - case C: //Root note C - root_note = MI_C; - break; - case Cs: //Root note C#/Db - root_note = MI_Cs; - break; - case D: // Root note D - root_note = MI_D; - break; - case Ds: // Root note D#/Eb - root_note = MI_Ds; - break; - case E: // Root note E - root_note = MI_E; - break; - case F: // Root note F - root_note = MI_F; - break; - case Fs: // Root note F#/Gb - root_note = MI_Fs; - break; - case G: // Root note G - root_note = MI_G; - break; - case Gs: // Root note G#/Ab - root_note = MI_Gs; - break; - case A: // Root note A - root_note = MI_A; - break; - case As: // Root note A#/Bb - root_note = MI_As; - break; - case B: // Root note B - root_note = MI_B; - break; - } - uint16_t major_third = root_note + 4; - uint16_t minor_third = root_note + 3; - //uint16_t flat_fifth = root_note + 6; - uint16_t fifth = root_note + 7; - uint16_t minor_seventh = root_note + 10; - uint16_t diminished_seventh = root_note -3; - switch (opt) { - case major: //Major chord + // MIDI Chord Keycodes + + case MI_CH_C ... MI_CH_B: // Major Chords + root_note = keycode - MI_CH_C + MI_C; process_midi(root_note, record); - process_midi(major_third, record); - process_midi(fifth, record); + process_midi(root_note + 4, record); // Major Third Note + process_midi(root_note + 7, record); // Fifth Note break; - case minor: //Minor chord + + case MI_CH_Cm ... MI_CH_Bm: // Minor Chord + root_note = keycode - MI_CH_Cm + MI_C; process_midi(root_note, record); - process_midi(minor_third, record); - process_midi(fifth, record); + process_midi(root_note + 3, record); // Minor Third Note + process_midi(root_note + 7, record); // Fifth Note break; - case dom_seventh: //Dominant Seventh chord + + case MI_CH_CDom7 ... MI_CH_BDom7: // Dominant 7th Chord + root_note = keycode - MI_CH_CDom7 + MI_C; process_midi(root_note, record); - process_midi(major_third, record); - process_midi(minor_seventh, record); + process_midi(root_note + 4, record); // Major Third Note + process_midi(root_note + 10, record); // Minor Seventh Note break; - case dim_seventh: //Diminished Seventh Chord + + case MI_CH_CDim7 ... MI_CH_BDim7: // Diminished 7th Chord + root_note = keycode - MI_CH_CDim7 + MI_C; process_midi(root_note, record); - process_midi(minor_third, record); - process_midi(diminished_seventh, record); + process_midi(root_note + 3, record); // Minor Third Note + process_midi(root_note - 3, record); // Diminished 7th Note break; } + return true; } -- cgit v1.2.3 From 78a4cfd453ddd66d2dc3f8c06827e89ec015cdc0 Mon Sep 17 00:00:00 2001 From: Ante Laurijssen Date: Mon, 12 Jun 2017 20:13:17 -0400 Subject: Modifications to readme.md and deletion of keyboard layout images --- .../bluebear/120-button_Stradella_chart.svg | 5190 -------------------- .../bluebear/S60X-Bluebear-ARROWFN-Layer.png | Bin 18499 -> 0 bytes .../keymaps/bluebear/S60X-Bluebear-BASE-Layer.png | Bin 28068 -> 0 bytes .../bluebear/S60X-Bluebear-MIDI_BASE-Layer.png | Bin 22521 -> 0 bytes .../bluebear/S60X-Bluebear-MIDI_CHORD-Layer.png | Bin 23687 -> 0 bytes .../keymaps/bluebear/S60X-Bluebear-MORSE-Layer.png | Bin 14330 -> 0 bytes .../keymaps/bluebear/S60X-Bluebear-MOUSE-Layer.png | Bin 18972 -> 0 bytes keyboards/s60_x/keymaps/bluebear/readme.md | 40 +- 8 files changed, 16 insertions(+), 5214 deletions(-) delete mode 100644 keyboards/s60_x/keymaps/bluebear/120-button_Stradella_chart.svg delete mode 100644 keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-ARROWFN-Layer.png delete mode 100644 keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-BASE-Layer.png delete mode 100644 keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MIDI_BASE-Layer.png delete mode 100644 keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MIDI_CHORD-Layer.png delete mode 100644 keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MORSE-Layer.png delete mode 100644 keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MOUSE-Layer.png (limited to 'keyboards/s60_x') diff --git a/keyboards/s60_x/keymaps/bluebear/120-button_Stradella_chart.svg b/keyboards/s60_x/keymaps/bluebear/120-button_Stradella_chart.svg deleted file mode 100644 index bd878faa1f..0000000000 --- a/keyboards/s60_x/keymaps/bluebear/120-button_Stradella_chart.svg +++ /dev/null @@ -1,5190 +0,0 @@ - - - -image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-ARROWFN-Layer.png b/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-ARROWFN-Layer.png deleted file mode 100644 index 1f659d184d..0000000000 Binary files a/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-ARROWFN-Layer.png and /dev/null differ diff --git a/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-BASE-Layer.png b/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-BASE-Layer.png deleted file mode 100644 index e77287a0f1..0000000000 Binary files a/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-BASE-Layer.png and /dev/null differ diff --git a/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MIDI_BASE-Layer.png b/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MIDI_BASE-Layer.png deleted file mode 100644 index 58ad1605f0..0000000000 Binary files a/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MIDI_BASE-Layer.png and /dev/null differ diff --git a/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MIDI_CHORD-Layer.png b/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MIDI_CHORD-Layer.png deleted file mode 100644 index 74a373ae22..0000000000 Binary files a/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MIDI_CHORD-Layer.png and /dev/null differ diff --git a/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MORSE-Layer.png b/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MORSE-Layer.png deleted file mode 100644 index 0e72d10326..0000000000 Binary files a/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MORSE-Layer.png and /dev/null differ diff --git a/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MOUSE-Layer.png b/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MOUSE-Layer.png deleted file mode 100644 index f37249b811..0000000000 Binary files a/keyboards/s60_x/keymaps/bluebear/S60X-Bluebear-MOUSE-Layer.png and /dev/null differ diff --git a/keyboards/s60_x/keymaps/bluebear/readme.md b/keyboards/s60_x/keymaps/bluebear/readme.md index 6f54d4d580..66c270ff3f 100644 --- a/keyboards/s60_x/keymaps/bluebear/readme.md +++ b/keyboards/s60_x/keymaps/bluebear/readme.md @@ -4,9 +4,7 @@ Custom keyboard layout for my S60X, my first ever custom mechanical keyboard kit This layout was inspired in part by the HHKB line of keyboards and a quest to find the perfect ergonomic, logical layout for what I do. If you like this layout, please feel free to use it, modify it and share it. -## BASE Layer - -![BASE Layer](S60X-Bluebear-BASE-Layer.png) +## [BASE Layer](http://www.keyboard-layout-editor.com/##@_name=S60X - Bluebear - BASE layer&author=Ante Laurijssen&switchMount=cherry&switchBrand=outemu&switchType=PG150Q01-1&plate:true%3B&@_c=%23ff7a00&fa@:0&:0&:0&:0&:0&:0&:0&:0&:0&:0&:9%3B%3B&=Esc%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A<%2F%2Fi>&_c=%23cccccc%3B&=!%0A1&=%2F@%0A2&=%23%0A3&=$%0A4&=%25%0A5&=^%0A6&=%2F&%0A7&=*%0A8&=(%0A9&=)%0A0&={%0A[&=}%0A]&=|%0A\&=~%0A`%3B&@_w:1.5%3B&=Tab&=”%0A’&=<%0A,&=>%0A.&=P&=Y&=F&=G&=C&=R&=L&=%3F%0A%2F%2F&=+%0A%2F=&_w:1.5%3B&=Backspace%3B&@_w:1.75%3B&=Ctrl (hold)%0AEsc (tap)&=A&=O&=E&=U&=I&=D&=H&=T&=N&=S&=%2F_%0A-&_w:2.25%3B&=Enter (tap)%0ACtrl (hold)%3B&@_w:2.25%3B&=Shift (hold)%0A( (tap)&=%2F:%0A%2F%3B&=Q&=J&=K&=X&=B&=M&=W&=V&=Z&_w:2.75%3B&=Shift (hold)%0A) (tap)%3B&@_w:1.25%3B&=Mouse Layer (hold)&_w:1.25%3B&=Win&_w:1.25%3B&=Alt&_a:5&w:6.25%3B&=Space (tap)%0AArrowFN Layer (hold)&_a:4&w:1.25%3B&=AltGr(h)%0AComp (t)&_w:1.25%3B&=Win&_w:1.25%3B&=Ctrl + Shift (oneshot)&_w:1.25%3B&=Ctrl + Alt (oneshot)) -Dvorak keyboard layout -Hold left control key for LCTL, and tap it for ESC @@ -19,49 +17,43 @@ This layout was inspired in part by the HHKB line of keyboards and a quest to fi -Tap key on bottom row, second from the right (where APP usually is) to get CTL-Shift (one shot modifier - next key pressed will be modified by ctl-shift) -Tap key on bottom right to get CTL-Alt (one shot modifier - next key pressed will be modified by ctl-alt) -## ARROWFN Layer - -![ARROWFN Layer](S60X-Bluebear-ARROWFN-Layer.png) +## [ARROWFN Layer](http://www.keyboard-layout-editor.com/##@_name=S60X%20-%20Bluebear%20-%20ARROWFN%20Layer&author=Ante%20Laurijssen&switchMount=cherry&switchBrand=outemu&switchType=PG150Q01-1&plate:true%3B&@_c=%23ff6b00&fa@:0&:0&:0&:0&:0&:0&:0&:0&:0&:0&:9%3B%3B&=Esc%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%3Ci%20class%2F=%27kb%20kb-logo-commodore%27%3E%3C%2F%2Fi%3E&_c=%23cccccc%3B&=F1&=F2&=F3&=F4&=F5&=F6&=F7&=F8&=F9&=F0&=F11&=F12&=To%20MIDI%20Layer&=To%20MORSE%20Layer%3B&@_a:7&w:1.5%3B&=&=&=&=&=&=&=&_a:4%3B&=PgUp&=%3Ci%20class%2F=%27kb%20kb-Arrows-Up%27%3E%3C%2F%2Fi%3E&_a:7%3B&=&=&=&_a:4%3B&=Ins&_w:1.5%3B&=Delete%3B&@_w:1.75%3B&=Caps%20Lock&=Home&_a:7%3B&=&_a:4%3B&=End&_a:7%3B&=&=&=&_a:4%3B&=%3Ci%20class%2F=%27kb%20kb-Arrows-Left%27%3E%3C%2F%2Fi%3E&=%3Ci%20class%2F=%27kb%20kb-Arrows-Down%27%3E%3C%2F%2Fi%3E&=%3Ci%20class%2F=%27kb%20kb-Arrows-Right%27%3E%3C%2F%2Fi%3E&_a:7%3B&=&=&_a:4&w:2.25%3B&=Enter%3B&@_a:7&w:2.25%3B&=&=&=&=&=&=&_a:4%3B&=Space&=PgDn&=Print%20Screen&=Scroll%20Lock&=Pause&_a:7&w:2.75%3B&=%3B&@_w:1.25%3B&=&_w:1.25%3B&=&_w:1.25%3B&=&_w:6.25%3B&=&_w:1.25%3B&=&_w:1.25%3B&=&_w:1.25%3B&=&_w:1.25%3B&=) -Number row becomes F1 to F12 --C, T, H, N keys become Up, Down, Left, Right --Access to various other keys normally found on a full sized keyboard +-C, T, H, N keys become Up, Down, Left, Right (equivalent to IJKL on QWERTY keyboard) +-Access to various other keys normally found on a full sized keyboard (INS, DEL, PSCR, SLCK, PAUSE, PGUP, PGDN, HOME, END) -Top right button toggles MORSE layer -Second from right, top row, toggles MIDI_BASE layer +-Holding Space-B lets you send Space repeatedly +-Hitting the LCTL button in this layer toggles caps lock -## MOUSE Layer - -![MOUSE Layer](S60X-Bluebear-MOUSE-Layer.png) +## [MOUSE Layer](http://www.keyboard-layout-editor.com/##@_name=S60X%20-%20Bluebear%20-%20MOUSE%20Layer&author=Ante%20Laurijssen&switchMount=cherry&switchBrand=outemu&switchType=PG150Q01-1&plate:true;&@_c=#ff7f08&fa@:0&:0&:0&:0&:0&:0&:0&:0&:0&:0&:9;;&=Reset%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%3Ci%20class/=%27kb%20kb-logo-commodore%27%3E%3C//i%3E&_c=#cccccc;&=F13&=F14&=F15&=F16&=F17&=F18&=F19&=F20&=F21&=F22&=F23&=F24&_a:7;&=&=;&@_a:4&w:1.5;&=Debug&_a:7;&=&=&=&=&=&=&_a:4;&=Mouse%20Button%201&_f:3;&=Mouse%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%3Ci%20class/=%27kb%20kb-Arrows-Up%27%3E%3C//i%3E&=Mouse%20Button%202&_f:3;&=Mouse%20Wheel%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%3Ci%20class/=%27kb%20kb-Arrows-Up%27%3E%3C//i%3E&_a:7;&=&=&_w:1.5;&=;&@_a:4&w:1.75;&=Ctl+%0ADel%0A%0A%0A%0A%0AAlt+&_a:7;&=&=&=&=&=&=&_a:4&f:3;&=Mouse%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%3Ci%20class/=%27kb%20kb-Arrows-Left%27%3E%3C//i%3E&_f:3;&=Mouse%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%3Ci%20class/=%27kb%20kb-Arrows-Down%27%3E%3C//i%3E&_f:3;&=Mouse%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%3Ci%20class/=%27kb%20kb-Arrows-Right%27%3E%3C//i%3E&_f:3;&=Mouse%20Wheel%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%3Ci%20class/=%27kb%20kb-Arrows-Down%27%3E%3C//i%3E&=Mouse%20Button%203&_a:7&w:2.25;&=;&@_a:4&w:2.25;&=Magic%0AToggle%0A%0A%0A%0A%0ASysRq&_a:7;&=&=&=&=&=&=&=&=&=&=&_w:2.75;&=;&@_w:1.25;&=&_w:1.25;&=&_w:1.25;&=&_a:5&w:6.25;&=Power&_a:7&w:1.25;&=&_w:1.25;&=&_w:1.25;&=&_w:1.25;&=) -Move the mouse with mouse keys -Hitting the escape key in this layer will give RESET, which puts the controller into dfu mode for flashing firmware onto it +-If Debug is enabled, hitting the TAB key in this layer activates debugging to the console when listening with hid-listen +-TFS button (Three Finger Salute) sends Ctl-Alt-Del +-MAGSYS toggles the Magic SysRq key (works only in Linux) -Hitting the space key in this layer is like hitting power button on computer --Hitting the tab button toggles caps lock -Number row becomes F13 to F24 -## MIDI_BASE Layer +## [MIDI_BASE Layer](http://www.keyboard-layout-editor.com/##@_name=S60X%20-%20Bluebear%20-%20MIDI%20BASE%20Layer&author=Ante%20Laurijssen&switchMount=cherry&switchBrand=outemu&switchType=PG150Q01-1&plate:true;&@_c=#ff8300&a:5&fa@:9;;&=%3Ci%20class/=%27kb%20kb-logo-commodore%27%3E%3C//i%3E%0ABASE%0A%0A%0ALayer&_c=#cccccc&a:4&f:3;&=%F0%9F%8E%B6%0ACmaj&_f:3;&=%F0%9F%8E%B6%0AGmaj&_f:3;&=%F0%9F%8E%B6%0ADmaj&_f:3;&=%F0%9F%8E%B6%0AAmaj&_f:3;&=%F0%9F%8E%B6%0AEmaj&_f:3;&=%F0%9F%8E%B6%0ABmaj&_f:3;&=%F0%9F%8E%B6%0AF#maj%0A%0A%0A%0A%0AGbmaj//&_f:3;&=%F0%9F%8E%B6%0AC#maj%0A%0A%0A%0A%0ADbmaj//&_f:3;&=%F0%9F%8E%B6%0AG#maj%0A%0A%0A%0A%0AAbmaj&_f:3;&=%F0%9F%8E%B6%0AD#maj%0A%0A%0A%0A%0AEbmaj//&_f:3;&=%F0%9F%8E%B6%0AA#maj%0A%0A%0A%0A%0ABbmaj//&_f:3;&=%F0%9F%8E%B6%0AFmaj&_a:7;&=&_a:4&f:3;&=To%0AChord%0A%0A%0A%0A%0AMidi;&@_f:3&w:1.5;&=Octave%20Up&_a:7;&=&_a:4&f:3;&=%E2%99%A9%0AC#//Db&_f:3;&=%E2%99%A9%0AD#//Eb&_a:7;&=&_a:4&f:3;&=%E2%99%A9%0AF#//Gb&_f:3;&=%E2%99%A9%0AG#//Ab&_f:3;&=%E2%99%A9%0AA#//Bb&_a:7;&=&_a:4&f:3;&=%E2%99%A9%0AD1b%0A%0A%0A%0A%0AC1#//&_f:3;&=%E2%99%A9%0AE1b%0A%0A%0A%0A%0AD1#//&_a:7;&=&=&_w:1.5;&=;&@_a:4&f:3&w:1.75;&=Octave%20Down&_f:3;&=%E2%99%A9%0AC&_f:3;&=%E2%99%A9%0AD&_f:3;&=%E2%99%A9%0AE&_f:3;&=%E2%99%A9%0AF&_f:3;&=%E2%99%A9%0AG&_f:3;&=%E2%99%A9%0AA&_f:3;&=%E2%99%A9%0AB&_f:3;&=%E2%99%A9%0AC1&_f:3;&=%E2%99%A9%0AD1&_f:3;&=%E2%99%A9%0AE1&_f:3;&=%E2%99%A9%0AF1&_a:7&w:2.25;&=;&@_a:4&f:3&w:2.25;&=%F0%9F%8E%B6%0ACm&_f:3;&=%F0%9F%8E%B6%0AGm&_f:3;&=%F0%9F%8E%B6%0ADm&_f:3;&=%F0%9F%8E%B6%0AAm&_f:3;&=%F0%9F%8E%B6%0AEm&_f:3;&=%F0%9F%8E%B6%0ABm&_f:3;&=%F0%9F%8E%B6%0AF#m%0A%0A%0A%0A%0AGbm//&_f:3;&=%F0%9F%8E%B6%0AC#m%0A%0A%0A%0A%0ADbm//&_f:3;&=%F0%9F%8E%B6%0AG#m%0A%0A%0A%0A%0AAbm//&_f:3;&=%F0%9F%8E%B6%0AD#m%0A%0A%0A%0A%0AEbm&_f:3;&=%F0%9F%8E%B6%0AA#m%0A%0A%0A%0A%0ABbm//&_f:3&w:2.75;&=%F0%9F%8E%B6%0AFm;&@_a:7&w:1.25;&=&_w:1.25;&=&_w:1.25;&=&_a:5&f:3&w:6.25;&=All%20notes%20off&_a:7&w:1.25;&=&_w:1.25;&=&_w:1.25;&=&_w:1.25;&=) -![MIDI_BASE Layer](S60X-Bluebear-MIDI_BASE-Layer.png) - -This layer was inspired by the Satan Midi layout (https://github.com/qmk/qmk_firmware/tree/master/keyboards/satan/keymaps/midi) and gives access to basic MIDI notes. What I added were two layers of MIDI chords (major and minor triads) arranged in a circle of fifths pattern. Thanks to @fredizzimo for helping me with the code for these chords. +This layer was inspired by the [Satan Midi layout](https://github.com/qmk/qmk_firmware/tree/master/keyboards/satan/keymaps/midi) and gives access to basic MIDI notes. What I added were two layers of MIDI chords (major and minor triads) arranged in a circle of fifths pattern. Thanks to @fredizzimo for helping me with the code for these. -Top right button toggles MORSE_CHORDS layer -Escape brings you back to the BASE layer -## MIDI_CHORD Layer - -![MIDI_CHORD Layer](S60X-Bluebear-MIDI_CHORD-Layer.png) +## [MIDI_CHORD Layer](http://www.keyboard-layout-editor.com/##@_name=S60X%20-%20Bluebear%20-%20MIDI%20CHORD%20Layer&switchMount=cherry&switchBrand=outemu&switchType=PG150Q01-1&plate:true&pcb:false;&@_c=#ff8300&a:5&fa@:9;;&=%3Ci%20class/=%27kb%20kb-logo-commodore%27%3E%3C//i%3E%0ABASE%0A%0A%0ALayer&_c=#cccccc&a:4&f:3;&=%F0%9F%8E%B6%0ACmaj&_f:3;&=%F0%9F%8E%B6%0AGmaj&_f:3;&=%F0%9F%8E%B6%0ADmaj&_f:3;&=%F0%9F%8E%B6%0AAmaj&_f:3;&=%F0%9F%8E%B6%0AEmaj&_f:3;&=%F0%9F%8E%B6%0ABmaj&_f:3;&=%F0%9F%8E%B6%0AF#maj%0A%0A%0A%0A%0AGbmaj//&_f:3;&=%F0%9F%8E%B6%0AC#maj%0A%0A%0A%0A%0ADbmaj//&_f:3;&=%F0%9F%8E%B6%0AG#maj%0A%0A%0A%0A%0AAbmaj&_f:3;&=%F0%9F%8E%B6%0AD#maj%0A%0A%0A%0A%0AEbmaj//&_f:3;&=%F0%9F%8E%B6%0AA#maj%0A%0A%0A%0A%0ABbmaj//&_f:3;&=%F0%9F%8E%B6%0AFmaj&_f:3;&=To%20Midi%20Base&_a:7;&=;&@_a:4&f:3&w:1.5;&=Octave%20Up&_f:3;&=%F0%9F%8E%B6%0ACm&_f:3;&=%F0%9F%8E%B6%0AGm&_f:3;&=%F0%9F%8E%B6%0ADm&_f:3;&=%F0%9F%8E%B6%0AAm&_f:3;&=%F0%9F%8E%B6%0AEm&_f:3;&=%F0%9F%8E%B6%0ABm&_f:3;&=%F0%9F%8E%B6%0AF#m%0A%0A%0A%0A%0AGbm//&_f:3;&=%F0%9F%8E%B6%0AC#m%0A%0A%0A%0A%0ADbm//&_f:3;&=%F0%9F%8E%B6%0AG#m%0A%0A%0A%0A%0AAbm//&_f:3;&=%F0%9F%8E%B6%0AD#m%0A%0A%0A%0A%0AEbm//&_f:3;&=%F0%9F%8E%B6%0AA#m%0A%0A%0A%0A%0ABbm//&_f:3;&=%F0%9F%8E%B6%0AFm&_a:7&w:1.5;&=;&@_a:4&f:3&w:1.75;&=Octave%20Down&_f:3;&=%F0%9F%8E%B6%0AC7&_f:3;&=%F0%9F%8E%B6%0AG7&_f:3;&=%F0%9F%8E%B6%0AD7&_f:3;&=%F0%9F%8E%B6%0AA7&_f:3;&=%F0%9F%8E%B6%0AE7&_f:3;&=%F0%9F%8E%B6%0AB7&_f:3;&=%F0%9F%8E%B6%0AF#7%0A%0A%0A%0A%0AGb7//&_f:3;&=%F0%9F%8E%B6%0AC#7%0A%0A%0A%0A%0ADb7//&_f:3;&=%F0%9F%8E%B6%0AG#7%0A%0A%0A%0A%0AAb7//&_f:3;&=%F0%9F%8E%B6%0AD#7%0A%0A%0A%0A%0AEb7//&_f:3;&=%F0%9F%8E%B6%0AA#7%0A%0A%0A%0A%0ABb7//&_f:3&w:2.25;&=%F0%9F%8E%B6%0AF7;&@_f:3&w:2.25;&=%F0%9F%8E%B6%0ACdim7&_f:3;&=%F0%9F%8E%B6%0AGdim7&_f:3;&=%F0%9F%8E%B6%0ADdim7&_f:3;&=%F0%9F%8E%B6%0AAdim7&_f:3;&=%F0%9F%8E%B6%0AEdim7&_f:3;&=%F0%9F%8E%B6%0ABdim7&_f:3;&=%F0%9F%8E%B6%0Adim7%0A%0A%0A%0A%0AGb&_f:3;&=%F0%9F%8E%B6%0Adim7%0A%0A%0A%0A%0ADb&_f:3;&=%F0%9F%8E%B6%0Adim7%0A%0A%0A%0A%0AAb&_f:3;&=%F0%9F%8E%B6%0Adim7%0A%0A%0A%0A%0AEb&_f:3;&=%F0%9F%8E%B6%0Adim7%0A%0A%0A%0A%0ABb&_f:3&w:2.75;&=%F0%9F%8E%B6%0AFdim7;&@_a:7&w:1.25;&=&_w:1.25;&=&_w:1.25;&=&_a:5&f:3&w:6.25;&=All%20notes%20off&_a:7&w:1.25;&=&_w:1.25;&=&_w:1.25;&=&_w:1.25;&=) -After figuring out how to code my MIDI chord function, I decided to dedicate a full layer to these chords. This chord layout was inspired by the Stradella Base system (https://en.wikipedia.org/wiki/Stradella_bass_system) found on accordions. This layer is a tool for musical composition and songwriting. +After figuring out how to code my MIDI chord function, I decided to dedicate a full layer to these chords. This chord layout was inspired by the [Stradella Base system](https://en.wikipedia.org/wiki/Stradella_bass_system) found on accordions. This layer is a tool for musical composition and songwriting. Originally, I had written the chord functions using the F(n) functions, but finally ended up using process_record_user and custom keycodes. I think this was a more efficient and elegant way of coding these. -Second from right, top row, toggles MIDI_BASE layer -Escape brings you back to the BASE layer -## MORSE LAYER - -![MORSE Layer](S60X-Bluebear-MORSE-Layer.png) +## [MORSE LAYER](http://www.keyboard-layout-editor.com/##@_name=S60X%20-%20Bluebear%20-%20MORSE%20Layer&author=Ante%20Laurijssen&switchMount=cherry&switchBrand=outemu&switchType=PG150Q01-1&plate:true;&@_c=#ff8a00&a:5&fa@:9;;&=%3Ci%20class/=%27kb%20kb-logo-commodore%27%3E%3C//i%3E%0ABASE%0A%0A%0ALayer&_c=#cccccc&a:4&fa@:5&:5;;&=-.-.--%0A.----&=.--.-.%0A..---&=%0A...--&=...-..-%0A....-&=%0A.....&=%0A-....&=.-...%0A--...&=%0A---..&=-.--.%0A----.&=-.--.-%0A-----&_a:7;&=&=&=&=;&@_w:1.5;&=&_a:4;&=.-..-.%0A.----.&=%0A--..--&=%0A.-.-.-&=.--.&=-.--&=..-.&=--.&=-.-.&=.-.&=.-..&=..--..%0A-..-.&=.-.-.%0A-...-&_f:3&w:1.5;&=Backspace;&@_a:7&w:1.75;&=&_a:4&f:3;&=.-&_f:3;&=---&_f:3;&=.&_f:3&n:true;&=..-&_f:3;&=..&_f:3;&=-..&_f:3&n:true;&=....&_f:3;&=-&_f:3;&=-.&_f:3;&=...&_f:3;&=..--.-%0A-....-&_f:3&w:2.25;&=Enter;&@_f:3&w:2.25;&=Shift&_f:3;&=---...%0A-.-.-.&_f:3;&=--.-&_f:3;&=.---&_f:3;&=-.-&_f:3;&=-..-&_f:3;&=-...&_f:3;&=--&_f:3;&=.--&_f:3;&=...-&_f:3;&=--..&_f:3&w:2.75;&=Shift;&@_a:7&w:1.25;&=&_w:1.25;&=&_w:1.25;&=&_a:5&f:3&w:6.25;&=Space%20(%5C%20)&_a:7&w:1.25;&=&_w:1.25;&=&_w:1.25;&=&_w:1.25;&=) -This layer is really just for fun, and because I am a ham radio operator and morse code enthusiast. Hitting the alphanumerical keys in this layer will send a series of dits (.) and dahs (-) representing that character in morse code. +This layer is really just for fun, and because I am a ham radio operator and morse code enthusiast. Hitting the alphanumerical keys in this layer will send a series of dits (.) and dahs (-) representing that character in morse code. This is all done through M(n). There are also a couple of characters that are sent through a shifted key on a regular layout, like @ or !. The same applies on this layer. And because I type using the Dvorak layout, this layer is also arranged in this manner. -Escape brings you back to the BASE layer -- cgit v1.2.3 From 3ee346c07ba60589162c83408e46b28d25b7bf83 Mon Sep 17 00:00:00 2001 From: Ante Laurijssen Date: Mon, 12 Jun 2017 20:20:28 -0400 Subject: Mods to readme.md --- keyboards/s60_x/keymaps/bluebear/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'keyboards/s60_x') diff --git a/keyboards/s60_x/keymaps/bluebear/readme.md b/keyboards/s60_x/keymaps/bluebear/readme.md index 66c270ff3f..153a825990 100644 --- a/keyboards/s60_x/keymaps/bluebear/readme.md +++ b/keyboards/s60_x/keymaps/bluebear/readme.md @@ -4,7 +4,7 @@ Custom keyboard layout for my S60X, my first ever custom mechanical keyboard kit This layout was inspired in part by the HHKB line of keyboards and a quest to find the perfect ergonomic, logical layout for what I do. If you like this layout, please feel free to use it, modify it and share it. -## [BASE Layer](http://www.keyboard-layout-editor.com/##@_name=S60X - Bluebear - BASE layer&author=Ante Laurijssen&switchMount=cherry&switchBrand=outemu&switchType=PG150Q01-1&plate:true%3B&@_c=%23ff7a00&fa@:0&:0&:0&:0&:0&:0&:0&:0&:0&:0&:9%3B%3B&=Esc%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A<%2F%2Fi>&_c=%23cccccc%3B&=!%0A1&=%2F@%0A2&=%23%0A3&=$%0A4&=%25%0A5&=^%0A6&=%2F&%0A7&=*%0A8&=(%0A9&=)%0A0&={%0A[&=}%0A]&=|%0A\&=~%0A`%3B&@_w:1.5%3B&=Tab&=”%0A’&=<%0A,&=>%0A.&=P&=Y&=F&=G&=C&=R&=L&=%3F%0A%2F%2F&=+%0A%2F=&_w:1.5%3B&=Backspace%3B&@_w:1.75%3B&=Ctrl (hold)%0AEsc (tap)&=A&=O&=E&=U&=I&=D&=H&=T&=N&=S&=%2F_%0A-&_w:2.25%3B&=Enter (tap)%0ACtrl (hold)%3B&@_w:2.25%3B&=Shift (hold)%0A( (tap)&=%2F:%0A%2F%3B&=Q&=J&=K&=X&=B&=M&=W&=V&=Z&_w:2.75%3B&=Shift (hold)%0A) (tap)%3B&@_w:1.25%3B&=Mouse Layer (hold)&_w:1.25%3B&=Win&_w:1.25%3B&=Alt&_a:5&w:6.25%3B&=Space (tap)%0AArrowFN Layer (hold)&_a:4&w:1.25%3B&=AltGr(h)%0AComp (t)&_w:1.25%3B&=Win&_w:1.25%3B&=Ctrl + Shift (oneshot)&_w:1.25%3B&=Ctrl + Alt (oneshot)) +## [BASE Layer](http://www.keyboard-layout-editor.com/##@_name=S60X%20-%20Bluebear%20-%20BASE%20layer&author=Ante%20Laurijssen&switchMount=cherry&switchBrand=outemu&switchType=PG150Q01-1&plate:true;&@_c=#ff7a00&fa@:0&:0&:0&:0&:0&:0&:0&:0&:0&:0&:9;;&=Esc%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%3Ci%20class/=%27kb%20kb-logo-commodore%27%3E%3C//i%3E&_c=#cccccc;&=!%0A1&=/@%0A2&=#%0A3&=$%0A4&=%25%0A5&=%5E%0A6&=/&%0A7&=*%0A8&=(%0A9&=)%0A0&=%7B%0A%5B&=%7D%0A%5D&=%7C%0A%5C&=~%0A%60;&@_w:1.5;&=Tab&=%22%0A%27&=%3C%0A,&=%3E%0A.&=P&=Y&=F&=G&=C&=R&=L&=?%0A//&=+%0A/=&_w:1.5;&=Backspace;&@_w:1.75;&=Ctrl%20(hold)%0AEsc%20%20(tap)&=A&=O&=E&=U&=I&=D&=H&=T&=N&=S&=/_%0A-&_w:2.25;&=Enter%20(tap)%0ACtrl%20(hold);&@_w:2.25;&=Shift%20(hold)%0A(%20(tap)&=/:%0A/;&=Q&=J&=K&=X&=B&=M&=W&=V&=Z&_w:2.75;&=Shift%20(hold)%0A)%20(tap);&@_w:1.25;&=Mouse%20Layer%20(hold)&_w:1.25;&=Win&_w:1.25;&=Alt&_a:5&w:6.25;&=Space%20(tap)%0AArrowFN%20Layer%20(hold)&_a:4&w:1.25;&=AltGr(h)%0AComp%20(t)&_w:1.25;&=Win&_w:1.25;&=Ctrl%20+%20Shift%20(oneshot)&_w:1.25;&=Ctrl%20+%20Alt%20(oneshot)) -Dvorak keyboard layout -Hold left control key for LCTL, and tap it for ESC -- cgit v1.2.3 From f37daa53430bafb3abb00efd60d6a684b82ad99a Mon Sep 17 00:00:00 2001 From: Ante Laurijssen Date: Mon, 12 Jun 2017 20:24:56 -0400 Subject: Properly formatted unordered lists in readme.md --- keyboards/s60_x/keymaps/bluebear/readme.md | 58 +++++++++++++++--------------- 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'keyboards/s60_x') diff --git a/keyboards/s60_x/keymaps/bluebear/readme.md b/keyboards/s60_x/keymaps/bluebear/readme.md index 153a825990..d2cf6a4c58 100644 --- a/keyboards/s60_x/keymaps/bluebear/readme.md +++ b/keyboards/s60_x/keymaps/bluebear/readme.md @@ -6,56 +6,56 @@ This layout was inspired in part by the HHKB line of keyboards and a quest to fi ## [BASE Layer](http://www.keyboard-layout-editor.com/##@_name=S60X%20-%20Bluebear%20-%20BASE%20layer&author=Ante%20Laurijssen&switchMount=cherry&switchBrand=outemu&switchType=PG150Q01-1&plate:true;&@_c=#ff7a00&fa@:0&:0&:0&:0&:0&:0&:0&:0&:0&:0&:9;;&=Esc%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%3Ci%20class/=%27kb%20kb-logo-commodore%27%3E%3C//i%3E&_c=#cccccc;&=!%0A1&=/@%0A2&=#%0A3&=$%0A4&=%25%0A5&=%5E%0A6&=/&%0A7&=*%0A8&=(%0A9&=)%0A0&=%7B%0A%5B&=%7D%0A%5D&=%7C%0A%5C&=~%0A%60;&@_w:1.5;&=Tab&=%22%0A%27&=%3C%0A,&=%3E%0A.&=P&=Y&=F&=G&=C&=R&=L&=?%0A//&=+%0A/=&_w:1.5;&=Backspace;&@_w:1.75;&=Ctrl%20(hold)%0AEsc%20%20(tap)&=A&=O&=E&=U&=I&=D&=H&=T&=N&=S&=/_%0A-&_w:2.25;&=Enter%20(tap)%0ACtrl%20(hold);&@_w:2.25;&=Shift%20(hold)%0A(%20(tap)&=/:%0A/;&=Q&=J&=K&=X&=B&=M&=W&=V&=Z&_w:2.75;&=Shift%20(hold)%0A)%20(tap);&@_w:1.25;&=Mouse%20Layer%20(hold)&_w:1.25;&=Win&_w:1.25;&=Alt&_a:5&w:6.25;&=Space%20(tap)%0AArrowFN%20Layer%20(hold)&_a:4&w:1.25;&=AltGr(h)%0AComp%20(t)&_w:1.25;&=Win&_w:1.25;&=Ctrl%20+%20Shift%20(oneshot)&_w:1.25;&=Ctrl%20+%20Alt%20(oneshot)) --Dvorak keyboard layout --Hold left control key for LCTL, and tap it for ESC --Hold enter key for RCTL and tap for ENT --Hold the space key to momentarily switch to ARROWFN layer --Left bottom key acts as momentary switch to the MOUSE layer --Hold right alt key for AltGr and tap for APP(which I have mapped to Compose in OS) --Hold left shift key for LSFT and tap for ( (Space Cadet style) --Hold right shift key for RSFT and tap for ) (Space Cadet style) --Tap key on bottom row, second from the right (where APP usually is) to get CTL-Shift (one shot modifier - next key pressed will be modified by ctl-shift) --Tap key on bottom right to get CTL-Alt (one shot modifier - next key pressed will be modified by ctl-alt) +- Dvorak keyboard layout +- Hold left control key for LCTL, and tap it for ESC +- Hold enter key for RCTL and tap for ENT +- Hold the space key to momentarily switch to ARROWFN layer +- Left bottom key acts as momentary switch to the MOUSE layer +- Hold right alt key for AltGr and tap for APP(which I have mapped to Compose in OS) +- Hold left shift key for LSFT and tap for ( (Space Cadet style) +- Hold right shift key for RSFT and tap for ) (Space Cadet style) +- Tap key on bottom row, second from the right (where APP usually is) to get CTL-Shift (one shot modifier - next key pressed will be modified by ctl-shift) +- Tap key on bottom right to get CTL-Alt (one shot modifier - next key pressed will be modified by ctl-alt) ## [ARROWFN Layer](http://www.keyboard-layout-editor.com/##@_name=S60X%20-%20Bluebear%20-%20ARROWFN%20Layer&author=Ante%20Laurijssen&switchMount=cherry&switchBrand=outemu&switchType=PG150Q01-1&plate:true%3B&@_c=%23ff6b00&fa@:0&:0&:0&:0&:0&:0&:0&:0&:0&:0&:9%3B%3B&=Esc%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%3Ci%20class%2F=%27kb%20kb-logo-commodore%27%3E%3C%2F%2Fi%3E&_c=%23cccccc%3B&=F1&=F2&=F3&=F4&=F5&=F6&=F7&=F8&=F9&=F0&=F11&=F12&=To%20MIDI%20Layer&=To%20MORSE%20Layer%3B&@_a:7&w:1.5%3B&=&=&=&=&=&=&=&_a:4%3B&=PgUp&=%3Ci%20class%2F=%27kb%20kb-Arrows-Up%27%3E%3C%2F%2Fi%3E&_a:7%3B&=&=&=&_a:4%3B&=Ins&_w:1.5%3B&=Delete%3B&@_w:1.75%3B&=Caps%20Lock&=Home&_a:7%3B&=&_a:4%3B&=End&_a:7%3B&=&=&=&_a:4%3B&=%3Ci%20class%2F=%27kb%20kb-Arrows-Left%27%3E%3C%2F%2Fi%3E&=%3Ci%20class%2F=%27kb%20kb-Arrows-Down%27%3E%3C%2F%2Fi%3E&=%3Ci%20class%2F=%27kb%20kb-Arrows-Right%27%3E%3C%2F%2Fi%3E&_a:7%3B&=&=&_a:4&w:2.25%3B&=Enter%3B&@_a:7&w:2.25%3B&=&=&=&=&=&=&_a:4%3B&=Space&=PgDn&=Print%20Screen&=Scroll%20Lock&=Pause&_a:7&w:2.75%3B&=%3B&@_w:1.25%3B&=&_w:1.25%3B&=&_w:1.25%3B&=&_w:6.25%3B&=&_w:1.25%3B&=&_w:1.25%3B&=&_w:1.25%3B&=&_w:1.25%3B&=) --Number row becomes F1 to F12 --C, T, H, N keys become Up, Down, Left, Right (equivalent to IJKL on QWERTY keyboard) --Access to various other keys normally found on a full sized keyboard (INS, DEL, PSCR, SLCK, PAUSE, PGUP, PGDN, HOME, END) --Top right button toggles MORSE layer --Second from right, top row, toggles MIDI_BASE layer --Holding Space-B lets you send Space repeatedly --Hitting the LCTL button in this layer toggles caps lock +- Number row becomes F1 to F12 +- C, T, H, N keys become Up, Down, Left, Right (equivalent to IJKL on QWERTY keyboard) +- Access to various other keys normally found on a full sized keyboard (INS, DEL, PSCR, SLCK, PAUSE, PGUP, PGDN, HOME, END) +- Top right button toggles MORSE layer +- Second from right, top row, toggles MIDI_BASE layer +- Holding Space-B lets you send Space repeatedly +- Hitting the LCTL button in this layer toggles caps lock ## [MOUSE Layer](http://www.keyboard-layout-editor.com/##@_name=S60X%20-%20Bluebear%20-%20MOUSE%20Layer&author=Ante%20Laurijssen&switchMount=cherry&switchBrand=outemu&switchType=PG150Q01-1&plate:true;&@_c=#ff7f08&fa@:0&:0&:0&:0&:0&:0&:0&:0&:0&:0&:9;;&=Reset%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%3Ci%20class/=%27kb%20kb-logo-commodore%27%3E%3C//i%3E&_c=#cccccc;&=F13&=F14&=F15&=F16&=F17&=F18&=F19&=F20&=F21&=F22&=F23&=F24&_a:7;&=&=;&@_a:4&w:1.5;&=Debug&_a:7;&=&=&=&=&=&=&_a:4;&=Mouse%20Button%201&_f:3;&=Mouse%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%3Ci%20class/=%27kb%20kb-Arrows-Up%27%3E%3C//i%3E&=Mouse%20Button%202&_f:3;&=Mouse%20Wheel%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%3Ci%20class/=%27kb%20kb-Arrows-Up%27%3E%3C//i%3E&_a:7;&=&=&_w:1.5;&=;&@_a:4&w:1.75;&=Ctl+%0ADel%0A%0A%0A%0A%0AAlt+&_a:7;&=&=&=&=&=&=&_a:4&f:3;&=Mouse%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%3Ci%20class/=%27kb%20kb-Arrows-Left%27%3E%3C//i%3E&_f:3;&=Mouse%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%3Ci%20class/=%27kb%20kb-Arrows-Down%27%3E%3C//i%3E&_f:3;&=Mouse%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%3Ci%20class/=%27kb%20kb-Arrows-Right%27%3E%3C//i%3E&_f:3;&=Mouse%20Wheel%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%3Ci%20class/=%27kb%20kb-Arrows-Down%27%3E%3C//i%3E&=Mouse%20Button%203&_a:7&w:2.25;&=;&@_a:4&w:2.25;&=Magic%0AToggle%0A%0A%0A%0A%0ASysRq&_a:7;&=&=&=&=&=&=&=&=&=&=&_w:2.75;&=;&@_w:1.25;&=&_w:1.25;&=&_w:1.25;&=&_a:5&w:6.25;&=Power&_a:7&w:1.25;&=&_w:1.25;&=&_w:1.25;&=&_w:1.25;&=) --Move the mouse with mouse keys --Hitting the escape key in this layer will give RESET, which puts the controller into dfu mode for flashing firmware onto it --If Debug is enabled, hitting the TAB key in this layer activates debugging to the console when listening with hid-listen --TFS button (Three Finger Salute) sends Ctl-Alt-Del --MAGSYS toggles the Magic SysRq key (works only in Linux) --Hitting the space key in this layer is like hitting power button on computer --Number row becomes F13 to F24 +- Move the mouse with mouse keys +- Hitting the escape key in this layer will give RESET, which puts the controller into dfu mode for flashing firmware onto it +- If Debug is enabled, hitting the TAB key in this layer activates debugging to the console when listening with hid-listen +- TFS button (Three Finger Salute) sends Ctl-Alt-Del +- MAGSYS toggles the Magic SysRq key (works only in Linux) +- Hitting the space key in this layer is like hitting power button on computer +- Number row becomes F13 to F24 ## [MIDI_BASE Layer](http://www.keyboard-layout-editor.com/##@_name=S60X%20-%20Bluebear%20-%20MIDI%20BASE%20Layer&author=Ante%20Laurijssen&switchMount=cherry&switchBrand=outemu&switchType=PG150Q01-1&plate:true;&@_c=#ff8300&a:5&fa@:9;;&=%3Ci%20class/=%27kb%20kb-logo-commodore%27%3E%3C//i%3E%0ABASE%0A%0A%0ALayer&_c=#cccccc&a:4&f:3;&=%F0%9F%8E%B6%0ACmaj&_f:3;&=%F0%9F%8E%B6%0AGmaj&_f:3;&=%F0%9F%8E%B6%0ADmaj&_f:3;&=%F0%9F%8E%B6%0AAmaj&_f:3;&=%F0%9F%8E%B6%0AEmaj&_f:3;&=%F0%9F%8E%B6%0ABmaj&_f:3;&=%F0%9F%8E%B6%0AF#maj%0A%0A%0A%0A%0AGbmaj//&_f:3;&=%F0%9F%8E%B6%0AC#maj%0A%0A%0A%0A%0ADbmaj//&_f:3;&=%F0%9F%8E%B6%0AG#maj%0A%0A%0A%0A%0AAbmaj&_f:3;&=%F0%9F%8E%B6%0AD#maj%0A%0A%0A%0A%0AEbmaj//&_f:3;&=%F0%9F%8E%B6%0AA#maj%0A%0A%0A%0A%0ABbmaj//&_f:3;&=%F0%9F%8E%B6%0AFmaj&_a:7;&=&_a:4&f:3;&=To%0AChord%0A%0A%0A%0A%0AMidi;&@_f:3&w:1.5;&=Octave%20Up&_a:7;&=&_a:4&f:3;&=%E2%99%A9%0AC#//Db&_f:3;&=%E2%99%A9%0AD#//Eb&_a:7;&=&_a:4&f:3;&=%E2%99%A9%0AF#//Gb&_f:3;&=%E2%99%A9%0AG#//Ab&_f:3;&=%E2%99%A9%0AA#//Bb&_a:7;&=&_a:4&f:3;&=%E2%99%A9%0AD1b%0A%0A%0A%0A%0AC1#//&_f:3;&=%E2%99%A9%0AE1b%0A%0A%0A%0A%0AD1#//&_a:7;&=&=&_w:1.5;&=;&@_a:4&f:3&w:1.75;&=Octave%20Down&_f:3;&=%E2%99%A9%0AC&_f:3;&=%E2%99%A9%0AD&_f:3;&=%E2%99%A9%0AE&_f:3;&=%E2%99%A9%0AF&_f:3;&=%E2%99%A9%0AG&_f:3;&=%E2%99%A9%0AA&_f:3;&=%E2%99%A9%0AB&_f:3;&=%E2%99%A9%0AC1&_f:3;&=%E2%99%A9%0AD1&_f:3;&=%E2%99%A9%0AE1&_f:3;&=%E2%99%A9%0AF1&_a:7&w:2.25;&=;&@_a:4&f:3&w:2.25;&=%F0%9F%8E%B6%0ACm&_f:3;&=%F0%9F%8E%B6%0AGm&_f:3;&=%F0%9F%8E%B6%0ADm&_f:3;&=%F0%9F%8E%B6%0AAm&_f:3;&=%F0%9F%8E%B6%0AEm&_f:3;&=%F0%9F%8E%B6%0ABm&_f:3;&=%F0%9F%8E%B6%0AF#m%0A%0A%0A%0A%0AGbm//&_f:3;&=%F0%9F%8E%B6%0AC#m%0A%0A%0A%0A%0ADbm//&_f:3;&=%F0%9F%8E%B6%0AG#m%0A%0A%0A%0A%0AAbm//&_f:3;&=%F0%9F%8E%B6%0AD#m%0A%0A%0A%0A%0AEbm&_f:3;&=%F0%9F%8E%B6%0AA#m%0A%0A%0A%0A%0ABbm//&_f:3&w:2.75;&=%F0%9F%8E%B6%0AFm;&@_a:7&w:1.25;&=&_w:1.25;&=&_w:1.25;&=&_a:5&f:3&w:6.25;&=All%20notes%20off&_a:7&w:1.25;&=&_w:1.25;&=&_w:1.25;&=&_w:1.25;&=) This layer was inspired by the [Satan Midi layout](https://github.com/qmk/qmk_firmware/tree/master/keyboards/satan/keymaps/midi) and gives access to basic MIDI notes. What I added were two layers of MIDI chords (major and minor triads) arranged in a circle of fifths pattern. Thanks to @fredizzimo for helping me with the code for these. --Top right button toggles MORSE_CHORDS layer --Escape brings you back to the BASE layer +- Top right button toggles MORSE_CHORDS layer +- Escape brings you back to the BASE layer ## [MIDI_CHORD Layer](http://www.keyboard-layout-editor.com/##@_name=S60X%20-%20Bluebear%20-%20MIDI%20CHORD%20Layer&switchMount=cherry&switchBrand=outemu&switchType=PG150Q01-1&plate:true&pcb:false;&@_c=#ff8300&a:5&fa@:9;;&=%3Ci%20class/=%27kb%20kb-logo-commodore%27%3E%3C//i%3E%0ABASE%0A%0A%0ALayer&_c=#cccccc&a:4&f:3;&=%F0%9F%8E%B6%0ACmaj&_f:3;&=%F0%9F%8E%B6%0AGmaj&_f:3;&=%F0%9F%8E%B6%0ADmaj&_f:3;&=%F0%9F%8E%B6%0AAmaj&_f:3;&=%F0%9F%8E%B6%0AEmaj&_f:3;&=%F0%9F%8E%B6%0ABmaj&_f:3;&=%F0%9F%8E%B6%0AF#maj%0A%0A%0A%0A%0AGbmaj//&_f:3;&=%F0%9F%8E%B6%0AC#maj%0A%0A%0A%0A%0ADbmaj//&_f:3;&=%F0%9F%8E%B6%0AG#maj%0A%0A%0A%0A%0AAbmaj&_f:3;&=%F0%9F%8E%B6%0AD#maj%0A%0A%0A%0A%0AEbmaj//&_f:3;&=%F0%9F%8E%B6%0AA#maj%0A%0A%0A%0A%0ABbmaj//&_f:3;&=%F0%9F%8E%B6%0AFmaj&_f:3;&=To%20Midi%20Base&_a:7;&=;&@_a:4&f:3&w:1.5;&=Octave%20Up&_f:3;&=%F0%9F%8E%B6%0ACm&_f:3;&=%F0%9F%8E%B6%0AGm&_f:3;&=%F0%9F%8E%B6%0ADm&_f:3;&=%F0%9F%8E%B6%0AAm&_f:3;&=%F0%9F%8E%B6%0AEm&_f:3;&=%F0%9F%8E%B6%0ABm&_f:3;&=%F0%9F%8E%B6%0AF#m%0A%0A%0A%0A%0AGbm//&_f:3;&=%F0%9F%8E%B6%0AC#m%0A%0A%0A%0A%0ADbm//&_f:3;&=%F0%9F%8E%B6%0AG#m%0A%0A%0A%0A%0AAbm//&_f:3;&=%F0%9F%8E%B6%0AD#m%0A%0A%0A%0A%0AEbm//&_f:3;&=%F0%9F%8E%B6%0AA#m%0A%0A%0A%0A%0ABbm//&_f:3;&=%F0%9F%8E%B6%0AFm&_a:7&w:1.5;&=;&@_a:4&f:3&w:1.75;&=Octave%20Down&_f:3;&=%F0%9F%8E%B6%0AC7&_f:3;&=%F0%9F%8E%B6%0AG7&_f:3;&=%F0%9F%8E%B6%0AD7&_f:3;&=%F0%9F%8E%B6%0AA7&_f:3;&=%F0%9F%8E%B6%0AE7&_f:3;&=%F0%9F%8E%B6%0AB7&_f:3;&=%F0%9F%8E%B6%0AF#7%0A%0A%0A%0A%0AGb7//&_f:3;&=%F0%9F%8E%B6%0AC#7%0A%0A%0A%0A%0ADb7//&_f:3;&=%F0%9F%8E%B6%0AG#7%0A%0A%0A%0A%0AAb7//&_f:3;&=%F0%9F%8E%B6%0AD#7%0A%0A%0A%0A%0AEb7//&_f:3;&=%F0%9F%8E%B6%0AA#7%0A%0A%0A%0A%0ABb7//&_f:3&w:2.25;&=%F0%9F%8E%B6%0AF7;&@_f:3&w:2.25;&=%F0%9F%8E%B6%0ACdim7&_f:3;&=%F0%9F%8E%B6%0AGdim7&_f:3;&=%F0%9F%8E%B6%0ADdim7&_f:3;&=%F0%9F%8E%B6%0AAdim7&_f:3;&=%F0%9F%8E%B6%0AEdim7&_f:3;&=%F0%9F%8E%B6%0ABdim7&_f:3;&=%F0%9F%8E%B6%0Adim7%0A%0A%0A%0A%0AGb&_f:3;&=%F0%9F%8E%B6%0Adim7%0A%0A%0A%0A%0ADb&_f:3;&=%F0%9F%8E%B6%0Adim7%0A%0A%0A%0A%0AAb&_f:3;&=%F0%9F%8E%B6%0Adim7%0A%0A%0A%0A%0AEb&_f:3;&=%F0%9F%8E%B6%0Adim7%0A%0A%0A%0A%0ABb&_f:3&w:2.75;&=%F0%9F%8E%B6%0AFdim7;&@_a:7&w:1.25;&=&_w:1.25;&=&_w:1.25;&=&_a:5&f:3&w:6.25;&=All%20notes%20off&_a:7&w:1.25;&=&_w:1.25;&=&_w:1.25;&=&_w:1.25;&=) After figuring out how to code my MIDI chord function, I decided to dedicate a full layer to these chords. This chord layout was inspired by the [Stradella Base system](https://en.wikipedia.org/wiki/Stradella_bass_system) found on accordions. This layer is a tool for musical composition and songwriting. Originally, I had written the chord functions using the F(n) functions, but finally ended up using process_record_user and custom keycodes. I think this was a more efficient and elegant way of coding these. --Second from right, top row, toggles MIDI_BASE layer --Escape brings you back to the BASE layer +- Second from right, top row, toggles MIDI_BASE layer +- Escape brings you back to the BASE layer ## [MORSE LAYER](http://www.keyboard-layout-editor.com/##@_name=S60X%20-%20Bluebear%20-%20MORSE%20Layer&author=Ante%20Laurijssen&switchMount=cherry&switchBrand=outemu&switchType=PG150Q01-1&plate:true;&@_c=#ff8a00&a:5&fa@:9;;&=%3Ci%20class/=%27kb%20kb-logo-commodore%27%3E%3C//i%3E%0ABASE%0A%0A%0ALayer&_c=#cccccc&a:4&fa@:5&:5;;&=-.-.--%0A.----&=.--.-.%0A..---&=%0A...--&=...-..-%0A....-&=%0A.....&=%0A-....&=.-...%0A--...&=%0A---..&=-.--.%0A----.&=-.--.-%0A-----&_a:7;&=&=&=&=;&@_w:1.5;&=&_a:4;&=.-..-.%0A.----.&=%0A--..--&=%0A.-.-.-&=.--.&=-.--&=..-.&=--.&=-.-.&=.-.&=.-..&=..--..%0A-..-.&=.-.-.%0A-...-&_f:3&w:1.5;&=Backspace;&@_a:7&w:1.75;&=&_a:4&f:3;&=.-&_f:3;&=---&_f:3;&=.&_f:3&n:true;&=..-&_f:3;&=..&_f:3;&=-..&_f:3&n:true;&=....&_f:3;&=-&_f:3;&=-.&_f:3;&=...&_f:3;&=..--.-%0A-....-&_f:3&w:2.25;&=Enter;&@_f:3&w:2.25;&=Shift&_f:3;&=---...%0A-.-.-.&_f:3;&=--.-&_f:3;&=.---&_f:3;&=-.-&_f:3;&=-..-&_f:3;&=-...&_f:3;&=--&_f:3;&=.--&_f:3;&=...-&_f:3;&=--..&_f:3&w:2.75;&=Shift;&@_a:7&w:1.25;&=&_w:1.25;&=&_w:1.25;&=&_a:5&f:3&w:6.25;&=Space%20(%5C%20)&_a:7&w:1.25;&=&_w:1.25;&=&_w:1.25;&=&_w:1.25;&=) This layer is really just for fun, and because I am a ham radio operator and morse code enthusiast. Hitting the alphanumerical keys in this layer will send a series of dits (.) and dahs (-) representing that character in morse code. This is all done through M(n). There are also a couple of characters that are sent through a shifted key on a regular layout, like @ or !. The same applies on this layer. And because I type using the Dvorak layout, this layer is also arranged in this manner. --Escape brings you back to the BASE layer +- Escape brings you back to the BASE layer ### THIS IS STILL A WORK IN PROGRESS -- cgit v1.2.3