diff options
author | Joe Wasson <jwasson+github@gmail.com> | 2018-05-12 09:54:35 -0700 |
---|---|---|
committer | Drashna Jaelre <drashna@live.com> | 2018-05-12 09:54:35 -0700 |
commit | 6dda0d6e34ac47c6dfdee1429937b445bf941425 (patch) | |
tree | e74a9e09830312df42d60858ae2673ec638f81c2 /layouts/community/tkl_ansi | |
parent | 48a68dcf107314d81fbade38d3969caaa31b5671 (diff) |
More work on Talljoe layout including adding layout support for HHKB and TKL. (#2946)
* Add tap-dancing semicolon.
* Infinity60 was running out of USB space.
* Rename common layout variable so it doesn't collide with some keyboards.
* Godspeed!!!
* Patch the number of LEDs for 1up60rgb
* Don't light up if rgblight is off.
* Add HHKB layout.
* Add HHKB to Talljoe's layout.
* Bring back bananasplit keymap.
* info.json
* Userspace config.h doesn't seem to be setting PREVENT_STUCK_MODIFIERS
* Remove 1uprgb workaround
* Add TKL to talljoe keymap.
Also introduces the tkl layout.
Diffstat (limited to 'layouts/community/tkl_ansi')
-rw-r--r-- | layouts/community/tkl_ansi/talljoe-tkl/config.h | 25 | ||||
-rw-r--r-- | layouts/community/tkl_ansi/talljoe-tkl/keymap.c | 89 | ||||
-rw-r--r-- | layouts/community/tkl_ansi/talljoe-tkl/rules.mk | 1 |
3 files changed, 115 insertions, 0 deletions
diff --git a/layouts/community/tkl_ansi/talljoe-tkl/config.h b/layouts/community/tkl_ansi/talljoe-tkl/config.h new file mode 100644 index 0000000000..90db04e7b0 --- /dev/null +++ b/layouts/community/tkl_ansi/talljoe-tkl/config.h @@ -0,0 +1,25 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include QMK_KEYBOARD_CONFIG_H + +#define PREVENT_STUCK_MODIFIERS +#define ENABLE_GAME_LAYER + +#define TEMPLATE_TKL(\ + KJ6, KI4, KH4, KH2, KH6, KA7, KE6, KD2, KD4, KB4, KB7, KB6, KB0, KC7, KC5, KA5, \ + KJ4, KJ7, KI7, KH7, KG7, KG4, KF4, KF7, KE7, KD7, KR7, KR4, KE4, KB2, KL4, KO4, KQ4, \ + KJ2, KJ5, KI5, KH5, KG5, KG2, KF2, KF5, KE5, KD5, KR5, KR2, KE2, KB3, KK4, KO7, KQ7, \ + KI2, KJ3, KI3, KH3, KG3, KG6, KF6, KF3, KE3, KD3, KR3, KR6, KB1, \ + KN2, KJ1, KI1, KH1, KG1, KG0, KF0, KF1, KE1, KD1, KR0, KN3, KO6, \ + KA4, KP2, KC6, KX1, KK6, KX2, KC0, KM3, KD0, KA1, KO0, KK0, KL0 \ +) LAYOUT_tkl_ansi( \ + KJ6, KI4, KH4, KH2, KH6, KA7, KE6, KD2, KD4, KB4, KB7, KB6, KB0, KC7, KC5, KA5, \ + KJ4, KJ7, KI7, KH7, KG7, KG4, KF4, KF7, KE7, KD7, KR7, KR4, KE4, KB2, KL4, KO4, KQ4, \ + KJ2, KJ5, KI5, KH5, KG5, KG2, KF2, KF5, KE5, KD5, KR5, KR2, KE2, KB3, KK4, KO7, KQ7, \ + KI2, KJ3, KI3, KH3, KG3, KG6, KF6, KF3, KE3, KD3, KR3, KR6, KB1, \ + KN2,KC_NO,KJ1, KI1, KH1, KG1, KG0, KF0, KF1, KE1, KD1, KR0, KN3, KO6, \ + KA4, KP2, KC6, KK6, KC0, KM3, KD0, KA1, KO0, KK0, KL0 \ +) + +#endif //CONFIG_USER_H diff --git a/layouts/community/tkl_ansi/talljoe-tkl/keymap.c b/layouts/community/tkl_ansi/talljoe-tkl/keymap.c new file mode 100644 index 0000000000..b5dc544927 --- /dev/null +++ b/layouts/community/tkl_ansi/talljoe-tkl/keymap.c @@ -0,0 +1,89 @@ +#ifdef KEYBOARD_zeal60 +#include "config.h" +#include "zeal60.h" +#include "zeal_backlight.h" +#include "action_layer.h" +#include "solarized.h" +#include "talljoe.h" + +// from zeal_backlight.c +// we want to be able to set indicators for the spacebar stabs +// but they are not represented by a row/index. +extern zeal_backlight_config g_config; +void map_row_column_to_led( uint8_t row, uint8_t column, uint8_t *led ); + +void set_backlight_defaults(void) { + uint8_t space; + uint8_t caps_lock; + map_row_column_to_led(3, 12, &caps_lock); + map_row_column_to_led(4, 7, &space); + zeal_backlight_config default_values = { + .use_split_backspace = USE_SPLIT_BACKSPACE, + .use_split_left_shift = USE_SPLIT_LEFT_SHIFT, + .use_split_right_shift = USE_SPLIT_RIGHT_SHIFT, + .use_7u_spacebar = USE_7U_SPACEBAR, + .use_iso_enter = USE_ISO_ENTER, + .disable_when_usb_suspended = 1, + .disable_after_timeout = 0, + .brightness = 255, + .effect = 10, + .color_1 = solarized.base2, + .color_2 = solarized.base02, + .caps_lock_indicator = { .index = caps_lock, .color = solarized.red }, + .layer_1_indicator = { .index = space, .color = solarized.blue }, + .layer_2_indicator = { .index = space, .color = solarized.yellow }, + .layer_3_indicator = { .index = 254, .color = solarized.red }, + .alphas_mods = { + BACKLIGHT_ALPHAS_MODS_ROW_0, + BACKLIGHT_ALPHAS_MODS_ROW_1, + BACKLIGHT_ALPHAS_MODS_ROW_2, + BACKLIGHT_ALPHAS_MODS_ROW_3, + BACKLIGHT_ALPHAS_MODS_ROW_4 } + }; + memcpy(&g_config, &default_values, sizeof(zeal_backlight_config)); + backlight_config_save(); + + solarized_t* S = &solarized; + HSV alphas = S->base2; + HSV custom_color_map[MATRIX_ROWS][MATRIX_COLS] = CM( + S->red, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, S->red, + S->orange, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, S->orange, + S->green, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, S->green, + S->blue, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, S->blue, S->blue, + S->violet, S->magenta, S->yellow, alphas, S->yellow, S->magenta, S->violet, S->green + ); + for (uint8_t row = 0; row < MATRIX_ROWS; ++row) { + for (uint8_t col = 0; col < MATRIX_COLS; ++col) { + backlight_set_key_color(row, col, custom_color_map[row][col]); + } + } +} + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + static uint8_t last_effect; + switch (keycode) { + case DFAULTS: + if (IS_PRESSED(record->event)) set_backlight_defaults(); + return false; + case BL_TOGG: + if (IS_PRESSED(record->event)) { + if (g_config.effect) { + last_effect = g_config.effect; + g_config.effect = 0; + } else { + g_config.effect = last_effect; + } + } + return false; + case EFFECT...EFFECT_END: + if (IS_PRESSED(record->event)) { + uint8_t effect = keycode - EFFECT; + g_config.effect = effect; + backlight_config_save(); + } + return false; + } + + return true; +} +#endif diff --git a/layouts/community/tkl_ansi/talljoe-tkl/rules.mk b/layouts/community/tkl_ansi/talljoe-tkl/rules.mk new file mode 100644 index 0000000000..92007fe8ad --- /dev/null +++ b/layouts/community/tkl_ansi/talljoe-tkl/rules.mk @@ -0,0 +1 @@ +USER_NAME := talljoe |