1
0
Fork 0

Move kbdpad_mk2 to kbdpad/mk2, add numpad layout to mk2.h (#15892)

This commit is contained in:
Felipe Bastos 2022-01-29 13:28:00 -05:00 committed by GitHub
parent 3307a8e057
commit 2100a7ca7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 33 additions and 16 deletions

View file

@ -0,0 +1,145 @@
/*
Copyright 2019 Ryota Goto
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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0xA103
#define PRODUCT_ID 0x0006
#define DEVICE_VER 0x0001
#define MANUFACTURER KBDfans
#define PRODUCT KBDPAD-MKII
/* key matrix size */
#define MATRIX_ROWS 6
#define MATRIX_COLS 4
/*
* 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 { D3, D1, D2, C6, C7, B6 }
#define MATRIX_COL_PINS { C4, C5, B3, B2 }
#define UNUSED_PINS
/* COL2ROW, ROW2COL*/
#define DIODE_DIRECTION COL2ROW
#define LED_NUM_LOCK_PIN B4
#define LED_PIN_ON_STATE 0
#define BACKLIGHT_PIN B7
#ifdef BACKLIGHT_PIN
#define BACKLIGHT_BREATHING
#define BACKLIGHT_LEVELS 5
#endif
#define RGB_DI_PIN B5
#ifdef RGB_DI_PIN
#define RGBLED_NUM 16
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8
#define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
#define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
/*== all animations enable ==*/
#define RGBLIGHT_ANIMATIONS
// /*== or choose animations ==*/
// #define RGBLIGHT_EFFECT_BREATHING
// #define RGBLIGHT_EFFECT_RAINBOW_MOOD
// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL
// #define RGBLIGHT_EFFECT_SNAKE
// #define RGBLIGHT_EFFECT_KNIGHT
// #define RGBLIGHT_EFFECT_CHRISTMAS
// #define RGBLIGHT_EFFECT_STATIC_GRADIENT
// #define RGBLIGHT_EFFECT_RGB_TEST
// #define RGBLIGHT_EFFECT_ALTERNATING
// /*== customize breathing effect ==*/
// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/
// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64
// /*==== use exp() and sin() ====*/
// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7
// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255
#endif
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5
/* define if matrix has ghost (lacks anti-ghosting diodes) */
//#define MATRIX_HAS_GHOST
/* number of backlight levels */
/* 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
/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
* This is userful for the Windows task manager shortcut (ctrl+shift+esc).
*/
// #define GRAVE_ESC_CTRL_OVERRIDE
/*
* 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
/*
* 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
/* Bootmagic Lite key configuration */
// #define BOOTMAGIC_LITE_ROW 0
// #define BOOTMAGIC_LITE_COLUMN 0

View file

@ -0,0 +1,35 @@
{
"keyboard_name": "kbdpad_mk2",
"url": "https://kb.ai03.me/projects/kbdpad-mkii.html",
"maintainer": "ai03",
"layouts": {
"LAYOUT_ortho_6x4": {
"layout": [
{"x":0, "y":0},
{"x":1, "y":0},
{"x":2, "y":0},
{"x":3, "y":0},
{"x":0, "y":1.25},
{"x":1, "y":1.25},
{"x":2, "y":1.25},
{"x":3, "y":1.25},
{"x":0, "y":2.25},
{"x":1, "y":2.25},
{"x":2, "y":2.25},
{"x":3, "y":2.25},
{"x":0, "y":3.25},
{"x":1, "y":3.25},
{"x":2, "y":3.25},
{"x":3, "y":3.25},
{"x":0, "y":4.25},
{"x":1, "y":4.25},
{"x":2, "y":4.25},
{"x":3, "y":4.25},
{"x":0, "y":5.25},
{"x":1, "y":5.25},
{"x":2, "y":5.25},
{"x":3, "y":5.25}
]
}
}
}

View file

@ -0,0 +1,28 @@
/* Copyright 2019 Ryota Goto
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_ortho_6x4( /* Base */
KC_ESC, KC_LCTL, KC_LALT, KC_BSPC,
KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
KC_P7, KC_P8, KC_P9, KC_PPLS,
KC_P4, KC_P5, KC_P6, KC_PPLS,
KC_P1, KC_P2, KC_P3, KC_PENT,
KC_P0, KC_P0, KC_PDOT, KC_PENT
),
};

View file

@ -0,0 +1,3 @@
# The default keymap for KBDPAD MKII
Just a numpad. Top row from Cherry G80-3700

View file

