Skip to content

Commit

Permalink
Trevonic
Browse files Browse the repository at this point in the history
  • Loading branch information
akatrevorjay committed Nov 8, 2017
1 parent 3f99f52 commit ddcdde1
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 67 deletions.
2 changes: 1 addition & 1 deletion bin/flash-preonic
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ flash() {
echo "connect preonic and press enter"
read

$make ${target}-dfu-util
$make ${target}-dfu
}

flash
13 changes: 13 additions & 0 deletions keyboards/preonic/keymaps/trevonic/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@

#include "../../config.h"

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

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

#define MUSIC_MASK (keycode != KC_NO)

/*
* MIDI options
*/
Expand Down
101 changes: 36 additions & 65 deletions keyboards/preonic/keymaps/trevonic/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,16 @@
// entirely and just use numbers.

enum preonic_layers {
_WORKMAN,
_QWERTY,
_COLEMAK,
_DVORAK,
_LOWER,
_RAISE,
_ADJUST
};

enum preonic_keycodes {
QWERTY = SAFE_RANGE,
COLEMAK,
DVORAK,
WORKMAN = SAFE_RANGE,
QWERTY,
LOWER,
RAISE,
BACKLIT
Expand All @@ -34,6 +32,29 @@ enum preonic_keycodes {

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


// Workman
/*
* ,-----------------------------------------------------------.
* |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| Bsp |
* |-----------------------------------------------------------|
* |Tab/M| Q| D| R| W| B| J| F| U| P| ;| [| ]| \ |
* |-----------------------------------------------------------|
* |Ctrl | A| S| H| T| G| Y| N| E| O| I| '| Return |
* |-----------------------------------------------------------|
* |Shift | Z| X| M| C| V| K| L| ,| .| /| Shift |
* |-----------------------------------------------------------|
* |Ctrl | Alt | GUI | Space/FN | Alt | GUI | Ctrl | qwerty |
* `-----------------------------------------------------------'
*/
[_WORKMAN] = { /* Workman */
{KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC},
{KC_TAB, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_DEL},
{KC_ESC, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, KC_QUOT},
{KC_LSFT, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, KC_ENT},
{BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
},

/* Qwerty
* ,-----------------------------------------------------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
Expand All @@ -55,48 +76,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
{BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
},

/* Colemak
* ,-----------------------------------------------------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Esc | A | R | S | T | D | H | N | E | I | O | " |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_COLEMAK] = {
{KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC},
{KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL},
{KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT},
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT },
{BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
},

/* Dvorak
* ,-----------------------------------------------------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Tab | " | , | . | P | Y | F | G | C | R | L | Del |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Esc | A | O | E | U | I | D | H | T | N | S | / |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_DVORAK] = {
{KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC},
{KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL},
{KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH},
{KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT },
{BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
},

/* Lower
* ,-----------------------------------------------------------------------------------.
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
Expand Down Expand Up @@ -155,7 +134,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_ADJUST] = {
{KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12},
{_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL},
{_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______},
{_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, WORKMAN, QWERTY, _______, _______, _______},
{_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
}
Expand All @@ -171,9 +150,10 @@ float tone_startup[][2] = {
{NOTE_B6, 8}
};

float tone_workman[][2] = SONG(DVORAK_SOUND);
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
float tone_dvorak[][2] = SONG(DVORAK_SOUND);
float tone_colemak[][2] = SONG(COLEMAK_SOUND);
/* float tone_dvorak[][2] = SONG(DVORAK_SOUND); */
/* float tone_colemak[][2] = SONG(COLEMAK_SOUND); */

float tone_goodbye[][2] = SONG(GOODBYE_SOUND);

Expand All @@ -187,30 +167,21 @@ void persistent_default_layer_set(uint16_t default_layer) {

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
case WORKMAN:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
PLAY_NOTE_ARRAY(tone_workman, false, 0);
#endif
persistent_default_layer_set(1UL<<_QWERTY);
}
return false;
break;
case COLEMAK:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_colemak, false, 0);
#endif
persistent_default_layer_set(1UL<<_COLEMAK);
persistent_default_layer_set(1UL<<_WORKMAN);
}
return false;
break;
case DVORAK:
case QWERTY:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
#endif
persistent_default_layer_set(1UL<<_DVORAK);
persistent_default_layer_set(1UL<<_QWERTY);
}
return false;
break;
Expand Down

0 comments on commit ddcdde1

Please sign in to comment.