From c5ab0b2b61ca673b4bd8e03a767fcd91c3dee995 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Mon, 9 Jan 2017 19:35:01 +0700 Subject: Implement greek layers on my Promethium layout --- .../handwired/promethium/keymaps/priyadi/keymap.c | 187 ++++++++++++++++++++- 1 file changed, 182 insertions(+), 5 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 7ae269563f..02ff57384f 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -29,6 +29,8 @@ enum layers { _NUM, _FUNC, _EMOJI, + _GREEKU, + _GREEKL, _GUI, }; @@ -44,6 +46,7 @@ enum planck_keycodes { FUNC, EMOJI, GUI, + GREEK, // os switchers LINUX, @@ -106,6 +109,59 @@ enum unicode_name { 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[] = { @@ -156,6 +212,57 @@ const uint32_t PROGMEM unicode_map[] = { [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, }; @@ -165,7 +272,6 @@ const uint32_t PROGMEM unicode_map[] = { // #undef KC_RSFT // #define KC_RSFT MT(MOD_LSFT, KC_EQL) - // hybrid right-gui & scroll lock (mapped to Compose in OS) #undef KC_RCTL #define KC_RCTL MT(MOD_LCTL, KC_SLCK) @@ -420,14 +526,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------|------+------+------+------+------+------| * | Shift| Z | X | C | V | B | N | M | , | . | / |Shift | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | GUI | Alt | Punc | Num | Space | Func |Emoji |AltGr | GUI | Ctrl | + * | Ctrl | Alt | GUI | Punc | Num | Space | Func |Emoji |Greek |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_LGUI, KC_LALT, PUNC, NUM, KC_SPC, KC_SPC, FUNC, EMOJI, KC_RALT, KC_RGUI, KC_RCTL + KC_LCTL, KC_LALT, KC_LGUI, PUNC, NUM, KC_SPC, KC_SPC, FUNC, EMOJI, GREEK, KC_RALT, KC_RCTL ), /* Colemak @@ -466,6 +572,42 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), +/* 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 * ,-----------------------------------------------------------------------------------. * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | ` | @@ -581,12 +723,47 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) PLAY_NOTE_ARRAY(tone_click, false, 0); #endif + bool lshifted = keyboard_report->mods & MOD_BIT(KC_LSFT); + bool rshifted = keyboard_report->mods & MOD_BIT(KC_RSFT); + switch (keycode) { + 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) { - bool lshifted = keyboard_report->mods & MOD_BIT(KC_LSFT); - bool rshifted = keyboard_report->mods & MOD_BIT(KC_RSFT); if (lshifted || rshifted) { if (lshifted) unregister_code(KC_LSFT); if (rshifted) unregister_code(KC_RSFT); -- cgit v1.2.3 From 306f43e5eedb5b0a48cc9a83cd7ee8902dbc30d5 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Mon, 9 Jan 2017 21:24:26 +0700 Subject: fix greek layers --- keyboards/handwired/promethium/keymaps/priyadi/keymap.c | 8 ++++---- keyboards/handwired/promethium/promethium.h | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 02ff57384f..4665e32af5 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -583,12 +583,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_GREEKU] = { +[_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), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -}, +), /* Lowercase Greek * ,-----------------------------------------------------------------------------------. @@ -601,12 +601,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_GREEKL] = { +[_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), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -}, +), /* Punc * ,-----------------------------------------------------------------------------------. diff --git a/keyboards/handwired/promethium/promethium.h b/keyboards/handwired/promethium/promethium.h index 662eeab990..a2572db2af 100644 --- a/keyboards/handwired/promethium/promethium.h +++ b/keyboards/handwired/promethium/promethium.h @@ -4,6 +4,7 @@ #include "quantum.h" #define PS2_INIT_DELAY 2000 +#define UNICODE_TYPE_DELAY 0 #define KEYMAP( \ k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \ -- cgit v1.2.3 From 011811af68baa6d0103ab289ed4737991c24f9c4 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Mon, 9 Jan 2017 23:19:34 +0700 Subject: minimize LEDs --- .../handwired/promethium/keymaps/priyadi/keymap.c | 148 ++++++++++----------- 1 file changed, 74 insertions(+), 74 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 4665e32af5..99948967be 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -352,15 +352,15 @@ const uint8_t PROGMEM LED_TRACKPOINT[] = { void led_reset(void) { for(uint8_t i = 0; i < COUNT(LED_ALNUM); i++) { - rgbsps_set(pgm_read_byte(&LED_ALNUM[i]), 15, 6, 0); + rgbsps_set(pgm_read_byte(&LED_ALNUM[i]), 0, 0, 0); } for(uint8_t i = 0; i < COUNT(LED_MODS); i++) { - rgbsps_set(pgm_read_byte(&LED_MODS[i]), 15, 0, 0); + rgbsps_set(pgm_read_byte(&LED_MODS[i]), 0, 0, 0); } for(uint8_t i = 0; i < COUNT(LED_FN); i++) { - rgbsps_set(pgm_read_byte(&LED_FN[i]), 15, 15, 15); + rgbsps_set(pgm_read_byte(&LED_FN[i]), 0, 0, 0); } } @@ -385,30 +385,30 @@ void led_layer_func(void) { rgbsps_set(pgm_read_byte(&LED_ALNUM[i]), 0, 0, 0); } - rgbsps_set(LED_I, 15, 0, 15); - rgbsps_set(LED_J, 15, 0, 15); - rgbsps_set(LED_K, 15, 0, 15); - rgbsps_set(LED_L, 15, 0, 15); - - rgbsps_set(LED_U, 15, 0, 0); - rgbsps_set(LED_O, 15, 0, 0); - rgbsps_set(LED_COMM, 15, 0, 0); - rgbsps_set(LED_DOT, 15, 0, 0); - rgbsps_set(LED_SCLN, 15, 0, 0); - rgbsps_set(LED_P, 15, 0, 0); - - rgbsps_set(LED_Q, 0, 15, 0); - rgbsps_set(LED_W, 0, 15, 0); - rgbsps_set(LED_E, 0, 15, 0); - rgbsps_set(LED_R, 0, 15, 0); - rgbsps_set(LED_A, 0, 15, 0); - rgbsps_set(LED_S, 0, 15, 0); - rgbsps_set(LED_D, 0, 15, 0); - rgbsps_set(LED_F, 0, 15, 0); - rgbsps_set(LED_Z, 0, 15, 0); - rgbsps_set(LED_X, 0, 15, 0); - rgbsps_set(LED_C, 0, 15, 0); - rgbsps_set(LED_V, 0, 15, 0); + // rgbsps_set(LED_I, 15, 0, 15); + // rgbsps_set(LED_J, 15, 0, 15); + // rgbsps_set(LED_K, 15, 0, 15); + // rgbsps_set(LED_L, 15, 0, 15); + + // rgbsps_set(LED_U, 15, 0, 0); + // rgbsps_set(LED_O, 15, 0, 0); + // rgbsps_set(LED_COMM, 15, 0, 0); + // rgbsps_set(LED_DOT, 15, 0, 0); + // rgbsps_set(LED_SCLN, 15, 0, 0); + // rgbsps_set(LED_P, 15, 0, 0); + + // rgbsps_set(LED_Q, 0, 15, 0); + // rgbsps_set(LED_W, 0, 15, 0); + // rgbsps_set(LED_E, 0, 15, 0); + // rgbsps_set(LED_R, 0, 15, 0); + // rgbsps_set(LED_A, 0, 15, 0); + // rgbsps_set(LED_S, 0, 15, 0); + // rgbsps_set(LED_D, 0, 15, 0); + // rgbsps_set(LED_F, 0, 15, 0); + // rgbsps_set(LED_Z, 0, 15, 0); + // rgbsps_set(LED_X, 0, 15, 0); + // rgbsps_set(LED_C, 0, 15, 0); + // rgbsps_set(LED_V, 0, 15, 0); rgbsps_send(); } @@ -430,54 +430,54 @@ void led_layer_num(void) { led_reset(); - for(uint8_t i = 0; i < COUNT(LED_ALNUM); i++) { - rgbsps_set(pgm_read_byte(&LED_ALNUM[i]), 0, 0, 0); - } - - rgbsps_set(LED_U, 0, 5, 15); - rgbsps_set(LED_I, 0, 5, 15); - rgbsps_set(LED_O, 0, 5, 15); - rgbsps_set(LED_J, 0, 5, 15); - rgbsps_set(LED_K, 0, 5, 15); - rgbsps_set(LED_L, 0, 5, 15); - rgbsps_set(LED_M, 0, 5, 15); - rgbsps_set(LED_COMM, 0, 5, 15); - rgbsps_set(LED_DOT, 0, 5, 15); - rgbsps_set(LED_FUNC, 0, 5, 15); - - rgbsps_set(LED_EMOJI, 0, 10, 15); - rgbsps_set(LED_RALT, 0, 10, 15); - - rgbsps_set(LED_Q, 0, 10, 15); - rgbsps_set(LED_W, 0, 10, 15); - rgbsps_set(LED_E, 0, 10, 15); - rgbsps_set(LED_R, 0, 10, 15); - rgbsps_set(LED_T, 0, 10, 15); - rgbsps_set(LED_Y, 0, 10, 15); - rgbsps_set(LED_P, 0, 10, 15); - - rgbsps_set(LED_A, 0, 15, 15); - rgbsps_set(LED_S, 0, 15, 15); - rgbsps_set(LED_D, 0, 15, 15); - rgbsps_set(LED_F, 0, 15, 15); - rgbsps_set(LED_Z, 0, 15, 15); - rgbsps_set(LED_X, 0, 15, 15); - rgbsps_set(LED_C, 0, 15, 15); - rgbsps_set(LED_V, 0, 15, 15); + // for(uint8_t i = 0; i < COUNT(LED_ALNUM); i++) { + // rgbsps_set(pgm_read_byte(&LED_ALNUM[i]), 0, 0, 0); + // } + + // rgbsps_set(LED_U, 0, 5, 15); + // rgbsps_set(LED_I, 0, 5, 15); + // rgbsps_set(LED_O, 0, 5, 15); + // rgbsps_set(LED_J, 0, 5, 15); + // rgbsps_set(LED_K, 0, 5, 15); + // rgbsps_set(LED_L, 0, 5, 15); + // rgbsps_set(LED_M, 0, 5, 15); + // rgbsps_set(LED_COMM, 0, 5, 15); + // rgbsps_set(LED_DOT, 0, 5, 15); + // rgbsps_set(LED_FUNC, 0, 5, 15); + + // rgbsps_set(LED_EMOJI, 0, 10, 15); + // rgbsps_set(LED_RALT, 0, 10, 15); + + // rgbsps_set(LED_Q, 0, 10, 15); + // rgbsps_set(LED_W, 0, 10, 15); + // rgbsps_set(LED_E, 0, 10, 15); + // rgbsps_set(LED_R, 0, 10, 15); + // rgbsps_set(LED_T, 0, 10, 15); + // rgbsps_set(LED_Y, 0, 10, 15); + // rgbsps_set(LED_P, 0, 10, 15); + + // rgbsps_set(LED_A, 0, 15, 15); + // rgbsps_set(LED_S, 0, 15, 15); + // rgbsps_set(LED_D, 0, 15, 15); + // rgbsps_set(LED_F, 0, 15, 15); + // rgbsps_set(LED_Z, 0, 15, 15); + // rgbsps_set(LED_X, 0, 15, 15); + // rgbsps_set(LED_C, 0, 15, 15); + // rgbsps_set(LED_V, 0, 15, 15); rgbsps_send(); } void led_layer_emoji(void) { - for(uint8_t i = 0; i < COUNT(LED_ALNUM); i++) { - rgbsps_set(pgm_read_byte(&LED_ALNUM[i]), 15, 15, 0); - } - for(uint8_t i = 0; i < COUNT(LED_MODS); i++) { - rgbsps_set(pgm_read_byte(&LED_MODS[i]), 15, 15, 0); - } - for(uint8_t i = 0; i < COUNT(LED_FN); i++) { - rgbsps_set(pgm_read_byte(&LED_FN[i]), 15, 15, 0); - } + // for(uint8_t i = 0; i < COUNT(LED_ALNUM); i++) { + // rgbsps_set(pgm_read_byte(&LED_ALNUM[i]), 15, 15, 0); + // } + // for(uint8_t i = 0; i < COUNT(LED_MODS); i++) { + // rgbsps_set(pgm_read_byte(&LED_MODS[i]), 15, 15, 0); + // } + // for(uint8_t i = 0; i < COUNT(LED_FN); i++) { + // rgbsps_set(pgm_read_byte(&LED_FN[i]), 15, 15, 0); + // } rgbsps_set(LED_IND_FUNC, 0, 0, 0); rgbsps_set(LED_IND_NUM, 0, 0, 0); @@ -612,17 +612,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------. * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | ` | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | \ | - | = | < | > | ( | ) | ' | | | + * | | | \ | - | = | | | ( | ) | < | > | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | _ | + | { | } | [ | ] | " | | | + * | | | | | _ | + | | | [ | ] | { | } | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ [_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, 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, + XXXXXXX, XXXXXXX, KC_BSLS, KC_MINS, KC_EQL, XXXXXXX, XXXXXXX, KC_LPRN, KC_RPRN, KC_LABK, KC_RABK, XXXXXXX, + XXXXXXX, XXXXXXX, KC_PIPE, KC_UNDS, KC_PLUS, XXXXXXX, XXXXXXX, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), -- cgit v1.2.3 From f36fc1d2e534b23bfd9794dab85859f6a9fbeb18 Mon Sep 17 00:00:00 2001 From: upils Date: Tue, 31 Jan 2017 22:37:03 +0100 Subject: Add reddot handwired keyboard. --- keyboards/handwired/reddot/Makefile | 3 + keyboards/handwired/reddot/config.h | 162 +++++++++++++++++++++ .../handwired/reddot/keymaps/default/keymap.c | 29 ++++ .../handwired/reddot/keymaps/default/readme.md | 1 + keyboards/handwired/reddot/readme.md | 24 +++ keyboards/handwired/reddot/reddot.c | 7 + keyboards/handwired/reddot/reddot.h | 20 +++ keyboards/handwired/reddot/rules.mk | 88 +++++++++++ 8 files changed, 334 insertions(+) create mode 100755 keyboards/handwired/reddot/Makefile create mode 100755 keyboards/handwired/reddot/config.h create mode 100755 keyboards/handwired/reddot/keymaps/default/keymap.c create mode 100755 keyboards/handwired/reddot/keymaps/default/readme.md create mode 100755 keyboards/handwired/reddot/readme.md create mode 100755 keyboards/handwired/reddot/reddot.c create mode 100755 keyboards/handwired/reddot/reddot.h create mode 100755 keyboards/handwired/reddot/rules.mk (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/reddot/Makefile b/keyboards/handwired/reddot/Makefile new file mode 100755 index 0000000000..191c6bb664 --- /dev/null +++ b/keyboards/handwired/reddot/Makefile @@ -0,0 +1,3 @@ +ifndef MAKEFILE_INCLUDED + include ../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/handwired/reddot/config.h b/keyboards/handwired/reddot/config.h new file mode 100755 index 0000000000..15f1142971 --- /dev/null +++ b/keyboards/handwired/reddot/config.h @@ -0,0 +1,162 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER upils +#define PRODUCT reddot +#define DESCRIPTION A custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 19 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B0, B1, B2, B3, E6 } +#define MATRIX_COL_PINS { B7, D0, D1, D2, D3, C6, C7, D5, D4, D7, B4, B5, B6, F7, F6, F5, F4, F1, F0 } +#define UNUSED_PINS + + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +//#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#endif diff --git a/keyboards/handwired/reddot/keymaps/default/keymap.c b/keyboards/handwired/reddot/keymaps/default/keymap.c new file mode 100755 index 0000000000..44ee2ce510 --- /dev/null +++ b/keyboards/handwired/reddot/keymaps/default/keymap.c @@ -0,0 +1,29 @@ +#include "reddot.h" +#include "../../../../../quantum/keymap_extras/keymap_french.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[0] = KEYMAP( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TAB, KC_CAPS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_FN0, KC_KP_SLASH, KC_KP_ASTERISK, KC_KP_MINUS,\ + KC_LALT, FR_AMP, FR_EACU, FR_QUOT, FR_APOS, FR_LPRN, KC_BSPACE, KC_DELETE, FR_MINS, FR_EGRV, FR_UNDS, FR_CCED, FR_AGRV, FR_RPRN, FR_EQL, KC_INSERT, KC_HOME, KC_PGUP,\ + KC_LGUI, FR_A, FR_Z, KC_E, KC_R, KC_T, KC_LSFT, KC_ENT, KC_Y, KC_U, KC_I, KC_O, KC_P, FR_CIRC, FR_DLR, KC_DELETE, KC_END, KC_PGDOWN, KC_KP_PLUS,\ + KC_LCTL, FR_Q, KC_S, KC_D, KC_F, KC_G, KC_ENT, KC_H, KC_J, KC_K, KC_L, FR_M, FR_UGRV, FR_ASTR, KC_KP_1, KC_UP, KC_KP_3,\ + FR_LESS, FR_W, KC_X, KC_C, KC_V, KC_B, KC_SPACE, KC_SPACE, KC_N, FR_COMM, FR_SCLN, FR_COLN, FR_EXLM, NO_ALGR, KC_LEFT, KC_DOWN, KC_RIGHT, KC_KP_ENTER), + + [1] = KEYMAP( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TAB, KC_CAPS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_FN0, KC_KP_SLASH, KC_KP_ASTERISK, KC_KP_MINUS,\ + KC_LALT, FR_AMP, FR_EACU, FR_QUOT, FR_APOS, FR_LPRN, KC_BSPACE, KC_DELETE, FR_MINS, FR_EGRV, FR_UNDS, FR_CCED, FR_AGRV, FR_RPRN, FR_EQL, KC_7, KC_8, KC_9,\ + KC_LGUI, FR_A, FR_Z, KC_E, KC_R, KC_T, KC_LSFT, KC_ENT, KC_Y, KC_U, KC_I, KC_O, KC_P, FR_CIRC, FR_DLR, KC_4, KC_5, KC_6, KC_KP_PLUS,\ + KC_LCTL, FR_Q, KC_S, KC_D, KC_F, KC_G, KC_ENT, KC_H, KC_J, KC_K, KC_L, FR_M, FR_UGRV, FR_ASTR, KC_1, KC_2, KC_3,\ + FR_LESS, FR_W, KC_X, KC_C, KC_V, KC_B, KC_SPACE, KC_SPACE, KC_N, FR_COMM, FR_SCLN, FR_COLN, FR_EXLM, NO_ALGR, KC_LEFT, KC_DOWN, KC_RIGHT, KC_KP_ENTER), +}; + + +const uint16_t PROGMEM fn_actions[] = { + ACTION_LAYER_TOGGLE(1), +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + return MACRO_NONE; +}; + diff --git a/keyboards/handwired/reddot/keymaps/default/readme.md b/keyboards/handwired/reddot/keymaps/default/readme.md new file mode 100755 index 0000000000..f04833c3e0 --- /dev/null +++ b/keyboards/handwired/reddot/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for handwired/reddot diff --git a/keyboards/handwired/reddot/readme.md b/keyboards/handwired/reddot/readme.md new file mode 100755 index 0000000000..11bcba54ad --- /dev/null +++ b/keyboards/handwired/reddot/readme.md @@ -0,0 +1,24 @@ +## RedDot Specific Info ## + + +## Quantum MK Firmware + +For the full Quantum feature list, see [the parent README.md](/README.md). + +## Building + +Download or clone the whole firmware and navigate to the keyboard/reddot folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file. + +Depending on which keymap you would like to use, you will have to compile slightly differently. + +### Default +To build with the default keymap, simply run `make`. + +### Other Keymaps +Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `.c` and see keymap document (you can find in top README.md) and existent keymap files. + +To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: +``` +$ make KEYMAP=[default|jack|] +``` +Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. diff --git a/keyboards/handwired/reddot/reddot.c b/keyboards/handwired/reddot/reddot.c new file mode 100755 index 0000000000..4e1efc06ce --- /dev/null +++ b/keyboards/handwired/reddot/reddot.c @@ -0,0 +1,7 @@ +#include "reddot.h" + +void matrix_init_kb(void) { + + matrix_init_user(); +} + diff --git a/keyboards/handwired/reddot/reddot.h b/keyboards/handwired/reddot/reddot.h new file mode 100755 index 0000000000..f0c4be5571 --- /dev/null +++ b/keyboards/handwired/reddot/reddot.h @@ -0,0 +1,20 @@ +#ifndef REDDOT_H +#define REDDOT_H + +#include "quantum.h" + +#define KEYMAP( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k10, k11, k12, k13, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, k30, k31, k32, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, k50, k51, k52, k53, \ + k60, k61, k62, k63, k64, k65, k66, k68, k69, k6A, k6B, k6C, k6D, k6E, k70, k71, k72, \ + k80, k81, k82, k83, k84, k85, k86, k88, k89, k8A, k8B, k8C, k8D, k8E, k90, k91, k92, k93\ +) { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k10, k11, k12, k13 }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, k30, k31, k32, KC_NO }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, k50, k51, k52, k53 }, \ + { k60, k61, k62, k63, k64, k65, k66, KC_NO, k68, k69, k6A, k6B, k6C, k6D, k6E, k70, k71, k72, KC_NO }, \ + { k80, k81, k82, k83, k84, k85, k86, KC_NO, k88, k89, k8A, k8B, k8C, k8D, k8E, k90, k91, k92, k93 } \ +} + +#endif diff --git a/keyboards/handwired/reddot/rules.mk b/keyboards/handwired/reddot/rules.mk new file mode 100755 index 0000000000..9a4409fe66 --- /dev/null +++ b/keyboards/handwired/reddot/rules.mk @@ -0,0 +1,88 @@ + +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# for avr upload +USB ?= /dev/cu.usbmodem1421 +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + + +ifdef TEENSY2 + OPT_DEFS += -DATREUS_TEENSY2 + ATREUS_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex +else + OPT_DEFS += -DATREUS_ASTAR + OPT_DEFS += -DCATERINA_BOOTLOADER + ATREUS_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \ + avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB) +endif +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# MCU name + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= no # Console for debug(+400) +COMMAND_ENABLE ?= no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE ?= no # USB Nkey Rollover +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE ?= no # Audio output on port C6 + +ifndef QUANTUM_DIR + include ../../../Makefile +endif + +upload: build + $(ATREUS_UPLOAD_COMMAND) + -- cgit v1.2.3 From de659486f52db6492be6ca03ce5450690f5d891d Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Tue, 7 Feb 2017 12:36:25 -0500 Subject: pass through travis errors --- keyboards/handwired/onekey/keymaps/default/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/onekey/keymaps/default/keymap.c b/keyboards/handwired/onekey/keymaps/default/keymap.c index 756c4f51ed..10c486718d 100644 --- a/keyboards/handwired/onekey/keymaps/default/keymap.c +++ b/keyboards/handwired/onekey/keymaps/default/keymap.c @@ -1,5 +1,5 @@ #include "onekey.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - { KC_A } + {{ KC_A }} }; -- cgit v1.2.3 From 4be4ed33970bbe5387e0004257d5fabc46a03d54 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Thu, 9 Feb 2017 01:40:22 +0700 Subject: Add USB-BLE manual output switching and indicator --- .../handwired/promethium/keymaps/priyadi/keymap.c | 56 +++++++++++++++++----- 1 file changed, 44 insertions(+), 12 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 99948967be..05cd2f061e 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -13,6 +13,7 @@ #include "rgbsps.h" #include "ps2_mouse.h" #include "ps2.h" +#include "outputselect.h" #define COUNT(x) (sizeof (x) / sizeof (*(x))) // #define RGBLED_NUM 5 @@ -496,6 +497,24 @@ void led_layer_gui(void) { rgbsps_send(); } +void led_set_output_ble(void) { + rgbsps_set(LED_IND_BLUETOOTH, 0, 0, 15); + rgbsps_set(LED_IND_USB, 0, 0, 0); + rgbsps_send(); +} + +void led_set_output_usb(void) { + rgbsps_set(LED_IND_BLUETOOTH, 0, 0, 0); + rgbsps_set(LED_IND_USB, 15, 15, 15); + rgbsps_send(); +} + +void led_set_output_none(void) { + rgbsps_set(LED_IND_BLUETOOTH, 0, 0, 0); + rgbsps_set(LED_IND_USB, 0, 0, 0); + rgbsps_send(); +} + void led_init(void) { // turn off all rgbsps_turnoff(); @@ -693,8 +712,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_GUI] = KEYMAP( _______, 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,KC_PAUS, QWERTY, - WIN, _______, KC_MPRV, KC_MPLY, KC_MNXT, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, COLEMAK, + LINUX, OUT_USB, KC_VOLD, KC_MUTE, KC_VOLU,_______,_______,KC_WWW_BACK,_______,KC_WWW_FORWARD,KC_PAUS, QWERTY, + WIN, OUT_BLE, KC_MPRV, KC_MPLY, KC_MNXT, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, COLEMAK, OSX, _______, _______, _______, _______, BL_DEC, BL_INC, _______, _______, RGB_VAI, RGB_VAD, WORKMAN ), @@ -908,23 +927,36 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } +void set_output_user(uint8_t output) { + switch(output) { + case OUTPUT_USB: + led_set_output_usb(); + break; + case OUTPUT_ADAFRUIT_BLE: + led_set_output_ble(); + break; + default: + led_set_output_none(); + } +} + void matrix_init_user(void) { + _delay_ms(500); // give time for usb to initialize + #ifdef AUDIO_ENABLE startup_user(); #endif set_unicode_input_mode(UC_LNX); led_init(); -} - -// void init_rgblight(void) { -// for (uint8_t i = 0; i < RGBLED_NUM; i++) { -// led[i].r = 255; -// led[i].g = 85; -// led[i].b = 0; -// } -// ws2812_setleds(led, RGBLED_NUM); -// } + // auto detect output on init + uint8_t output = auto_detect_output(); + if (output == OUTPUT_USB) { + set_output(OUTPUT_USB); + } else { + set_output(OUTPUT_ADAFRUIT_BLE); + } +} #ifdef AUDIO_ENABLE -- cgit v1.2.3 From 92308ed0e5ccac1aaeba6a952ccc2556dfffe4e0 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Fri, 10 Feb 2017 02:08:55 +0700 Subject: Remove audio stuff --- .../handwired/promethium/keymaps/priyadi/keymap.c | 60 ---------------------- 1 file changed, 60 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 05cd2f061e..f2d7ebcb76 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -3,10 +3,6 @@ #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" @@ -719,29 +715,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -#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)); -#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) { - #ifdef AUDIO_ENABLE - // faux clicky - if (record->event.pressed) PLAY_NOTE_ARRAY(tone_click, false, 0); - #endif - bool lshifted = keyboard_report->mods & MOD_BIT(KC_LSFT); bool rshifted = keyboard_report->mods & MOD_BIT(KC_RSFT); @@ -813,27 +792,18 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { // layout switchers 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; @@ -904,23 +874,14 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { // 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; } @@ -943,9 +904,6 @@ void set_output_user(uint8_t output) { void matrix_init_user(void) { _delay_ms(500); // give time for usb to initialize - #ifdef AUDIO_ENABLE - startup_user(); - #endif set_unicode_input_mode(UC_LNX); led_init(); @@ -958,24 +916,6 @@ void matrix_init_user(void) { } } -#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 - - void ps2_mouse_init_user() { uint8_t rcv; -- cgit v1.2.3 From af97d6b58ea7e2a445093eff5d757edc59dc0b57 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Fri, 10 Feb 2017 06:01:59 +0700 Subject: Add dvorak & norman layout. Add sys layer. --- .../handwired/promethium/keymaps/priyadi/keymap.c | 227 ++++++++++++++------- 1 file changed, 148 insertions(+), 79 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index f2d7ebcb76..3c48347d42 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -20,22 +20,30 @@ extern keymap_config_t keymap_config; enum layers { _QWERTY, + _DVORAK, _COLEMAK, _WORKMAN, + _NORMAN, + _PUNC, _NUM, _FUNC, - _EMOJI, + _GREEKU, _GREEKL, + + _EMOJI, _GUI, + _SYS, }; enum planck_keycodes { // layouts QWERTY = SAFE_RANGE, + DVORAK, COLEMAK, WORKMAN, + NORMAN, // layer switchers PUNC, @@ -269,9 +277,9 @@ const uint32_t PROGMEM unicode_map[] = { // #undef KC_RSFT // #define KC_RSFT MT(MOD_LSFT, KC_EQL) -// hybrid right-gui & scroll lock (mapped to Compose in OS) -#undef KC_RCTL -#define KC_RCTL MT(MOD_LCTL, KC_SLCK) +// hybrid right-alt & scroll lock (mapped to Compose in OS) +#undef KC_RALT +#define KC_RALT MT(MOD_RALT, KC_SLCK) // RGBSPS @@ -537,18 +545,36 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------. * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | S | D | F | G | H | J | K | L | ; |Enter | + * | Esc | A | S | D | F | G | H | J | K | L | ' |Enter | * |------+------+------+------+------+------|------+------+------+------+------+------| * | Shift| Z | X | C | V | B | N | M | , | . | / |Shift | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | Alt | GUI | Punc | Num | Space | Func |Emoji |Greek |AltGr | Ctrl | + * | Ctrl | Alt | GUI | Punc | Num | Space | Func |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, KC_SPC, KC_SPC, FUNC, EMOJI, GREEK, KC_RALT, KC_RCTL + KC_LCTL, KC_LALT, KC_LGUI, PUNC, NUM, KC_SPC, KC_SPC, FUNC, GREEK, KC_RGUI, KC_RALT, KC_RCTL +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | ' | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S |Enter | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| / | Q | J | K | X | B | M | W | V | Z |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt | GUI | Punc | Num | Space | Func |Greek | GUI |AltGr | Ctrl | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = KEYMAP( + _______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, _______, + _______, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, _______, + _______, KC_SLSH, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), /* Colemak @@ -559,7 +585,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------|------+------+------+------+------+------| * | Shift| Z | X | C | V | B | K | M | , | . | / |Shift | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | GUI | Alt | Punc | Num | Space | Func |Emoji |AltGr | GUI | Ctrl | + * | Ctrl | Alt | GUI | Punc | Num | Space | Func |Greek | GUI |AltGr | Ctrl | * `-----------------------------------------------------------------------------------' */ [_COLEMAK] = KEYMAP( @@ -569,57 +595,39 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), -/* Workman +/* Norman * ,-----------------------------------------------------------------------------------. - * | Tab | Q | D | R | W | B | J | F | U | P | ; | Bksp | + * | Tab | Q | W | D | F | K | J | U | R | L | ; | Bksp | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | S | H | T | G | Y | N | E | O | I |Enter | + * | Esc | A | S | E | T | G | Y | N | I | O | H |Enter | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | M | C | V | K | K | , | . | / |Shift | + * | Shift| Z | X | C | V | B | P | M | , | . | / |Shift | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | GUI | Alt | Punc | Num | Space | Func |Emoji |AltGr | GUI | Ctrl | + * | Ctrl | Alt | GUI | Punc | Num | Space | Func |Greek | GUI |AltGr | Ctrl | * `-----------------------------------------------------------------------------------' */ -[_WORKMAN] = KEYMAP( - _______, 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, _______, +[_NORMAN] = KEYMAP( + _______, KC_Q, KC_W, KC_D, KC_F, KC_K, KC_J, KC_U, KC_R, KC_L, KC_QUOT, _______, + _______, KC_A, KC_S, KC_E, KC_T, KC_G, KC_Y, KC_N, KC_I, KC_O, KC_H, _______, + _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_P, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), -/* Uppercase Greek - * ,-----------------------------------------------------------------------------------. - * | | | | | | | | | | | | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ -[_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), _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -), - -/* Lowercase Greek +/* 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 | Alt | GUI | Punc | Num | Space | Func |Greek | GUI |AltGr | Ctrl | * `-----------------------------------------------------------------------------------' */ -[_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), _______, _______, _______, _______, +[_WORKMAN] = KEYMAP( + _______, 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, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), @@ -677,6 +685,42 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), +/* Uppercase Greek + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_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), _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Lowercase Greek + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_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), _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + /* Emoji * ,-----------------------------------------------------------------------------------. * | | | | | | | | | | | | | @@ -713,6 +757,24 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { OSX, _______, _______, _______, _______, BL_DEC, BL_INC, _______, _______, RGB_VAI, RGB_VAD, WORKMAN ), +/* GUI + * ,-----------------------------------------------------------------------------------. + * | |Qwerty| Win | | | | | USB | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | |Audio | |Dvorak| | Glow | | |WorkMn|Linux | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | |Colmak| | BLE |Norman|MacOS | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_SYS] = KEYMAP( + XXXXXXX, QWERTY, WIN, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, OUT_USB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, DVORAK, XXXXXXX, XXXXXXX, 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, XXXXXXX, XXXXXXX +), + }; void persistant_default_layer_set(uint16_t default_layer) { @@ -725,22 +787,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { bool rshifted = keyboard_report->mods & MOD_BIT(KC_RSFT); switch (keycode) { - 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; - + // handle greek layer shift case KC_LSFT: case KC_RSFT: ; @@ -750,7 +797,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { layer_on(_GREEKU); layer_off(_GREEKL); } else { - if (lshifted ^ rshifted) { // if only one shift is pressed + if (lshifted ^ rshifted) { // if only one shift was pressed layer_on(_GREEKL); layer_off(_GREEKU); } @@ -796,6 +843,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; + case DVORAK: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_DVORAK); + } + return false; + break; case COLEMAK: if (record->event.pressed) { persistant_default_layer_set(1UL<<_COLEMAK); @@ -808,48 +861,63 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; + case NORMAN: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_NORMAN); + } + return false; + break; // layer switcher case PUNC: if (record->event.pressed) { layer_on(_PUNC); - update_tri_layer(_PUNC, _EMOJI, _GUI); - if (IS_LAYER_ON(_GUI)) { - led_layer_gui(); + update_tri_layer(_PUNC, _GREEKL, _EMOJI); + if (IS_LAYER_ON(_EMOJI)) { + led_layer_emoji(); } else { - led_layer_punc();; + led_layer_punc(); } } else { layer_off(_PUNC); - update_tri_layer(_PUNC, _EMOJI, _GUI); - if (IS_LAYER_ON(_EMOJI)) { - led_layer_emoji(); + update_tri_layer(_PUNC, _GREEKL, _EMOJI); + if (IS_LAYER_ON(_GREEKL)) { + ; } else { - led_layer_normal();; + led_layer_normal(); } } return false; break; - case EMOJI: + + case GREEK: if (record->event.pressed) { - layer_on(_EMOJI); - update_tri_layer(_PUNC, _EMOJI, _GUI); - if (IS_LAYER_ON(_GUI)) { - led_layer_gui(); + if (lshifted || rshifted) { + layer_on(_GREEKU); + layer_off(_GREEKL); } else { - led_layer_emoji();; + layer_on(_GREEKL); + layer_off(_GREEKU); + update_tri_layer(_PUNC, _GREEKL, _EMOJI); + if (IS_LAYER_ON(_EMOJI)) { + led_layer_emoji(); + } else { + ; + } } } else { - layer_off(_EMOJI); - update_tri_layer(_PUNC, _EMOJI, _GUI); + layer_off(_GREEKU); + layer_off(_GREEKL); + update_tri_layer(_PUNC, _GREEKL, _EMOJI); if (IS_LAYER_ON(_PUNC)) { led_layer_punc(); } else { - led_layer_normal();; + led_layer_normal(); } } return false; break; + case NUM: if (record->event.pressed) { layer_on(_NUM); @@ -860,6 +928,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; + case FUNC: if (record->event.pressed) { layer_on(_FUNC); -- cgit v1.2.3 From dee6a6982cdc8ee7970d1c61f7b7b4799b0f777b Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Fri, 10 Feb 2017 06:31:29 +0700 Subject: Fix LED indicator --- keyboards/handwired/promethium/keymaps/priyadi/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 3c48347d42..082997ad64 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -882,7 +882,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { layer_off(_PUNC); update_tri_layer(_PUNC, _GREEKL, _EMOJI); if (IS_LAYER_ON(_GREEKL)) { - ; + led_layer_normal(); } else { led_layer_normal(); } -- cgit v1.2.3 From 27e7eac279b7f0f8c62a213444e1dd02968bd720 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Fri, 10 Feb 2017 06:51:10 +0700 Subject: Reorganize punctuation & numbers layer --- .../handwired/promethium/keymaps/priyadi/keymap.c | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 082997ad64..fa3e21d72d 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -635,36 +635,36 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------. * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | ` | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | \ | - | = | | | ( | ) | < | > | | + * | | * | \ | - | = | | | ( | ) | < | > | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | _ | + | | | [ | ] | { | } | | + * | & | ^ | | | _ | + | | | [ | ] | { | } | : | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ [_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, XXXXXXX, KC_BSLS, KC_MINS, KC_EQL, XXXXXXX, XXXXXXX, KC_LPRN, KC_RPRN, KC_LABK, KC_RABK, XXXXXXX, - XXXXXXX, XXXXXXX, KC_PIPE, KC_UNDS, KC_PLUS, XXXXXXX, XXXXXXX, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, XXXXXXX, + XXXXXXX, KC_ASTR, KC_BSLS, KC_MINS, KC_EQL, XXXXXXX, XXXXXXX, KC_LPRN, KC_RPRN, KC_LABK, KC_RABK, XXXXXXX, + KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, XXXXXXX, XXXXXXX, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, KC_COLN, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), /* Num * ,-----------------------------------------------------------------------------------. - * | ^ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * | ~ | ! | @ | # | $ | % | A | 7 | 8 | 9 | D | ` | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | @ | A | B | C | ( | ) | 4 | 5 | 6 | : |Enter | + * | | * | \ | - | = | | B | 4 | 5 | 6 | E | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | & | # | D | E | F | [ | ] | 1 | 2 | 3 | / | * | + * | & | ^ | | | _ | + | | C | 1 | 2 | 3 | F | : | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | x | | | 0 | , | . | + | - | + * | | | | | | | x | 0 | , | . | | | * `-----------------------------------------------------------------------------------' */ [_NUM] = KEYMAP( - 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 + 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, XXXXXXX, S(KC_B), KC_4, KC_5, KC_6, S(KC_E), _______, + KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, XXXXXXX, S(KC_C), KC_1, KC_2, KC_3, S(KC_F), KC_COLN, + _______, _______, _______, _______, _______, _______, KC_X, KC_0, KC_COMM, KC_DOT, _______, _______ ), /* Func -- cgit v1.2.3 From a4a57d47eda4cae27dd56204a8bf36d3dac8e663 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Fri, 10 Feb 2017 13:13:04 +0700 Subject: Reimplement GUI Layer --- .../handwired/promethium/keymaps/priyadi/keymap.c | 41 +++++++++++----------- 1 file changed, 21 insertions(+), 20 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index fa3e21d72d..9605c493c2 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -63,6 +63,7 @@ enum planck_keycodes { #define _______ KC_TRNS #define XXXXXXX KC_NO +#define G(x) LGUI(x) // unicode map @@ -741,23 +742,23 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* GUI * ,-----------------------------------------------------------------------------------. - * | | D1 | D2 | D3 | D4 | D5 | D6 | D7 | D8 | D9 | D10 | | + * | | | | | | | | | | | | | * |------+------+------+------+------+-------------+------+------+------+------+------| - * |Linux | | Vol- | Mute | Vol+ | | | D- | | D+ | |Qwerty| + * | | D1 | D2 | D3 | D4 | D5 | D6 | D7 | D8 | D9 | D10 | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Win | | Prev | Play | Next | | | | | | |Colmak| + * | | | | | | | | | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | OSX | | | | | BL- | BL+ | | | | |Workmn| + * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ [_GUI] = KEYMAP( - _______, 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, OUT_USB, KC_VOLD, KC_MUTE, KC_VOLU,_______,_______,KC_WWW_BACK,_______,KC_WWW_FORWARD,KC_PAUS, QWERTY, - WIN, OUT_BLE, KC_MPRV, KC_MPLY, KC_MNXT, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, COLEMAK, - OSX, _______, _______, _______, _______, BL_DEC, BL_INC, _______, _______, RGB_VAI, RGB_VAD, WORKMAN + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + 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, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX ), -/* GUI +/* Sys * ,-----------------------------------------------------------------------------------. * | |Qwerty| Win | | | | | USB | | | | | * |------+------+------+------+------+-------------+------+------+------+------+------| @@ -772,7 +773,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { XXXXXXX, QWERTY, WIN, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, OUT_USB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DVORAK, XXXXXXX, XXXXXXX, 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, XXXXXXX, XXXXXXX + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______ ), }; @@ -872,15 +873,15 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case PUNC: if (record->event.pressed) { layer_on(_PUNC); - update_tri_layer(_PUNC, _GREEKL, _EMOJI); - if (IS_LAYER_ON(_EMOJI)) { - led_layer_emoji(); + update_tri_layer(_PUNC, _GREEKL, _GUI); + if (IS_LAYER_ON(_GUI)) { + led_layer_normal(); } else { led_layer_punc(); } } else { layer_off(_PUNC); - update_tri_layer(_PUNC, _GREEKL, _EMOJI); + update_tri_layer(_PUNC, _GREEKL, _GUI); if (IS_LAYER_ON(_GREEKL)) { led_layer_normal(); } else { @@ -898,19 +899,19 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } else { layer_on(_GREEKL); layer_off(_GREEKU); - update_tri_layer(_PUNC, _GREEKL, _EMOJI); - if (IS_LAYER_ON(_EMOJI)) { - led_layer_emoji(); + update_tri_layer(_PUNC, _GREEKL, _GUI); + if (IS_LAYER_ON(_GUI)) { + led_layer_normal(); } else { - ; + led_layer_normal(); } } } else { layer_off(_GREEKU); layer_off(_GREEKL); - update_tri_layer(_PUNC, _GREEKL, _EMOJI); + update_tri_layer(_PUNC, _GREEKL, _GUI); if (IS_LAYER_ON(_PUNC)) { - led_layer_punc(); + led_layer_normal(); } else { led_layer_normal(); } -- cgit v1.2.3 From 0f92d305e267bbf399913d3631007aac885df88d Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Fri, 10 Feb 2017 14:32:24 +0700 Subject: Add slash/question mark to punc/num layer --- .../handwired/promethium/keymaps/priyadi/keymap.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 9605c493c2..80224b93ae 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -636,17 +636,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------. * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | ` | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | * | \ | - | = | | | ( | ) | < | > | | + * | | * | \ | - | = | / | | ( | ) | < | > | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | & | ^ | | | _ | + | | | [ | ] | { | } | : | + * | & | ^ | | | _ | + | ? | | [ | ] | { | } | : | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ [_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, XXXXXXX, XXXXXXX, KC_LPRN, KC_RPRN, KC_LABK, KC_RABK, XXXXXXX, - KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, XXXXXXX, XXXXXXX, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, KC_COLN, + 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, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), @@ -654,17 +654,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------. * | ~ | ! | @ | # | $ | % | A | 7 | 8 | 9 | D | ` | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | * | \ | - | = | | B | 4 | 5 | 6 | E | | + * | | * | \ | - | = | / | B | 4 | 5 | 6 | E | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | & | ^ | | | _ | + | | C | 1 | 2 | 3 | F | : | + * | & | ^ | | | _ | + | ? | C | 1 | 2 | 3 | F | : | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | x | 0 | , | . | | | * `-----------------------------------------------------------------------------------' */ [_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, XXXXXXX, S(KC_B), KC_4, KC_5, KC_6, S(KC_E), _______, - KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, XXXXXXX, S(KC_C), KC_1, KC_2, KC_3, S(KC_F), KC_COLN, + 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_X, KC_0, KC_COMM, KC_DOT, _______, _______ ), @@ -752,9 +752,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_GUI] = KEYMAP( - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, 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, 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 ), -- cgit v1.2.3 From 4ffbfe829862bb6cc23202ced13da2672c490f5b Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Fri, 10 Feb 2017 14:43:56 +0700 Subject: Restore GUI layer --- .../handwired/promethium/keymaps/priyadi/keymap.c | 24 ++++++++++------------ 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 80224b93ae..c06fb7e786 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -12,9 +12,13 @@ #include "outputselect.h" #define COUNT(x) (sizeof (x) / sizeof (*(x))) -// #define RGBLED_NUM 5 -// struct cRGB led[RGBLED_NUM]; +// Fillers to make layering clearer +#define _______ KC_TRNS +#define XXXXXXX KC_NO +#define G(x) LGUI(x) +#define KC_WWWB KC_WWW_BACK +#define KC_WWWF KC_WWW_FORWARD extern keymap_config_t keymap_config; @@ -59,12 +63,6 @@ enum planck_keycodes { OSX, }; -// Fillers to make layering clearer - -#define _______ KC_TRNS -#define XXXXXXX KC_NO -#define G(x) LGUI(x) - // unicode map enum unicode_name { @@ -742,19 +740,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* GUI * ,-----------------------------------------------------------------------------------. - * | | | | | | | | | | | | | - * |------+------+------+------+------+-------------+------+------+------+------+------| * | | D1 | D2 | D3 | D4 | D5 | D6 | D7 | D8 | D9 | D10 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | Vol- | Mute | Vol+ | | | Prev | | Next | | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | + * | | | Prev | Play | Next | | | | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ [_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, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, 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, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX ), -- cgit v1.2.3 From a5b8db52a046e803c21146402e1d009f31b91508 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Fri, 10 Feb 2017 17:11:52 +0700 Subject: Activate SYS layer by pressing both Ctrls --- .../handwired/promethium/keymaps/priyadi/keymap.c | 34 ++++++++++++++++------ 1 file changed, 25 insertions(+), 9 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index c06fb7e786..eee859e316 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -782,8 +782,8 @@ void persistant_default_layer_set(uint16_t default_layer) { } bool process_record_user(uint16_t keycode, keyrecord_t *record) { - bool lshifted = keyboard_report->mods & MOD_BIT(KC_LSFT); - bool rshifted = keyboard_report->mods & MOD_BIT(KC_RSFT); + bool lshift = keyboard_report->mods & MOD_BIT(KC_LSFT); + bool rshift = keyboard_report->mods & MOD_BIT(KC_RSFT); switch (keycode) { // handle greek layer shift @@ -796,7 +796,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { layer_on(_GREEKU); layer_off(_GREEKL); } else { - if (lshifted ^ rshifted) { // if only one shift was pressed + if (lshift ^ rshift) { // if only one shift was pressed layer_on(_GREEKL); layer_off(_GREEKU); } @@ -805,16 +805,32 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; break; + // press both ctrls to activate SYS layer + case KC_LCTL: + case KC_RCTL: + ; + bool lctrl = keyboard_report->mods & MOD_BIT(KC_LCTL); + bool rctrl = keyboard_report->mods & MOD_BIT(KC_RCTL); + if (record->event.pressed) { + if (lctrl ^ rctrl) { // if only one ctrl was pressed + layer_on(_SYS); + } + } else { + layer_off(_SYS); + } + 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); + if (lshift || rshift) { + if (lshift) unregister_code(KC_LSFT); + if (rshift) unregister_code(KC_RSFT); register_code(KC_SCLN); unregister_code(KC_SCLN); - if (lshifted) register_code(KC_LSFT); - if (rshifted) register_code(KC_RSFT); + if (lshift) register_code(KC_LSFT); + if (rshift) register_code(KC_RSFT); } else { register_code(KC_COMM); unregister_code(KC_COMM); @@ -891,7 +907,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case GREEK: if (record->event.pressed) { - if (lshifted || rshifted) { + if (lshift || rshift) { layer_on(_GREEKU); layer_off(_GREEKL); } else { -- cgit v1.2.3 From 07879bf66b29535214a147b1797f96767b1faa58 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Fri, 10 Feb 2017 17:45:12 +0700 Subject: Add function to cycle backlight modes --- .../handwired/promethium/keymaps/priyadi/keymap.c | 152 ++++++++++----------- 1 file changed, 74 insertions(+), 78 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index eee859e316..65fa14dd35 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -20,6 +20,13 @@ #define KC_WWWB KC_WWW_BACK #define KC_WWWF KC_WWW_FORWARD +enum glow_modes { + GLOW_NONE, + GLOW_MIN, + GLOW_FULL +}; +uint8_t glow_mode = GLOW_MIN; + extern keymap_config_t keymap_config; enum layers { @@ -61,6 +68,10 @@ enum planck_keycodes { LINUX, WIN, OSX, + + // others + GLOW, + AUDIO }; // unicode map @@ -317,6 +328,17 @@ const uint8_t PROGMEM LED_ALNUM[] = { LED_RSPC }; +const uint8_t PROGMEM LED_HOMING[] = { + LED_A, + LED_S, + LED_D, + LED_F, + LED_J, + LED_K, + LED_L, + LED_SCLN +}; + const uint8_t PROGMEM LED_MODS[] = { LED_TAB, LED_ESC, @@ -354,20 +376,50 @@ const uint8_t PROGMEM LED_TRACKPOINT[] = { LED_TRACKPOINT3, }; -void led_reset(void) { +void led_turnoff_keys(void) { for(uint8_t i = 0; i < COUNT(LED_ALNUM); i++) { rgbsps_set(pgm_read_byte(&LED_ALNUM[i]), 0, 0, 0); } - for(uint8_t i = 0; i < COUNT(LED_MODS); i++) { rgbsps_set(pgm_read_byte(&LED_MODS[i]), 0, 0, 0); } - for(uint8_t i = 0; i < COUNT(LED_FN); i++) { rgbsps_set(pgm_read_byte(&LED_FN[i]), 0, 0, 0); } } +void led_reset(void) { + switch (glow_mode) { + case GLOW_NONE: + led_turnoff_keys(); + break; + case GLOW_MIN: + led_turnoff_keys(); + for(uint8_t i = 0; i < COUNT(LED_HOMING); i++) { + rgbsps_set(pgm_read_byte(&LED_HOMING[i]), 8, 8, 8); + } + rgbsps_set(LED_F, 15, 0, 0); + rgbsps_set(LED_J, 15, 0, 0); + break; + case GLOW_FULL: + for(uint8_t i = 0; i < COUNT(LED_ALNUM); i++) { + rgbsps_set(pgm_read_byte(&LED_ALNUM[i]), 8, 8, 8); + } + for(uint8_t i = 0; i < COUNT(LED_MODS); i++) { + rgbsps_set(pgm_read_byte(&LED_MODS[i]), 0, 15, 0); + } + for(uint8_t i = 0; i < COUNT(LED_FN); i++) { + rgbsps_set(pgm_read_byte(&LED_FN[i]), 0, 0, 15); + } + for(uint8_t i = 0; i < COUNT(LED_HOMING); i++) { + rgbsps_set(pgm_read_byte(&LED_HOMING[i]), 15, 0, 0); + } + rgbsps_set(LED_F, 15, 15, 0); + rgbsps_set(LED_J, 15, 15, 0); + break; + } +} + void led_layer_normal(void) { rgbsps_set(LED_IND_FUNC, 0, 0, 0); rgbsps_set(LED_IND_NUM, 0, 0, 0); @@ -385,35 +437,6 @@ void led_layer_func(void) { led_reset(); - for(uint8_t i = 0; i < COUNT(LED_ALNUM); i++) { - rgbsps_set(pgm_read_byte(&LED_ALNUM[i]), 0, 0, 0); - } - - // rgbsps_set(LED_I, 15, 0, 15); - // rgbsps_set(LED_J, 15, 0, 15); - // rgbsps_set(LED_K, 15, 0, 15); - // rgbsps_set(LED_L, 15, 0, 15); - - // rgbsps_set(LED_U, 15, 0, 0); - // rgbsps_set(LED_O, 15, 0, 0); - // rgbsps_set(LED_COMM, 15, 0, 0); - // rgbsps_set(LED_DOT, 15, 0, 0); - // rgbsps_set(LED_SCLN, 15, 0, 0); - // rgbsps_set(LED_P, 15, 0, 0); - - // rgbsps_set(LED_Q, 0, 15, 0); - // rgbsps_set(LED_W, 0, 15, 0); - // rgbsps_set(LED_E, 0, 15, 0); - // rgbsps_set(LED_R, 0, 15, 0); - // rgbsps_set(LED_A, 0, 15, 0); - // rgbsps_set(LED_S, 0, 15, 0); - // rgbsps_set(LED_D, 0, 15, 0); - // rgbsps_set(LED_F, 0, 15, 0); - // rgbsps_set(LED_Z, 0, 15, 0); - // rgbsps_set(LED_X, 0, 15, 0); - // rgbsps_set(LED_C, 0, 15, 0); - // rgbsps_set(LED_V, 0, 15, 0); - rgbsps_send(); } @@ -434,55 +457,10 @@ void led_layer_num(void) { led_reset(); - // for(uint8_t i = 0; i < COUNT(LED_ALNUM); i++) { - // rgbsps_set(pgm_read_byte(&LED_ALNUM[i]), 0, 0, 0); - // } - - // rgbsps_set(LED_U, 0, 5, 15); - // rgbsps_set(LED_I, 0, 5, 15); - // rgbsps_set(LED_O, 0, 5, 15); - // rgbsps_set(LED_J, 0, 5, 15); - // rgbsps_set(LED_K, 0, 5, 15); - // rgbsps_set(LED_L, 0, 5, 15); - // rgbsps_set(LED_M, 0, 5, 15); - // rgbsps_set(LED_COMM, 0, 5, 15); - // rgbsps_set(LED_DOT, 0, 5, 15); - // rgbsps_set(LED_FUNC, 0, 5, 15); - - // rgbsps_set(LED_EMOJI, 0, 10, 15); - // rgbsps_set(LED_RALT, 0, 10, 15); - - // rgbsps_set(LED_Q, 0, 10, 15); - // rgbsps_set(LED_W, 0, 10, 15); - // rgbsps_set(LED_E, 0, 10, 15); - // rgbsps_set(LED_R, 0, 10, 15); - // rgbsps_set(LED_T, 0, 10, 15); - // rgbsps_set(LED_Y, 0, 10, 15); - // rgbsps_set(LED_P, 0, 10, 15); - - // rgbsps_set(LED_A, 0, 15, 15); - // rgbsps_set(LED_S, 0, 15, 15); - // rgbsps_set(LED_D, 0, 15, 15); - // rgbsps_set(LED_F, 0, 15, 15); - // rgbsps_set(LED_Z, 0, 15, 15); - // rgbsps_set(LED_X, 0, 15, 15); - // rgbsps_set(LED_C, 0, 15, 15); - // rgbsps_set(LED_V, 0, 15, 15); - rgbsps_send(); } void led_layer_emoji(void) { - // for(uint8_t i = 0; i < COUNT(LED_ALNUM); i++) { - // rgbsps_set(pgm_read_byte(&LED_ALNUM[i]), 15, 15, 0); - // } - // for(uint8_t i = 0; i < COUNT(LED_MODS); i++) { - // rgbsps_set(pgm_read_byte(&LED_MODS[i]), 15, 15, 0); - // } - // for(uint8_t i = 0; i < COUNT(LED_FN); i++) { - // rgbsps_set(pgm_read_byte(&LED_FN[i]), 15, 15, 0); - // } - rgbsps_set(LED_IND_FUNC, 0, 0, 0); rgbsps_set(LED_IND_NUM, 0, 0, 0); rgbsps_set(LED_IND_EMOJI, 15, 15, 0); @@ -769,7 +747,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_SYS] = KEYMAP( XXXXXXX, QWERTY, WIN, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, OUT_USB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, DVORAK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, WORKMAN, LINUX, XXXXXXX, XXXXXXX, + XXXXXXX, AUDIO, 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, _______ ), @@ -968,6 +946,24 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { set_unicode_input_mode(UC_OSX); return false; break; + + // glow mode changer + case GLOW: + if (record->event.pressed) { + glow_mode++; + if (glow_mode > GLOW_FULL) { + glow_mode = GLOW_NONE; + } + led_reset(); + rgbsps_send(); + } + return false; + break; + + // faux clicky toggle, TBD + case AUDIO: + return false; + break; } return true; } -- cgit v1.2.3 From 5944ab246a981d6ceca94b0972345277a746c2d3 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Fri, 10 Feb 2017 21:28:46 +0700 Subject: Implement battery level indicator --- .../handwired/promethium/keymaps/priyadi/keymap.c | 11 ++--- keyboards/handwired/promethium/promethium.c | 34 ++++++++++++++- keyboards/handwired/promethium/promethium.h | 6 ++- keyboards/handwired/promethium/rgbsps.c | 51 +++++++++++++++++++++- keyboards/handwired/promethium/rgbsps.h | 3 +- keyboards/handwired/promethium/rules.mk | 3 +- 6 files changed, 97 insertions(+), 11 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 65fa14dd35..469d7a5d80 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -25,6 +25,7 @@ enum glow_modes { GLOW_MIN, GLOW_FULL }; + uint8_t glow_mode = GLOW_MIN; extern keymap_config_t keymap_config; @@ -505,11 +506,6 @@ void led_init(void) { rgbsps_set(LED_TRACKPOINT2, 0, 0, 15); rgbsps_set(LED_TRACKPOINT3, 15, 0, 0); - // // hardcode indicator for now - rgbsps_set(LED_IND_BLUETOOTH, 0, 0, 15); - rgbsps_set(LED_IND_USB, 15, 15, 15); - rgbsps_set(LED_IND_BATTERY, 0, 15, 0); - led_layer_normal(); } @@ -996,6 +992,11 @@ void matrix_init_user(void) { } } +void battery_poll(float percentage) { + rgbsps_sethsv(LED_IND_BATTERY, percentage*120/100, 255, 15); + rgbsps_send(); +} + void ps2_mouse_init_user() { uint8_t rcv; diff --git a/keyboards/handwired/promethium/promethium.c b/keyboards/handwired/promethium/promethium.c index a0035cce1a..7f876c7562 100644 --- a/keyboards/handwired/promethium/promethium.c +++ b/keyboards/handwired/promethium/promethium.c @@ -1,6 +1,36 @@ #include "promethium.h" +#include "analog.h" +#include "timer.h" +#include "matrix.h" -void matrix_init_kb(void) { +float battery_percentage(void) { + float voltage = analogRead(BATTERY_PIN) * 2 * 3.3 / 1024; + float percentage = (voltage - 3.5) * 143; + if (percentage > 100) { + return 100; + } else if (percentage < 0) { + return 0; + } else { + return percentage; + } +} + +__attribute__ ((weak)) +void battery_poll(float percentage) { +} +void matrix_init_kb(void) { matrix_init_user(); -} \ No newline at end of file +} + +void matrix_scan_kb(void) { + static uint16_t counter = BATTERY_POLL; + counter++; + + if (counter > BATTERY_POLL) { + counter = 0; + battery_poll(battery_percentage()); + } +} + + diff --git a/keyboards/handwired/promethium/promethium.h b/keyboards/handwired/promethium/promethium.h index a2572db2af..6d51f81ca6 100644 --- a/keyboards/handwired/promethium/promethium.h +++ b/keyboards/handwired/promethium/promethium.h @@ -5,6 +5,8 @@ #define PS2_INIT_DELAY 2000 #define UNICODE_TYPE_DELAY 0 +#define BATTERY_PIN 9 +#define BATTERY_POLL 30000 #define KEYMAP( \ k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \ @@ -23,6 +25,8 @@ {k47, k48, k49, k4a, k4b, k4c} \ } + + enum led_sequence { LED_IND_BLUETOOTH, LED_IND_USB, @@ -99,4 +103,4 @@ enum led_sequence { #endif - +void battery_poll(float percentage); \ No newline at end of file diff --git a/keyboards/handwired/promethium/rgbsps.c b/keyboards/handwired/promethium/rgbsps.c index ea922ec3fd..f30badd356 100644 --- a/keyboards/handwired/promethium/rgbsps.c +++ b/keyboards/handwired/promethium/rgbsps.c @@ -21,4 +21,53 @@ void rgbsps_turnoff(void) { void rgbsps_send(void) { ws2812_setleds(led, RGBSPS_NUM); -} \ No newline at end of file +} + +void rgbsps_sethsv(uint8_t index, uint16_t hue, uint8_t sat, uint8_t val) { + uint8_t r = 0, g = 0, b = 0, base, color; + + if (sat == 0) { // Acromatic color (gray). Hue doesn't mind. + r = val; + g = val; + b = val; + } else { + base = ((255 - sat) * val) >> 8; + color = (val - base) * (hue % 60) / 60; + + switch (hue / 60) { + case 0: + r = val; + g = base + color; + b = base; + break; + case 1: + r = val - color; + g = val; + b = base; + break; + case 2: + r = base; + g = val; + b = base + color; + break; + case 3: + r = base; + g = val - color; + b = val; + break; + case 4: + r = base + color; + g = base; + b = val; + break; + case 5: + r = val; + g = base; + b = val - color; + break; + } + } + + rgbsps_set(index, r, g, b); +} + diff --git a/keyboards/handwired/promethium/rgbsps.h b/keyboards/handwired/promethium/rgbsps.h index 6da197f75d..72612a7a82 100644 --- a/keyboards/handwired/promethium/rgbsps.h +++ b/keyboards/handwired/promethium/rgbsps.h @@ -1,4 +1,5 @@ void rgbsps_set(uint8_t index, uint8_t r, uint8_t g, uint8_t b); void rgbsps_setall(uint8_t r, uint8_t g, uint8_t b); void rgbsps_turnoff(void); -void rgbsps_send(void); \ No newline at end of file +void rgbsps_send(void); +void rgbsps_sethsv(uint8_t index, uint16_t hue, uint8_t sat, uint8_t val); \ No newline at end of file diff --git a/keyboards/handwired/promethium/rules.mk b/keyboards/handwired/promethium/rules.mk index 465ef3359a..e75cf4dde4 100644 --- a/keyboards/handwired/promethium/rules.mk +++ b/keyboards/handwired/promethium/rules.mk @@ -72,4 +72,5 @@ API_SYSEX_ENABLE ?= no SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend SRC += $(QUANTUM_DIR)/light_ws2812.c -SRC += rgbsps.c \ No newline at end of file +SRC += rgbsps.c +SRC += $(QUANTUM_DIR)/analog.c \ No newline at end of file -- cgit v1.2.3 From 229e38f097448c61b2311c00837362fe5de17889 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Fri, 10 Feb 2017 22:15:15 +0700 Subject: Add ifdefs for keyboard layouts --- .../handwired/promethium/keymaps/priyadi/config.h | 5 +++ .../handwired/promethium/keymaps/priyadi/keymap.c | 37 ++++++++++++++-------- 2 files changed, 29 insertions(+), 13 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/config.h b/keyboards/handwired/promethium/keymaps/priyadi/config.h index 8b78c0dc4f..36baedd486 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/config.h +++ b/keyboards/handwired/promethium/keymaps/priyadi/config.h @@ -14,4 +14,9 @@ #define RGB_DI_PIN B5 #define RGBSPS_NUM 57 +#define LAYOUT_DVORAK +#define LAYOUT_COLEMAK +#define LAYOUT_NORMAN +#define LAYOUT_WORKMAN + #endif diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 469d7a5d80..1e5e497dfd 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -13,19 +13,22 @@ #define COUNT(x) (sizeof (x) / sizeof (*(x))) // Fillers to make layering clearer - #define _______ KC_TRNS #define XXXXXXX KC_NO #define G(x) LGUI(x) #define KC_WWWB KC_WWW_BACK #define KC_WWWF KC_WWW_FORWARD +// hybrid right-alt & scroll lock (mapped to Compose in OS) +#undef KC_RALT +#define KC_RALT MT(MOD_RALT, KC_SLCK) + +// glow enum glow_modes { GLOW_NONE, GLOW_MIN, GLOW_FULL }; - uint8_t glow_mode = GLOW_MIN; extern keymap_config_t keymap_config; @@ -281,17 +284,6 @@ const uint32_t PROGMEM unicode_map[] = { [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-alt & scroll lock (mapped to Compose in OS) -#undef KC_RALT -#define KC_RALT MT(MOD_RALT, KC_SLCK) - // RGBSPS const uint8_t PROGMEM LED_ALNUM[] = { @@ -543,12 +535,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Ctrl | Alt | GUI | Punc | Num | Space | Func |Greek | GUI |AltGr | Ctrl | * `-----------------------------------------------------------------------------------' */ +#ifdef LAYOUT_DVORAK [_DVORAK] = KEYMAP( _______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, _______, _______, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, _______, _______, KC_SLSH, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), +#endif /* Colemak * ,-----------------------------------------------------------------------------------. @@ -561,12 +555,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Ctrl | Alt | GUI | Punc | Num | Space | Func |Greek | GUI |AltGr | Ctrl | * `-----------------------------------------------------------------------------------' */ + +#ifdef LAYOUT_COLEMAK [_COLEMAK] = KEYMAP( _______, 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, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), +#endif /* Norman * ,-----------------------------------------------------------------------------------. @@ -579,12 +576,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Ctrl | Alt | GUI | Punc | Num | Space | Func |Greek | GUI |AltGr | Ctrl | * `-----------------------------------------------------------------------------------' */ + +#ifdef LAYOUT_NORMAN [_NORMAN] = KEYMAP( _______, KC_Q, KC_W, KC_D, KC_F, KC_K, KC_J, KC_U, KC_R, KC_L, KC_QUOT, _______, _______, KC_A, KC_S, KC_E, KC_T, KC_G, KC_Y, KC_N, KC_I, KC_O, KC_H, _______, _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_P, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), +#endif /* Workman * ,-----------------------------------------------------------------------------------. @@ -597,12 +597,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Ctrl | Alt | GUI | Punc | Num | Space | Func |Greek | GUI |AltGr | Ctrl | * `-----------------------------------------------------------------------------------' */ + +#ifdef LAYOUT_WORKMAN [_WORKMAN] = KEYMAP( _______, 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, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), +#endif /* Punc * ,-----------------------------------------------------------------------------------. @@ -832,30 +835,38 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; +#ifdef LAYOUT_DVORAK case DVORAK: if (record->event.pressed) { persistant_default_layer_set(1UL<<_DVORAK); } return false; break; +#endif +#ifdef LAYOUT_COLEMAK case COLEMAK: if (record->event.pressed) { persistant_default_layer_set(1UL<<_COLEMAK); } return false; break; +#endif +#ifdef LAYOUT_WORKMAN case WORKMAN: if (record->event.pressed) { persistant_default_layer_set(1UL<<_WORKMAN); } return false; break; +#endif +#ifdef LAYOUT_NORMAN case NORMAN: if (record->event.pressed) { persistant_default_layer_set(1UL<<_NORMAN); } return false; break; +#endif // layer switcher case PUNC: -- cgit v1.2.3 From 909fd4ae64432206e80925f12268c17ea7f2f68f Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Sat, 11 Feb 2017 00:07:10 +0700 Subject: Generalize layer indicators --- .../handwired/promethium/keymaps/priyadi/keymap.c | 142 +++++++++------------ keyboards/handwired/promethium/promethium.c | 2 + 2 files changed, 61 insertions(+), 83 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 1e5e497dfd..72b6253570 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -413,61 +413,43 @@ void led_reset(void) { } } -void led_layer_normal(void) { - rgbsps_set(LED_IND_FUNC, 0, 0, 0); - rgbsps_set(LED_IND_NUM, 0, 0, 0); - rgbsps_set(LED_IND_EMOJI, 0, 0, 0); - - led_reset(); - - rgbsps_send(); -} +void led_set_layer_indicator(void) { + static uint8_t oldlayer = 255; -void led_layer_func(void) { - rgbsps_set(LED_IND_FUNC, 0, 15, 0); + rgbsps_set(LED_IND_FUNC, 0, 0, 0); rgbsps_set(LED_IND_NUM, 0, 0, 0); rgbsps_set(LED_IND_EMOJI, 0, 0, 0); led_reset(); - rgbsps_send(); -} - -void led_layer_punc(void) { - rgbsps_set(LED_IND_FUNC, 0, 15, 0); - rgbsps_set(LED_IND_NUM, 0, 0, 15); - rgbsps_set(LED_IND_EMOJI, 0, 0, 0); - - led_reset(); - - rgbsps_send(); -} - -void led_layer_num(void) { - rgbsps_set(LED_IND_FUNC, 0, 0, 0); - rgbsps_set(LED_IND_NUM, 0, 0, 15); - rgbsps_set(LED_IND_EMOJI, 0, 0, 0); - - led_reset(); + uint8_t layer = biton32(layer_state); + if (oldlayer == layer) { + return; + } - rgbsps_send(); -} + oldlayer = layer; -void led_layer_emoji(void) { - rgbsps_set(LED_IND_FUNC, 0, 0, 0); - rgbsps_set(LED_IND_NUM, 0, 0, 0); - rgbsps_set(LED_IND_EMOJI, 15, 15, 0); - - rgbsps_set(LED_PUNC, 15, 15, 15); - rgbsps_set(LED_EMOJI, 15, 15, 15); + if (layer <= _NORMAN) { + rgbsps_send(); + return; + } - rgbsps_send(); -} + switch(layer) { + case _FUNC: + rgbsps_set(LED_IND_FUNC, 15, 0, 0); + break; + case _NUM: + rgbsps_set(LED_IND_NUM, 0, 0, 15); + break; + case _EMOJI: + 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_EMOJI, 3, 3, 3); + } -void led_layer_gui(void) { - rgbsps_set(LED_IND_FUNC, 15, 10, 15); - rgbsps_set(LED_IND_NUM, 15, 10, 15); - rgbsps_set(LED_IND_EMOJI, 15, 10, 15); rgbsps_send(); } @@ -497,8 +479,6 @@ void led_init(void) { rgbsps_set(LED_TRACKPOINT1, 15, 0, 0); rgbsps_set(LED_TRACKPOINT2, 0, 0, 15); rgbsps_set(LED_TRACKPOINT3, 15, 0, 0); - - led_layer_normal(); } @@ -798,6 +778,22 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; break; + // press both Supers to activate EMOJI layer + case KC_LGUI: + case KC_RGUI: + ; + bool lgui = keyboard_report->mods & MOD_BIT(KC_LGUI); + bool rgui = keyboard_report->mods & MOD_BIT(KC_RGUI); + if (record->event.pressed) { + if (lgui ^ rgui) { // if only one super was pressed + layer_on(_EMOJI); + } + } else { + layer_off(_EMOJI); + } + return true; + break; + // QWERTZ style comma and dot: semicolon and colon when shifted case KC_COMM: if (record->event.pressed) { @@ -873,19 +869,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { layer_on(_PUNC); update_tri_layer(_PUNC, _GREEKL, _GUI); - if (IS_LAYER_ON(_GUI)) { - led_layer_normal(); - } else { - led_layer_punc(); - } } else { layer_off(_PUNC); update_tri_layer(_PUNC, _GREEKL, _GUI); - if (IS_LAYER_ON(_GREEKL)) { - led_layer_normal(); - } else { - led_layer_normal(); - } } return false; break; @@ -899,21 +885,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { layer_on(_GREEKL); layer_off(_GREEKU); update_tri_layer(_PUNC, _GREEKL, _GUI); - if (IS_LAYER_ON(_GUI)) { - led_layer_normal(); - } else { - led_layer_normal(); - } } } else { layer_off(_GREEKU); layer_off(_GREEKL); update_tri_layer(_PUNC, _GREEKL, _GUI); - if (IS_LAYER_ON(_PUNC)) { - led_layer_normal(); - } else { - led_layer_normal(); - } } return false; break; @@ -921,10 +897,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case NUM: if (record->event.pressed) { layer_on(_NUM); - led_layer_num(); } else { layer_off(_NUM); - led_layer_normal(); } return false; break; @@ -932,10 +906,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case FUNC: if (record->event.pressed) { layer_on(_FUNC); - led_layer_func(); } else { layer_off(_FUNC); - led_layer_normal(); } return false; break; @@ -1003,6 +975,10 @@ void matrix_init_user(void) { } } +void matrix_scan_user(void) { + led_set_layer_indicator(); +} + void battery_poll(float percentage) { rgbsps_sethsv(LED_IND_BATTERY, percentage*120/100, 255, 15); rgbsps_send(); @@ -1012,23 +988,23 @@ void ps2_mouse_init_user() { uint8_t rcv; // set TrackPoint sensitivity - PS2_MOUSE_SEND(0xE2, "set trackpoint sensitivity: 0xE2"); - PS2_MOUSE_SEND(0x81, "set trackpoint sensitivity: 0x81"); - PS2_MOUSE_SEND(0x4A, "set trackpoint sensitivity: 0x4A"); - PS2_MOUSE_SEND(0x49, "set trackpoint sensitivity: 0x59"); + 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, "set negative inertia factor: 0xE2"); - PS2_MOUSE_SEND(0x81, "set negative inertia factor: 0x81"); - PS2_MOUSE_SEND(0x4D, "set negative inertia factor: 0x4D"); - PS2_MOUSE_SEND(0x06, "set negative inertia factor: 0x06"); + 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, "set trackpoint speed: 0xE2"); - PS2_MOUSE_SEND(0x81, "set trackpoint speed: 0x81"); - PS2_MOUSE_SEND(0x60, "set trackpoint speed: 0x60"); - PS2_MOUSE_SEND(0x61, "set trackpoint speed: 0x61"); + 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); diff --git a/keyboards/handwired/promethium/promethium.c b/keyboards/handwired/promethium/promethium.c index 7f876c7562..adfc11e2ac 100644 --- a/keyboards/handwired/promethium/promethium.c +++ b/keyboards/handwired/promethium/promethium.c @@ -31,6 +31,8 @@ void matrix_scan_kb(void) { counter = 0; battery_poll(battery_percentage()); } + + matrix_scan_user(); } -- cgit v1.2.3 From bf31f516e30c4aae89a6636cecb3d7c5bb332cad Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Sat, 11 Feb 2017 00:07:44 +0700 Subject: Add reset keycode --- keyboards/handwired/promethium/keymaps/priyadi/keymap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 72b6253570..3107d4e05f 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -715,7 +715,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Sys * ,-----------------------------------------------------------------------------------. - * | |Qwerty| Win | | | | | USB | | | | | + * | |Qwerty| Win | |Reset | | | USB | | | | | * |------+------+------+------+------+-------------+------+------+------+------+------| * | |Audio | |Dvorak| | Glow | | |WorkMn|Linux | | | * |------+------+------+------+------+------+------+------+------+------+------+------| @@ -725,7 +725,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_SYS] = KEYMAP( - XXXXXXX, QWERTY, WIN, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, OUT_USB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + 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, XXXXXXX, XXXXXXX, COLEMAK, XXXXXXX, OUT_BLE, NORMAN, OSX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______ -- cgit v1.2.3 From fdd06d3fcafd5aae5eb8a6edf208f60a40a6a0be Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Sat, 11 Feb 2017 00:21:27 +0700 Subject: RShift + LShift = Capslock --- keyboards/handwired/promethium/keymaps/priyadi/keymap.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 3107d4e05f..b50d2c3e23 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -744,6 +744,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { // handle greek layer shift + // handle both shift = capslock case KC_LSFT: case KC_RSFT: ; @@ -758,6 +759,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { layer_off(_GREEKU); } } + } else { + if (record->event.pressed) { + if (lshift ^ rshift) { // if only one shift was pressed + register_code(KC_CAPS); + unregister_code(KC_CAPS); + } + } } return true; break; -- cgit v1.2.3 From b31ac35441a8117877e446b8467e3e34e0a4505b Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Sat, 11 Feb 2017 01:30:08 +0700 Subject: Fix emoji layer --- keyboards/handwired/promethium/keymaps/priyadi/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index b50d2c3e23..6eb4e903f7 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -692,7 +692,7 @@ 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 -- cgit v1.2.3 From 9fc3afbef4b3ecc8568c37f247c3c7f1ec87a4c1 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Sat, 11 Feb 2017 14:50:43 +0700 Subject: simplify battery calculation for now --- keyboards/handwired/promethium/config.h | 89 +++++++++++++++++++--- .../handwired/promethium/keymaps/priyadi/keymap.c | 4 +- keyboards/handwired/promethium/promethium.c | 19 ++--- keyboards/handwired/promethium/promethium.h | 4 +- 4 files changed, 92 insertions(+), 24 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/config.h b/keyboards/handwired/promethium/config.h index 23fbfd0b9a..fd45c2bfe3 100644 --- a/keyboards/handwired/promethium/config.h +++ b/keyboards/handwired/promethium/config.h @@ -43,38 +43,107 @@ along with this program. If not, see . #define MATRIX_ROW_PINS { D7, C6, D0, D1, F5, F4, F1, F0 } #define UNUSED_PINS -/* COL2ROW or ROW2COL */ +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ #define DIODE_DIRECTION COL2ROW -/* define if matrix has ghost */ +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST /* number of backlight levels */ -#define BACKLIGHT_LEVELS 3 - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE +// #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE +// #define LOCKING_RESYNC_ENABLE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO /* key combination for command */ #define IS_COMMAND() ( \ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT) | MOD_BIT(KC_LCTRL) | MOD_BIT(KC_RCTRL)) \ ) +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + /* * Feature disable options * These options are also useful to firmware size reduction. */ /* disable debug print */ -//#define NO_DEBUG +// #define NO_DEBUG /* disable print */ -//#define NO_PRINT +// #define NO_PRINT /* disable action features */ //#define NO_ACTION_LAYER diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 6eb4e903f7..992a03a417 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -987,8 +987,8 @@ void matrix_scan_user(void) { led_set_layer_indicator(); } -void battery_poll(float percentage) { - rgbsps_sethsv(LED_IND_BATTERY, percentage*120/100, 255, 15); +void battery_poll(uint8_t level) { + rgbsps_sethsv(LED_IND_BATTERY, level * 120/255, 255, 15); rgbsps_send(); } diff --git a/keyboards/handwired/promethium/promethium.c b/keyboards/handwired/promethium/promethium.c index adfc11e2ac..3e369a6246 100644 --- a/keyboards/handwired/promethium/promethium.c +++ b/keyboards/handwired/promethium/promethium.c @@ -3,20 +3,17 @@ #include "timer.h" #include "matrix.h" -float battery_percentage(void) { +// cubic fit {3.3, 0}, {3.5, 2.9}, {3.6, 5}, {3.7, 8.6}, {3.8, 36}, {3.9, 62}, {4.0, 73}, {4.05, 83}, {4.1, 89}, {4.15, 94}, {4.2, 100} + +uint8_t battery_level(void) { float voltage = analogRead(BATTERY_PIN) * 2 * 3.3 / 1024; - float percentage = (voltage - 3.5) * 143; - if (percentage > 100) { - return 100; - } else if (percentage < 0) { - return 0; - } else { - return percentage; - } + if (voltage < MIN_VOLTAGE) return 0; + if (voltage > MAX_VOLTAGE) return 255; + return (voltage - MIN_VOLTAGE) / (MAX_VOLTAGE - MIN_VOLTAGE) * 255; } __attribute__ ((weak)) -void battery_poll(float percentage) { +void battery_poll(uint8_t level) { } void matrix_init_kb(void) { @@ -29,7 +26,7 @@ void matrix_scan_kb(void) { if (counter > BATTERY_POLL) { counter = 0; - battery_poll(battery_percentage()); + battery_poll(battery_level()); } matrix_scan_user(); diff --git a/keyboards/handwired/promethium/promethium.h b/keyboards/handwired/promethium/promethium.h index 6d51f81ca6..da37e5c560 100644 --- a/keyboards/handwired/promethium/promethium.h +++ b/keyboards/handwired/promethium/promethium.h @@ -7,6 +7,8 @@ #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, \ @@ -103,4 +105,4 @@ enum led_sequence { #endif -void battery_poll(float percentage); \ No newline at end of file +void battery_poll(uint8_t level); \ No newline at end of file -- cgit v1.2.3 From 79de0cd11964e9205654498aa0027510e3c3535e Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Sat, 11 Feb 2017 19:03:18 +0700 Subject: Implement Capslock LED --- .../handwired/promethium/keymaps/priyadi/keymap.c | 23 ++++++++++++++++++---- keyboards/handwired/promethium/promethium.c | 3 +++ 2 files changed, 22 insertions(+), 4 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 992a03a417..2a21b4ba77 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -10,6 +10,7 @@ #include "ps2_mouse.h" #include "ps2.h" #include "outputselect.h" +#include "led.h" #define COUNT(x) (sizeof (x) / sizeof (*(x))) // Fillers to make layering clearer @@ -23,6 +24,8 @@ #undef KC_RALT #define KC_RALT MT(MOD_RALT, KC_SLCK) +bool capslock = false; + // glow enum glow_modes { GLOW_NONE, @@ -417,7 +420,7 @@ void led_set_layer_indicator(void) { static uint8_t oldlayer = 255; rgbsps_set(LED_IND_FUNC, 0, 0, 0); - rgbsps_set(LED_IND_NUM, 0, 0, 0); + // rgbsps_set(LED_IND_NUM, 0, 0, 0); rgbsps_set(LED_IND_EMOJI, 0, 0, 0); led_reset(); @@ -438,9 +441,9 @@ void led_set_layer_indicator(void) { case _FUNC: rgbsps_set(LED_IND_FUNC, 15, 0, 0); break; - case _NUM: - rgbsps_set(LED_IND_NUM, 0, 0, 15); - break; + // case _NUM: + // rgbsps_set(LED_IND_NUM, 0, 0, 15); + // break; case _EMOJI: rgbsps_set(LED_IND_EMOJI, 15, 15, 0); break; @@ -992,6 +995,18 @@ void battery_poll(uint8_t level) { rgbsps_send(); } +void led_set_user(uint8_t usb_led) { + bool new_capslock = usb_led & (1< Date: Sat, 11 Feb 2017 21:54:10 +0700 Subject: LSpace + RSpace = switch layer --- .../handwired/promethium/keymaps/priyadi/config.h | 2 + .../handwired/promethium/keymaps/priyadi/keymap.c | 91 +++++++++++++++++++++- 2 files changed, 92 insertions(+), 1 deletion(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/config.h b/keyboards/handwired/promethium/keymaps/priyadi/config.h index 36baedd486..53059ca7d4 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/config.h +++ b/keyboards/handwired/promethium/keymaps/priyadi/config.h @@ -19,4 +19,6 @@ #define LAYOUT_NORMAN #define LAYOUT_WORKMAN +#define DOUBLESPACE_LAYER_ENABLE + #endif diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 2a21b4ba77..9fa038724a 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -25,6 +25,13 @@ #define KC_RALT MT(MOD_RALT, KC_SLCK) bool capslock = false; +#ifdef DOUBLESPACE_LAYER_ENABLE +bool lspace_active = false; +bool rspace_active = false; +bool lspace_emitted = false; +bool rspace_emitted = false; +bool space_layer_entered = false; +#endif // glow enum glow_modes { @@ -55,6 +62,9 @@ enum layers { _SYS, }; +// double-space layer +#define _SPACE _GUI + enum planck_keycodes { // layouts QWERTY = SAFE_RANGE, @@ -77,6 +87,8 @@ enum planck_keycodes { OSX, // others + LSPACE, + RSPACE, GLOW, AUDIO }; @@ -504,7 +516,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_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, GREEK, KC_RGUI, KC_RALT, KC_RCTL + KC_LCTL, KC_LALT, KC_LGUI, PUNC, NUM, LSPACE, RSPACE, FUNC, GREEK, KC_RGUI, KC_RALT, KC_RCTL ), /* Dvorak @@ -745,7 +757,84 @@ 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); +#ifdef DOUBLESPACE_LAYER_ENABLE + // double-space: send space immediately if any other key depressed before space is released + if ((lspace_active ^ rspace_active) + && keycode != LSPACE + && keycode != RSPACE + && record->event.pressed) + { + if (lspace_active) { + if (!lspace_emitted) { + register_code(KC_SPC); + unregister_code(KC_SPC); + } + lspace_emitted = true; + } + if (rspace_active) { + if (!rspace_emitted) { + register_code(KC_SPC); + unregister_code(KC_SPC); + } + rspace_emitted = true; + } + } +#endif + switch (keycode) { + +#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; + } + } + 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; + } + } + return false; + break; +#endif + // handle greek layer shift // handle both shift = capslock case KC_LSFT: -- cgit v1.2.3 From c6123b2e4a8472557c3a563d69662840dc3d0720 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Sat, 11 Feb 2017 22:03:34 +0700 Subject: Move X in number layer away from space --- keyboards/handwired/promethium/keymaps/priyadi/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 9fa038724a..bfca58e379 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -635,7 +635,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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_X, KC_0, KC_COMM, KC_DOT, _______, _______ + _______, _______, _______, _______, _______, _______, _______, KC_0, KC_COMM, KC_DOT, KC_X, _______ ), /* Func -- cgit v1.2.3 From 4586b19be3058822474ba0b8035cc867a41154f9 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Sat, 11 Feb 2017 22:07:04 +0700 Subject: Turn off capslock when entering num layer --- keyboards/handwired/promethium/keymaps/priyadi/keymap.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index bfca58e379..8c24f381f4 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -996,6 +996,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case NUM: if (record->event.pressed) { + turn_off_capslock(); layer_on(_NUM); } else { layer_off(_NUM); @@ -1096,6 +1097,13 @@ void led_set_user(uint8_t usb_led) { } } +void turn_off_capslock() { + if (capslock) { + register_code(KC_CAPS); + unregister_code(KC_CAPS); + } +} + void ps2_mouse_init_user() { uint8_t rcv; -- cgit v1.2.3 From 4c05e39a02a06644da6a5e65cbfce44e8626cfd2 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Sat, 11 Feb 2017 22:13:35 +0700 Subject: Switch to Emoji layer using Punc + greek --- .../handwired/promethium/keymaps/priyadi/keymap.c | 24 ++++------------------ 1 file changed, 4 insertions(+), 20 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 8c24f381f4..9fa224bb5b 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -878,22 +878,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; break; - // press both Supers to activate EMOJI layer - case KC_LGUI: - case KC_RGUI: - ; - bool lgui = keyboard_report->mods & MOD_BIT(KC_LGUI); - bool rgui = keyboard_report->mods & MOD_BIT(KC_RGUI); - if (record->event.pressed) { - if (lgui ^ rgui) { // if only one super was pressed - layer_on(_EMOJI); - } - } else { - layer_off(_EMOJI); - } - return true; - break; - // QWERTZ style comma and dot: semicolon and colon when shifted case KC_COMM: if (record->event.pressed) { @@ -968,10 +952,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case PUNC: if (record->event.pressed) { layer_on(_PUNC); - update_tri_layer(_PUNC, _GREEKL, _GUI); + update_tri_layer(_PUNC, _GREEKL, _EMOJI); } else { layer_off(_PUNC); - update_tri_layer(_PUNC, _GREEKL, _GUI); + update_tri_layer(_PUNC, _GREEKL, _EMOJI); } return false; break; @@ -984,12 +968,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } else { layer_on(_GREEKL); layer_off(_GREEKU); - update_tri_layer(_PUNC, _GREEKL, _GUI); + update_tri_layer(_PUNC, _GREEKL, _EMOJI); } } else { layer_off(_GREEKU); layer_off(_GREEKL); - update_tri_layer(_PUNC, _GREEKL, _GUI); + update_tri_layer(_PUNC, _GREEKL, _EMOJI); } return false; break; -- cgit v1.2.3 From 4163a3819ee4cdd49446da612a6ef3f74091ede1 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Sat, 11 Feb 2017 22:16:19 +0700 Subject: Add regular space to B+N on GUI layer for repeating space --- keyboards/handwired/promethium/keymaps/priyadi/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 9fa224bb5b..1ad34612e3 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -724,7 +724,7 @@ 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, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, 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 ), -- cgit v1.2.3 From 5d5f2ff50daaef0e76e8e267a29a7ac2286f65d8 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Sun, 12 Feb 2017 00:00:01 +0700 Subject: Some space optimization and housekeeping --- .../handwired/promethium/keymaps/priyadi/keymap.c | 74 +++++++++------------- 1 file changed, 30 insertions(+), 44 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 1ad34612e3..e35e42488b 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -41,6 +41,7 @@ enum glow_modes { }; uint8_t glow_mode = GLOW_MIN; +void turn_off_capslock(void); extern keymap_config_t keymap_config; enum layers { @@ -49,6 +50,7 @@ enum layers { _COLEMAK, _WORKMAN, _NORMAN, + _DEFAULT_LAYER_MAX = _NORMAN, _PUNC, _NUM, @@ -444,7 +446,7 @@ void led_set_layer_indicator(void) { oldlayer = layer; - if (layer <= _NORMAN) { + if (layer <= _DEFAULT_LAYER_MAX) { rgbsps_send(); return; } @@ -461,7 +463,7 @@ void led_set_layer_indicator(void) { break; default: rgbsps_set(LED_IND_FUNC, 3, 3, 3); - rgbsps_set(LED_IND_NUM, 3, 3, 3); + // rgbsps_set(LED_IND_NUM, 3, 3, 3); rgbsps_set(LED_IND_EMOJI, 3, 3, 3); } @@ -753,6 +755,30 @@ void persistant_default_layer_set(uint16_t default_layer) { default_layer_set(default_layer); } +void process_doublespace(bool pressed, bool *isactive, bool *otheractive, bool *isemitted) { + if (pressed) { + *isactive = true; + if (*otheractive) { + layer_on(_SPACE); + space_layer_entered = true; + } + } else { + *isactive = false; + if (space_layer_entered) { + layer_off(_SPACE); + if (!*otheractive) { + space_layer_entered = false; + } + } else { + if (!*isemitted) { + register_code(KC_SPC); + unregister_code(KC_SPC); + } + *isemitted = false; + } + } +} + 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); @@ -786,51 +812,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 -- cgit v1.2.3 From 455568d1978bdf4312ab684d7b6da43bdc19895c Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Sun, 12 Feb 2017 00:02:36 +0700 Subject: Workaround to remove warning --- keyboards/handwired/promethium/keymaps/priyadi/config.h | 2 ++ keyboards/handwired/promethium/promethium.h | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/config.h b/keyboards/handwired/promethium/keymaps/priyadi/config.h index 53059ca7d4..6c9d2195e1 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/config.h +++ b/keyboards/handwired/promethium/keymaps/priyadi/config.h @@ -14,6 +14,8 @@ #define RGB_DI_PIN B5 #define RGBSPS_NUM 57 +#define UNICODE_TYPE_DELAY 0 + #define LAYOUT_DVORAK #define LAYOUT_COLEMAK #define LAYOUT_NORMAN diff --git a/keyboards/handwired/promethium/promethium.h b/keyboards/handwired/promethium/promethium.h index da37e5c560..d6fea76ce1 100644 --- a/keyboards/handwired/promethium/promethium.h +++ b/keyboards/handwired/promethium/promethium.h @@ -4,7 +4,6 @@ #include "quantum.h" #define PS2_INIT_DELAY 2000 -#define UNICODE_TYPE_DELAY 0 #define BATTERY_PIN 9 #define BATTERY_POLL 30000 #define MAX_VOLTAGE 4.2 -- cgit v1.2.3 From 68e5c859990b31240b57ddf70a6d4e2e3762d195 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Sun, 12 Feb 2017 00:07:33 +0700 Subject: Remove assignment warning --- keyboards/handwired/promethium/keymaps/priyadi/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index e35e42488b..52b186c409 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -1058,7 +1058,7 @@ void battery_poll(uint8_t level) { void led_set_user(uint8_t usb_led) { bool new_capslock = usb_led & (1< Date: Sun, 12 Feb 2017 00:20:47 +0700 Subject: Forgot to add ifdef to optional feature --- keyboards/handwired/promethium/keymaps/priyadi/keymap.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 52b186c409..a24a79aa1c 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -755,6 +755,7 @@ 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; @@ -778,6 +779,7 @@ void process_doublespace(bool pressed, bool *isactive, bool *otheractive, bool * } } } +#endif bool process_record_user(uint16_t keycode, keyrecord_t *record) { bool lshift = keyboard_report->mods & MOD_BIT(KC_LSFT); -- cgit v1.2.3 From 15e2dbb2a991945d354f7ffdb34a9eac2815bd12 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Mon, 13 Feb 2017 22:18:36 +0700 Subject: move GRV to ESC position --- keyboards/handwired/promethium/keymaps/priyadi/keymap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index a24a79aa1c..68f79f5f76 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -616,8 +616,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_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_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + KC_GRV, KC_ASTR, KC_BSLS, KC_MINS, KC_EQL, KC_SLSH, XXXXXXX, KC_LPRN, KC_RPRN, KC_LABK, KC_RABK, _______, KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, KC_QUES, XXXXXXX, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, KC_COLN, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), @@ -634,8 +634,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_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_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, _______, _______, _______, _______, _______, _______, _______, KC_0, KC_COMM, KC_DOT, KC_X, _______ ), -- cgit v1.2.3 From c2531ff43b9929382e97c5cbce6f4abc4559bd3a Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Tue, 14 Feb 2017 00:44:02 +0700 Subject: Func + Num = Punc --- .../handwired/promethium/keymaps/priyadi/keymap.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 68f79f5f76..4e33d61f39 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -52,13 +52,13 @@ enum layers { _NORMAN, _DEFAULT_LAYER_MAX = _NORMAN, - _PUNC, - _NUM, - _FUNC, - _GREEKU, _GREEKL, + _NUM, + _FUNC, + _PUNC, + _EMOJI, _GUI, _SYS, @@ -637,7 +637,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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, - _______, _______, _______, _______, _______, _______, _______, KC_0, KC_COMM, KC_DOT, KC_X, _______ + _______, _______, _______, _______, _______, _______, _______, LT(_PUNC, KC_0), KC_COMM, KC_DOT, KC_X, _______ ), /* Func @@ -652,10 +652,10 @@ 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, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + 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, _______, + _______, _______, _______, _______, PUNC, _______, _______, _______, _______, _______, _______, _______ ), /* Uppercase Greek -- cgit v1.2.3 From 02662e386923ba3d47d75d85e22672ef9fb46827 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Tue, 14 Feb 2017 00:46:06 +0700 Subject: Add explicit punctuation key for greek layers --- keyboards/handwired/promethium/keymaps/priyadi/keymap.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 4e33d61f39..96d0d940ec 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -670,9 +670,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, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), @@ -688,9 +688,9 @@ 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, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), -- cgit v1.2.3 From 7ae677dcb7f54960a6f58c85f3e3430bfc2797fc Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Tue, 14 Feb 2017 03:18:34 +0700 Subject: remove stand alone punc layer switcher for now --- keyboards/handwired/promethium/keymaps/priyadi/keymap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 96d0d940ec..907da21cb2 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -92,6 +92,8 @@ enum planck_keycodes { LSPACE, RSPACE, GLOW, + + // stub AUDIO }; @@ -518,7 +520,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_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, XXXXXXX, NUM, LSPACE, RSPACE, FUNC, GREEK, KC_RGUI, KC_RALT, KC_RCTL ), /* Dvorak -- cgit v1.2.3 From 6c692fca7df7178c2abe673b6d5b1db686e22190 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Tue, 14 Feb 2017 03:58:12 +0700 Subject: Alt-tab handling in GUI layer --- keyboards/handwired/promethium/keymaps/priyadi/keymap.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 907da21cb2..5829d2e43c 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -720,14 +720,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+-------------+------+------+------+------+------| * | | | Vol- | Mute | Vol+ | | | Prev | | Next | | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | Prev | Play | Next | | | | | | | | + * | | | Prev | Play | Next | BTab | Tab | | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ [_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, + KC_ESC, XXXXXXX, KC_VOLD, KC_MUTE, KC_VOLU,S(KC_TAB),KC_TAB, 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 ), @@ -763,11 +763,13 @@ void process_doublespace(bool pressed, bool *isactive, bool *otheractive, bool * *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; @@ -786,6 +788,7 @@ void process_doublespace(bool pressed, bool *isactive, bool *otheractive, bool * 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); + uint8_t layer = biton32(layer_state); #ifdef DOUBLESPACE_LAYER_ENABLE // double-space: send space immediately if any other key depressed before space is released @@ -809,6 +812,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) { + if (record->event.pressed) { + unregister_code(KC_LALT); + } else { + register_code(KC_LALT); + } + } #endif switch (keycode) { @@ -830,7 +841,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); -- cgit v1.2.3 From 3758cfd95fe25d6928cf6650b8be3301335dada9 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Tue, 14 Feb 2017 04:17:09 +0700 Subject: GUI layer fixes --- keyboards/handwired/promethium/keymaps/priyadi/keymap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 5829d2e43c..08a425823d 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -729,7 +729,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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, KC_ESC, XXXXXXX, KC_VOLD, KC_MUTE, KC_VOLU,S(KC_TAB),KC_TAB, 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 + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX ), /* Sys @@ -813,7 +813,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } } - if (layer == _SPACE && keycode != S(KC_TAB) && keycode != KC_TAB && keycode != KC_ESC) { + if (layer == _SPACE && keycode != S(KC_TAB) && keycode != KC_TAB && keycode != KC_ESC && keycode != XXXXXXX) { if (record->event.pressed) { unregister_code(KC_LALT); } else { -- cgit v1.2.3 From df311c7b40cb6e611a522331dca9836f6eef9dce Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Wed, 15 Feb 2017 05:01:03 +0700 Subject: num, func, punc 3state layer done right --- .../handwired/promethium/keymaps/priyadi/keymap.c | 99 ++++++++++------------ keyboards/handwired/promethium/promethium.h | 4 +- 2 files changed, 46 insertions(+), 57 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 08a425823d..9f07a7d080 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -56,7 +56,7 @@ enum layers { _GREEKL, _NUM, - _FUNC, + _FUN, _PUNC, _EMOJI, @@ -76,9 +76,9 @@ enum planck_keycodes { NORMAN, // layer switchers - PUNC, - NUM, - FUNC, + // PUNC, + // NUM, + // FUN, EMOJI, GUI, GREEK, @@ -92,11 +92,16 @@ enum planck_keycodes { LSPACE, RSPACE, GLOW, + FOR0, // stub AUDIO }; +#define NUM MO(_NUM) +#define FUN MO(_FUN) +#define FUN0 LT(_FUN, KC_0) + // unicode map enum unicode_name { @@ -369,14 +374,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, @@ -435,7 +440,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); @@ -454,8 +459,8 @@ void led_set_layer_indicator(void) { } 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); @@ -464,7 +469,7 @@ 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_FUN, 3, 3, 3); // rgbsps_set(LED_IND_NUM, 3, 3, 3); rgbsps_set(LED_IND_EMOJI, 3, 3, 3); } @@ -520,7 +525,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_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, XXXXXXX, NUM, LSPACE, RSPACE, FUNC, GREEK, KC_RGUI, KC_RALT, KC_RCTL + KC_LCTL, KC_LALT, KC_LGUI, XXXXXXX, NUM, LSPACE, RSPACE, FUN, GREEK, KC_RGUI, KC_RALT, KC_RCTL ), /* Dvorak @@ -636,10 +641,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_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, 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, - _______, _______, _______, _______, _______, _______, _______, LT(_PUNC, 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 @@ -653,11 +658,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_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, _______, - _______, _______, _______, _______, PUNC, _______, _______, _______, _______, _______, _______, _______ +[_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 @@ -785,10 +790,25 @@ void process_doublespace(bool pressed, bool *isactive, bool *otheractive, bool * } #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); + } + 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); - uint8_t layer = biton32(layer_state); + 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 @@ -949,17 +969,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 +978,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; diff --git a/keyboards/handwired/promethium/promethium.h b/keyboards/handwired/promethium/promethium.h index d6fea76ce1..caad5258e4 100644 --- a/keyboards/handwired/promethium/promethium.h +++ b/keyboards/handwired/promethium/promethium.h @@ -33,7 +33,7 @@ enum led_sequence { LED_IND_USB, LED_IND_BATTERY, - LED_IND_FUNC, + LED_IND_FUN, LED_IND_NUM, LED_IND_EMOJI, @@ -60,7 +60,7 @@ enum led_sequence { LED_U, LED_J, LED_M, - LED_FUNC, + LED_FUN, LED_RSPC, LED_N, -- cgit v1.2.3 From 168c91202731ab5df5a8b1e9f985ab52ab7291e8 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Wed, 15 Feb 2017 05:38:40 +0700 Subject: Move Alt-Tab position --- keyboards/handwired/promethium/keymaps/priyadi/keymap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 9f07a7d080..3d25c766c2 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -723,17 +723,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------. * | | D1 | D2 | D3 | D4 | D5 | D6 | D7 | D8 | D9 | D10 | | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | Vol- | Mute | Vol+ | | | Prev | | Next | | | + * | Esc | | Btab | Esc | Tab | | | Prev | | Next | | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | Prev | Play | Next | BTab | Tab | | | | | | + * | | | Prev | Play | Next | | | | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ [_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, - KC_ESC, XXXXXXX, KC_VOLD, KC_MUTE, KC_VOLU,S(KC_TAB),KC_TAB, KC_WWWB, XXXXXXX, KC_WWWF, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, KC_MPRV, KC_MPLY, KC_MNXT, KC_SPC, KC_SPC, 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 ), -- cgit v1.2.3 From c2f0207d598189415b355e46031f37835408b6ea Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Wed, 15 Feb 2017 16:36:31 +0700 Subject: Merge my Planck-like keyboards --- .../handwired/promethium/keymaps/priyadi/config.h | 4 + .../handwired/promethium/keymaps/priyadi/keymap.c | 164 +++++++++++++-------- 2 files changed, 104 insertions(+), 64 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/config.h b/keyboards/handwired/promethium/keymaps/priyadi/config.h index 6c9d2195e1..00f9fed313 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,6 +13,7 @@ #define PREVENT_STUCK_MODIFIERS +#define RGBSPS_ENABLE #define RGB_DI_PIN B5 #define RGBSPS_NUM 57 @@ -22,5 +25,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 3d25c766c2..0dc0a03396 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -1,14 +1,32 @@ // 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 "promethium.h" +#if defined(PRIYADI_PROMETHIUM) + #include "promethium.h" +#elif defined(PRIYADI_PLANCK) + #include "planck.h" +#else + #error "no keyboard defined" +#endif + #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))) @@ -76,9 +94,6 @@ enum planck_keycodes { NORMAN, // layer switchers - // PUNC, - // NUM, - // FUN, EMOJI, GUI, GREEK, @@ -92,10 +107,15 @@ enum planck_keycodes { LSPACE, RSPACE, GLOW, - FOR0, // stub - AUDIO +#ifndef FAUXCLICKY_ENABLE + FC_TOG, +#endif +#ifndef ADAFRUIT_BLE_ENABLE + OUT_BLE, +#endif + KEYCODE_END }; #define NUM MO(_NUM) @@ -310,6 +330,7 @@ const uint32_t PROGMEM unicode_map[] = { // RGBSPS +#ifdef RGBSPS_ENABLE const uint8_t PROGMEM LED_ALNUM[] = { LED_Z, LED_A, @@ -504,7 +525,7 @@ void led_init(void) { rgbsps_set(LED_TRACKPOINT2, 0, 0, 15); rgbsps_set(LED_TRACKPOINT3, 15, 0, 0); } - +#endif // RGBSPS_ENABLE // keymaps @@ -750,7 +771,7 @@ 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, _______ ), @@ -1001,6 +1022,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++; @@ -1012,16 +1034,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(); @@ -1032,82 +1058,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< Date: Wed, 15 Feb 2017 16:39:19 +0700 Subject: Added copyright notice --- keyboards/handwired/promethium/keymaps/priyadi/keymap.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 0dc0a03396..cdec187ee5 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -1,5 +1,17 @@ -// 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 . +*/ #if defined(PRIYADI_PROMETHIUM) #include "promethium.h" -- cgit v1.2.3 From 3882f97d2e779899c202111e46cf2cf2926b9212 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Wed, 15 Feb 2017 19:22:58 +0700 Subject: Move keyboard specific stuff to keyboard specific files, and vice versa --- keyboards/handwired/promethium/config.h | 104 ++++++++++++++++++++ .../handwired/promethium/keymaps/priyadi/config.h | 2 - .../handwired/promethium/keymaps/priyadi/keymap.c | 69 +++++++++++--- keyboards/handwired/promethium/promethium.c | 4 + keyboards/handwired/promethium/promethium.h | 105 +-------------------- 5 files changed, 168 insertions(+), 116 deletions(-) (limited to 'keyboards/handwired') 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 . //#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/config.h b/keyboards/handwired/promethium/keymaps/priyadi/config.h index 00f9fed313..3f5dd5817d 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/config.h +++ b/keyboards/handwired/promethium/keymaps/priyadi/config.h @@ -14,8 +14,6 @@ #define PREVENT_STUCK_MODIFIERS #define RGBSPS_ENABLE -#define RGB_DI_PIN B5 -#define RGBSPS_NUM 57 #define UNICODE_TYPE_DELAY 0 diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index cdec187ee5..2c43f98847 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -74,6 +74,7 @@ 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, @@ -89,9 +90,10 @@ enum layers { _FUN, _PUNC, + _EMPTY, _EMOJI, _GUI, - _SYS, + _SYS }; // double-space layer @@ -130,6 +132,7 @@ enum planck_keycodes { KEYCODE_END }; +#define EMPTY MO(_EMPTY) #define NUM MO(_NUM) #define FUN MO(_FUN) #define FUN0 LT(_FUN, KC_0) @@ -237,6 +240,11 @@ enum unicode_name { LOMEG, FSIGM, + + LTEQ, + GTEQ, + NOTEQ, + PLMIN, }; const uint32_t PROGMEM unicode_map[] = { @@ -338,6 +346,12 @@ 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 @@ -551,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, XXXXXXX, NUM, LSPACE, RSPACE, FUN, 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 @@ -646,31 +660,31 @@ 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, KC_ASTR, KC_BSLS, KC_MINS, KC_EQL, KC_SLSH, XXXXXXX, KC_LPRN, KC_RPRN, KC_LABK, KC_RABK, _______, - 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( @@ -734,6 +748,24 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), +/* 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, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + /* Emoji * ,-----------------------------------------------------------------------------------. * | | | | | | | | | | | | | @@ -749,7 +781,7 @@ 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 @@ -788,6 +820,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______ ), + }; void persistant_default_layer_set(uint16_t default_layer) { @@ -831,6 +864,16 @@ uint32_t layer_state_set_kb(uint32_t state) } 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; } 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 caad5258e4..260f140c55 100644 --- a/keyboards/handwired/promethium/promethium.h +++ b/keyboards/handwired/promethium/promethium.h @@ -1,107 +1,10 @@ #ifndef PROMETHIUM_H #define PROMETHIUM_H -#include "quantum.h" +#include "stdint.h" -#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} \ -} - - - -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, -}; +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 -- cgit v1.2.3 From ac04fe03015c875f2d796f573ed42aeb9eebb267 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Wed, 15 Feb 2017 19:40:33 +0700 Subject: Added README for my keymap --- .../handwired/promethium/keymaps/priyadi/README.md | 44 ++++++++++++++++++++++ .../handwired/promethium/keymaps/priyadi/readme.md | 0 2 files changed, 44 insertions(+) create mode 100644 keyboards/handwired/promethium/keymaps/priyadi/README.md delete mode 100644 keyboards/handwired/promethium/keymaps/priyadi/readme.md (limited to 'keyboards/handwired') 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/readme.md b/keyboards/handwired/promethium/keymaps/priyadi/readme.md deleted file mode 100644 index e69de29bb2..0000000000 -- cgit v1.2.3 From 96a8e2d5f52c4f9d4c774f820139be726894e70d Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Thu, 16 Feb 2017 23:53:09 +0700 Subject: reposition ins and del key --- .../handwired/promethium/keymaps/priyadi/README.md | 2 +- .../handwired/promethium/keymaps/priyadi/keymap.c | 28 ++++++++++++---------- 2 files changed, 17 insertions(+), 13 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/README.md b/keyboards/handwired/promethium/keymaps/priyadi/README.md index 37c2be6f99..ddeaed939e 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/README.md +++ b/keyboards/handwired/promethium/keymaps/priyadi/README.md @@ -13,7 +13,7 @@ Main layer modifications from default Planck layout: * 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). +On Promethium, Trackpoint is enabled on PD2 and PD3. 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. diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 2c43f98847..4b9491fae7 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -54,6 +54,10 @@ along with this program. If not, see . #undef KC_RALT #define KC_RALT MT(MOD_RALT, KC_SLCK) +// dual use right-shift & del key +#undef KC_RSFT +#define KC_RSFT MT(MOD_RSFT, KC_DEL) + bool capslock = false; #ifdef DOUBLESPACE_LAYER_ENABLE bool lspace_active = false; @@ -664,16 +668,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+-------------+------+------+------+------+------| * | | * | \ | - | = | / | ≠ | ( | ) | < | > | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | & | ^ | | | _ | + | ? | ± | [ | ] | { | } | : | + * | & | ^ | | | _ | + | ? | ± | [ | ] | { | } | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | + * | | | | | | | | | | : | | * `-----------------------------------------------------------------------------------' */ [_PUNC] = KEYMAP( 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, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + 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 @@ -682,23 +686,23 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+-------------+------+------+------+------+------| * | ` | * | \ | - | = | / | B | 4 | 5 | 6 | E | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | & | ^ | | | _ | + | ? | C | 1 | 2 | 3 | F | : | + * | & | ^ | | | _ | + | ? | C | 1 | 2 | 3 | F | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | 0 | , | . | x | | + * | | | x | | | | | 0 | , | . | : | | * `-----------------------------------------------------------------------------------' */ [_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, 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, _______ + 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_X, _______, _______, _______, _______, FUN0 , KC_COMM, KC_DOT, KC_COLN, _______ ), /* Func * ,-----------------------------------------------------------------------------------. - * | | F1 | F2 | F3 | F4 | | | PgUp | Up | PgDn | PgUp | Del | + * | | F1 | F2 | F3 | F4 | Ins | | PgUp | Up | PgDn | PgUp | | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | F5 | F6 | F7 | F8 |PrtSc | | Left | Down | Right| PgDn | Ins | + * | | F5 | F6 | F7 | F8 |PrtSc | | Left | Down | Right| PgDn | | * |------+------+------+------+------+------|------+------+------+------+------+------| * | | F9 | F10 | F11 | F12 | | | | Home | End | | | * |------+------+------+------+------+------+------+------+------+------+------+------| @@ -706,8 +710,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_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, + XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_INS, XXXXXXX, KC_PGUP, KC_UP, KC_PGDN, KC_PGUP, _______, + XXXXXXX, KC_F5, KC_F6, KC_F7, KC_F8, KC_PSCR, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, _______, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_END, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), -- cgit v1.2.3 From e5bd81f0a68948a87ad5279bc2c41a4876466023 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Thu, 16 Feb 2017 23:56:47 +0700 Subject: Fix integer overflow --- keyboards/handwired/promethium/keymaps/priyadi/keymap.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 4b9491fae7..8f712ccfed 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -51,12 +51,10 @@ along with this program. If not, see . #define KC_WWWF KC_WWW_FORWARD // hybrid right-alt & scroll lock (mapped to Compose in OS) -#undef KC_RALT -#define KC_RALT MT(MOD_RALT, KC_SLCK) +#define C_RALT MT(MOD_RALT, KC_SLCK) // dual use right-shift & del key -#undef KC_RSFT -#define KC_RSFT MT(MOD_RSFT, KC_DEL) +#define C_RSFT MT(MOD_RSFT, KC_DEL) bool capslock = false; #ifdef DOUBLESPACE_LAYER_ENABLE @@ -575,8 +573,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_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, EMPTY, NUM, LSPACE, RSPACE, FUN, GREEK, KC_RGUI, KC_RALT, KC_RCTL + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, C_RSFT, + KC_LCTL, KC_LALT, KC_LGUI, EMPTY, NUM, LSPACE, RSPACE, FUN, GREEK, KC_RGUI, C_RALT, KC_RCTL ), /* Dvorak -- cgit v1.2.3 From 77f93636757d32f4e2ce6d7295f3d6293af3b462 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Tue, 21 Feb 2017 03:24:32 +0700 Subject: Only process Fnumber on key release, and only when layer is still active --- keyboards/handwired/promethium/keymaps/priyadi/keymap.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 8f712ccfed..cf486b39f5 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -1046,6 +1046,16 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; #endif + // only process Fnumber on key release, and only when layer switcher is still pressed. + // this is to avoid accidental presses + case KC_F1 ... KC_F12: + if (!record->event.pressed && layer == _FUN) { + register_code(keycode); + unregister_code(keycode); + } + return false; + break; + // layer switcher // case GREEK: -- cgit v1.2.3 From b306f83c6b5ef671917bbc3789297e7344bede99 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Tue, 21 Feb 2017 04:00:05 +0700 Subject: Move del back to fun+backspce --- keyboards/handwired/promethium/keymaps/priyadi/keymap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index cf486b39f5..0c39da8248 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -54,7 +54,7 @@ along with this program. If not, see . #define C_RALT MT(MOD_RALT, KC_SLCK) // dual use right-shift & del key -#define C_RSFT MT(MOD_RSFT, KC_DEL) +// #define C_RSFT MT(MOD_RSFT, KC_DEL) bool capslock = false; #ifdef DOUBLESPACE_LAYER_ENABLE @@ -573,7 +573,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_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, C_RSFT, + 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, EMPTY, NUM, LSPACE, RSPACE, FUN, GREEK, KC_RGUI, C_RALT, KC_RCTL ), @@ -708,7 +708,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_FUN] = KEYMAP( - XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_INS, XXXXXXX, KC_PGUP, KC_UP, KC_PGDN, KC_PGUP, _______, + XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_INS, 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_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_END, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -- cgit v1.2.3 From 57623805e8d73aa14adae1e76d5338911dfc31b2 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Tue, 21 Feb 2017 16:36:35 +0700 Subject: Move caps to FUN layer; add Pause key --- keyboards/handwired/promethium/keymaps/priyadi/keymap.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 0c39da8248..aed5a81eef 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -700,17 +700,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------. * | | F1 | F2 | F3 | F4 | Ins | | PgUp | Up | PgDn | PgUp | | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | F5 | F6 | F7 | F8 |PrtSc | | Left | Down | Right| PgDn | | + * | Caps | F5 | F6 | F7 | F8 |PrtSc | | Left | Down | Right| PgDn | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F9 | F10 | F11 | F12 | | | | Home | End | | | + * | | F9 | F10 | F11 | F12 |Pause | | | Home | End | | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ [_FUN] = KEYMAP( XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_INS, 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_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_END, XXXXXXX, _______, + KC_CAPS, KC_F5, KC_F6, KC_F7, KC_F8, KC_PSCR, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, + _______, KC_F9, KC_F10, KC_F11, KC_F12, KC_PAUS, XXXXXXX, XXXXXXX, KC_HOME, KC_END, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), @@ -935,7 +935,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #endif // handle greek layer shift - // handle both shift = capslock case KC_LSFT: case KC_RSFT: ; @@ -949,13 +948,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { layer_off(_GREEKU); } } - } else { - if (record->event.pressed) { - if (lshift ^ rshift) { // if only one shift was pressed - register_code(KC_CAPS); - unregister_code(KC_CAPS); - } - } } return true; break; -- cgit v1.2.3 From 3dab8a60fca182376d1df07d3f1e25882aa57be4 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Tue, 21 Feb 2017 16:40:38 +0700 Subject: added pause, prtsc & ins to list of keys to be processed on release --- keyboards/handwired/promethium/keymaps/priyadi/keymap.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index aed5a81eef..cf7c67339d 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -1039,9 +1039,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #endif // only process Fnumber on key release, and only when layer switcher is still pressed. - // this is to avoid accidental presses + // this is to avoid accidental presses on potentially destructive keys case KC_F1 ... KC_F12: - if (!record->event.pressed && layer == _FUN) { + case KC_PAUS: + case KC_PSCR: + case KC_INS: + if (!record->event.pressed && layer == _FUN) { // key released and still in FUN layer register_code(keycode); unregister_code(keycode); } -- cgit v1.2.3