@ -0,0 +1,156 @@
/* Copyright 2021 Aaron VerDow
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
// Layer declarations
enum {
DEF_LAYER,
MOD_LAYER,
};
// Tap Dance declarations
enum {
TD_CAR,
TD_PRINT,
TD_CAM_UP,
TD_CAM_DN
};
void camera_number(uint16_t tens, uint16_t ones) {
/* Switch to a specific camera number
*
* I haven't been able to find official docs for this.
*
* To determine the number click the dropdown in UI and
* count from the top. The list can change with updates.
*
* Shift must be held between both * presses or the combo
* won't be recognized.
*/
register_code16(KC_LSFT);
tap_code(KC_8);
tap_code(KC_8);
unregister_code16(KC_LSFT);
tap_code(tens);
tap_code(ones);
tap_code(KC_ENT);
}
void cam_up(qk_tap_dance_state_t *state, void *user_data) {
switch (state->count) {
case 1:
tap_code(KC_C); // tap once for next cam
break;
case 2:
camera_number(KC_2,KC_0); // tap twice for reverse chase cam
break;
}
}
void cam_down(qk_tap_dance_state_t *state, void *user_data) {
switch (state->count) {
case 1:
tap_code16(LSFT(KC_C)); // tap once for prev cam
break;
case 2:
camera_number(KC_1,KC_8); // tap twice for chase cam
break;
}
}
// Tap Dance definitions
qk_tap_dance_action_t tap_dance_actions[] = {
[TD_CAR] = ACTION_TAP_DANCE_DOUBLE(
LSFT(KC_V), // tap once for prev car
LCTL(KC_V) // tap twice for my car
),
[TD_PRINT] = ACTION_TAP_DANCE_DOUBLE(
LCTL(LALT(LSFT(KC_S))), // tap once for iRacing screenshot (must be enabled in options)
LGUI(KC_PSCR) // tap twice for Windows print screen and save to file
),
[TD_CAM_UP] = ACTION_TAP_DANCE_FN(cam_up),
[TD_CAM_DN] = ACTION_TAP_DANCE_FN(cam_down)
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[DEF_LAYER] = LAYOUT_ortho_6x4( /* Base */
TD(TD_CAM_UP), // next cam, double tap for reverse chase cam
KC_V, // next car
LSFT(KC_P3), // next lap
LCTL(KC_P3), // next inc
TD(TD_CAM_DN), // prev cam, double tap for chase cam
TD(TD_CAR), // prev car, double tap for my car
LSFT(KC_P1), // prev lap
LCTL(KC_P1), // prev inc
LSFT(KC_P4), // rewind
KC_P5, // play/pause
LSFT(KC_P6), // fast forward
KC_P8, // slow mo
KC_P4, // prev frame
KC_W, // up
KC_P6, // next frame
TD(TD_PRINT), // print screen
KC_A, // left
KC_S, // down
KC_D, // right
LALT(KC_K), // toggle click and drag ui elements (in car)
KC_LCTL, // ctrl
KC_LALT, // alt
LCTL(KC_F12), // camera tool
LT(MOD_LAYER, KC_SPACE) // press once for UI, hold for MOD layer
),
[MOD_LAYER] = LAYOUT_ortho_6x4( /* Base */
KC_B, // next sub cam
KC_PGUP, // next driver cam
LCTL(KC_P6), // next session
KC_P7, // start
LSFT(KC_B), // prev sub cam
KC_PGDOWN, // prev driver cam
LCTL(KC_P4), // prev session
KC_P1, // end
KC_RBRC, // FOV up
KC_EQL, // step factor up
_______,
_______,
KC_LBRC, // FOV down
KC_MINS, // step factor down
_______,
_______,
_______,
_______,
_______,
_______,
_______,
LALT(KC_M), // cycle aim
RALT(KC_ENTER), // fullscreen (unreliable)
_______
),
};

View file

@ -0,0 +1,17 @@
# iRacing Replay Tool
![](https://imgur.com/0948eBGh.jpg)
Replay/camera tool for iRacing. This uses the default keybindings for the game so nothing should need to be mapped. This makes replays much easier to view in VR and makes waiting through heats a lot more enjoyable.
To make full use of the arrow keys open the camera tool (you can close the UI after) and optionally switch the AIM to static.
The code to generate stl files for the keycap set are ![available here.](https://github.com/AaronVerDow/KeyV2/blob/numpad/src/layouts/numpad/iracing.scad)
Other notes:
* Hold MOD (UI key) to access features on the front of
* Double tap car down is a shortcut for your car
* Double tap cam down is a shortcut for chase cam
* Double tap cam up is a shortcut for reverse chase cam
* The record button takes a screenshot using iRacing. Double tap record button to auto save a screenshot using Windows.
* The key above UI is unassigned

View file

@ -0,0 +1 @@
TAP_DANCE_ENABLE = yes

View file

@ -0,0 +1,28 @@
/* Copyright 2019 Ryota Goto
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_ortho_6x4( /* Base */
BL_TOGG, BL_STEP, RGB_TOG, RGB_MOD,
KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
KC_P7, KC_P8, KC_P9, KC_PPLS,
KC_P4, KC_P5, KC_P6, KC_PPLS,
KC_P1, KC_P2, KC_P3, KC_PENT,
KC_P0, KC_P0, KC_PDOT, KC_PENT
),
};

View file

@ -0,0 +1,9 @@
# The testing keymap for KBDPAD MKII
Turns top row into LED tester.
From left to right:
Backlight Toggle
Backlight Step
RGB Toggle
RGB Mode Cycle

View file

@ -0,0 +1,52 @@
/* Copyright 2019 Ryota Goto
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_ortho_6x4( /* Base */
KC_ESC, KC_LCTL, KC_LALT, KC_BSPC,
KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
KC_P7, KC_P8, KC_P9, KC_PPLS,
KC_P4, KC_P5, KC_P6, KC_PPLS,
KC_P1, KC_P2, KC_P3, KC_PENT,
KC_P0, KC_P0, KC_PDOT, KC_PENT
),
[1] = LAYOUT_ortho_6x4(
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______
),
[2] = LAYOUT_ortho_6x4(
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______
),
[3] = LAYOUT_ortho_6x4(
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______
),
};

View file

@ -0,0 +1,2 @@
VIA_ENABLE = yes
LTO_ENABLE = yes

View file

@ -0,0 +1,16 @@
/* Copyright 2019 Ryota Goto
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "mk2.h"

View file

@ -0,0 +1,60 @@
/* Copyright 2019 Ryota Goto
*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "quantum.h"
/* This a shortcut to help you visually see your layout.
*
* The first section contains all of the arguments representing the physical
* layout of the board and position of the keys.
*
* The second converts the arguments into a two-dimensional array which
* represents the switch matrix.
*/
#define LAYOUT_ortho_6x4( \
K00, K01, K02, K03, \
K10, K11, K12, K13, \
K20, K21, K22, K23, \
K30, K31, K32, K33, \
K40, K41, K42, K43, \
K50, K51, K52, K53 \
) \
{ \
{ K00, K01, K02, K03 }, \
{ K10, K11, K12, K13 }, \
{ K20, K21, K22, K23 }, \
{ K30, K31, K32, K33 }, \
{ K40, K41, K42, K43 }, \
{ K50, K51, K52, K53 } \
}
#define LAYOUT_numpad_6x4( \
K00, K01, K02, K03, \
K10, K11, K12, K13, \
K20, K21, K22, \
K30, K31, K32, K33, \
K40, K41, K42, \
K50, K52, K53 \
) \
{ \
{ K00, K01, K02, K03 }, \
{ K10, K11, K12, K13 }, \
{ K20, K21, K22, KC_NO }, \
{ K30, K31, K32, K33 }, \
{ K40, K41, K42, KC_NO }, \
{ K50, KC_NO, K52, K53 } \
}

View file

@ -0,0 +1,15 @@
# KBDPAD MKII
![kbdpad_mk2](https://cdn.shopify.com/s/files/1/1473/3902/files/1_17ddc70a-87f6-406d-8a32-d63615c70773.jpg?v=1552119175)
A simple numpad
Keyboard Maintainer: [ai03](https://github.com/ai03-2725)/[KBDfans](https://kbdfans.cn/)
Hardware Supported: The KBDPAD MKII PCB/case
Hardware Availability: [KBDfans](https://kbdfans.cn/products/gb-kbdpad-mkii-mechanical-keyboard-kit)
Make example for this keyboard (after setting up your build environment):
make kbdfans/kbdpad_mk2:default
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).

View file

@ -0,0 +1,20 @@
# MCU name
MCU = atmega32u2
# Bootloader selection
BOOTLOADER = atmel-dfu
# Build Options
# change yes to no to disable
#
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
MOUSEKEY_ENABLE = yes # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = no # Console for debug
COMMAND_ENABLE = yes # Commands for debug and configuration
NKRO_ENABLE = yes # Enable N-Key Rollover
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
AUDIO_ENABLE = no # Audio output
LAYOUTS = ortho_6x4