Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add smt keymap for tv44 (MiniVan) #1091

Merged
merged 1 commit into from Feb 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 21 additions & 0 deletions keyboards/tv44/keymaps/smt/Makefile
@@ -0,0 +1,21 @@
# Build Options
# change to "no" to disable the options, or define them in the Makefile in
# the appropriate keymap folder that will get included automatically
#
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 = yes # Commands for debug and configuration
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
MIDI_ENABLE = no # MIDI controls
AUDIO_ENABLE = no # Audio output on port C6
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend

ifndef QUANTUM_DIR
include ../../../../Makefile
endif
36 changes: 36 additions & 0 deletions keyboards/tv44/keymaps/smt/config.h
@@ -0,0 +1,36 @@
#ifndef CONFIG_USER_H
#define CONFIG_USER_H

#include "../../config.h"

/**
*TV44 keymap definition macro
*/
#define KEYMAP_TV44( \
K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, \
K13, K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, K24, \
K25, K26, K27, K28, K29, K30, K31, K32, K33, K34, K35, K36, \
K37, K38, K39, K40, K41, K42, K43, K44 \
) { \
{ K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, }, \
{ K13, K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, K24, }, \
{ K25, K26, K27, K28, K29, K30, K31, K32, K33, K34, K35, K36, }, \
{ K37, K38, K39, K40, KC_NO, KC_NO, KC_NO, K41, K42, K43, KC_NO, K44 } \
}

/**
*TV45 keymap definition macro (arrows layout)
*/
#define KEYMAP_TV45( \
K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, \
K13, K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, K24, \
K25, K26, K27, K28, K29, K30, K31, K32, K33, K34, K35, K36, \
K37, K38, K39, K40, K41, K42, K43, K44, K45 \
) { \
{ K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, }, \
{ K13, K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, K24, }, \
{ K25, K26, K27, K28, K29, K30, K31, K32, K33, K34, K35, K36, }, \
{ K37, K38, K39, K40, KC_NO, KC_NO, KC_NO, K41, K42, K43, K44, K45 } \
}

#endif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
232 changes: 232 additions & 0 deletions keyboards/tv44/keymaps/smt/keymap.c
@@ -0,0 +1,232 @@
#include "tv44.h"
#include "action_layer.h"
#include "eeconfig.h"

extern keymap_config_t keymap_config;

// 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 _QWERTY 0
#define _COLEMAK 1
#define _DVORAK 2
#define _LOWER 3
#define _RAISE 4
#define _ADJUST 16

// Keycodes
enum planck_keycodes {
QWERTY = SAFE_RANGE,
COLEMAK,
DVORAK,
LOWER,
RAISE,
BACKLIT
};

// Fillers to make layering more clear
#define _______ KC_TRNS
#define XXXXXXX KC_NO

// Custom macros
#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl
#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift
#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper
#define ALT_GRV ALT_T(KC_GRV) // Tap for Backtick, hold for Alt

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

/* Qwerty
*
* ,---------+------+------+------+------+------+------+------+------+------+------+---------.
* |Hyper/Tab| Q | W | E | R | T | Y | U | I | O | P | Bksp |
* |---------`------`------`------`------`------`------`------`------`------`------`---------|
* | Ctrl/Esc | A | S | D | F | G | H | J | K | L | ; | ' |
* |----------`------`------`------`------`------`------`------`------`------`------`--------|
* | Shift | Z | X | C | V | B | N | M | , | . | / |Sft/Ent|
* |-----------`------`------`------`------`-----'-------`------`------`------`------`-------|
* | Alt/` | GUI | Lower | Space | Space | Raise | GUI | Alt | Ctrl |
* `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------'
*/
[_QWERTY] = KEYMAP_TV45(
/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/
HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC ,
/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/
CTL_ESC , KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT ,
/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
KC_LSFT , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT ,
/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
ALT_GRV , KC_LGUI , LOWER , KC_SPC , KC_SPC , RAISE , KC_RGUI, KC_RALT, KC_RCTL ),
/*`---------+---------------+---------+-------^^^------+-------^^^-------+----------+--------+--------+--------------'*/

/* Colemak
* ,---------+------+------+------+------+------+------+------+------+------+------+---------.
* |Hyper/Tab| Q | W | F | P | G | J | L | U | Y | ; | Bksp |
* |---------`------`------`------`------`------`------`------`------`------`------`---------|
* | Ctrl/Esc | A | R | S | T | D | H | N | E | I | O | ' |
* |----------`------`------`------`------`------`------`------`------`------`------`--------|
* | Shift | Z | X | C | V | B | K | M | , | . | / |Sft/Ent|
* |-----------`------`------`------`------`-----'-------`------`------`------`------`-------|
* | Alt/` | GUI | Lower | Space | Space | Raise | GUI | Alt | Ctrl |
* `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------'
*/
[_COLEMAK] = KEYMAP_TV45(
/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/
HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC ,
/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/
CTL_ESC , KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT ,
/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
KC_LSFT , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT ,
/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
ALT_GRV , KC_LGUI , LOWER , KC_SPC , KC_SPC , RAISE , KC_RGUI, KC_RALT, KC_RCTL ),
/*`---------+---------------+---------+-------^^^------+-------^^^-------+----------+--------+--------+--------------'*/

