layout(preonic): update to dudeofawesome's layout (#2507)
* 🎉 duplicate default Preonic keymap * ✨ add Workman layout * 🚚 swap backspace and delete * ✨ enable hold enter for shift * 🚚 swap media play and next * 💄 use Planck startup sound * 💄 add Workman layer sound * ✨ add numpad layer * 💄 add new workman sound * 📝 add README * 🎨 fix layout formatting * 📝 add image of numpad layer * 📦 changing chibios submodule version to match upstream/master's version * ✨ add caps lock key on adjust layer * ✨ reworking numpad layer to match a real numpad * ✨ add double tap to activate numpad * 📝 fix layout comments * 📝 update numpad layer render * ✨ adding operator keys to left hand on numpad * 🎨 shorten numpad keycodes * 🎨 remove redundant breaks * 📝 update numpad layer render * 🎨 fix indentation * 🔧 add rules file * ✨🔊 play sound when switching to numpad layer * 🔨 use userspace soundsmaster
parent
48321c3eee
commit
f139c3db8d
|
@ -1,27 +1,20 @@
|
|||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "config_common.h"
|
||||
#include "../../config.h"
|
||||
#include "dudeofawesome.h"
|
||||
|
||||
#define TAPPING_TOGGLE 2
|
||||
|
||||
#ifdef AUDIO_ENABLE
|
||||
#define STARTUP_SONG SONG(PLANCK_SOUND)
|
||||
// #define STARTUP_SONG SONG(NO_SOUND)
|
||||
#define STARTUP_SONG SONG(PLANCK_SOUND)
|
||||
// #define STARTUP_SONG SONG(NO_SOUND)
|
||||
|
||||
#define WORKMAN_SOUND \
|
||||
E__NOTE(_GS7), \
|
||||
ED_NOTE(_E7), \
|
||||
S__NOTE(_REST), \
|
||||
E__NOTE(_A6), \
|
||||
S__NOTE(_REST), \
|
||||
ED_NOTE(_GS6),
|
||||
|
||||
#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
|
||||
SONG(WORKMAN_SOUND), \
|
||||
SONG(COLEMAK_SOUND), \
|
||||
SONG(DVORAK_SOUND) \
|
||||
}
|
||||
#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
|
||||
SONG(WORKMAN_SOUND), \
|
||||
SONG(COLEMAK_SOUND), \
|
||||
SONG(DVORAK_SOUND) \
|
||||
}
|
||||
#endif
|
||||
|
||||
#define MUSIC_MASK (keycode != KC_NO)
|
||||
|
|
|
@ -213,63 +213,77 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case QWERTY:
|
||||
if (record->event.pressed) {
|
||||
set_single_persistent_default_layer(_QWERTY);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case WORKMAN:
|
||||
if (record->event.pressed) {
|
||||
set_single_persistent_default_layer(_WORKMAN);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case COLEMAK:
|
||||
if (record->event.pressed) {
|
||||
set_single_persistent_default_layer(_COLEMAK);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case DVORAK:
|
||||
if (record->event.pressed) {
|
||||
set_single_persistent_default_layer(_DVORAK);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case LOWER:
|
||||
if (record->event.pressed) {
|
||||
layer_on(_LOWER);
|
||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||
} else {
|
||||
layer_off(_LOWER);
|
||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case RAISE:
|
||||
if (record->event.pressed) {
|
||||
layer_on(_RAISE);
|
||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||
} else {
|
||||
layer_off(_RAISE);
|
||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case BACKLIT:
|
||||
if (record->event.pressed) {
|
||||
register_code(KC_RSFT);
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
backlight_step();
|
||||
#endif
|
||||
PORTE &= ~(1<<6);
|
||||
} else {
|
||||
unregister_code(KC_RSFT);
|
||||
PORTE |= (1<<6);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case QWERTY:
|
||||
if (record->event.pressed) {
|
||||
set_single_persistent_default_layer(_QWERTY);
|
||||
}
|
||||
return true;
|
||||
return false;
|
||||
case WORKMAN:
|
||||
if (record->event.pressed) {
|
||||
set_single_persistent_default_layer(_WORKMAN);
|
||||
}
|
||||
return false;
|
||||
case COLEMAK:
|
||||
if (record->event.pressed) {
|
||||
set_single_persistent_default_layer(_COLEMAK);
|
||||
}
|
||||
return false;
|
||||
case DVORAK:
|
||||
if (record->event.pressed) {
|
||||
set_single_persistent_default_layer(_DVORAK);
|
||||
}
|
||||
return false;
|
||||
case LOWER:
|
||||
if (record->event.pressed) {
|
||||
layer_on(_LOWER);
|
||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||
} else {
|
||||
layer_off(_LOWER);
|
||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||
}
|
||||
return false;
|
||||
case RAISE:
|
||||
if (record->event.pressed) {
|
||||
layer_on(_RAISE);
|
||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||
} else {
|
||||
layer_off(_RAISE);
|
||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||
}
|
||||
return false;
|
||||
case BACKLIT:
|
||||
if (record->event.pressed) {
|
||||
register_code(KC_RSFT);
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
backlight_step();
|
||||
#endif
|
||||
PORTE &= ~(1<<6);
|
||||
} else {
|
||||
unregister_code(KC_RSFT);
|
||||
PORTE |= (1<<6);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
bool numpadActive = false;
|
||||
|
||||
float tone_numpad_on[][2] = SONG(NUMPAD_ON_SOUND);
|
||||
|
||||
void matrix_scan_user (void) {
|
||||
uint8_t layer = biton32(layer_state);
|
||||
|
||||
switch (layer) {
|
||||
case _NUMPAD:
|
||||
if (!numpadActive) {
|
||||
numpadActive = true;
|
||||
PLAY_SONG(tone_numpad_on);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (numpadActive) {
|
||||
numpadActive = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
- Dvorak
|
||||
- Colemak
|
||||
- Numpad layer
|
||||
![numpad layer](https://i.imgur.com/V5iGHZg.png)
|
||||
![numpad layer](https://i.imgur.com/IH8sWmQ.png)
|
||||
- Audio
|
||||
|
||||
## Building and flashing
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||
MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = yes # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
|
@ -14,6 +14,12 @@
|
|||
E__NOTE(_A6), \
|
||||
S__NOTE(_REST), \
|
||||
ED_NOTE(_GS6),
|
||||
|
||||
#define NUMPAD_ON_SOUND \
|
||||
E__NOTE(_C6), \
|
||||
ED_NOTE(_BF5), \
|
||||
S__NOTE(_C6), \
|
||||
ED_NOTE(_BF5),
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue