Skip to content

Commit

Permalink
[Keyboard] Add Key 65 by Fox Lab (qmk#9116)
Browse files Browse the repository at this point in the history
* Add Key65 Universal PCB

* Add ISO layout to universal

* Correct universal info.json

* Add Key 65 Hotswap

* Correct typo in Key 65 Universal

* Update readmes

* Correct name

* Update keyboards/foxlab/key65/hotswap/config.h

* Apply suggestions from code review

* Invert capslock LED state

* Avoid initial capslock LED flash

* Apply suggestions from code review

* Update rules.mk

* Apply suggestions from code review
  • Loading branch information
MxBlu authored and sjmacneil committed Jan 27, 2021
1 parent b2219b8 commit b31cee6
Show file tree
Hide file tree
Showing 18 changed files with 1,172 additions and 0 deletions.
172 changes: 172 additions & 0 deletions keyboards/foxlab/key65/hotswap/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
/* Copyright 2020 Jumail Mundekkat / MxBlue
*
* 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 0x464C // "FL"
#define PRODUCT_ID 0x0003
#define DEVICE_VER 0x0001
#define MANUFACTURER Fox Lab
#define PRODUCT Key 65 Hotswap
#define DESCRIPTION Key 65 Hotswap

/* key matrix size */
#define MATRIX_ROWS 5
#define MATRIX_COLS 15

/*
* 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 { D2, D1, D0, D3, B3 }
#define MATRIX_COL_PINS { F5, F4, F1, F0, B0, F6, F7, C7, C6, B6, B5, B4, D7, D6, D4 }

/* COL2ROW, ROW2COL*/
#define DIODE_DIRECTION COL2ROW

#define BACKLIGHT_PIN B7
// #define BACKLIGHT_BREATHING
#define BACKLIGHT_LEVELS 5

#define RGB_DI_PIN E2
#ifdef RGB_DI_PIN
#define RGBLED_NUM 8
#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 */
#define RGBLIGHT_ANIMATIONS
#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

/* 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

/*
* Magic Key Options
*
* Magic keys are hotkey commands that allow control over firmware functions of
* the keyboard. They are best used in combination with the HID Listen program,
* found here: https://www.pjrc.com/teensy/hid_listen.html
*
* The options below allow the magic key functionality to be changed. This is
* useful if your keyboard/keypad is missing keys and you want magic key support.
*
*/

/* key combination for magic key command */
/* defined by default; to change, uncomment and set to the combination you want */
// #define IS_COMMAND() (get_mods() == MOD_MASK_SHIFT)

/* control how magic key switches layers */
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false

/* override magic key keymap */
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
//#define MAGIC_KEY_HELP H
//#define MAGIC_KEY_HELP_ALT SLASH
//#define MAGIC_KEY_DEBUG D
//#define MAGIC_KEY_DEBUG_MATRIX X
//#define MAGIC_KEY_DEBUG_KBD K
//#define MAGIC_KEY_DEBUG_MOUSE M
//#define MAGIC_KEY_VERSION V
//#define MAGIC_KEY_STATUS S
//#define MAGIC_KEY_CONSOLE C
//#define MAGIC_KEY_LAYER0 0
//#define MAGIC_KEY_LAYER0_ALT GRAVE
//#define MAGIC_KEY_LAYER1 1
//#define MAGIC_KEY_LAYER2 2
//#define MAGIC_KEY_LAYER3 3
//#define MAGIC_KEY_LAYER4 4
//#define MAGIC_KEY_LAYER5 5
//#define MAGIC_KEY_LAYER6 6
//#define MAGIC_KEY_LAYER7 7
//#define MAGIC_KEY_LAYER8 8
//#define MAGIC_KEY_LAYER9 9
//#define MAGIC_KEY_BOOTLOADER B
//#define MAGIC_KEY_BOOTLOADER_ALT ESC
//#define MAGIC_KEY_LOCK CAPS
//#define MAGIC_KEY_EEPROM E
//#define MAGIC_KEY_EEPROM_CLEAR BSPACE
//#define MAGIC_KEY_NKRO N
//#define MAGIC_KEY_SLEEP_LED Z

/*
* 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

/* disable these deprecated features by default */
#define NO_ACTION_MACRO
#define NO_ACTION_FUNCTION
34 changes: 34 additions & 0 deletions keyboards/foxlab/key65/hotswap/hotswap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* Copyright 2020 Jumail Mundekkat / MxBlue
*
* 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 "hotswap.h"

void keyboard_pre_init_kb(void) {
led_init_ports();
keyboard_pre_init_user();
}

void led_init_ports(void) {
setPinOutput(E6);
writePinHigh(E6);
}

bool led_update_kb(led_t led_state) {
if (led_update_user(led_state)) {
writePin(E6, !led_state.caps_lock);
}
return true;
}
33 changes: 33 additions & 0 deletions keyboards/foxlab/key65/hotswap/hotswap.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/* Copyright 2020 Jumail Mundekkat / MxBlue
*
* 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"

#define LAYOUT( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2E, \
K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \
K40, K41, K42, K47, K4B, K4C, K4D, K4E \
) { \
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, KC_NO, K2E }, \
{ K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \
{ K40, K41, K42, KC_NO, KC_NO, KC_NO, KC_NO, K47, KC_NO, KC_NO, KC_NO, K4B, K4C, K4D, K4E }, \
}
80 changes: 80 additions & 0 deletions keyboards/foxlab/key65/hotswap/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"keyboard_name": "Key 65 Hotswap",
"url": "",
"maintainer": "qmk",
"width": 15,
"height": 5,
"layouts": {
"LAYOUT": {
"key_count": 66,
"layout": [
{"label":"K00 (D2,F5)", "x":0, "y":0},
{"label":"K01 (D2,F4)", "x":1, "y":0},
{"label":"K02 (D2,F1)", "x":2, "y":0},
{"label":"K03 (D2,F0)", "x":3, "y":0},
{"label":"K04 (D2,B0)", "x":4, "y":0},
{"label":"K05 (D2,F6)", "x":5, "y":0},
{"label":"K06 (D2,F7)", "x":6, "y":0},
{"label":"K07 (D2,C7)", "x":7, "y":0},
{"label":"K08 (D2,C6)", "x":8, "y":0},
{"label":"K09 (D2,B6)", "x":9, "y":0},
{"label":"K0A (D2,B5)", "x":10, "y":0},
{"label":"K0B (D2,B4)", "x":11, "y":0},
{"label":"K0C (D2,D7)", "x":12, "y":0},
{"label":"K0D (D2,D6)", "x":13, "y":0, "w":2},
{"label":"K0E (D2,D4)", "x":15, "y":0},
{"label":"K10 (D1,F5)", "x":0, "y":1, "w":1.5},
{"label":"K11 (D1,F4)", "x":1.5, "y":1},
{"label":"K12 (D1,F1)", "x":2.5, "y":1},
{"label":"K13 (D1,F0)", "x":3.5, "y":1},
{"label":"K14 (D1,B0)", "x":4.5, "y":1},
{"label":"K15 (D1,F6)", "x":5.5, "y":1},
{"label":"K16 (D1,F7)", "x":6.5, "y":1},
{"label":"K17 (D1,C7)", "x":7.5, "y":1},
{"label":"K18 (D1,C6)", "x":8.5, "y":1},
{"label":"K19 (D1,B6)", "x":9.5, "y":1},
{"label":"K1A (D1,B5)", "x":10.5, "y":1},
{"label":"K1B (D1,B4)", "x":11.5, "y":1},
{"label":"K1C (D1,D7)", "x":12.5, "y":1},
{"label":"K1D (D1,D6)", "x":13.5, "y":1, "w":1.5},
{"label":"K1E (D1,D4)", "x":15, "y":1},
{"label":"K20 (D0,F5)", "x":0, "y":2, "w":1.75},
{"label":"K21 (D0,F4)", "x":1.75, "y":2},
{"label":"K22 (D0,F1)", "x":2.75, "y":2},
{"label":"K23 (D0,F0)", "x":3.75, "y":2},
{"label":"K24 (D0,B0)", "x":4.75, "y":2},
{"label":"K25 (D0,F6)", "x":5.75, "y":2},
{"label":"K26 (D0,F7)", "x":6.75, "y":2},
{"label":"K27 (D0,C7)", "x":7.75, "y":2},
{"label":"K28 (D0,C6)", "x":8.75, "y":2},
{"label":"K29 (D0,B6)", "x":9.75, "y":2},
{"label":"K2A (D0,B5)", "x":10.75, "y":2},
{"label":"K2B (D0,B4)", "x":11.75, "y":2},
{"label":"K2C (D0,D7)", "x":12.75, "y":2, "w":2.25},
{"label":"K2E (D0,D4)", "x":15, "y":2},
{"label":"K30 (D3,F5)", "x":0, "y":3, "w":2.25},
{"label":"K32 (D3,F1)", "x":2.25, "y":3},
{"label":"K33 (D3,F0)", "x":3.25, "y":3},
{"label":"K34 (D3,B0)", "x":4.25, "y":3},
{"label":"K35 (D3,F6)", "x":5.25, "y":3},
{"label":"K36 (D3,F7)", "x":6.25, "y":3},
{"label":"K37 (D3,C7)", "x":7.25, "y":3},
{"label":"K38 (D3,C6)", "x":8.25, "y":3},
{"label":"K39 (D3,B6)", "x":9.25, "y":3},
{"label":"K3A (D3,B5)", "x":10.25, "y":3},
{"label":"K3B (D3,B4)", "x":11.25, "y":3},
{"label":"K3C (D3,D7)", "x":12.25, "y":3, "w":1.75},
{"label":"K3D (D3,D6)", "x":14, "y":3},
{"label":"K3E (D3,D4)", "x":15, "y":3},
{"label":"K40 (B3,F5)", "x":0, "y":4, "w":1.5},
{"label":"K41 (B3,F4)", "x":1.5, "y":4},
{"label":"K42 (B3,F1)", "x":2.5, "y":4, "w":1.5},
{"label":"K47 (B3,C7)", "x":4, "y":4, "w":7},
{"label":"K4B (B3,B4)", "x":11, "y":4, "w":1.5},
{"label":"K4C (B3,D7)", "x":13, "y":4},
{"label":"K4D (B3,D6)", "x":14, "y":4},
{"label":"K4E (B3,D4)", "x":15, "y":4}
]
}
}
}
36 changes: 36 additions & 0 deletions keyboards/foxlab/key65/hotswap/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/* Copyright 2020 Jumail Mundekkat / MxBlue
*
* 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(
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_GRV,
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_PGUP,
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_PGDN,
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_UP, MO(1),
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT
),
[1] = LAYOUT(
RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, BL_TOGG, BL_DEC, BL_INC, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______
),

};

Loading

0 comments on commit b31cee6

Please sign in to comment.