/* Dvorak
* ,---------+------+------+------+------+------+------+------+------+------+------+---------.
* |Hyper/Tab| ' | , | . | P | Y | F | G | C | R | L | Bksp |
* |---------`------`------`------`------`------`------`------`------`------`------`---------|
* | Ctrl/Esc | A | O | E | U | I | D | H | T | N | S | - |
* |----------`------`------`------`------`------`------`------`------`------`------`--------|
* | Shift | ; | Q | J | K | X | B | M | W | V | Z |Sft/Ent|
* |-----------`------`------`------`------`-----'-------`------`------`------`------`-------|
* | Alt/` | GUI | Lower | Space | Space | Raise | GUI | Alt | Ctrl |
* `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------'
*/
[_DVORAK] = KEYMAP_TV45(
/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/
HPR_TAB,KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC ,
/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/
CTL_ESC , KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS ,
/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
KC_LSFT , KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT ,
/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
ALT_GRV , KC_LGUI , LOWER , KC_SPC , KC_SPC , RAISE , KC_RGUI, KC_RALT, KC_RCTL ),
/*`---------+---------------+---------+-------^^^------+-------^^^-------+----------+--------+--------+--------------'*/

/* Lower
* ,---------+------+------+------+------+------+------+------+------+------+------+---------.
* | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del |
* |---------`------`------`------`------`------`------`------`------`------`------`---------|
* | $ | 4 | 5 | 6 | . | + | * | 4 | 5 | 6 | . | PageUp |
* |----------`------`------`------`------`------`------`------`------`------`------`--------|
* | = | 7 | 8 | 9 | 0 | - | / | 1 | 2 | 3 | Up |PageDn |
* |-----------`------`------`------`------`-----'-------`------`------`------`------`-------|
* | Brite | | | Home | End | | Left | Down | Right |
* `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------'
*/
[_LOWER] = KEYMAP_TV45(
/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/
KC_0 , KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL ,
/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/
KC_DLR , KC_4, KC_5, KC_6, KC_DOT, KC_PLUS, KC_ASTR, KC_4, KC_5, KC_6, KC_DOT, KC_PGUP ,
/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
KC_EQL , KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_SLSH, KC_1, KC_2, KC_3, KC_UP, KC_PGDN ,
/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
BACKLIT , _______ , _______ , KC_HOME , KC_END , _______ , KC_LEFT, KC_DOWN, KC_RGHT ),
/*`---------+---------------+---------+-------^^^------+-------^^^-------+----------+--------+--------+--------------'*/

/* Raise
* ,---------+------+------+------+------+------+------+------+------+------+------+---------.
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del |
* |---------`------`------`------`------`------`------`------`------`------`------`---------|
* | F1 | F2 | F3 | F4 | F5 | F6 | _ | ? | + | { | } | |
* |----------`------`------`------`------`------`------`------`------`------`------`--------|
* | F7 | F8 | F9 | F10 | F11 | F12 | - | / | = | [ | ] | |
* |-----------`------`------`------`------`-----'-------`------`------`------`------`-------|
* | Brite | | | Play | Next | | Mute | Vol- | Vol+ |
* `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------'
*/
[_RAISE] = KEYMAP_TV45(
/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/
KC_TILD,KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL ,
/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_QUES, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE ,
/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MINS, KC_SLSH, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS ,
/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
BACKLIT , _______ , _______ , KC_MPLY , KC_MNXT , _______ , KC_MUTE, KC_VOLD, KC_VOLU ),
/*`---------+---------------+---------+-------^^^------+-------^^^-------+----------+--------+--------+--------------'*/

/* Adjust (Lower + Raise)
* ,---------+------+------+------+------+------+------+------+------+------+------+---------.
* | | Reset| | | | | | | | | | Del |
* |---------`------`------`------`------`------`------`------`------`------`------`---------|
* | | | | | |AGnorm|AGswap|Qwerty|Colemk|Dvorak| | |
* |----------`------`------`------`------`------`------`------`------`------`------`--------|
* | | | | | | | | | | | | |
* |-----------`------`------`------`------`-----'-------`------`------`------`------`-------|
* | | | | | | | | | |
* `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------'
*/
[_ADJUST] = KEYMAP_TV45(
/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/
_______, RESET , _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL ,
/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/
_______ ,_______, _______, _______, _______, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______ ,
/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
_______ ,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ,
/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
_______ , _______ , _______ , _______ , _______ , _______ , _______, _______, _______ ),
/*`---------+---------------+---------+-------^^^------+-------^^^-------+----------+--------+--------+--------------'*/
};

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) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_QWERTY);
}
return false;
break;
case COLEMAK:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_COLEMAK);
}
return false;
break;
case DVORAK:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_DVORAK);
}
return false;
break;
case LOWER:
if (record->event.pressed) {
layer_on(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case RAISE:
if (record->event.pressed) {
layer_on(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case BACKLIT:
if (record->event.pressed) {
register_code(KC_RSFT);
#ifdef BACKLIGHT_ENABLE
backlight_step();
#endif
} else {
unregister_code(KC_RSFT);
}
return false;
break;
}
return true;
}