summaryrefslogtreecommitdiff
path: root/keyboards
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards')
-rw-r--r--keyboards/preonic/keymaps/dudeofawesome/config.h27
-rw-r--r--keyboards/preonic/keymaps/dudeofawesome/keymap.c130
-rw-r--r--keyboards/preonic/keymaps/dudeofawesome/readme.md2
-rw-r--r--keyboards/preonic/keymaps/dudeofawesome/rules.mk5
4 files changed, 88 insertions, 76 deletions
diff --git a/keyboards/preonic/keymaps/dudeofawesome/config.h b/keyboards/preonic/keymaps/dudeofawesome/config.h
index 566fac3ed3..48bd13ba45 100644
--- a/keyboards/preonic/keymaps/dudeofawesome/config.h
+++ b/keyboards/preonic/keymaps/dudeofawesome/config.h
@@ -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 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 STARTUP_SONG SONG(PLANCK_SOUND)
+ // #define STARTUP_SONG SONG(NO_SOUND)
+
+ #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
+ SONG(WORKMAN_SOUND), \
+ SONG(COLEMAK_SOUND), \
+ SONG(DVORAK_SOUND) \
+ }
#endif
#define MUSIC_MASK (keycode != KC_NO)
diff --git a/keyboards/preonic/keymaps/dudeofawesome/keymap.c b/keyboards/preonic/keymaps/dudeofawesome/keymap.c
index e8faf670be..dbe7fb6488 100644
--- a/keyboards/preonic/keymaps/dudeofawesome/keymap.c
+++ b/keyboards/preonic/keymaps/dudeofawesome/keymap.c
@@ -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;
+ }
+ }
};
diff --git a/keyboards/preonic/keymaps/dudeofawesome/readme.md b/keyboards/preonic/keymaps/dudeofawesome/readme.md
index 244442494d..a5d89fc828 100644
--- a/keyboards/preonic/keymaps/dudeofawesome/readme.md
+++ b/keyboards/preonic/keymaps/dudeofawesome/readme.md
@@ -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
diff --git a/keyboards/preonic/keymaps/dudeofawesome/rules.mk b/keyboards/preonic/keymaps/dudeofawesome/rules.mk
index e69de29bb2..4434d3de7e 100644
--- a/keyboards/preonic/keymaps/dudeofawesome/rules.mk
+++ b/keyboards/preonic/keymaps/dudeofawesome/rules.mk
@@ -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.