Roadkit refactor and Configurator support (#3303)

* Matrix refactor: rename KEYMAP to LAYOUT_numpad_4x4

* Keymap refactor: QMK_KEYBOARD_H, matrix renames, readability

* Configurator support

* Add numpad_4x4 LAYOUT to rules.mk
This commit is contained in:
noroadsleft 2018-07-04 17:59:35 -07:00 committed by Drashna Jaelre
parent d5def73f6e
commit 3204dec096
9 changed files with 253 additions and 232 deletions

View File

@ -0,0 +1,15 @@
{
"keyboard_name": "Roadkit",
"url": "",
"maintainer": "qmk",
"width": 4,
"height": 4,
"layouts": {
"LAYOUT_numpad_4x4": {
"layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0, "h":2}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2, "h":2}, {"x":0, "y":3, "w":2}, {"x":2, "y":3}]
},
"LAYOUT_ortho_4x4": {
"layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}]
}
}
}

View File

@ -1,6 +1,4 @@
#include "roadkit.h"
#include "action_layer.h"
#include "eeconfig.h"
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;
@ -20,11 +18,12 @@ extern keymap_config_t keymap_config;
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_NP] = /* Numpad */
KEYMAP(KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, \
KC_KP_4, KC_KP_5, KC_KP_6, \
KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_ENTER, \
KC_KP_0, KC_KP_DOT),
[_NP] = LAYOUT_numpad_4x4( /* Numpad */
KC_P7, KC_P8, KC_P9, KC_PPLS, \
KC_P4, KC_P5, KC_P6, \
KC_P1, KC_P2, KC_P3, KC_PENT, \
KC_P0, KC_PDOT \
),
};
const uint16_t PROGMEM fn_actions[] = {

View File

@ -1,6 +1,4 @@
#include "roadkit.h"
#include "action_layer.h"
#include "eeconfig.h"
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;
@ -47,31 +45,36 @@ enum roadkit_keycodes {
#define XXXXXXX KC_NO
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_NUMPAD] = /* Numpad */
KEYMAP(KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, \
[_NUMPAD] = LAYOUT_numpad_4x4( /* Numpad */
KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, \
KC_KP_4, KC_KP_5, KC_KP_6, \
KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_ENTER, \
LT(_ADJUST, KC_KP_0), KC_KP_DOT),
[_FPH] = /* Quiet T9 */
KEYMAP(FPH_7, FPH_8, FPH_9, KC_KP_PLUS, \
LT(_ADJUST, KC_KP_0), KC_KP_DOT \
),
[_FPH] = LAYOUT_numpad_4x4( /* Quiet T9 */
FPH_7, FPH_8, FPH_9, KC_KP_PLUS, \
FPH_4, FPH_5, FPH_6, \
FPH_1, FPH_2, FPH_3, SFT_T(KC_KP_ENTER), \
LT(_ADJUST, KC_SPACE), KC_KP_DOT),
[_FPHNOISY] = /* Noisy T9 */
KEYMAP(FPH_7, FPH_8, FPH_9, KC_KP_PLUS, \
LT(_ADJUST, KC_SPACE), KC_KP_DOT \
),
[_FPHNOISY] = LAYOUT_numpad_4x4( /* Noisy T9 */
FPH_7, FPH_8, FPH_9, KC_KP_PLUS, \
FPH_4, FPH_5, FPH_6, \
FPH_1, FPH_2, FPH_3, SFT_T(KC_KP_ENTER), \
LT(_ADJUST, KC_SPACE), KC_KP_DOT),
[_ADJUST] = /* Adjustments */
KEYMAP(KC_NUMLOCK, TG(_FPHNOISY), TG(_FPH), TG(_NUMPAD), \
LT(_ADJUST, KC_SPACE), KC_KP_DOT \
),
[_ADJUST] = LAYOUT_numpad_4x4( /* Adjustments */
KC_NUMLOCK, TG(_FPHNOISY), TG(_FPH), TG(_NUMPAD), \
KC_BSPC, BACKLIT, KC_DEL, \
MACSLEEP, _______, _______, _______, \
_______, MO(_DYN)),
[_DYN] = /* DYNAMIC MACRO */
KEYMAP(DYN_REC_START1, DYN_REC_START2, _______, DYN_REC_STOP, \
_______, MO(_DYN) \
),
[_DYN] = LAYOUT_numpad_4x4( /* DYNAMIC MACRO */
DYN_REC_START1, DYN_REC_START2, _______, DYN_REC_STOP, \
_______, _______, _______, \
DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, _______, _______, \
_______, _______),
_______, _______ \
),
};
const uint16_t PROGMEM fn_actions[] = {

View File

@ -1,6 +1,4 @@
#include "roadkit.h"
#include "action_layer.h"
#include "eeconfig.h"
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;
@ -22,7 +20,7 @@ enum custom_keycodes {
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Numpad
/* Numpad
* ,-----------------------.
* | 7 | 8 | 9 |Bksp |
* |-----`-----`-----`-----|
@ -34,13 +32,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-----`-----`-----`-----'
* | L1 | L2 | | | Layer hold
*/
[_NP] = /* Numpad */
LAYOUT_ortho_4x4(KC_P7, KC_P8, KC_P9, KC_BSPC, \
[_NP] = LAYOUT_ortho_4x4( /* Numpad */
KC_P7, KC_P8, KC_P9, KC_BSPC, \
KC_P4, KC_P5, KC_P6, KC_TAB, \
KC_P1, KC_P2, KC_P3, KC_PENT, \
LT(1, KC_P0), LT(2, KC_SPC), KC_PDOT, KC_PSLS),
LT(1, KC_P0), LT(2, KC_SPC), KC_PDOT, KC_PSLS
),
/* L1
/* L1
* ,-----------------------.
* |Reset| | | Del |
* |-----`-----`-----`-----|
@ -51,13 +50,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |_____| LED | . | |
* `-----`-----`-----`-----'
*/
[_L1] = /* LAYER 1 */
LAYOUT_ortho_4x4(RESET, XXXXXXX, XXXXXXX, KC_DEL, \
[_L1] = LAYOUT_ortho_4x4( /* LAYER 1 */
RESET, XXXXXXX, XXXXXXX, KC_DEL, \
KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, \
STR192, STR255, XXXXXXX, XXXXXXX, \
_______, BL_STEP, _______, XXXXXXX),
_______, BL_STEP, _______, XXXXXXX
),
/* L2
/* L2
* ,-----------------------.
* | | | str | str |
* |-----`-----`-----`-----|
@ -68,11 +68,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | |_____| | |
* `-----`-----`-----`-----'
*/
[_L2] = /* LAYER 2 */
LAYOUT_ortho_4x4(XXXXXXX, XXXXXXX, ADMIN, SMSPC1, \
[_L2] = LAYOUT_ortho_4x4( /* LAYER 2 */
XXXXXXX, XXXXXXX, ADMIN, SMSPC1, \
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
XXXXXXX, _______, XXXXXXX, XXXXXXX)
XXXXXXX, _______, XXXXXXX, XXXXXXX
)
};
void persistent_default_layer_set(uint16_t default_layer) {

View File

@ -1,6 +1,4 @@
#include "roadkit.h"
#include "action_layer.h"
#include "eeconfig.h"
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;
@ -46,31 +44,36 @@ enum minivan_keycodes {
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_NUMPAD] = /* Numpad */
KEYMAP(KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, \
[_NUMPAD] = LAYOUT_numpad_4x4( /* Numpad */
KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, \
KC_KP_4, KC_KP_5, KC_KP_6, \
KC_KP_1, KC_KP_2, KC_KP_3, NAVIGATION, \
EXCEL, KC_KP_DOT),
[_EXCEL] = /* Excel related */
KEYMAP(KC_KP_SLASH, KC_KP_ASTERISK, KC_MINS, KC_TAB, \
KC_QUOT, KC_KP_EQUAL, PARENS , \
EXCEL, KC_KP_DOT
),
[_EXCEL] = LAYOUT_numpad_4x4( /* Excel related */
KC_KP_SLASH, KC_KP_ASTERISK, KC_MINS, KC_TAB, \
KC_QUOT, KC_KP_EQUAL, PARENS, \
KC_DQT, BRACKETS, BRACES, _______, \
_______, MO(_DYN)),
[_NAVIGATION] = /* Navigation */
KEYMAP(KC_HOME, _______, KC_PGUP, KC_TAB, \
_______, MO(_DYN)
),
[_NAVIGATION] = LAYOUT_numpad_4x4( /* Navigation */
KC_HOME, _______, KC_PGUP, KC_TAB, \
KC_END, KC_UP, KC_PGDN, \
KC_LEFT, KC_DOWN, KC_RIGHT, _______, \
_______, MO(_DYN)),
[_ADJUST] = /* Adjustments */
KEYMAP(KC_NUMLOCK, MACSLEEP, BACKLIT, _______, \
_______, MO(_DYN)
),
[_ADJUST] = LAYOUT_numpad_4x4( /* Adjustments */
KC_NUMLOCK, MACSLEEP, BACKLIT, _______, \
KC_BSPC, _______, KC_DEL, \
EXCEL_LOCK, NUMPAD_LOCK, NAVIGATION_LOCK, _______, \
_______, _______),
[_DYN] = /* DYNAMIC MACRO */
KEYMAP(DYN_REC_START1, DYN_REC_START2, _______, _______, \
_______, _______
),
[_DYN] = LAYOUT_numpad_4x4( /* DYNAMIC MACRO */
DYN_REC_START1, DYN_REC_START2, _______, _______, \
_______, _______, _______, \
DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, _______, _______, \
_______, _______),
_______, _______
),
};
const uint16_t PROGMEM fn_actions[] = {

View File

@ -1,6 +1,4 @@
#include "roadkit.h"
#include "action_layer.h"
#include "eeconfig.h"
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;
@ -22,16 +20,18 @@ extern keymap_config_t keymap_config;
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_NP] = /* Numpad */
LAYOUT_ortho_4x4(KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, \
[_NP] = LAYOUT_ortho_4x4( /* Numpad */
KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, \
KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_MINUS, \
KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_ENTER, \
KC_KP_0, KC_KP_DOT, TG(_L1), KC_BSPC),
[_L1] = /* LAYER 1 */
LAYOUT_ortho_4x4(KC_NUMLOCK, KC_TRNS, KC_TRNS, KC_VOLU, \
KC_TRNS, KC_UP, KC_TRNS, KC_VOLD, \
KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS)
KC_KP_0, KC_KP_DOT, TG(_L1), KC_BSPC
),
[_L1] = LAYOUT_ortho_4x4( /* LAYER 1 */
KC_NUMLOCK, _______, _______, KC_VOLU, \
_______, KC_UP, _______, KC_VOLD, \
KC_LEFT, KC_DOWN, KC_RIGHT, _______, \
_______, _______, _______, _______
)
};
const uint16_t PROGMEM fn_actions[] = {

View File

@ -1,6 +1,4 @@
#include "roadkit.h"
#include "action_layer.h"
#include "eeconfig.h"
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;
@ -132,7 +130,7 @@ qk_tap_dance_action_t tap_dance_actions[] = {
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Numberpad
/* Numberpad
* ,-----------------------.
* | 7 | 8 | 9 | / |
* |-----`-----`-----`-----|
@ -146,13 +144,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | L3 | L2 | L1 | NP |
* `-----`-----`-----`-----'
*/
[_NP] = /* Numpad */
LAYOUT_ortho_4x4(KC_7, KC_8, KC_9, KC_SLASH, \
[_NP] = LAYOUT_ortho_4x4( /* Numpad */
KC_7, KC_8, KC_9, KC_SLASH, \
KC_4, KC_5, KC_6, KC_KP_ASTERISK, \
KC_1, KC_2, KC_3, KC_MINUS, \
TD(TD_0_L3), TD(TD_DOT_L2), TD(TD_KP_PLUS_L1), TD(TD_EQUAL_NP)),
TD(TD_0_L3), TD(TD_DOT_L2), TD(TD_KP_PLUS_L1), TD(TD_EQUAL_NP)
),
/* L1
/* L1
* ,-----------------------.
* | Esc |Bksp |Home |PgUp |
* |-----`-----`-----`-----|
@ -163,13 +162,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | 0 | . | + | = |
* `-----`-----`-----`-----'
*/
[_L1] = /* LAYER 1 */
LAYOUT_ortho_4x4(KC_ESCAPE, KC_BSPACE, KC_HOME, KC_PGUP, \
[_L1] = LAYOUT_ortho_4x4( /* LAYER 1 */
KC_ESCAPE, KC_BSPACE, KC_HOME, KC_PGUP, \
KC_TAB, KC_UP, KC_END, KC_PGDOWN, \
KC_LEFT, KC_DOWN, KC_RIGHT, KC_KP_ENTER, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
_______, _______, _______, _______
),
/* L2
/* L2
* ,-----------------------.
* |Sleep|LClik|RClik|VolUp|
* |-----`-----`-----`-----|
@ -180,14 +180,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | 0 | . | + | = |
* `-----`-----`-----`-----'
*/
[_L2] = /* LAYER 2 */
LAYOUT_ortho_4x4(KC_SYSTEM_SLEEP, KC_MS_BTN1, KC_MS_BTN2, KC_AUDIO_VOL_UP, \
[_L2] = LAYOUT_ortho_4x4( /* LAYER 2 */
KC_SYSTEM_SLEEP, KC_MS_BTN1, KC_MS_BTN2, KC_AUDIO_VOL_UP, \
LALT(KC_F4), KC_F11, LGUI(KC_TAB), KC_AUDIO_VOL_DOWN, \
KC_MEDIA_PREV_TRACK, KC_MEDIA_PLAY_PAUSE, KC_MEDIA_NEXT_TRACK, KC_AUDIO_MUTE, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
_______, _______, _______, _______
),
/* L3 needs cut, copy, paste, undo, again (redo), find, calc, www back, www forward, F5
/* L3 needs cut, copy, paste, undo, again (redo), find, calc, www back, www forward, F5
* ,-----------------------.
* |WBack|WHome|WFor | F5 |
* |-----`-----`-----`-----|
@ -198,11 +198,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | 0 | . | + | = |
* `-----`-----`-----`-----'
*/
[_L3] = /* LAYER 3 */
LAYOUT_ortho_4x4(KC_WWW_BACK, KC_WWW_HOME, KC_WWW_FORWARD, KC_F5, \
KC_CALCULATOR, LCTL(KC_Z), LCTL(KC_Y), KC_WWW_SEARCH, \
LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), LCTL(KC_F), \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
[_L3] = LAYOUT_ortho_4x4( /* LAYER 3 */
KC_SYSTEM_SLEEP, KC_MS_BTN1, KC_MS_BTN2, KC_AUDIO_VOL_UP, \
LALT(KC_F4), KC_F11, LGUI(KC_TAB), KC_AUDIO_VOL_DOWN, \
KC_MEDIA_PREV_TRACK, KC_MEDIA_PLAY_PAUSE, KC_MEDIA_NEXT_TRACK, KC_AUDIO_MUTE, \
_______, _______, _______, _______
),
};
const uint16_t PROGMEM fn_actions[] = {
@ -214,9 +215,8 @@ void persistent_default_layer_set(uint16_t default_layer) {
default_layer_set(default_layer);
}
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
switch(id) {
const macro_t * action_get_macro(keyrecord_t * record, uint8_t id, uint8_t opt) {
switch (id) {
case _L3:
if (record->event.pressed) {
persistent_default_layer_set(1UL<<_L3);

View File

@ -4,7 +4,7 @@
#include "quantum.h"
// This is a shortcut to help you visually see your layout.
#define KEYMAP( \
#define LAYOUT_numpad_4x4( \
K00, K01, K02, K03, \
K10, K11, K12, \
K20, K21, K22, K23, \

View File

@ -68,4 +68,4 @@ UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = no # Audio output on port C6
LAYOUTS = ortho_4x4
LAYOUTS = numpad_4x4 ortho_4x4