diff --git a/.travis.yml b/.travis.yml index 2e0714d713..436c17338a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,9 +21,11 @@ env: - KEYBOARD=hhkb - KEYBOARD=jd45 - KEYBOARD=kc60 + - KEYBOARD=phantom - KEYBOARD=planck - KEYBOARD=preonic - KEYBOARD=retro_refit + - KEYBOARD=satan - KEYBOARD=sixkeyboard script: diff --git a/Makefile b/Makefile index f8c945045c..e93528600d 100644 --- a/Makefile +++ b/Makefile @@ -112,4 +112,9 @@ VPATH += $(QUANTUM_PATH)/audio include $(TMK_PATH)/protocol/lufa.mk include $(TMK_PATH)/common.mk -include $(TMK_PATH)/rules.mk \ No newline at end of file +include $(TMK_PATH)/rules.mk + +GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d") + +OPT_DEFS += -DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYMAP=\"$(KEYMAP)\" +OPT_DEFS += -DQMK_VERSION=\"$(GIT_VERSION)\" diff --git a/keyboard/ergodox_ez/keymaps/algernon/.gitignore b/keyboard/ergodox_ez/keymaps/algernon/.gitignore new file mode 100644 index 0000000000..a075e32bf4 --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/algernon/.gitignore @@ -0,0 +1 @@ +/compiled.hex diff --git a/keyboard/ergodox_ez/keymaps/algernon/Makefile b/keyboard/ergodox_ez/keymaps/algernon/Makefile index 34e574220f..3db507c8f2 100644 --- a/keyboard/ergodox_ez/keymaps/algernon/Makefile +++ b/keyboard/ergodox_ez/keymaps/algernon/Makefile @@ -2,3 +2,7 @@ BOOTMAGIC_ENABLE=no COMMAND_ENABLE=no SLEEP_LED_ENABLE=no UNICODE_ENABLE=no + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboard/ergodox_ez/keymaps/algernon/compiled.hex b/keyboard/ergodox_ez/keymaps/algernon/compiled.hex deleted file mode 100644 index 6146c48fd8..0000000000 Binary files a/keyboard/ergodox_ez/keymaps/algernon/compiled.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/algernon/config.h b/keyboard/ergodox_ez/keymaps/algernon/config.h index 724618cc48..4cb878ebce 100644 --- a/keyboard/ergodox_ez/keymaps/algernon/config.h +++ b/keyboard/ergodox_ez/keymaps/algernon/config.h @@ -1,5 +1,5 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H 1 +#ifndef CONFIG_ALGERNON_H +#define CONFIG_ALGERNON_H #include "../../config.h" @@ -24,4 +24,6 @@ #undef LEADER_TIMEOUT #define LEADER_TIMEOUT 1000 +#define FORCE_NKRO + #endif diff --git a/keyboard/ergodox_ez/keymaps/algernon/images/base-layer.png b/keyboard/ergodox_ez/keymaps/algernon/images/base-layer.png index e335859205..1a7c0f4805 100644 Binary files a/keyboard/ergodox_ez/keymaps/algernon/images/base-layer.png and b/keyboard/ergodox_ez/keymaps/algernon/images/base-layer.png differ diff --git a/keyboard/ergodox_ez/keymaps/algernon/images/experimental-layer.png b/keyboard/ergodox_ez/keymaps/algernon/images/experimental-layer.png new file mode 100644 index 0000000000..c5e695b8c1 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/algernon/images/experimental-layer.png differ diff --git a/keyboard/ergodox_ez/keymaps/algernon/images/hun-layer.png b/keyboard/ergodox_ez/keymaps/algernon/images/hun-layer.png index 3c76653921..f1e5f9ec07 100644 Binary files a/keyboard/ergodox_ez/keymaps/algernon/images/hun-layer.png and b/keyboard/ergodox_ez/keymaps/algernon/images/hun-layer.png differ diff --git a/keyboard/ergodox_ez/keymaps/algernon/images/steno-layer.png b/keyboard/ergodox_ez/keymaps/algernon/images/steno-layer.png new file mode 100644 index 0000000000..e747bfb414 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/algernon/images/steno-layer.png differ diff --git a/keyboard/ergodox_ez/keymaps/algernon/keymap.c b/keyboard/ergodox_ez/keymaps/algernon/keymap.c index 7ded1e1aee..4eea6874c7 100644 --- a/keyboard/ergodox_ez/keymaps/algernon/keymap.c +++ b/keyboard/ergodox_ez/keymaps/algernon/keymap.c @@ -9,77 +9,98 @@ #include "action_util.h" #include "mousekey.h" #include "timer.h" +#include "keymap_plover.h" /* Layers */ -#define BASE 0 // default layer -#define APPSEL 1 // application select layer -#define HUN 2 // Hungarian layer -#define EMACS 3 // (Spac)Emacs layer -#define OHLFT 4 // One-handed, left side -#define OHRGT 5 // One-handed, right side +enum { + BASE = 0, + APPSEL, + HUN, + EMACS, + OHLFT, + OHRGT, + PLVR, + EXPRM +}; /* Macros */ -#define A_GUI 0 // GUI magic -#define A_ESC 44 // OSM-clearing ESC +enum { + NONE = 0, + // Buttons that do extra stuff + A_GUI, + A_PLVR, + A_ESC, + A_MPN, + A_COLN, -#define A_MUL 1 // mouse up-left -#define A_MUR 2 // mouse up-right -#define A_MDL 3 // mouse down-left -#define A_MDR 4 // mouse down-right + // Function / number keys + KF_1, // 1, F1 + KF_2, // 2, F2 + KF_3, // ... + KF_4, + KF_5, + KF_6, + KF_7, + KF_8, + KF_9, + KF_10, + KF_11, // =, F11 -#define AE_VIS 5 // Visual mode -#define AE_PSTDEL 6 // Paste/Delete -#define AE_CPYC 7 // Copy/Cut -#define AE_EMACS 8 // Emacs copy & paste mode -#define AE_TERM 9 // Terminal copy & paste mode -#define AE_OTHER 10 // Other copy & paste mode -#define AE_INS 11 // Insert mode -#define AE_OVR 12 // Overwrite mode -#define AE_APPND 13 // Append + // Application select keys + APP_SLK, // Slack + APP_EMCS, // Emacs + APP_TERM, // Terminal + APP_CHRM, // Chrome + APP_MSIC, // Music -#define HU_AA 14 // Á -#define HU_OO 15 // Ó -#define HU_EE 16 // É -#define HU_UU 17 // Ú -#define HU_II 18 // Í -#define HU_OE 19 // Ö -#define HU_UE 20 // Ü -#define HU_OEE 21 // Ő -#define HU_UEE 22 // Ű + // Diagonal mouse movement + A_MUL, + A_MUR, + A_MDL, + A_MDR, -#define APP_SLK 23 // Slack -#define APP_EMCS 24 // Emacs -#define APP_TERM 25 // Terminal -#define APP_CHRM 26 // Chrome -#define APP_MSIC 27 // Music + // Emacs layer keys + AE_VIS, // Visual mode + AE_PSTDEL, // Paste/Delete + AE_CPYC, // Copy/Cut + AE_EMACS, // Emacs copy & paste mode + AE_TERM, // Terminal copy & paste mode + AE_OTHER, // Other copy & paste mode + AE_INS, // Insert mode + AE_OVR, // Overwrite mode + AE_APPND, // Append -#define KF_1 28 // 1, F1 -#define KF_2 29 // 2, F2 -#define KF_3 30 // ... -#define KF_4 31 -#define KF_5 32 -#define KF_6 33 -#define KF_7 34 -#define KF_8 35 -#define KF_9 36 -#define KF_10 37 -#define KF_11 38 // =, F11 + // Hungarian layer keys + HU_AA, // Á + HU_OO, // Ó + HU_EE, // É + HU_UU, // Ú + HU_II, // Í + HU_OE, // Ö + HU_UE, // Ü + HU_OEE, // Ő + HU_UEE, // Ű -#define OH_BSSPC 39 -#define OH_ENTSFT 40 -#define OH_BASE 41 -#define OH_LEFT 42 -#define OH_RIGHT 43 + // One-handed layout specials + OH_BSSPC, + OH_ENTSFT, + OH_BASE, + OH_LEFT, + OH_RIGHT, +}; /* Fn keys */ -#define F_BSE 0 -#define F_HUN 1 -#define F_GUI 2 -#define F_SFT 3 -#define F_ALT 4 -#define F_CTRL 5 + +enum { + F_BSE = 0, + F_HUN, + F_GUI, + F_SFT, + F_ALT, + F_CTRL +}; /* States & timers */ @@ -117,13 +138,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 0: Base Layer * * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | `~ | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Apps | | Apps | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10| = F11 | + * | `~ | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Plvr | | Apps | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10| F11 | * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | Tab | ' | , | . | P | Y | [ | | ] | F | G | C | R | L | / | + * | Next/Prev | ' | , | . | P | Y | [ | | ] | F | G | C | R | L | = | * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | - | A | O | E | U | I |------| |------| D | H | T | N | S | \ | + * | Tab | A | O | E | U | I |------| |------| D | H | T | N | S | \ | * |-----------+------+------+------+------+------| ( | | ) |------+------+------+------+------+-----------| - * | Play/Pause| ; | Q | J | K | X | | | | B | M | W | V | Z | Stop | + * | Play/Pause| / | Q | J | K | X | | | | B | M | W | V | Z | Stop | * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' * | Home | End | Down | Up | : | | - | Left | Right| PgUp | PgDn | * `-----------------------------------' `-----------------------------------' @@ -137,19 +158,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [BASE] = KEYMAP( // left hand - KC_GRV ,M(KF_1) ,M(KF_2) ,M(KF_3),M(KF_4),M(KF_5),KC_APP -,KC_TAB ,KC_QUOT ,KC_COMM ,KC_DOT ,KC_P ,KC_Y ,KC_LBRC -,KC_MINS ,KC_A ,KC_O ,KC_E ,KC_U ,KC_I -,KC_MPLY ,KC_SCLN ,KC_Q ,KC_J ,KC_K ,KC_X ,KC_LPRN -,KC_HOME ,KC_END ,KC_DOWN ,KC_UP ,KC_COLN + KC_GRV ,M(KF_1) ,M(KF_2) ,M(KF_3),M(KF_4),M(KF_5),M(A_PLVR) +,M(A_MPN) ,KC_QUOT ,KC_COMM ,KC_DOT ,KC_P ,KC_Y ,KC_LBRC +,KC_TAB ,KC_A ,KC_O ,KC_E ,KC_U ,KC_I +,KC_MPLY ,KC_SLSH ,KC_Q ,KC_J ,KC_K ,KC_X ,KC_LPRN +,KC_HOME ,KC_END ,KC_DOWN ,KC_UP ,M(A_COLN) ,F(F_ALT),F(F_GUI) ,F(F_CTRL) ,KC_BSPC,F(F_SFT),M(A_ESC) // right hand - ,KC_APP ,M(KF_6),M(KF_7),M(KF_8),M(KF_9) ,M(KF_10) ,M(KF_11) - ,KC_RBRC ,KC_F ,KC_G ,KC_C ,KC_R ,KC_L ,KC_SLSH + ,KC_APP ,M(KF_6),M(KF_7),M(KF_8),M(KF_9) ,M(KF_10) ,KC_F11 + ,KC_RBRC ,KC_F ,KC_G ,KC_C ,KC_R ,KC_L ,KC_EQL ,KC_D ,KC_H ,KC_T ,KC_N ,KC_S ,KC_BSLS ,KC_RPRN ,KC_B ,KC_M ,KC_W ,KC_V ,KC_Z ,KC_MSTP ,KC_MINS,KC_LEFT,KC_RGHT ,KC_PGUP ,KC_PGDN @@ -386,6 +407,96 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ,KC_NO ,KC_NO ,KC_NO ), +/* Keymap 7: Steno for Plover + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | BASE | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | # | # | # | # | # | | | | # | # | # | # | # | # | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | T | P | H | |------| |------| | F | P | L | T | D | + * |--------+ S +------+------+------+ * | | | | * +------+------+------+------+--------| + * | | | K | W | R | | | | | | R | B | G | S | Z | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | A | O |------| |------| E | U | + * | | | | | | | | + * `--------------------' `--------------------' + */ + +[PLVR] = KEYMAP( +// left hand +KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, M(A_PLVR), +KC_NO, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, KC_NO, +KC_NO, PV_LS, PV_LT, PV_LP, PV_LH, PV_STAR, +KC_NO, PV_LS, PV_LK, PV_LW, PV_LR, PV_STAR, KC_NO, +KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, + KC_NO, + PV_A, PV_O, KC_NO, + + // right hand + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, + PV_STAR, PV_RF, PV_RP, PV_RL, PV_RT, PV_RD, + KC_NO, PV_STAR, PV_RR, PV_RB, PV_RG, PV_RS, PV_RZ, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, + KC_NO, + KC_NO,PV_E, PV_U + ), + +/* Keymap 8: Experimental layer + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | `~ | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Plvr | | Apps | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10| F11 | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | Next/Prev | ' | , | . | P | Y | [ | | ] | Q | F | C | R | J | = | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | Tab | A | O | E | U | I |------| |------| D | H | T | N | S | \ | + * |-----------+------+------+------+------+------| ( | | ) |------+------+------+------+------+-----------| + * | Play/Pause| Z | K | V | G | X | | | | L | M | W | B | / | Stop | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | Home | End | Down | Up | : | | - | Left | Right| PgUp | PgDn | + * `-----------------------------------' `-----------------------------------' + * ,-------------. ,-------------. + * | LAlt | GUI | |EMACS | 1HND | + * ,------|------|------| |------+------+------. + * | | | Ctrl | | LEAD | | | + * |Backsp|LShift|------| |------| Enter| Space| + * | | | ESC | | HUN | | | + * `--------------------' `--------------------' + */ +[EXPRM] = KEYMAP( +// left hand + KC_GRV ,M(KF_1) ,M(KF_2) ,M(KF_3),M(KF_4),M(KF_5),M(A_PLVR) +,M(A_MPN) ,KC_QUOT ,KC_COMM ,KC_DOT ,KC_P ,KC_Y ,KC_LBRC +,KC_TAB ,KC_A ,KC_O ,KC_E ,KC_U ,KC_I +,KC_MPLY ,KC_Z ,KC_K ,KC_V ,KC_G ,KC_X ,KC_LPRN +,KC_HOME ,KC_END ,KC_DOWN ,KC_UP ,M(A_COLN) + + ,F(F_ALT),F(F_GUI) + ,F(F_CTRL) + ,KC_BSPC,F(F_SFT),M(A_ESC) + + // right hand + ,KC_APP ,M(KF_6),M(KF_7),M(KF_8),M(KF_9) ,M(KF_10) ,KC_F11 + ,KC_RBRC ,KC_Q ,KC_F ,KC_C ,KC_R ,KC_J ,KC_EQL + ,KC_D ,KC_H ,KC_T ,KC_N ,KC_S ,KC_BSLS + ,KC_RPRN ,KC_L ,KC_M ,KC_W ,KC_B ,KC_SLSH ,KC_MSTP + ,KC_MINS,KC_LEFT,KC_RGHT ,KC_PGUP ,KC_PGDN + + ,OSL(EMACS),M(OH_LEFT) + ,KC_LEAD + ,F(F_HUN),KC_ENT ,KC_SPC + ), + + }; const uint16_t PROGMEM fn_actions[] = { @@ -397,6 +508,29 @@ const uint16_t PROGMEM fn_actions[] = { ,[F_CTRL] = ACTION_MODS_ONESHOT (MOD_LCTL) }; +void toggle_steno(int pressed) +{ + uint8_t layer = biton32(layer_state); + + if (pressed) { + if (layer != PLVR) layer_on(PLVR); else layer_off(PLVR); + + register_code(PV_LP); + register_code(PV_LH); + register_code(PV_LR); + register_code(PV_O); + register_code(PV_RL); + register_code(PV_RG); + } else { + unregister_code(PV_LP); + unregister_code(PV_LH); + unregister_code(PV_LR); + unregister_code(PV_O); + unregister_code(PV_RL); + unregister_code(PV_RG); + } +} + macro_t *ang_do_hun (keyrecord_t *record, uint16_t accent, uint16_t hun_char) { uint8_t need_shift = 0; @@ -476,11 +610,53 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) } else { register_code (KC_ESC); } + layer_off (HUN); } else { unregister_code (KC_ESC); } break; + case A_COLN: + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || + ((get_oneshot_mods() & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out())) { + int oneshot = ((get_oneshot_mods() & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out()); + + if (record->event.pressed) { + if (oneshot) + clear_oneshot_mods (); + unregister_code (KC_LSFT); + + register_code (KC_SCLN); + unregister_code (KC_SCLN); + if (!oneshot) + register_code (KC_LSFT); + } + } else { + return MACRODOWN (D(RSFT), T(SCLN), U(RSFT), END); + } + break; + + case A_MPN: + if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || + ((get_oneshot_mods() & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out())) { + int oneshot = ((get_oneshot_mods() & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out()); + + if (oneshot) + clear_oneshot_mods (); + unregister_code (KC_LSFT); + + register_code (KC_MPRV); + unregister_code (KC_MPRV); + + if (!oneshot) + register_code (KC_LSFT); + } else { + return MACRO (T(MNXT), END); + } + } + break; + /* Hungarian layer */ case HU_AA: return ang_do_hun (record, KC_QUOT, KC_A); @@ -666,6 +842,11 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) } break; + /* Plover base */ + case A_PLVR: + toggle_steno(record->event.pressed); + break; + /* GUI & AppSel */ case A_GUI: if (record->event.pressed) { @@ -691,29 +872,19 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) break; case APP_SLK: - if (record->event.pressed) - return MACRO(T(S), T(C), T(U), T(D), T(C), T(L), T(O), T(U), T(D), T(ENT), END); - break; + return MACRODOWN(T(S), T(C), T(U), T(D), T(C), T(L), T(O), T(U), T(D), T(ENT), END); case APP_EMCS: - if (record->event.pressed) - return MACRO(T(E), T(M), T(A), T(C), T(S), T(ENT), END); - break; + return MACRODOWN(T(E), T(M), T(A), T(C), T(S), T(ENT), END); case APP_TERM: - if (record->event.pressed) - return MACRO(T(T), T(E), T(R), T(M), T(ENT), END); - break; + return MACRODOWN(T(T), T(E), T(R), T(M), T(ENT), END); case APP_CHRM: - if (record->event.pressed) - return MACRO(T(C), T(H), T(R), T(O), T(M), T(ENT), END); - break; + return MACRODOWN(T(C), T(H), T(R), T(O), T(M), T(ENT), END); case APP_MSIC: - if (record->event.pressed) - return MACRO(T(R), T(H), T(Y), T(T), T(H), T(M), T(B), T(O), T(X), T(ENT), END); - break; + return MACRODOWN(T(R), T(H), T(Y), T(T), T(H), T(M), T(B), T(O), T(X), T(ENT), END); /* Function keys */ case KF_1 ... KF_11: @@ -783,9 +954,16 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // Runs just one time when the keyboard initializes. void matrix_init_user(void) { - ergodox_led_all_set (LED_BRIGHTNESS_LO); ergodox_led_all_on(); + for (int i = LED_BRIGHTNESS_HI; i > LED_BRIGHTNESS_LO; i--) { + ergodox_led_all_set (i); + _delay_ms (5); + } _delay_ms(1000); + for (int i = LED_BRIGHTNESS_LO; i > 0; i--) { + ergodox_led_all_set (i); + _delay_ms (10); + } ergodox_led_all_off(); }; @@ -798,12 +976,14 @@ void ang_do_unicode (void) { unregister_code (KC_U); unregister_code (KC_RSFT); unregister_code (KC_RCTL); + _delay_ms (100); } void ang_tap (uint16_t codes[]) { for (int i = 0; codes[i] != 0; i++) { register_code (codes[i]); unregister_code (codes[i]); + _delay_ms (50); } } @@ -811,6 +991,8 @@ void ang_tap (uint16_t codes[]) { register_code (code); \ unregister_code (code) +uint8_t is_exp = 0; + // Runs constantly in the background, in a loop. void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); @@ -829,6 +1011,16 @@ void matrix_scan_user(void) { } else if (layer == EMACS) { ergodox_right_led_1_on(); ergodox_right_led_2_on(); + } else if (layer == PLVR) { + ergodox_right_led_1_on (); + ergodox_right_led_2_on (); + ergodox_right_led_3_on (); + } else if (layer == EXPRM) { + ergodox_right_led_1_on (); + ergodox_right_led_2_on (); + ergodox_right_led_3_on (); + + ergodox_right_led_2_set (LED_BRIGHTNESS_HI); } if (layer == OHLFT || layer == OHRGT) { @@ -863,7 +1055,7 @@ void matrix_scan_user(void) { ergodox_right_led_1_on (); } else { ergodox_right_led_1_set (LED_BRIGHTNESS_LO); - if (layer != OHLFT && layer != EMACS) + if (layer != OHLFT && layer != EMACS && layer != PLVR && layer != EXPRM) ergodox_right_led_1_off (); } @@ -873,7 +1065,7 @@ void matrix_scan_user(void) { ergodox_right_led_2_on (); } else { ergodox_right_led_2_set (LED_BRIGHTNESS_LO); - if (layer != OHRGT && layer != HUN && layer != OHLFT && layer != EMACS) + if (layer != OHRGT && layer != HUN && layer != OHLFT && layer != EMACS && layer != PLVR && layer != EXPRM) ergodox_right_led_2_off (); } @@ -883,7 +1075,7 @@ void matrix_scan_user(void) { ergodox_right_led_3_on (); } else { ergodox_right_led_3_set (LED_BRIGHTNESS_LO); - if (layer != OHRGT && layer != HUN) + if (layer != OHRGT && layer != HUN && layer != PLVR && layer != EXPRM) ergodox_right_led_3_off (); } @@ -895,6 +1087,12 @@ void matrix_scan_user(void) { ang_do_unicode (); } +#ifdef QMK_VERSION + SEQ_ONE_KEY (KC_V) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } +#endif + SEQ_ONE_KEY (KC_L) { /* λ */ ang_do_unicode (); @@ -903,6 +1101,11 @@ void matrix_scan_user(void) { ang_tap (codes); } + SEQ_ONE_KEY (KC_Y) { + uint16_t codes[] = {KC_BSLS, KC_O, KC_SLSH, 0}; + ang_tap (codes); + } + SEQ_ONE_KEY (KC_S) { ang_do_unicode (); TAP_ONCE (KC_A); TAP_ONCE (KC_F); TAP_ONCE (KC_SPC); TAP_ONCE (KC_BSLS); @@ -928,5 +1131,42 @@ void matrix_scan_user(void) { unregister_code (KC_UP); unregister_code (KC_LGUI); } + + SEQ_ONE_KEY (KC_E) { + if (is_exp == 0) { + default_layer_and (0); + default_layer_or ((1 << EXPRM)); + is_exp = 1; + + ergodox_led_all_off (); + ergodox_right_led_3_on (); + _delay_ms (100); + ergodox_right_led_2_on (); + _delay_ms (100); + ergodox_right_led_3_off (); + ergodox_right_led_1_on (); + _delay_ms (100); + ergodox_right_led_2_off (); + _delay_ms (100); + ergodox_right_led_1_off (); + } else { + is_exp = 0; + default_layer_and (0); + default_layer_or (1 << BASE); + + ergodox_led_all_off (); + ergodox_right_led_1_on (); + _delay_ms (100); + ergodox_right_led_2_on (); + _delay_ms (100); + ergodox_right_led_1_off (); + ergodox_right_led_3_on (); + _delay_ms (100); + ergodox_right_led_2_off (); + _delay_ms (100); + ergodox_right_led_3_off (); + + } + } } } diff --git a/keyboard/ergodox_ez/keymaps/algernon/README.md b/keyboard/ergodox_ez/keymaps/algernon/readme.md similarity index 83% rename from keyboard/ergodox_ez/keymaps/algernon/README.md rename to keyboard/ergodox_ez/keymaps/algernon/readme.md index b8578e438f..c9c481add2 100644 --- a/keyboard/ergodox_ez/keymaps/algernon/README.md +++ b/keyboard/ergodox_ez/keymaps/algernon/readme.md @@ -34,14 +34,19 @@ right). The more interesting parts are how certain keys behave: * The `ESC` key also doubles as a one-shot cancel key: if tapped while any of the one-shot modifiers are in-flight (as in, single-tapped, and not expired yet), it cancels all one-shot modifiers. Otherwise it sends the usual keycode. -* The **Emacs** and **Hun** layer keys are one-shot, the **1Hand** is a toggle. +* The **Emacs** and **Hun** layer keys are one-shot, the **1Hand** and **STENO** + keys are toggles. * The **Lead** key allows me to type in a sequence of keys, and trigger some actions: - `LEAD u` enters unicode input mode, by sending the GTK+ key sequence that does this. - `LEAD l` uses the unicode input method to enter a `λ`. - `LEAD s` does a lot of magic to type in a shruggie: `¯\_(ツ)_/¯` + - `LEAD y` types `\o/`. - `LEAD w m` maximises the currently focused window. + - `LEAD e` makes the [experimental layer](#experimental-layer) the default. + - `LEAD v` prints the firmware version, the keyboard and the keymap, if + compiled with a QMK version that has these available. ## Hungarian layer @@ -100,6 +105,26 @@ The differences are as follows: * The `Apps`/`BASE` key can be used to go back to the base layer, by long-tapping it. A short-tap will send the `App` key, as usual. +## Steno layer + +[![Steno layer for Plover](images/steno-layer.png)](http://www.keyboard-layout-editor.com/#/gists/401ef9a84369e47c57f9aedcf0a0d667) + +This is to be used with [Plover](http://www.openstenoproject.org/plover/), +nothing really fancy here. The **STENO** key toggles the layer on and off, and +sends the toggle command to Plover too. + +## Experimental layer + +[![Experimental layer](images/experimental-layer.png)](http://www.keyboard-layout-editor.com/#/gists/6ff50bf71248e05aab5b3fec4fae3d08) + +While using the standard Dvorak layout, I encountered a number of +inconveniences, and on this layer, I am playing with ideas to make the layout +feel better. Initially, it was based on [Capewell-Dvorak][cpd], but that too, +had shortcomings I was not happy with. So now this is something inbetween, with +own observations thrown in. How it works out in the long run remains to be seen. + + [cpd]: http://www.michaelcapewell.com/projects/keyboard/layout_capewell-dvorak.htm + # Building To make my workflow easier, this layout is maintained in diff --git a/keyboard/ergodox_ez/keymaps/algernon/tools/max-focused b/keyboard/ergodox_ez/keymaps/algernon/tools/max-focused new file mode 100755 index 0000000000..4d5220aa8b --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/algernon/tools/max-focused @@ -0,0 +1,5 @@ +#! /bin/sh +WIN="$(xdotool getactivewindow)" +wmctrl -i -r ${WIN} -b remove,maximized_vert,maximized_horz +xdotool windowsize ${WIN} 100% 100% +wmctrl -i -r ${WIN} -b add,maximized_vert,maximized_horz diff --git a/keyboard/kc60/README.md b/keyboard/kc60/README.md index 4be448d15c..fbc5ac9422 100644 --- a/keyboard/kc60/README.md +++ b/keyboard/kc60/README.md @@ -1,4 +1,4 @@ -kc60 keyboard firmware +KC60 (version 2.0) keyboard firmware ====================== ## Quantum MK Firmware diff --git a/keyboard/kc60/keymaps/default/compiled.hex b/keyboard/kc60/keymaps/default/compiled.hex index aa29b5112c..c8233506df 100644 Binary files a/keyboard/kc60/keymaps/default/compiled.hex and b/keyboard/kc60/keymaps/default/compiled.hex differ diff --git a/keyboard/kc60/keymaps/sgoodwin/compiled.hex b/keyboard/kc60/keymaps/sgoodwin/compiled.hex new file mode 100644 index 0000000000..0d9a356f7d Binary files /dev/null and b/keyboard/kc60/keymaps/sgoodwin/compiled.hex differ diff --git a/keyboard/kc60/keymaps/sgoodwin/keymap.c b/keyboard/kc60/keymaps/sgoodwin/keymap.c new file mode 100644 index 0000000000..99e95c2326 --- /dev/null +++ b/keyboard/kc60/keymaps/sgoodwin/keymap.c @@ -0,0 +1,42 @@ +// 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 "kc60.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * Toggles between colemak and qwerty by tapping the bottom right key. + * Holding capslock key gives a layer like the KBParadise v60. + */ + [0] = KEYMAP( /* Basic Colemak */ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, \ + MO(2), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_NO, KC_ENT, \ + KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_NO, KC_RSFT, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL, DF(1) \ + ), + [1] = KEYMAP( /* Basic QWERTY */ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + MO(2), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \ + KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_NO, KC_RSFT, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL, DF(0) \ + ), + [2] = KEYMAP( /* KBP v60-like arrows, media keys, etc */ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ + KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, BL_INC, BL_DEC, BL_STEP, \ + KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_NO, KC_TRNS, \ + KC_TRNS, KC_NO, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_SPC, DEBUG, RESET, KC_TRNS, KC_NO \ + ), +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + return MACRO_NONE; +}; diff --git a/keyboard/satan/Makefile b/keyboard/satan/Makefile new file mode 100644 index 0000000000..9df0e4fd07 --- /dev/null +++ b/keyboard/satan/Makefile @@ -0,0 +1,115 @@ +#---------------------------------------------------------------------------- +# On command line: +# +# make all = Make software. +# +# make clean = Clean out built project files. +# +# make coff = Convert ELF to AVR COFF. +# +# make extcoff = Convert ELF to AVR Extended COFF. +# +# make program = Download the hex file to the device. +# Please customize your programmer settings(PROGRAM_CMD) +# +# make teensy = Download the hex file to the device, using teensy_loader_cli. +# (must have teensy_loader_cli installed). +# +# make dfu = Download the hex file to the device, using dfu-programmer (must +# have dfu-programmer installed). +# +# make flip = Download the hex file to the device, using Atmel FLIP (must +# have Atmel FLIP installed). +# +# make dfu-ee = Download the eeprom file to the device, using dfu-programmer +# (must have dfu-programmer installed). +# +# make flip-ee = Download the eeprom file to the device, using Atmel FLIP +# (must have Atmel FLIP installed). +# +# make debug = Start either simulavr or avarice as specified for debugging, +# with avr-gdb or avr-insight as the front end for debugging. +# +# make filename.s = Just compile filename.c into the assembler code only. +# +# make filename.i = Create a preprocessed source file for use in submitting +# bug reports to the GCC project. +# +# To rebuild project do "make clean" then "make all". +#---------------------------------------------------------------------------- + +SRC = led.c + +# MCU name +#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 + + +# +# 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) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# 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 +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE ?= yes # Enable keyboard underlight functionality (+4870) +BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality (+1150) +MIDI_ENABLE ?= no # MIDI controls +AUDIO_ENABLE ?= no +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID + +#ifdef BACKLIGHT_ENABLE + SRC := backlight.c $(SRC) +#endif + +ifndef QUANTUM_DIR + include ../../Makefile +endif diff --git a/keyboard/satan/backlight.c b/keyboard/satan/backlight.c new file mode 100644 index 0000000000..4240b09164 --- /dev/null +++ b/keyboard/satan/backlight.c @@ -0,0 +1,24 @@ + +#include +#include "backlight.h" +#include "print.h" + +void init_backlight_pin(void) { + print("init_backlight_pin()\n"); + // Set our LED pins as output + DDRB |= (1<<6); + + // Set our LED pins low + PORTB &= ~(1<<6); +} + +void backlight_set(uint8_t level) { + if ( level == 0 ) { + // Turn off light + PORTB |= (1<<6); + } else { + // Turn on light + PORTB &= ~(1<<6); + } +} + diff --git a/keyboard/satan/config.h b/keyboard/satan/config.h new file mode 100644 index 0000000000..aea9254e8d --- /dev/null +++ b/keyboard/satan/config.h @@ -0,0 +1,92 @@ +/* +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 0x0003 +#define MANUFACTURER SATAN +#define PRODUCT GH60 +#define DESCRIPTION QMK keyboard firmware for Satan GH60 with WS2812 support + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +// ROWS: Top to bottom, COLS: Left to right + +#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 } +#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B7, D4, B1, B0, B5, B4, D7, D6, B3 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* 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 +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* Backlight configuration + */ +#define BACKLIGHT_LEVELS 1 + +/* Underlight configuration + */ + #define ws2812_PORTREG PORTE + #define ws2812_DDRREG DDRE + #define ws2812_pin 2 + #define RGBLED_NUM 8 // Number of LEDs + #define RGBLIGHT_HUE_STEP 10 + #define RGBLIGHT_SAT_STEP 17 + #define RGBLIGHT_VAL_STEP 17 + +/* + * 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/keyboard/satan/controller.jpg b/keyboard/satan/controller.jpg new file mode 100644 index 0000000000..76ffa45004 Binary files /dev/null and b/keyboard/satan/controller.jpg differ diff --git a/keyboard/satan/keymaps/default/compiled.hex b/keyboard/satan/keymaps/default/compiled.hex new file mode 100644 index 0000000000..8f4957d1c7 Binary files /dev/null and b/keyboard/satan/keymaps/default/compiled.hex differ diff --git a/keyboard/satan/keymaps/default/keymap.c b/keyboard/satan/keymaps/default/keymap.c new file mode 100644 index 0000000000..b19404afc7 --- /dev/null +++ b/keyboard/satan/keymaps/default/keymap.c @@ -0,0 +1,162 @@ +#include "satan.h" + +#ifdef RGBLIGHT_ENABLE +#include "rgblight.h" +#endif + +// Used for SHIFT_ESC +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BL 0 +#define _FL 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,-----------------------------------------------------------. + * |Esc~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | + * |-----------------------------------------------------------| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | + * |-----------------------------------------------------------| + * |Ctrl|Gui |Alt | Space |Alt |Gui |FN |Ctrl | + * `-----------------------------------------------------------' + */ +[_BL] = KEYMAP( + F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,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, KC_SPC, KC_RALT, KC_RGUI, MO(_FL), KC_RCTL), + + /* Keymap _FL: Function Layer + * ,-----------------------------------------------------------. + * | | | | | | | | | | | | | | RESET| + * |-----------------------------------------------------------| + * | | | | | | | | | | | |BL-|BL+|BL | + * |-----------------------------------------------------------| + * | | | | | | | | | | | | | + * |-----------------------------------------------------------| + * | | F1|F2 | F3|F4 | F5| F6| F7| F8| | | | + * |-----------------------------------------------------------| + * | | | | | | | | | + * `-----------------------------------------------------------' + */ +[_FL] = KEYMAP( + #ifdef RGBLIGHT_ENABLE + KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, \ + KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_INC, BL_TOGG, \ + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, F(1), F(2), F(3), F(4), F(5), F(6), F(7), F(8), KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + #else + KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, \ + KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_INC, BL_TOGG, \ + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + #endif +}; + +enum function_id { + SHIFT_ESC, + #ifdef RGBLIGHT_ENABLE + RGBLED_TOGGLE, + RGBLED_STEP_MODE, + RGBLED_INCREASE_HUE, + RGBLED_DECREASE_HUE, + RGBLED_INCREASE_SAT, + RGBLED_DECREASE_SAT, + RGBLED_INCREASE_VAL, + RGBLED_DECREASE_VAL + #endif +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_FUNCTION(SHIFT_ESC), + #ifdef RGBLIGHT_ENABLE + [1] = ACTION_FUNCTION(RGBLED_TOGGLE), + [2] = ACTION_FUNCTION(RGBLED_STEP_MODE), + [3] = ACTION_FUNCTION(RGBLED_INCREASE_HUE), + [4] = ACTION_FUNCTION(RGBLED_DECREASE_HUE), + [5] = ACTION_FUNCTION(RGBLED_INCREASE_SAT), + [6] = ACTION_FUNCTION(RGBLED_DECREASE_SAT), + [7] = ACTION_FUNCTION(RGBLED_INCREASE_VAL), + [8] = ACTION_FUNCTION(RGBLED_DECREASE_VAL), + #endif +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + static uint8_t shift_esc_shift_mask; + switch (id) { + case SHIFT_ESC: + shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; + if (record->event.pressed) { + if (shift_esc_shift_mask) { + add_key(KC_GRV); + send_keyboard_report(); + } else { + add_key(KC_ESC); + send_keyboard_report(); + } + } else { + if (shift_esc_shift_mask) { + del_key(KC_GRV); + send_keyboard_report(); + } else { + del_key(KC_ESC); + send_keyboard_report(); + } + } + break; + //led operations + #ifdef RGBLIGHT_ENABLE + case RGBLED_TOGGLE: + if (record->event.pressed) { + rgblight_toggle(); + } + break; + case RGBLED_INCREASE_HUE: + if (record->event.pressed) { + rgblight_increase_hue(); + } + break; + case RGBLED_DECREASE_HUE: + if (record->event.pressed) { + rgblight_decrease_hue(); + } + break; + case RGBLED_INCREASE_SAT: + if (record->event.pressed) { + rgblight_increase_sat(); + } + break; + case RGBLED_DECREASE_SAT: + if (record->event.pressed) { + rgblight_decrease_sat(); + } + break; + case RGBLED_INCREASE_VAL: + if (record->event.pressed) { + rgblight_increase_val(); + } + break; + case RGBLED_DECREASE_VAL: + if (record->event.pressed) { + rgblight_decrease_val(); + } + break; + case RGBLED_STEP_MODE: + if (record->event.pressed) { + rgblight_step(); + } + break; + #endif + } +} diff --git a/keyboard/satan/led.c b/keyboard/satan/led.c new file mode 100644 index 0000000000..5a9f2af672 --- /dev/null +++ b/keyboard/satan/led.c @@ -0,0 +1,36 @@ +/* +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 . +*/ + +#include +#include "stdint.h" +#include "led.h" + + +void led_init_ports() { + // * Set our LED pins as output + DDRB |= (1<<2); +} + +void led_set_kb(uint8_t usb_led) { + if (usb_led & (1< + + +/* Clueboard matrix layout + * ,-----------------------------------------------------------. + * | 00 |01| 02| 03| 04| 05| 06| 07| 08| 09| 0a| 0b| 0c| 0d | + * |-----------------------------------------------------------| + * | 10 | 11| 12| 13| 14| 15| 16| 17| 18| 19| 1a| 1b| 1c| 1d | + * |-----------------------------------------------------------| + * | 20 | 21| 22| 23| 24| 25| 26| 27| 28| 29| 2a| 2b| 2d | + * |-----------------------------------------------------------| + * | 30 | 32| 33| 34| 35| 36| 37| 38| 39| 3a| 3b| 3d | + * |-----------------------------------------------------------| + * | 40 | 41 | 42 | 45 | 4a | 4b | 4c | 4d | + * `-----------------------------------------------------------' + */ +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array +#define KEYMAP( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2d, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, \ + k40, k41, k42, k45, k4a, k4b, k4c, k4d \ +) \ +{ \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \ + {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, KC_NO, k2d}, \ + {k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3d}, \ + {k40, k41, k42, KC_NO, KC_NO, k45, KC_NO, KC_NO, KC_NO, KC_NO, k4a, k4b, k4c, k4d} \ +} + +void matrix_init_user(void); +void matrix_scan_user(void); + +#endif