summaryrefslogtreecommitdiff
path: root/keyboard/planck
diff options
context:
space:
mode:
authorIBNobody <ibnobody@gmail.com>2016-04-16 19:31:32 -0500
committerIBNobody <ibnobody@gmail.com>2016-04-16 19:31:32 -0500
commit4aea806aa8aa585930a89b67d7206050ac6adb3a (patch)
treead8b36cc2ebb7500a531ff4601a6fbdf1086ffe2 /keyboard/planck
parentb5c22ab5b5b77d5e21cc4145831608eed6756ad7 (diff)
parentb8d2e66638409066661e7dd3c66473d583256ec5 (diff)
downloadqmk_firmware-4aea806aa8aa585930a89b67d7206050ac6adb3a.tar.gz
qmk_firmware-4aea806aa8aa585930a89b67d7206050ac6adb3a.zip
Adding Musical Notes
Diffstat (limited to 'keyboard/planck')
-rw-r--r--keyboard/planck/keymaps/bone2planck.c112
-rw-r--r--keyboard/planck/keymaps/default/README.md32
-rw-r--r--keyboard/planck/keymaps/default/keymap.c86
3 files changed, 159 insertions, 71 deletions
diff --git a/keyboard/planck/keymaps/bone2planck.c b/keyboard/planck/keymaps/bone2planck.c
new file mode 100644
index 0000000000..a99e7719f9
--- /dev/null
+++ b/keyboard/planck/keymaps/bone2planck.c
@@ -0,0 +1,112 @@
+
+#include "planck.h"
+#ifdef BACKLIGHT_ENABLE
+#include "backlight.h"
+#endif
+#include "..\..\quantum\keymap_extras\keymap_german.h"
+
+/* This Layout tries to emulate the Bone2 Variant of Neo2, and is intended to be used with a German QWERTZ Softwarelayout.
+ It has Umlauts and "ß" as it is optimized for a mix of German & English.
+ My favourite features are the placement of the special characters often used for programming right on the home row
+ and the number & navigation block combo, so you never have to move your hands from their home position.
+
+ Bone2 wiki page: http://wiki.neo-layout.org/wiki/Bone
+*/
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+ /* Bone2
+ * ,-----------------------------------------------------------------------------------.
+ * | Q | J | D | U | A | X | P | H | L | M | W | ẞ |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | M1 | C | T | I | E | O | B | N | R | S | G | M1 |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | Shift| F | V | Ü | Ä | Ö | Y | Z | , | . | K |Shift |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Ctrl | GUI | Alt | M3 | M2 | Space | M2 | M3 | Esc | Tab |Enter |
+ * `-----------------------------------------------------------------------------------'
+ */
+ [0] = {
+ { DE_Q, DE_J, DE_D, DE_U, DE_A, DE_X, DE_P, DE_H, DE_L, DE_M, DE_W, DE_SS },
+ { MO(1), DE_C, DE_T, DE_I, DE_E, DE_O, DE_B, DE_N, DE_R, DE_S, DE_G, MO(1) },
+ { DE_S, DE_F, DE_V, DE_UE, DE_AE, DE_OE, DE_Y, DE_Z, DE_COMM, DE_DOT, DE_K, DE_S },
+ { KC_LCTL, KC_LGUI, KC_LALT, MO(3), MO(2), KC_SPC, KC_SPC, MO(2), MO(3), KC_ESC, KC_TAB, KC_ENT }
+ },
+
+ /* M1 Special Characters
+ * ,-----------------------------------------------------------------------------------.
+ * | ° | @ | _ | [ | ] | ^ | ! | < | > | = | & | |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | M1 | \ | / | { | } | * | ? | ( | ) | - | : | M1 |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | # | $ | | | ~ | € | + | % | " | ' | ; | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Ctrl | GUI | Alt | M3 | M2 | Space | M2 | M3 | Esc | Tab |Enter |
+ * `-----------------------------------------------------------------------------------'
+ */
+ [1] = {
+ { DE_RING, DE_AT, DE_UNDS, DE_LBRC, DE_RBRC, DE_CIRC, DE_EXLM, DE_LESS, DE_MORE, DE_EQL, DE_AMPR, KC_NO },
+ { KC_TRNS, DE_BSLS, DE_SLSH, DE_LCBR, DE_RCBR, DE_ASTR, DE_QST, DE_LPRN, DE_RPRN, DE_MINS, DE_COLN, KC_TRNS },
+ { KC_NO , DE_HASH, DE_DLR, DE_PIPE, DE_TILD, DE_EURO, DE_PLUS, DE_PERC, DE_DQOT, DE_QUOT, DE_SCLN, KC_NO },
+ { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS }
+ },
+
+ /* Navigation & Number Blocks
+ * ,-----------------------------------------------------------------------------------.
+ * | | PgUp | Bksp | Up | DEL | PgDn | | 7 | 8 | 9 | | |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | | Home | Lft | Down | Right| End | . | 4 | 5 | 6 | , | |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | Shift| | Tab | Ins | Enter| | 0 | 1 | 2 | 3 | ; |Shift |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Ctrl | GUI | Alt | M3 | M2 | Space | M2 | M3 | Esc | Tab |Enter |
+ * `-----------------------------------------------------------------------------------'
+ */
+ [2] = {
+ { KC_NO, KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PGDN, KC_NO, DE_7, DE_8, DE_9, KC_NO, KC_NO },
+ { KC_NO, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, DE_DOT, DE_4, DE_5, DE_6, DE_COMM, KC_NO },
+ { DE_S, KC_NO, KC_TAB, KC_INS, KC_ENT, KC_NO, KC_0, DE_1, DE_2, DE_3, DE_SCLN, DE_S },
+ { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS }
+ },
+
+ /* Function & Media Keys
+ * ,-----------------------------------------------------------------------------------.
+ * | | | Print|Scroll|Pause | | | F7 | F8 | F9 | F12 | |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | | | Mute | Vol- | Vol+ | | ³ | F4 | F5 | F6 | F11 | |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | Shift| | Prev | Play | Next | | ² | F1 | F2 | F3 | F10 |Shift |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Ctrl | GUI | Alt | M3 | | Space | | M3 | Esc | Tab |Enter |
+ * `-----------------------------------------------------------------------------------'
+ */
+ [3] = {
+ { KC_NO, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_NO, KC_NO, KC_F7, KC_F8, KC_F9, KC_F12, KC_NO },
+ { KC_NO, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, DE_SQ3, KC_F4, KC_F5, KC_F6, KC_F11, KC_NO },
+ { KC_TRNS, KC_NO, KC_MPRV, KC_MPLY, KC_MNXT, KC_NO, DE_SQ2, KC_F1, KC_F2, KC_F3, KC_F10, KC_TRNS},
+ { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}
+ }
+};
+
+const uint16_t PROGMEM fn_actions[] = {
+
+};
+
+const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
+{
+ // MACRODOWN only works in this function
+ switch (id) {
+ case 0:
+ if (record->event.pressed) {
+ register_code(KC_RSFT);
+#ifdef BACKLIGHT_ENABLE
+ backlight_step();
+#endif
+ }
+ else {
+ unregister_code(KC_RSFT);
+ }
+ break;
+ }
+ return MACRO_NONE;
+};
diff --git a/keyboard/planck/keymaps/default/README.md b/keyboard/planck/keymaps/default/README.md
index d2f43bbdb8..de9680b498 100644
--- a/keyboard/planck/keymaps/default/README.md
+++ b/keyboard/planck/keymaps/default/README.md
@@ -1,34 +1,2 @@
# The Default Planck Layout
- const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
- [_QW] = { /* Qwerty */
- {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
- {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
- {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT },
- {M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
- },
- [_CM] = { /* Colemak */
- {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC},
- {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 },
- {M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
- },
- [_DV] = { /* Dvorak */
- {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC},
- {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 },
- {M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
- },
- [_RS] = { /* RAISE */
- {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_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS},
- {KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_QW), DF(_CM), DF(_DV), RESET, KC_TRNS},
- {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
- },
- [_LW] = { /* LOWER */
- {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC},
- {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE},
- {KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_QW), DF(_CM), DF(_DV), RESET, KC_TRNS},
- {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
- }
- }; \ No newline at end of file
diff --git a/keyboard/planck/keymaps/default/keymap.c b/keyboard/planck/keymaps/default/keymap.c
index dee2840f2d..ede08ad7f1 100644
--- a/keyboard/planck/keymaps/default/keymap.c
+++ b/keyboard/planck/keymaps/default/keymap.c
@@ -19,12 +19,16 @@
#define _AD 5
// Macro name shortcuts
-#define M_QW 0
-#define M_CM 1
-#define M_DV 2
-#define M_LW 3
-#define M_RS 4
+#define QWERTY M(_QW)
+#define COLEMAK M(_CM)
+#define DVORAK M(_DV)
+#define LOWER M(_LW)
+#define RAISE M(_RS)
#define M_BL 5
+#ifdef AUDIO_ENABLE
+ #define AUD_OFF M(6)
+ #define AUD_ON M(7)
+#endif
// Fillers to make layering more clear
#define _______ KC_TRNS
@@ -47,7 +51,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
{KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
{KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT },
- {M(M_BL), KC_LCTL, KC_LALT, KC_LGUI, M(M_LW), KC_SPC, KC_SPC, M(M_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
+ {M(M_BL), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
},
/* Colemak
@@ -65,7 +69,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
{KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC},
{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 },
- {M(M_BL), KC_LCTL, KC_LALT, KC_LGUI, M(M_LW), KC_SPC, KC_SPC, M(M_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
+ {M(M_BL), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
},
/* Dvorak
@@ -83,7 +87,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
{KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC},
{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 },
- {M(M_BL), KC_LCTL, KC_LALT, KC_LGUI, M(M_LW), KC_SPC, KC_SPC, M(M_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
+ {M(M_BL), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
},
/* Lower
@@ -126,7 +130,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* ,-----------------------------------------------------------------------------------.
* | | Reset| | | | | | | | | | Del |
* |------+------+------+------+------+-------------+------+------+------+------+------|
- * | | | | | | | |Qwerty|Colemk|Dvorak| | |
+ * | | | |Aud on|Audoff| | |Qwerty|Colemk|Dvorak| | |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | | | | | | | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
@@ -135,7 +139,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
[_AD] = {
{_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL},
- {_______, _______, _______, _______, _______, _______, _______, M(M_QW), M(M_CM), M(M_DV), _______, _______},
+ {_______, _______, _______, AUD_ON, AUD_OFF, _______, _______, QWERTY, COLEMAK, DVORAK, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
}
@@ -146,6 +150,14 @@ const uint16_t PROGMEM fn_actions[] = {
};
#ifdef AUDIO_ENABLE
+float start_up[][2] = {
+ {440.0*pow(2.0,(67)/12.0), 12},
+ {440.0*pow(2.0,(64)/12.0), 8},
+ {440.0*pow(2.0,(55)/12.0), 8},
+ {440.0*pow(2.0,(60)/12.0), 8},
+ {440.0*pow(2.0,(64)/12.0), 20}
+};
+
float tone_qw[][2] = {
{440.0*pow(2.0,(59)/12.0), 8},
{440.0*pow(2.0,(60)/12.0), 8},
@@ -157,38 +169,29 @@ float tone_cm[][2] = {
{440.0*pow(2.0,(59)/12.0), 8},
{440.0*pow(2.0,(60)/12.0), 8},
{0, 4},
- {440.0*pow(2.0,(67)/12.0), 16},
+ {440.0*pow(2.0,(67)/12.0), 12},
{0, 4},
- {440.0*pow(2.0,(71)/12.0), 16}
+ {440.0*pow(2.0,(71)/12.0), 12}
};
float tone_dv[][2] = {
{440.0*pow(2.0,(59)/12.0), 8},
{440.0*pow(2.0,(60)/12.0), 8},
{0, 4},
- {440.0*pow(2.0,(67)/12.0), 16},
+ {440.0*pow(2.0,(67)/12.0), 8},
{0, 4},
- {440.0*pow(2.0,(69)/12.0), 16},
+ {440.0*pow(2.0,(69)/12.0), 8},
{0, 4},
- {440.0*pow(2.0,(67)/12.0), 16}
+ {440.0*pow(2.0,(67)/12.0), 8}
};
#endif
-#define IS_LAYER_ON(layer) ((layer_state) & (1<<(layer)))
-#define IS_LAYER_OFF(layer) ((!layer_state) & (1<<(layer)))
-void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3) {
- if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) {
- layer_on(layer3);
- } else {
- layer_off(layer3);
- }
-}
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
// MACRODOWN only works in this function
switch(id) {
- case M_QW:
+ case _QW:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
play_notes(&tone_qw, 4, false);
@@ -196,7 +199,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
default_layer_set(1UL<<_QW);
}
break;
- case M_CM:
+ case _CM:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
play_notes(&tone_cm, 6, false);
@@ -204,7 +207,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
default_layer_set(1UL<<_CM);
}
break;
- case M_DV:
+ case _DV:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
play_notes(&tone_dv, 8, false);
@@ -212,7 +215,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
default_layer_set(1UL<<_DV);
}
break;
- case M_LW:
+ case _LW:
if (record->event.pressed) {
layer_on(_LW);
update_tri_layer(_LW, _RS, _AD);
@@ -221,7 +224,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
update_tri_layer(_LW, _RS, _AD);
}
break;
- case M_RS:
+ case _RS:
if (record->event.pressed) {
layer_on(_RS);
update_tri_layer(_LW, _RS, _AD);
@@ -240,20 +243,25 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
unregister_code(KC_RSFT);
}
break;
+ case 6:
+ if (record->event.pressed) {
+ #ifdef AUDIO_ENABLE
+ audio_off();
+ #endif
+ }
+ break;
+ case 7:
+ if (record->event.pressed) {
+ #ifdef AUDIO_ENABLE
+ audio_on();
+ play_notes(&start_up, 5, false);
+ #endif
+ }
+ break;
}
return MACRO_NONE;
};
-#ifdef AUDIO_ENABLE
-float start_up[][2] = {
- {440.0*pow(2.0,(67)/12.0), 12},
- {440.0*pow(2.0,(64)/12.0), 8},
- {440.0*pow(2.0,(55)/12.0), 8},
- {440.0*pow(2.0,(60)/12.0), 8},
- {440.0*pow(2.0,(64)/12.0), 20}
-};
-#endif
-
void matrix_init_user(void) {
#ifdef AUDIO_ENABLE
init_notes();