summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/handwired/promethium/config.h104
-rw-r--r--keyboards/handwired/promethium/keymaps/priyadi/README.md44
-rw-r--r--keyboards/handwired/promethium/keymaps/priyadi/config.h8
-rw-r--r--keyboards/handwired/promethium/keymaps/priyadi/keymap.c452
-rw-r--r--keyboards/handwired/promethium/keymaps/priyadi/readme.md0
-rw-r--r--keyboards/handwired/promethium/promethium.c4
-rw-r--r--keyboards/handwired/promethium/promethium.h106
-rw-r--r--keyboards/planck/keymaps/priyadi/config.h39
-rw-r--r--keyboards/planck/keymaps/priyadi/keymap.c681
9 files changed, 468 insertions, 970 deletions
diff --git a/keyboards/handwired/promethium/config.h b/keyboards/handwired/promethium/config.h
index fd45c2bfe3..24f02993fb 100644
--- a/keyboards/handwired/promethium/config.h
+++ b/keyboards/handwired/promethium/config.h
@@ -152,6 +152,110 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
//#define NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION
+#define PS2_INIT_DELAY 2000
+#define BATTERY_PIN 9
+#define BATTERY_POLL 30000
+#define MAX_VOLTAGE 4.2
+#define MIN_VOLTAGE 3.2
+
+#define KEYMAP( \
+ k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \
+ k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \
+ k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \
+ k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c \
+) \
+{ \
+ {k11, k12, k13, k14, k15, k16}, \
+ {k21, k22, k23, k24, k25, k26}, \
+ {k31, k32, k33, k34, k35, k36}, \
+ {k41, k42, k43, k44, k45, k46}, \
+ {k17, k18, k19, k1a, k1b, k1c}, \
+ {k27, k28, k29, k2a, k2b, k2c}, \
+ {k37, k38, k39, k3a, k3b, k3c}, \
+ {k47, k48, k49, k4a, k4b, k4c} \
+}
+
+#ifndef __ASSEMBLER__ // assembler doesn't like enum in .h file
+enum led_sequence {
+ LED_IND_BLUETOOTH,
+ LED_IND_USB,
+ LED_IND_BATTERY,
+
+ LED_IND_FUN,
+ LED_IND_NUM,
+ LED_IND_EMOJI,
+
+ LED_BKSP,
+ LED_ENT,
+ LED_RSFT,
+ LED_RCTL,
+
+ LED_RGUI,
+ LED_SLSH,
+ LED_SCLN,
+ LED_P,
+
+ LED_O,
+ LED_L,
+ LED_DOT,
+ LED_RALT,
+
+ LED_EMOJI,
+ LED_COMM,
+ LED_K,
+ LED_I,
+
+ LED_U,
+ LED_J,
+ LED_M,
+ LED_FUN,
+
+ LED_RSPC,
+ LED_N,
+ LED_HH,
+ LED_Y,
+
+ LED_TRACKPOINT3,
+ LED_TRACKPOINT2,
+ LED_TRACKPOINT1,
+
+ LED_LSPC,
+ LED_B,
+ LED_G,
+ LED_T,
+
+ LED_R,
+ LED_F,
+ LED_V,
+ LED_NUM,
+
+ LED_PUNC,
+ LED_C,
+ LED_D,
+ LED_E,
+
+ LED_W,
+ LED_S,
+ LED_X,
+ LED_LALT,
+
+ LED_LGUI,
+ LED_Z,
+ LED_A,
+ LED_Q,
+
+ LED_TAB,
+ LED_ESC,
+ LED_LSFT,
+ LED_LCTL,
+
+ LED_TOTAL
+};
+
+#define RGB_DI_PIN B5
+#define RGBSPS_NUM LED_TOTAL
+#endif
+
/* PS/2 mouse */
#ifdef PS2_USE_BUSYWAIT
# define PS2_CLOCK_PORT PORTD
diff --git a/keyboards/handwired/promethium/keymaps/priyadi/README.md b/keyboards/handwired/promethium/keymaps/priyadi/README.md
new file mode 100644
index 0000000000..37c2be6f99
--- /dev/null
+++ b/keyboards/handwired/promethium/keymaps/priyadi/README.md
@@ -0,0 +1,44 @@
+Priyadi Keymap for Planck-like Keyboards
+========================================
+
+Main layer modifications from default Planck layout:
+
+* Enter moved to quotes position
+* Quotes moved to semicolon position.
+* QWERTZ style colon & semicolon. shift-. = : shift-, = ; This is done in hardware, no layout switching needed in software.
+* < & > occupied precious real estate, and so they are moved down to punctuation layer.
+* Right-shift on Enter position.
+* Removed arrow keys, they are on another layer now.
+* Put Ctrl-Alt-Super and Super-AltGr-Ctrl in left & right corners.
+* Lower & Raise is now called Num and Fun.
+* OS & Left keys become another thumb modifier: Empty & Greek (Empty because I used this for another use and my muscle memory is not adapted to it yet)
+
+On Promethium, Trackpoint is enabled on PD2 and PD2. We impersonate a Thinkpad keyboard to be able to use Thinkpad driver on Windows (still needs verification).
+
+AltGr & Compose dual use key. Tap for Compose (mapped to Scroll Lock in hardware) and press for AltGr.
+
+Supported layouts: QWERTY, DVORAK, Colemak, Workman, Norman. Switchable from SYS layer. In DVORAK, semicolon is replaced by /? key.
+
+Num activates NUM layer: hexkeypad on the right side and most punctuation on the left side. Hexkeypad is optimized for C-style hex, IPv6, HTML RGB triplets, etc.
+
+Fun activates FUN layer: arrow cluster on right home row, F-numbers on left side.
+
+Pressing Num+Fun activates PUNC layer: same punctuations as NUM layer on the left side, parens on the right side.
+
+Greek activates either GREEKU or GREEKL layer, depending whether shift is pressed or not. Shift state changes are also taken into account when the layer is active.
+
+Greek+Empty activates EMOJI layer. The whole keyboard now outputs emojis!
+
+Pressing both spacebars (spacekeys, actually) activates GUI layer. QWERTYUIOP switches to a virtual desktop. J & L switches virtual desktop to the left or right. S & F behaves like Alt-Tab and Alt-Shift-Tab. This works by sending Alt press when entering the layer, and Alt release when other than S or F keys are pressed.
+
+Pressing both Ctrls activates SYS layer for configuring the keyboard.
+
+On Promethium, USB or Bluetooth output is detected on startup. If USB is connected, then USB is used initially. SYS-U and SYS-B switch output to USB or Bluetooth at runtime. Current active output is indicated with LEDs.
+
+SYS-W, SYS-L, SYS-M switch Unicode input method. SYS-Q, SYS-D, SYS-C, SYS-K, SYS-N switch to QWERTY, DVORAK, Colemak, Workman and Norman, respectively.
+
+On Planck, SYS-A (mnemonic: audio) toggles faux clicky: use buzzer to emit clicks on key presses and releases.
+
+On Promethium there are 6 indicator LEDs, and under switch LEDs on each switches, including Trackpoint buttons. Totaling 57 LEDs. Output is limited to 0xF for each LEDs to conserve power. SYS-G (mnemonic: glow) toggles various backlighting modes.
+
+On Promethium, there's a LED to indicate battery level. Hue indicates level: green is full, red is empty. \ No newline at end of file
diff --git a/keyboards/handwired/promethium/keymaps/priyadi/config.h b/keyboards/handwired/promethium/keymaps/priyadi/config.h
index 53059ca7d4..3f5dd5817d 100644
--- a/keyboards/handwired/promethium/keymaps/priyadi/config.h
+++ b/keyboards/handwired/promethium/keymaps/priyadi/config.h
@@ -3,6 +3,8 @@
#include "../../config.h"
+#define PRIYADI_PROMETHIUM
+
/* bootmagic salt key */
#define BOOTMAGIC_KEY_SALT KC_ESC
@@ -11,8 +13,9 @@
#define PREVENT_STUCK_MODIFIERS
-#define RGB_DI_PIN B5
-#define RGBSPS_NUM 57
+#define RGBSPS_ENABLE
+
+#define UNICODE_TYPE_DELAY 0
#define LAYOUT_DVORAK
#define LAYOUT_COLEMAK
@@ -20,5 +23,6 @@
#define LAYOUT_WORKMAN
#define DOUBLESPACE_LAYER_ENABLE
+// #define TOLELOT_ENABLE
#endif
diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c
index 1ad34612e3..2c43f98847 100644
--- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c
+++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c
@@ -1,14 +1,44 @@
-// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
-// this is the style you want to emulate.
+/*
+Copyright 2017 Priyadi Iman Nurcahyo
+
+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 <http://www.gnu.org/licenses/>.
+*/
+
+#if defined(PRIYADI_PROMETHIUM)
+ #include "promethium.h"
+#elif defined(PRIYADI_PLANCK)
+ #include "planck.h"
+#else
+ #error "no keyboard defined"
+#endif
-#include "promethium.h"
#include "action_layer.h"
+#ifdef AUDIO_ENABLE
+ #include "audio.h"
+ #include "musical_notes.h"
+#endif
#include "eeconfig.h"
#include "process_unicode.h"
#include "quantum.h"
+#ifdef RGBSPS_ENABLE
#include "rgbsps.h"
+#endif
+#ifdef PS2_MOUSE_ENABLE
#include "ps2_mouse.h"
#include "ps2.h"
+#endif
+#ifdef FAUXCLICKY_ENABLE
+#include "fauxclicky.h"
+#endif
#include "outputselect.h"
#include "led.h"
#define COUNT(x) (sizeof (x) / sizeof (*(x)))
@@ -41,25 +71,29 @@ enum glow_modes {
};
uint8_t glow_mode = GLOW_MIN;
+void turn_off_capslock(void);
extern keymap_config_t keymap_config;
+// layers, ordering is important!
enum layers {
_QWERTY,
_DVORAK,
_COLEMAK,
_WORKMAN,
_NORMAN,
-
- _PUNC,
- _NUM,
- _FUNC,
+ _DEFAULT_LAYER_MAX = _NORMAN,
_GREEKU,
_GREEKL,
+ _NUM,
+ _FUN,
+ _PUNC,
+
+ _EMPTY,
_EMOJI,
_GUI,
- _SYS,
+ _SYS
};
// double-space layer
@@ -74,9 +108,6 @@ enum planck_keycodes {
NORMAN,
// layer switchers
- PUNC,
- NUM,
- FUNC,
EMOJI,
GUI,
GREEK,
@@ -90,9 +121,22 @@ enum planck_keycodes {
LSPACE,
RSPACE,
GLOW,
- AUDIO
+
+ // stub
+#ifndef FAUXCLICKY_ENABLE
+ FC_TOG,
+#endif
+#ifndef ADAFRUIT_BLE_ENABLE
+ OUT_BLE,
+#endif
+ KEYCODE_END
};
+#define EMPTY MO(_EMPTY)
+#define NUM MO(_NUM)
+#define FUN MO(_FUN)
+#define FUN0 LT(_FUN, KC_0)
+
// unicode map
enum unicode_name {
@@ -196,6 +240,11 @@ enum unicode_name {
LOMEG,
FSIGM,
+
+ LTEQ,
+ GTEQ,
+ NOTEQ,
+ PLMIN,
};
const uint32_t PROGMEM unicode_map[] = {
@@ -297,10 +346,17 @@ const uint32_t PROGMEM unicode_map[] = {
[LPSI] = 0x03C8,
[LOMEG] = 0x03C9,
[FSIGM] = 0x03C2,
+
+ // other
+ [LTEQ] = 0x2264, // less than or equal
+ [GTEQ] = 0x2265, // greater than or equal
+ [NOTEQ] = 0x2260, // not equal
+ [PLMIN] = 0xB1, // plus minus
};
// RGBSPS
+#ifdef RGBSPS_ENABLE
const uint8_t PROGMEM LED_ALNUM[] = {
LED_Z,
LED_A,
@@ -365,14 +421,14 @@ const uint8_t PROGMEM LED_MODS[] = {
const uint8_t PROGMEM LED_FN[] = {
LED_PUNC,
LED_NUM,
- LED_FUNC,
+ LED_FUN,
LED_EMOJI
};
const uint8_t PROGMEM LED_INDICATORS[] = {
LED_IND_EMOJI,
LED_IND_NUM,
- LED_IND_FUNC,
+ LED_IND_FUN,
LED_IND_BATTERY,
LED_IND_USB,
LED_IND_BLUETOOTH,
@@ -431,7 +487,7 @@ void led_reset(void) {
void led_set_layer_indicator(void) {
static uint8_t oldlayer = 255;
- rgbsps_set(LED_IND_FUNC, 0, 0, 0);
+ rgbsps_set(LED_IND_FUN, 0, 0, 0);
// rgbsps_set(LED_IND_NUM, 0, 0, 0);
rgbsps_set(LED_IND_EMOJI, 0, 0, 0);
@@ -444,14 +500,14 @@ void led_set_layer_indicator(void) {
oldlayer = layer;
- if (layer <= _NORMAN) {
+ if (layer <= _DEFAULT_LAYER_MAX) {
rgbsps_send();
return;
}
switch(layer) {
- case _FUNC:
- rgbsps_set(LED_IND_FUNC, 15, 0, 0);
+ case _FUN:
+ rgbsps_set(LED_IND_FUN, 15, 0, 0);
break;
// case _NUM:
// rgbsps_set(LED_IND_NUM, 0, 0, 15);
@@ -460,8 +516,8 @@ void led_set_layer_indicator(void) {
rgbsps_set(LED_IND_EMOJI, 15, 15, 0);
break;
default:
- rgbsps_set(LED_IND_FUNC, 3, 3, 3);
- rgbsps_set(LED_IND_NUM, 3, 3, 3);
+ rgbsps_set(LED_IND_FUN, 3, 3, 3);
+ // rgbsps_set(LED_IND_NUM, 3, 3, 3);
rgbsps_set(LED_IND_EMOJI, 3, 3, 3);
}
@@ -495,7 +551,7 @@ void led_init(void) {
rgbsps_set(LED_TRACKPOINT2, 0, 0, 15);
rgbsps_set(LED_TRACKPOINT3, 15, 0, 0);
}
-
+#endif // RGBSPS_ENABLE
// keymaps
@@ -509,14 +565,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | N | M | , | . | / |Shift |
* |------+------+------+------+------+------+------+------+------+------+------+------|
- * | Ctrl | Alt | GUI | Punc | Num | Space | Func |Greek | GUI |AltGr | Ctrl |
+ * | Ctrl | Alt | GUI | Punc | Num | Space | Fun |Greek | GUI |AltGr | Ctrl |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = KEYMAP(
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_QUOT, KC_ENT ,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
- KC_LCTL, KC_LALT, KC_LGUI, PUNC, NUM, LSPACE, RSPACE, FUNC, GREEK, KC_RGUI, KC_RALT, KC_RCTL
+ KC_LCTL, KC_LALT, KC_LGUI, EMPTY, NUM, LSPACE, RSPACE, FUN, GREEK, KC_RGUI, KC_RALT, KC_RCTL
),
/* Dvorak
@@ -604,38 +660,38 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Punc
* ,-----------------------------------------------------------------------------------.
- * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | ` |
+ * | ~ | ! | @ | # | $ | % | ^ | & | * | ≤ | ≥ | ` |
* |------+------+------+------+------+-------------+------+------+------+------+------|
- * | | * | \ | - | = | / | | ( | ) | < | > | |
+ * | | * | \ | - | = | / | ≠ | ( | ) | < | > | |
* |------+------+------+------+------+------|------+------+------+------+------+------|
- * | & | ^ | | | _ | + | ? | | [ | ] | { | } | : |
+ * | & | ^ | | | _ | + | ? | ± | [ | ] | { | } | : |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_PUNC] = KEYMAP(
- KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_GRV ,
- XXXXXXX, KC_ASTR, KC_BSLS, KC_MINS, KC_EQL, KC_SLSH, XXXXXXX, KC_LPRN, KC_RPRN, KC_LABK, KC_RABK, XXXXXXX,
- KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, KC_QUES, XXXXXXX, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, KC_COLN,
+ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, X(LTEQ), X(GTEQ), _______,
+ KC_GRV, KC_ASTR, KC_BSLS, KC_MINS, KC_EQL, KC_SLSH, X(NOTEQ),KC_LPRN, KC_RPRN, KC_LABK, KC_RABK, _______,
+ KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, KC_QUES, X(PLMIN),KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, KC_COLN,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
/* Num
* ,-----------------------------------------------------------------------------------.
- * | ~ | ! | @ | # | $ | % | A | 7 | 8 | 9 | D | ` |
+ * | ~ | ! | @ | # | $ | % | A | 7 | 8 | 9 | D | |
* |------+------+------+------+------+-------------+------+------+------+------+------|
- * | | * | \ | - | = | / | B | 4 | 5 | 6 | E | |
+ * | ` | * | \ | - | = | / | B | 4 | 5 | 6 | E | |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | & | ^ | | | _ | + | ? | C | 1 | 2 | 3 | F | : |
* |------+------+------+------+------+------+------+------+------+------+------+------|
- * | | | | | | | x | 0 | , | . | | |
+ * | | | | | | | | 0 | , | . | x | |
* `-----------------------------------------------------------------------------------'
*/
[_NUM] = KEYMAP(
- KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, S(KC_A), KC_7, KC_8, KC_9, S(KC_D), KC_GRV,
- XXXXXXX, KC_ASTR, KC_BSLS, KC_MINS, KC_EQL, KC_SLSH, S(KC_B), KC_4, KC_5, KC_6, S(KC_E), _______,
- KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, KC_QUES, S(KC_C), KC_1, KC_2, KC_3, S(KC_F), KC_COLN,
- _______, _______, _______, _______, _______, _______, _______, KC_0, KC_COMM, KC_DOT, KC_X, _______
+ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, S(KC_A), KC_7, KC_8, KC_9, S(KC_D), _______,
+ KC_GRV, KC_ASTR, KC_BSLS, KC_MINS, KC_EQL, KC_SLSH, S(KC_B), KC_4, KC_5, KC_6, S(KC_E), _______,
+ KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, KC_QUES, S(KC_C), KC_1, KC_2, KC_3, S(KC_F), KC_COLN,
+ _______, _______, _______, _______, _______, _______, _______, FUN0 , KC_COMM, KC_DOT, KC_X, _______
),
/* Func
@@ -649,11 +705,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
-[_FUNC] = KEYMAP(
- XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, XXXXXXX, KC_PGUP, KC_UP, KC_PGDN, KC_PGUP, KC_DEL,
- XXXXXXX, KC_F5, KC_F6, KC_F7, KC_F8,KC_PSCREEN,XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_INS,
- _______, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_END, XXXXXXX, _______,
- _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
+[_FUN] = KEYMAP(
+ XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, XXXXXXX, KC_PGUP, KC_UP, KC_PGDN, KC_PGUP, KC_DEL,
+ XXXXXXX, KC_F5, KC_F6, KC_F7, KC_F8, KC_PSCR, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_INS,
+ _______, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_END, XXXXXXX, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
/* Uppercase Greek
@@ -668,9 +724,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-----------------------------------------------------------------------------------'
*/
[_GREEKU] = KEYMAP(
- _______, _______, _______,X(UEPSI), X(URHO), X(UTAU),X(UUPSI),X(UTHET),X(UIOTA),X(UOMIC), X(UPI), _______,
- _______,X(UALPH),X(USIGM),X(UDELT), X(UPHI),X(UGAMM), X(UETA), X(UXI),X(UKAPP),X(ULAMB), _______, _______,
- _______,X(UZETA), X(UCHI), X(UPSI),X(UOMEG),X(UBETA), X(UNU), X(UMU), _______, _______, _______, _______,
+ _______, XXXXXXX, XXXXXXX,X(UEPSI), X(URHO), X(UTAU),X(UUPSI),X(UTHET),X(UIOTA),X(UOMIC), X(UPI), _______,
+ _______,X(UALPH),X(USIGM),X(UDELT), X(UPHI),X(UGAMM), X(UETA), X(UXI),X(UKAPP),X(ULAMB), KC_QUOT, _______,
+ _______,X(UZETA), X(UCHI), X(UPSI),X(UOMEG),X(UBETA), X(UNU), X(UMU), KC_COMM, KC_DOT, KC_SLSH, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
@@ -686,9 +742,27 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-----------------------------------------------------------------------------------'
*/
[_GREEKL] = KEYMAP(
- _______, _______,X(FSIGM),X(LEPSI), X(LRHO), X(LTAU),X(LUPSI),X(LTHET),X(LIOTA),X(LOMIC), X(LPI), _______,
- _______,X(LALPH),X(LSIGM),X(LDELT), X(LPHI),X(LGAMM), X(LETA), X(LXI),X(LKAPP),X(LLAMB), _______, _______,
- _______,X(LZETA), X(LCHI), X(LPSI),X(LOMEG),X(LBETA), X(LNU), X(LMU), _______, _______, _______, _______,
+ _______, XXXXXXX,X(FSIGM),X(LEPSI), X(LRHO), X(LTAU),X(LUPSI),X(LTHET),X(LIOTA),X(LOMIC), X(LPI), _______,
+ _______,X(LALPH),X(LSIGM),X(LDELT), X(LPHI),X(LGAMM), X(LETA), X(LXI),X(LKAPP),X(LLAMB), KC_QUOT, _______,
+ _______,X(LZETA), X(LCHI), X(LPSI),X(LOMEG),X(LBETA), X(LNU), X(LMU), KC_COMM, KC_DOT, KC_SLSH, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
+),
+
+/* Empty
+ * ,-----------------------------------------------------------------------------------.
+ * | | | | | | | | | | | | |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | | | | | | | | | | | | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | | | | | | | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | | | | | | | |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_EMPTY] = KEYMAP(
+ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
+ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
+ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
@@ -707,14 +781,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
X(HART2), X(CRY2),X(WEARY),X(EYERT),X(SMIRK), X(TJOY),X(RECYC),X(UNAMU),X(MUSIC),X(OKHND),X(PENSV), X(PHEW),
X(THMUP), X(PRAY),X(SMILE),X(SMIL2),X(FLUSH), X(GRIN),X(HEART), X(BYE), X(KISS),X(CELEB), X(COOL),X(NOEVS),
X(THMDN),X(SLEEP), X(CLAP), X(CRY), X(VIC),X(BHART), X(SUN),X(SMEYE), X(WINK), X(MOON),X(CONFU),X(NOEVH),
- X(POO), X(EYES), _______,X(HUNRD), X(SKULL),X(HORNS), X(HALO), X(FEAR),X(YUMMY),_______,X(DISAP),X(NOEVK)
+ X(POO), X(EYES), X(HUNRD),_______, X(SKULL),X(HORNS), X(HALO), X(FEAR),_______,X(YUMMY),X(DISAP),X(NOEVK)
),
/* GUI
* ,-----------------------------------------------------------------------------------.
* | | D1 | D2 | D3 | D4 | D5 | D6 | D7 | D8 | D9 | D10 | |
* |------+------+------+------+------+-------------+------+------+------+------+------|
- * | | | Vol- | Mute | Vol+ | | | Prev | | Next | | |
+ * | Esc | | Btab | Esc | Tab | | | Prev | | Next | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | Prev | Play | Next | | | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
@@ -723,9 +797,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
[_GUI] = KEYMAP(
XXXXXXX, G(KC_1), G(KC_2), G(KC_3), G(KC_4), G(KC_5), G(KC_6), G(KC_7), G(KC_8), G(KC_9), G(KC_0), XXXXXXX,
- XXXXXXX, XXXXXXX, KC_VOLD, KC_MUTE, KC_VOLU, XXXXXXX, XXXXXXX, KC_WWWB, XXXXXXX, KC_WWWF, XXXXXXX, XXXXXXX,
- XXXXXXX, XXXXXXX, KC_MPRV, KC_MPLY, KC_MNXT, KC_SPC, KC_SPC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
- XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX
+ KC_ESC, XXXXXXX, S(KC_TAB),KC_ESC, KC_TAB, XXXXXXX, XXXXXXX, KC_WWWB, XXXXXXX, KC_WWWF, XXXXXXX, XXXXXXX,
+ XXXXXXX, XXXXXXX, KC_VOLD, KC_MUTE, KC_VOLU, KC_SPC, KC_SPC, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX,
+ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
),
/* Sys
@@ -741,11 +815,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
[_SYS] = KEYMAP(
XXXXXXX, QWERTY, WIN, XXXXXXX, RESET, XXXXXXX, XXXXXXX, OUT_USB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
- XXXXXXX, AUDIO, XXXXXXX, DVORAK, XXXXXXX, GLOW, XXXXXXX, XXXXXXX, WORKMAN, LINUX, XXXXXXX, XXXXXXX,
+ XXXXXXX, FC_TOG, XXXXXXX, DVORAK, XXXXXXX, GLOW, XXXXXXX, XXXXXXX, WORKMAN, LINUX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, COLEMAK, XXXXXXX, OUT_BLE, NORMAN, OSX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______
),
+
};
void persistant_default_layer_set(uint16_t default_layer) {
@@ -753,9 +828,63 @@ void persistant_default_layer_set(uint16_t default_layer) {
default_layer_set(default_layer);
}
+#ifdef DOUBLESPACE_LAYER_ENABLE
+void process_doublespace(bool pressed, bool *isactive, bool *otheractive, bool *isemitted) {
+ if (pressed) {
+ *isactive = true;
+ if (*otheractive) {
+ layer_on(_SPACE);
+ register_code(KC_LALT); // sends alt and enter layer
+ space_layer_entered = true;
+ }
+ } else {
+ *isactive = false;
+ if (space_layer_entered) {
+ unregister_code(KC_LALT); // release alt and exit layer
+ layer_off(_SPACE);
+ if (!*otheractive) {
+ space_layer_entered = false;
+ }
+ } else {
+ if (!*isemitted) {
+ register_code(KC_SPC);
+ unregister_code(KC_SPC);
+ }
+ *isemitted = false;
+ }
+ }
+}
+#endif
+
+uint32_t layer_state_set_kb(uint32_t state)
+{
+ // turn on punc layer if both fun & num are on
+ if ((state & ((1UL<<_NUM) | (1UL<<_FUN))) == ((1UL<<_NUM) | (1UL<<_FUN))) {
+ state |= (1UL<<_PUNC);
+ } else {
+ state &= ~(1UL<<_PUNC);
+ }
+
+ // turn on emoji layer if empty and greek layer are on
+ if (
+ (state & ((1UL<<_EMPTY) | (1UL<<_GREEKU))) == ((1UL<<_EMPTY) | (1UL<<_GREEKU))
+ || (state & ((1UL<<_EMPTY) | (1UL<<_GREEKL))) == ((1UL<<_EMPTY) | (1UL<<_GREEKL))
+ ) {
+ state |= (1UL<<_EMOJI);
+ } else {
+ state &= ~(1UL<<_EMOJI);
+ }
+ return state;
+}
+
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
- bool lshift = keyboard_report->mods & MOD_BIT(KC_LSFT);
- bool rshift = keyboard_report->mods & MOD_BIT(KC_RSFT);
+ static bool lshift = false;
+ static bool rshift = false;
+ static uint8_t layer = 0;
+
+ lshift = keyboard_report->mods & MOD_BIT(KC_LSFT);
+ rshift = keyboard_report->mods & MOD_BIT(KC_RSFT);
+ layer = biton32(layer_state);
#ifdef DOUBLESPACE_LAYER_ENABLE
// double-space: send space immediately if any other key depressed before space is released
@@ -779,6 +908,14 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
rspace_emitted = true;
}
}
+
+ if (layer == _SPACE && keycode != S(KC_TAB) && keycode != KC_TAB && keycode != KC_ESC && keycode != XXXXXXX) {
+ if (record->event.pressed) {
+ unregister_code(KC_LALT);
+ } else {
+ register_code(KC_LALT);
+ }
+ }
#endif
switch (keycode) {
@@ -786,51 +923,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef DOUBLESPACE_LAYER_ENABLE
// double-space enter space layer
case LSPACE:
- if (record->event.pressed) {
- lspace_active = true;
- if (rspace_active) {
- layer_on(_SPACE);
- space_layer_entered = true;
- }
- } else {
- lspace_active = false;
- if (space_layer_entered) {
- layer_off(_SPACE);
- if (!rspace_active) {
- space_layer_entered = false;
- }
- } else {
- if (!lspace_emitted) {
- register_code(KC_SPC);
- unregister_code(KC_SPC);
- }
- lspace_emitted = false;
- }
- }
+ process_doublespace(record->event.pressed, &lspace_active, &rspace_active, &lspace_emitted);
return false;
break;
case RSPACE:
- if (record->event.pressed) {
- rspace_active = true;
- if (lspace_active) {
- layer_on(_SPACE);
- space_layer_entered = true;
- }
- } else {
- rspace_active = false;
- if (space_layer_entered) {
- layer_off(_SPACE);
- if (!lspace_active) {
- space_layer_entered = false;
- }
- } else {
- if (!rspace_emitted) {
- register_code(KC_SPC);
- unregister_code(KC_SPC);
- }
- rspace_emitted = false;
- }
- }
+ process_doublespace(record->event.pressed, &rspace_active, &lspace_active, &rspace_emitted);
return false;
break;
#endif
@@ -840,7 +937,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
case KC_LSFT:
case KC_RSFT:
;
- uint8_t layer = biton32(layer_state);
if (layer == _GREEKU || layer == _GREEKL) {
if (record->event.pressed) {
layer_on(_GREEKU);
@@ -949,17 +1045,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#endif
// layer switcher
- case PUNC:
- if (record->event.pressed) {
- layer_on(_PUNC);
- update_tri_layer(_PUNC, _GREEKL, _EMOJI);
- } else {
- layer_off(_PUNC);
- update_tri_layer(_PUNC, _GREEKL, _EMOJI);
- }
- return false;
- break;
-
+ //
case GREEK:
if (record->event.pressed) {
if (lshift || rshift) {
@@ -968,31 +1054,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
} else {
layer_on(_GREEKL);
layer_off(_GREEKU);
- update_tri_layer(_PUNC, _GREEKL, _EMOJI);
}
} else {
layer_off(_GREEKU);
layer_off(_GREEKL);
- update_tri_layer(_PUNC, _GREEKL, _EMOJI);
- }
- return false;
- break;
-
- case NUM:
- if (record->event.pressed) {
- turn_off_capslock();
- layer_on(_NUM);
- } else {
- layer_off(_NUM);
- }
- return false;
- break;
-
- case FUNC:
- if (record->event.pressed) {
- layer_on(_FUNC);
- } else {
- layer_off(_FUNC);
}
return false;
break;
@@ -1012,6 +1077,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
break;
// glow mode changer
+#ifdef RGBSPS_ENABLE
case GLOW:
if (record->event.pressed) {
glow_mode++;
@@ -1023,16 +1089,20 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
return false;
break;
+#endif
- // faux clicky toggle, TBD
- case AUDIO:
- return false;
+ // faux clicky indicator
+#ifdef FAUXCLICKY_ENABLE
+ case FC_TOG:
+ return true;
break;
+#endif
}
return true;
}
void set_output_user(uint8_t output) {
+#ifdef ADAFRUIT_BLE_ENABLE
switch(output) {
case OUTPUT_USB:
led_set_output_usb();
@@ -1043,82 +1113,92 @@ void set_output_user(uint8_t output) {
default:
led_set_output_none();
}
+#endif
}
-void matrix_init_user(void) {
+void matrix_init_user() {
_delay_ms(500); // give time for usb to initialize
set_unicode_input_mode(UC_LNX);
+
+#ifdef RGBSPS_ENABLE
led_init();
+#endif
// auto detect output on init
+#ifdef ADAFRUIT_BLE_ENABLE
uint8_t output = auto_detect_output();
if (output == OUTPUT_USB) {
set_output(OUTPUT_USB);
} else {
set_output(OUTPUT_ADAFRUIT_BLE);
}
+#endif
}
-void matrix_scan_user(void) {
- led_set_layer_indicator();
+void turn_off_capslock() {
+ if (capslock) {
+ register_code(KC_CAPS);
+ unregister_code(KC_CAPS);
+ }
}
-void battery_poll(uint8_t level) {
- rgbsps_sethsv(LED_IND_BATTERY, level * 120/255, 255, 15);
- rgbsps_send();
-}
+#ifdef RGBSPS_ENABLE
+ void matrix_scan_user(void) {
+ led_set_layer_indicator();
+ }
-void led_set_user(uint8_t usb_led) {
- bool new_capslock = usb_led & (1<<USB_LED_CAPS_LOCK);
- if (new_capslock ^ capslock) { // capslock state is different
- if (capslock = new_capslock) {
- rgbsps_set(LED_IND_NUM, 15, 0, 0);
- } else {
- rgbsps_set(LED_IND_NUM, 0, 0, 0);
- }
+ void battery_poll(uint8_t level) {
+ rgbsps_sethsv(LED_IND_BATTERY, level * 120/255, 255, 15);
rgbsps_send();
}
-}
-void turn_off_capslock() {
- if (capslock) {
- register_code(KC_CAPS);
- unregister_code(KC_CAPS);
+ void led_set_user(uint8_t usb_led) {
+ bool new_capslock = usb_led & (1<<USB_LED_CAPS_LOCK);
+ if (new_capslock ^ capslock) { // capslock state is different
+ if ((capslock = new_capslock)) {
+ rgbsps_set(LED_IND_NUM, 15, 0, 0);
+ } else {
+ rgbsps_set(LED_IND_NUM, 0, 0, 0);
+ }
+ rgbsps_send();
+ }
}
-}
+#endif
-void ps2_mouse_init_user() {
- uint8_t rcv;
-
- // set TrackPoint sensitivity
- PS2_MOUSE_SEND(0xE2, "tpsens: 0xE2");
- PS2_MOUSE_SEND(0x81, "tpsens: 0x81");
- PS2_MOUSE_SEND(0x4A, "tpsens: 0x4A");
- PS2_MOUSE_SEND(0x49, "tpsens: 0x59");
-
- // set TrackPoint Negative Inertia factor
- PS2_MOUSE_SEND(0xE2, "tpnegin: 0xE2");
- PS2_MOUSE_SEND(0x81, "tpnegin: 0x81");
- PS2_MOUSE_SEND(0x4D, "tpnegin: 0x4D");
- PS2_MOUSE_SEND(0x06, "tpnegin: 0x06");
-
- // set TrackPoint speed
- // (transfer function upper plateau speed)
- PS2_MOUSE_SEND(0xE2, "tpsp: 0xE2");
- PS2_MOUSE_SEND(0x81, "tpsp: 0x81");
- PS2_MOUSE_SEND(0x60, "tpsp: 0x60");
- PS2_MOUSE_SEND(0x61, "tpsp: 0x61");
-
- // inquire pts status
- rcv = ps2_host_send(0xE2);
- rcv = ps2_host_send(0x2C);
- rcv = ps2_host_recv_response();
- if ((rcv & 1) == 1) {
- // if on, disable pts
+#ifdef PS2_MOUSE_ENABLE
+ void ps2_mouse_init_user() {
+ uint8_t rcv;
+
+ // set TrackPoint sensitivity
+ PS2_MOUSE_SEND(0xE2, "tpsens: 0xE2");
+ PS2_MOUSE_SEND(0x81, "tpsens: 0x81");
+ PS2_MOUSE_SEND(0x4A, "tpsens: 0x4A");
+ PS2_MOUSE_SEND(0x49, "tpsens: 0x59");
+
+ // set TrackPoint Negative Inertia factor
+ PS2_MOUSE_SEND(0xE2, "tpnegin: 0xE2");
+ PS2_MOUSE_SEND(0x81, "tpnegin: 0x81");
+ PS2_MOUSE_SEND(0x4D, "tpnegin: 0x4D");
+ PS2_MOUSE_SEND(0x06, "tpnegin: 0x06");
+
+ // set TrackPoint speed
+ // (transfer function upper plateau speed)
+ PS2_MOUSE_SEND(0xE2, "tpsp: 0xE2");
+ PS2_MOUSE_SEND(0x81, "tpsp: 0x81");
+ PS2_MOUSE_SEND(0x60, "tpsp: 0x60");
+ PS2_MOUSE_SEND(0x61, "tpsp: 0x61");
+
+ // inquire pts status
rcv = ps2_host_send(0xE2);
- rcv = ps2_host_send(0x47);
rcv = ps2_host_send(0x2C);
- rcv = ps2_host_send(0x01);
- }
-} \ No newline at end of file
+ rcv = ps2_host_recv_response();
+ if ((rcv & 1) == 1) {
+ // if on, disable pts
+ rcv = ps2_host_send(0xE2);
+ rcv = ps2_host_send(0x47);
+ rcv = ps2_host_send(0x2C);
+ rcv = ps2_host_send(0x01);
+ }
+ }
+#endif \ No newline at end of file
diff --git a/keyboards/handwired/promethium/keymaps/priyadi/readme.md b/keyboards/handwired/promethium/keymaps/priyadi/readme.md
deleted file mode 100644
index e69de29bb2..0000000000
--- a/keyboards/handwired/promethium/keymaps/priyadi/readme.md
+++ /dev/null
diff --git a/keyboards/handwired/promethium/promethium.c b/keyboards/handwired/promethium/promethium.c
index 62e2281fac..4943f8c9fc 100644
--- a/keyboards/handwired/promethium/promethium.c
+++ b/keyboards/handwired/promethium/promethium.c
@@ -36,3 +36,7 @@ void led_set_kb(uint8_t usb_led) {
led_set_user(usb_led);
}
+__attribute__ ((weak))
+void led_set_user(uint8_t usb_led) {
+}
+
diff --git a/keyboards/handwired/promethium/promethium.h b/keyboards/handwired/promethium/promethium.h
index da37e5c560..260f140c55 100644
--- a/keyboards/handwired/promethium/promethium.h
+++ b/keyboards/handwired/promethium/promethium.h
@@ -1,108 +1,10 @@
#ifndef PROMETHIUM_H
#define PROMETHIUM_H
-#include "quantum.h"
+#include "stdint.h"
-#define PS2_INIT_DELAY 2000
-#define UNICODE_TYPE_DELAY 0
-#define BATTERY_PIN 9
-#define BATTERY_POLL 30000
-#define MAX_VOLTAGE 4.2
-#define MIN_VOLTAGE 3.2
-
-#define KEYMAP( \
- k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \
- k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \
- k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \
- k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c \
-) \
-{ \
- {k11, k12, k13, k14, k15, k16}, \
- {k21, k22, k23, k24, k25, k26}, \
- {k31, k32, k33, k34, k35, k36}, \
- {k41, k42, k43, k44, k45, k46}, \
- {k17, k18, k19, k1a, k1b, k1c}, \
- {k27, k28, k29, k2a, k2b, k2c}, \
- {k37, k38, k39, k3a, k3b, k3c}, \
- {k47, k48, k49, k4a, k4b, k4c} \
-}
-
-
-
-enum led_sequence {
- LED_IND_BLUETOOTH,
- LED_IND_USB,
- LED_IND_BATTERY,
-
- LED_IND_FUNC,
- LED_IND_NUM,
- LED_IND_EMOJI,
-
- LED_BKSP,
- LED_ENT,
- LED_RSFT,
- LED_RCTL,
-
- LED_RGUI,
- LED_SLSH,
- LED_SCLN,
- LED_P,
-
- LED_O,
- LED_L,
- LED_DOT,
- LED_RALT,
-
- LED_EMOJI,
- LED_COMM,
- LED_K,
- LED_I,
-
- LED_U,
- LED_J,
- LED_M,
- LED_FUNC,
-
- LED_RSPC,
- LED_N,
- LED_HH,
- LED_Y,
-
- LED_TRACKPOINT3,
- LED_TRACKPOINT2,
- LED_TRACKPOINT1,
-
- LED_LSPC,
- LED_B,
- LED_G,
- LED_T,
-
- LED_R,
- LED_F,
- LED_V,
- LED_NUM,
-
- LED_PUNC,
- LED_C,
- LED_D,
- LED_E,
-
- LED_W,
- LED_S,
- LED_X,
- LED_LALT,
-
- LED_LGUI,
- LED_Z,
- LED_A,
- LED_Q,
-
- LED_TAB,
- LED_ESC,
- LED_LSFT,
- LED_LCTL,
-};
+void battery_poll(uint8_t level);
+void led_set_kb(uint8_t usb_led);
+void led_set_user(uint8_t usb_led);
#endif
-
-void battery_poll(uint8_t level); \ No newline at end of file
diff --git a/keyboards/planck/keymaps/priyadi/config.h b/keyboards/planck/keymaps/priyadi/config.h
new file mode 100644
index 0000000000..82e4a25c60
--- /dev/null
+++ b/keyboards/planck/keymaps/priyadi/config.h
@@ -0,0 +1,39 @@
+#ifndef CONFIG_USER_H
+#define CONFIG_USER_H
+
+#include "../../config.h"
+
+#define PRIYADI_PLANCK
+
+/* bootmagic salt key */
+#define BOOTMAGIC_KEY_SALT KC_ESC
+
+/* skip bootmagic and eeconfig */
+#define BOOTMAGIC_KEY_SKIP KC_SPACE
+
+#define PREVENT_STUCK_MODIFIERS
+
+#define UNICODE_TYPE_DELAY 0
+
+#define LAYOUT_DVORAK
+#define LAYOUT_COLEMAK
+#define LAYOUT_NORMAN
+#define LAYOUT_WORKMAN
+
+#define DOUBLESPACE_LAYER_ENABLE
+ // #define TOLELOT_ENABLE
+
+#define KEYMAP( \
+ k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \
+ k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \
+ k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \
+ k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c \
+) \
+{ \
+ {k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c}, \
+ {k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c}, \
+ {k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c}, \
+ {k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c} \
+}
+
+#endif
diff --git a/keyboards/planck/keymaps/priyadi/keymap.c b/keyboards/planck/keymaps/priyadi/keymap.c
index 13668fd106..bb3a2e92c4 100644
--- a/keyboards/planck/keymaps/priyadi/keymap.c
+++ b/keyboards/planck/keymaps/priyadi/keymap.c
@@ -1,680 +1 @@
-// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
-// this is the style you want to emulate.
-
-#include "planck.h"
-#include "action_layer.h"
-#ifdef AUDIO_ENABLE
- #include "audio.h"
- #include "musical_notes.h"
-#endif
-#include "eeconfig.h"
-#include "process_unicode.h"
-#include "quantum.h"
-
-// #define TOLELOT_ENABLE
-
-extern keymap_config_t keymap_config;
-
-enum layers {
- _QWERTY,
- _COLEMAK,
- _WORKMAN,
- _PUNC,
- _NUM,
- _FUNC,
- _EMOJI,
- _GREEKU,
- _GREEKL,
- _GUI,
-};
-
-enum planck_keycodes {
- // layouts
- QWERTY = SAFE_RANGE,
- COLEMAK,
- WORKMAN,
-
- // layer switchers
- PUNC,
- NUM,
- FUNC,
- EMOJI,
- GUI,
- GREEK,
-
- // os switchers
- LINUX,
- WIN,
- OSX,
-};
-
-// Fillers to make layering clearer
-
-#define _______ KC_TRNS
-#define XXXXXXX KC_NO
-
-// unicode map
-
-enum unicode_name {
- GRIN, // grinning face 😊
- TJOY, // tears of joy 😂
- SMILE, // grining face with smiling eyes 😁
- HEART, // heart ❤
- EYERT, // smiling face with heart shaped eyes 😍
- CRY, // crying face 😭
- SMEYE, // smiling face with smiling eyes 😊
- UNAMU, // unamused 😒
- KISS, // kiss 😘
- HART2, // two hearts 💕
- WEARY, // weary 😩
- OKHND, // ok hand sign 👌
- PENSV, // pensive 😔
- SMIRK, // smirk 😏
- RECYC, // recycle ♻
- WINK, // wink 😉
- THMUP, // thumb up 👍
- THMDN, // thumb down 👎
- PRAY, // pray 🙏
- PHEW, // relieved 😌
- MUSIC, // musical notes
- FLUSH, // flushed 😳
- CELEB, // celebration 🙌
- CRY2, // crying face 😢
- COOL, // smile with sunglasses 😎
- NOEVS, // see no evil
- NOEVH, // hear no evil
- NOEVK, // speak no evil
- POO, // pile of poo
- EYES, // eyes
- VIC, // victory hand
- BHART, // broken heart
- SLEEP, // sleeping face
- SMIL2, // smiling face with open mouth & sweat
- HUNRD, // 100
- CONFU, // confused
- TONGU, // face with tongue & winking eye
- DISAP, // disappointed
- YUMMY, // face savoring delicious food
- CLAP, // hand clapping
- FEAR, // face screaming in fear
- HORNS, // smiling face with horns
- HALO, // smiling face with halo
- BYE, // waving hand
- SUN, // sun
- MOON, // moon
- SKULL, // skull
-
- // greek letters
- UALPH,
- UBETA,
- UGAMM,
- UDELT,
- UEPSI,
- UZETA,
- UETA,
- UTHET,
- UIOTA,
- UKAPP,
- ULAMB,
- UMU,
- UNU,
- UXI,
- UOMIC,
- UPI,
- URHO,
- USIGM,
- UTAU,
- UUPSI,
- UPHI,
- UCHI,
- UPSI,
- UOMEG,
-
- LALPH,
- LBETA,
- LGAMM,
- LDELT,
- LEPSI,
- LZETA,
- LETA,
- LTHET,
- LIOTA,
- LKAPP,
- LLAMB,
- LMU,
- LNU,
- LXI,
- LOMIC,
- LPI,
- LRHO,
- LSIGM,
- LTAU,
- LUPSI,
- LPHI,
- LCHI,
- LPSI,
- LOMEG,
-
- FSIGM,
-};
-
-const uint32_t PROGMEM unicode_map[] = {
- [GRIN] = 0x1F600,
- [TJOY] = 0x1F602,
- [SMILE] = 0x1F601,
- [HEART] = 0x2764,
- [EYERT] = 0x1f60d,
- [CRY] = 0x1f62d,
- [SMEYE] = 0x1F60A,
- [UNAMU] = 0x1F612,
- [KISS] = 0x1F618,
- [HART2] = 0x1F495,
- [WEARY] = 0x1F629,
- [OKHND] = 0x1F44C,
- [PENSV] = 0x1F614,
- [SMIRK] = 0x1F60F,
- [RECYC] = 0x267B,
- [WINK] = 0x1F609,
- [THMUP] = 0x1F44D,
- [THMDN] = 0x1F44E,
- [PRAY] = 0x1F64F,
- [PHEW] = 0x1F60C,
- [MUSIC] = 0x1F3B6,
- [FLUSH] = 0x1F633,
- [CELEB] = 0x1F64C,
- [CRY2] = 0x1F622,
- [COOL] = 0x1F60E,
- [NOEVS] = 0x1F648,
- [NOEVH] = 0x1F649,
- [NOEVK] = 0x1F64A,
- [POO] = 0x1F4A9,
- [EYES] = 0x1F440,
- [VIC] = 0x270C,
- [BHART] = 0x1F494,
- [SLEEP] = 0x1F634,
- [SMIL2] = 0x1F605,
- [HUNRD] = 0x1F4AF,
- [CONFU] = 0x1F615,
- [TONGU] = 0x1F61C,
- [DISAP] = 0x1F61E,
- [YUMMY] = 0x1F60B,
- [CLAP] = 0x1F44F,
- [FEAR] = 0x1F631,
- [HORNS] = 0x1F608,
- [HALO] = 0x1F607,
- [BYE] = 0x1F44B,
- [SUN] = 0x2600,
- [MOON] = 0x1F314,
- [SKULL] = 0x1F480,
-
- // greek letters
- [UALPH] = 0x0391,
- [UBETA] = 0x0392,
- [UGAMM] = 0x0393,
- [UDELT] = 0x0394,
- [UEPSI] = 0x0395,
- [UZETA] = 0x0396,
- [UETA] = 0x0397,
- [UTHET] = 0x0398,
- [UIOTA] = 0x0399,
- [UKAPP] = 0x039A,
- [ULAMB] = 0x039B,
- [UMU] = 0x039C,
- [UNU] = 0x039D,
- [UXI] = 0x039E,
- [UOMIC] = 0x039F,
- [UPI] = 0x03A0,
- [URHO] = 0x03A1,
- [USIGM] = 0x03A3,
- [UTAU] = 0x03A4,
- [UUPSI] = 0x03A5,
- [UPHI] = 0x03A6,
- [UCHI] = 0x03A7,
- [UPSI] = 0x03A8,
- [UOMEG] = 0x03A9,
- [LALPH] = 0x03B1,
- [LBETA] = 0x03B2,
- [LGAMM] = 0x03B3,
- [LDELT] = 0x03B4,
- [LEPSI] = 0x03B5,
- [LZETA] = 0x03B6,
- [LETA] = 0x03B7,
- [LTHET] = 0x03B8,
- [LIOTA] = 0x03B9,
- [LKAPP] = 0x03BA,
- [LLAMB] = 0x03BB,
- [LMU] = 0x03BC,
- [LNU] = 0x03BD,
- [LXI] = 0x03BE,
- [LOMIC] = 0x03BF,
- [LPI] = 0x03C0,
- [LRHO] = 0x03C1,
- [LSIGM] = 0x03C3,
- [LTAU] = 0x03C4,
- [LUPSI] = 0x03C5,
- [LPHI] = 0x03C6,
- [LCHI] = 0x03C7,
- [LPSI] = 0x03C8,
- [LOMEG] = 0x03C9,
- [FSIGM] = 0x03C2,
-};
-
-
-// hybrid shift - =
-// #undef KC_LSFT
-// #define KC_LSFT MT(MOD_LSFT, KC_MINS)
-// #undef KC_RSFT
-// #define KC_RSFT MT(MOD_LSFT, KC_EQL)
-
-
-// hybrid right-gui & scroll lock (mapped to Compose in OS)
-#undef KC_RALT
-#define KC_RALT MT(MOD_RALT, KC_SLCK)
-
-// keymaps
-
-const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-
-/* Qwerty
- * ,-----------------------------------------------------------------------------------.
- * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
- * |------+------+------+------+------+-------------+------+------+------+------+------|
- * | Esc | A | S | D | F | G | H | J | K | L | ; |Enter |
- * |------+------+------+------+------+------|------+------+------+------+------+------|
- * | Shift| Z | X | C | V | B | N | M | , | . | / |Shift |
- * |------+------+------+------+------+------+------+------+------+------+------+------|
- * | Ctrl | GUI | Alt | Punc | Num | Space | Func |Emoji |Greek |AltGr | Ctrl |
- * `-----------------------------------------------------------------------------------'
- */
-[_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_QUOT, KC_ENT },
- {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT},
- {KC_LCTL, KC_LALT, KC_LGUI, PUNC, NUM, KC_SPC, KC_SPC, FUNC, EMOJI, GREEK, KC_RALT, KC_RCTL}
-},
-
-/* Colemak
- * ,-----------------------------------------------------------------------------------.
- * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
- * |------+------+------+------+------+-------------+------+------+------+------+------|
- * | Esc | A | R | S | T | D | H | N | E | I | O |Enter |
- * |------+------+------+------+------+------|------+------+------+------+------+------|
- * | Shift| Z | X | C | V | B | K | M | , | . | / |Shift |
- * |------+------+------+------+------+------+------+------+------+------+------+------|
- * | Ctrl | GUI | Alt | Punc | Num | Space | Func |Emoji |AltGr | GUI | Ctrl |
- * `-----------------------------------------------------------------------------------'
- */
-[_COLEMAK] = {
- {_______, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_QUOT, _______},
- {_______, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, _______},
- {_______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______},
- {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
-},
-
-/* Workman
- * ,-----------------------------------------------------------------------------------.
- * | Tab | Q | D | R | W | B | J | F | U | P | ; | Bksp |
- * |------+------+------+------+------+-------------+------+------+------+------+------|
- * | Esc | A | S | H | T | G | Y | N | E | O | I |Enter |
- * |------+------+------+------+------+------|------+------+------+------+------+------|
- * | Shift| Z | X | M | C | V | K | K | , | . | / |Shift |
- * |------+------+------+------+------+------+------+------+------+------+------+------|
- * | Ctrl | GUI | Alt | Punc | Num | Space | Func |Emoji |AltGr | GUI | Ctrl |
- * `-----------------------------------------------------------------------------------'
- */
-[_WORKMAN] = {
- {_______, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_QUOT, _______},
- {_______, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, _______},
- {_______, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, _______},
- {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
-},
-
-/* Uppercase Greek
- * ,-----------------------------------------------------------------------------------.
- * | | | | | | | | | | | | |
- * |------+------+------+------+------+-------------+------+------+------+------+------|
- * | | | | | | | | | | | | |
- * |------+------+------+------+------+------+------+------+------+------+------+------|
- * | | | | | | | | | | | | |
- * |------+------+------+------+------+------+------+------+------+------+------+------|
- * | | | | | | | | | | | | |
- * `-----------------------------------------------------------------------------------'
- */
-[_GREEKU] = {
- {_______, _______, _______,X(UEPSI), X(URHO), X(UTAU),X(UUPSI),X(UTHET),X(UIOTA),X(UOMIC), X(UPI), _______},
- {_______,X(UALPH),X(USIGM),X(UDELT), X(UPHI),X(UGAMM), X(UETA), X(UXI),X(UKAPP),X(ULAMB), _______, _______},
- {_______,X(UZETA), X(UCHI), X(UPSI),X(UOMEG),X(UBETA), X(UNU), X(UMU), _______, _______, _______, _______},
- {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
-},
-
-/* Lowercase Greek
- * ,-----------------------------------------------------------------------------------.
- * | | | | | | | | | | | | |
- * |------+------+------+------+------+-------------+------+------+------+------+------|
- * | | | | | | | | | | | | |
- * |------+------+------+------+------+------+------+------+------+------+------+------|
- * | | | | | | | | | | | | |
- * |------+------+------+------+------+------+------+------+------+------+------+------|
- * | | | | | | | | | | | | |
- * `-----------------------------------------------------------------------------------'
- */
-[_GREEKL] = {
- {_______, _______,X(FSIGM),X(LEPSI), X(LRHO), X(LTAU),X(LUPSI),X(LTHET),X(LIOTA),X(LOMIC), X(LPI), _______},
- {_______,X(LALPH),X(LSIGM),X(LDELT), X(LPHI),X(LGAMM), X(LETA), X(LXI),X(LKAPP),X(LLAMB), _______, _______},
- {_______,X(LZETA), X(LCHI), X(LPSI),X(LOMEG),X(LBETA), X(LNU), X(LMU), _______, _______, _______, _______},
- {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
-},
-
-/* Punc
- * ,-----------------------------------------------------------------------------------.
- * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | ` |
- * |------+------+------+------+------+-------------+------+------+------+------+------|
- * | | | \ | - | = | < | > | ( | ) | ' | | |
- * |------+------+------+------+------+------|------+------+------+------+------+------|
- * | | | | | _ | + | { | } | [ | ] | " | | |
- * |------+------+------+------+------+------+------+------+------+------+------+------|
- * | | | | | | | | | | | |
- * `-----------------------------------------------------------------------------------'
- */
-[_PUNC] = {
- {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_GRV },
- {XXXXXXX, XXXXXXX, KC_BSLS, KC_MINS, KC_EQL, KC_LABK, KC_RABK, KC_LPRN, KC_RPRN, KC_QUOT, XXXXXXX, XXXXXXX},
- {XXXXXXX, XXXXXXX, KC_PIPE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_LBRC, KC_RBRC, KC_DQUO, XXXXXXX, XXXXXXX},
- {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
-},
-
-/* Num
- * ,-----------------------------------------------------------------------------------.
- * | ^ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
- * |------+------+------+------+------+-------------+------+------+------+------+------|
- * | Esc | @ | A | B | C | ( | ) | 4 | 5 | 6 | : |Enter |
- * |------+------+------+------+------+------|------+------+------+------+------+------|
- * | & | # | D | E | F | [ | ] | 1 | 2 | 3 | / | * |
- * |------+------+------+------+------+------+------+------+------+------+------+------|
- * | | | | x | | | 0 | , | . | + | - |
- * `-----------------------------------------------------------------------------------'
- */
-[_NUM] = {
- {KC_CIRC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC},
- { KC_ESC, KC_AT, S(KC_A), S(KC_B), S(KC_C), KC_LPRN, KC_RPRN, KC_4, KC_5, KC_6, KC_COLN, KC_ENT},
- {KC_AMPR, KC_HASH, S(KC_D), S(KC_E), S(KC_F), KC_LBRC, KC_RBRC, KC_1, KC_2, KC_3, KC_SLSH, KC_ASTR},
- {_______, _______, _______, KC_X, _______, KC_SPC, KC_SPC, KC_0, KC_COMM, KC_DOT, KC_PLUS, KC_MINS}
-},
-
-/* Func
- * ,-----------------------------------------------------------------------------------.
- * | | F1 | F2 | F3 | F4 | | | PgUp | Up | PgDn | PgUp | Del |
- * |------+------+------+------+------+-------------+------+------+------+------+------|
- * | | F5 | F6 | F7 | F8 |PrtSc | | Left | Down | Right| PgDn | Ins |
- * |------+------+------+------+------+------|------+------+------+------+------+------|
- * | | F9 | F10 | F11 | F12 | | | | Home | End | | |
- * |------+------+------+------+------+------+------+------+------+------+------+------|
- * | | | | | | | | | | | |
- * `-----------------------------------------------------------------------------------'
- */
-[_FUNC] = {
- {XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, XXXXXXX, KC_PGUP, KC_UP, KC_PGDN, KC_PGUP, KC_DEL},
- {XXXXXXX, KC_F5, KC_F6, KC_F7, KC_F8,KC_PSCREEN,XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_INS},
- {_______, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_END, XXXXXXX, _______},
- {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
-},
-
-/* Emoji
- * ,-----------------------------------------------------------------------------------.
- * | | | | | | | | | | | | |
- * |------+------+------+------+------+-------------+------+------+------+------+------|
- * | | | | | | | | | | | | |
- * |------+------+------+------+------+------+------+------+------+------+------+------|
- * | | | | | | | | | | | | |
- * |------+------+------+------+------+------+------+------+------+------+------+------|
- * | | | | | | | | | | | | |
- * `-----------------------------------------------------------------------------------'
- */
-[_EMOJI] = {
- {X(HART2), X(CRY2),X(WEARY),X(EYERT),X(SMIRK), X(TJOY),X(RECYC),X(UNAMU),X(MUSIC),X(OKHND),X(PENSV), X(PHEW)},
- {X(THMUP), X(PRAY),X(SMILE),X(SMIL2),X(FLUSH), X(GRIN),X(HEART), X(BYE), X(KISS),X(CELEB), X(COOL),X(NOEVS)},
- {X(THMDN),X(SLEEP), X(CLAP), X(CRY), X(VIC),X(BHART), X(SUN),X(SMEYE), X(WINK), X(MOON),X(CONFU),X(NOEVH)},
- { X(POO), X(EYES),X(HUNRD), _______,X(SKULL),X(HORNS), X(HALO), X(FEAR), _______,X(YUMMY),X(DISAP),X(NOEVK)}
-},
-
-/* GUI
- * ,-----------------------------------------------------------------------------------.
- * | | D1 | D2 | D3 | D4 | D5 | D6 | D7 | D8 | D9 | D10 | |
- * |------+------+------+------+------+-------------+------+------+------+------+------|
- * |Linux | | Vol- | Mute | Vol+ | | | D- | | D+ | |Qwerty|
- * |------+------+------+------+------+------+------+------+------+------+------+------|
- * | Win | | Prev | Play | Next | | | | | | |Colmak|
- * |------+------+------+------+------+------+------+------+------+------+------+------|
- * | OSX | | | | | BL- | BL+ | | | | |Workmn|
- * `-----------------------------------------------------------------------------------'
- */
-[_GUI] = {
- {_______, LGUI(KC_1),LGUI(KC_2),LGUI(KC_3),LGUI(KC_4),LGUI(KC_5),LGUI(KC_6),LGUI(KC_7),LGUI(KC_8),LGUI(KC_9),LGUI(KC_0), _______},
- { LINUX, _______, KC_VOLD, KC_MUTE, KC_VOLU,_______,_______,KC_WWW_BACK,_______,KC_WWW_FORWARD,_______, QWERTY},
- { WIN, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, _______, _______, _______, COLEMAK},
- { OSX, _______, _______, _______, _______, BL_DEC, BL_INC, _______, _______, _______, _______, WORKMAN}
-},
-
-};
-
-#ifdef AUDIO_ENABLE
-float tone_startup[][2] = SONG(STARTUP_SOUND);
-float tone_qwerty[][2] = SONG(QWERTY_SOUND);
-float tone_colemak[][2] = SONG(COLEMAK_SOUND);
-float tone_workman[][2] = SONG(DVORAK_SOUND);
-float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
-float tone_linux[][2] = SONG(CAPS_LOCK_ON_SOUND);
-float tone_windows[][2] = SONG(SCROLL_LOCK_ON_SOUND);
-float tone_osx[][2] = SONG(NUM_LOCK_ON_SOUND);
-float tone_click[][2] = SONG(MUSICAL_NOTE(_F3, 2));
-float tone_release[][2] = SONG(MUSICAL_NOTE(_A3, 2));
-float tone_tolelot[][2] = SONG(Q__NOTE(_E5), Q__NOTE(_C5), Q__NOTE(_D5));
-#endif
-
-void persistant_default_layer_set(uint16_t default_layer) {
- eeconfig_update_default_layer(default_layer);
- default_layer_set(default_layer);
-}
-
-bool process_record_user(uint16_t keycode, keyrecord_t *record) {
- // faux clicky
- // if (record->event.pressed) PLAY_NOTE_ARRAY(tone_click, false, 0);
- #ifdef AUDIO_ENABLE
- #ifdef TOLELOT_ENABLE
- if (record->event.pressed) {
- PLAY_NOTE_ARRAY(tone_tolelot, false, 0);
- }
- #else
- if (record->event.pressed) {
- PLAY_NOTE_ARRAY(tone_click, false, 0);
- } else {
- PLAY_NOTE_ARRAY(tone_release, false, 0);
- }
- #endif
- #endif
-
- bool lshifted = keyboard_report->mods & MOD_BIT(KC_LSFT);
- bool rshifted = keyboard_report->mods & MOD_BIT(KC_RSFT);
-
- switch (keycode) {
- // Greek layer handling
- case GREEK:
- if (record->event.pressed) {
- if (lshifted || rshifted) {
- layer_on(_GREEKU);
- layer_off(_GREEKL);
- } else {
- layer_on(_GREEKL);
- layer_off(_GREEKU);
- }
- } else {
- layer_off(_GREEKU);
- layer_off(_GREEKL);
- }
- return false;
- break;
-
- case KC_LSFT:
- case KC_RSFT:
- ;
- uint8_t layer = biton32(layer_state);
- if (layer == _GREEKU || layer == _GREEKL) {
- if (record->event.pressed) {
- layer_on(_GREEKU);
- layer_off(_GREEKL);
- } else {
- if (lshifted ^ rshifted) { // if only one shift is pressed
- layer_on(_GREEKL);
- layer_off(_GREEKU);
- }
- }
- }
- return true;
- break;
-
- // QWERTZ style comma and dot: semicolon and colon when shifted
- case KC_COMM:
- if (record->event.pressed) {
- if (lshifted || rshifted) {
- if (lshifted) unregister_code(KC_LSFT);
- if (rshifted) unregister_code(KC_RSFT);
- register_code(KC_SCLN);
- unregister_code(KC_SCLN);
- if (lshifted) register_code(KC_LSFT);
- if (rshifted) register_code(KC_RSFT);
- } else {
- register_code(KC_COMM);
- unregister_code(KC_COMM);
- }
- }
- return false;
- break;
- case KC_DOT:
- if (record->event.pressed) {
- if ((keyboard_report->mods & MOD_BIT(KC_LSFT)) || (keyboard_report->mods & MOD_BIT(KC_RSFT))) {
- register_code(KC_SCLN);
- unregister_code(KC_SCLN);
- } else {
- register_code(KC_DOT);
- unregister_code(KC_DOT);
- }
- }
- return false;
- break;
-
- // layout switcher
- case QWERTY:
- if (record->event.pressed) {
- #ifdef AUDIO_ENABLE
- PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
- #endif
- persistant_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
- persistant_default_layer_set(1UL<<_COLEMAK);
- }
- return false;
- break;
- case WORKMAN:
- if (record->event.pressed) {
- #ifdef AUDIO_ENABLE
- PLAY_NOTE_ARRAY(tone_workman, false, 0);
- #endif
- persistant_default_layer_set(1UL<<_WORKMAN);
- }
- return false;
- break;
-
- // layer switchers
- case PUNC:
- if (record->event.pressed) {
- layer_on(_PUNC);
- update_tri_layer(_PUNC, _EMOJI, _GUI);
- } else {
- layer_off(_PUNC);
- update_tri_layer(_PUNC, _EMOJI, _GUI);
- }
- return false;
- break;
- case EMOJI:
- if (record->event.pressed) {
- layer_on(_EMOJI);
- update_tri_layer(_PUNC, _EMOJI, _GUI);
- } else {
- layer_off(_EMOJI);
- update_tri_layer(_PUNC, _EMOJI, _GUI);
- }
- return false;
- break;
- case NUM:
- if (record->event.pressed) {
- layer_on(_NUM);
- } else {
- layer_off(_NUM);
- }
- return false;
- break;
- case FUNC:
- if (record->event.pressed) {
- layer_on(_FUNC);
- } else {
- layer_off(_FUNC);
- }
- return false;
- break;
-
- // OS switchers
- case LINUX:
- set_unicode_input_mode(UC_LNX);
- #ifdef AUDIO_ENABLE
- PLAY_NOTE_ARRAY(tone_linux, false, 0);
- #endif
- return false;
- break;
- case WIN:
- set_unicode_input_mode(UC_WINC);
- #ifdef AUDIO_ENABLE
- PLAY_NOTE_ARRAY(tone_windows, false, 0);
- #endif
- return false;
- break;
- case OSX:
- set_unicode_input_mode(UC_OSX);
- #ifdef AUDIO_ENABLE
- PLAY_NOTE_ARRAY(tone_osx, false, 0);
- #endif
- return false;
- break;
- }
- return true;
-}
-
-void matrix_init_user(void) {
- #ifdef AUDIO_ENABLE
- startup_user();
- #endif
- set_unicode_input_mode(UC_LNX);
-}
-
-#ifdef AUDIO_ENABLE
-
-void startup_user()
-{
- _delay_ms(20); // gets rid of tick
- PLAY_NOTE_ARRAY(tone_startup, false, 0);
-}
-
-void shutdown_user()
-{
- PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
- _delay_ms(150);
- stop_all_notes();
-}
-
-#endif \ No newline at end of file
+#include "../../../handwired/promethium/keymaps/priyadi/keymap.c" \ No newline at end of file