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 keysofkings folder and twokey keyboard #10754

Merged
merged 16 commits into from
Nov 1, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions keyboards/keysofkings/twokey/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#pragma once
drashna marked this conversation as resolved.
Show resolved Hide resolved

#include "config_common.h"

/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x6060
King-Icewind marked this conversation as resolved.
Show resolved Hide resolved
#define DEVICE_VER 0x0001
#define MANUFACTURER Keys of Kings
#define PRODUCT Twokey
#define DESCRIPTION 2020 What a year
drashna marked this conversation as resolved.
Show resolved Hide resolved

/* key matrix size */
#define MATRIX_ROWS 2
#define MATRIX_COLS 2

/* key matrix pins */
#define MATRIX_ROW_PINS { B4, B5 }
#define MATRIX_COL_PINS { B3, B2 }
#define UNUSED_PINS


#define ENCODERS_PAD_A { E6 }
#define ENCODERS_PAD_B { D7 }
#define ENCODER_RESOLUTION 1
#define ENCODER_DIRECTION_FLIP

/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW

/* Set 0 if debouncing isn't needed */
#define DEBOUNCE 5

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

#ifdef RGBLIGHT_ENABLE
#define RGB_DI_PIN D3
#define RGBLIGHT_ANIMATIONS
#define RGBLED_NUM 5
#define RGBLIGHT_HUE_STEP 4
#define RGBLIGHT_SAT_STEP 4
#define RGBLIGHT_VAL_STEP 4
#define B6_AUDIO
#define AUDIO_CLICKY
#endif

#ifdef AUDIO_ENABLE
#define STARTUP_SONG SONG(MAJOR_SOUND)
#endif
1 change: 1 addition & 0 deletions keyboards/keysofkings/twokey/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"keyboard": "keysofkings/twokey", "keymap": "default", "layout": "LAYOUT", "layers": [["LT(1, KC_MUTE)", "LT(4, KC_MPLY)", "LT(7, KC_MNXT)"], ["KC_TRNS", "TO(2)", "TO(3)"], ["TO(0)", "RGB_TOG", "RGB_MOD"], ["TO(0)", "RGB_HUI", "RGB_HUD"], ["TO(5)", "KC_TRNS", "TO(6)"], ["TO(0)", "RGB_SAI", "RGB_SAD"], ["TO(0)", "RGB_VAI", "RGB_VAD"], ["TO(8)", "TO(9)", "KC_TRNS"], ["TO(0)", "CK_TOGG", "MU_TOG"], ["TO(0)", "RESET", "EEPROM_RESET"]]}
fauxpark marked this conversation as resolved.
Show resolved Hide resolved
63 changes: 63 additions & 0 deletions keyboards/keysofkings/twokey/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#include QMK_KEYBOARD_H
drashna marked this conversation as resolved.
Show resolved Hide resolved

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
LAYOUT(
LT(1, KC_MUTE),
LT(4, KC_MPLY), LT(7, KC_MNXT)),

LAYOUT(
KC_TRNS,
TO(2), TO(3)),

LAYOUT(
TO(0),
RGB_TOG, RGB_MOD),

LAYOUT(
TO(0),
RGB_HUI, RGB_HUD),

LAYOUT(
TO(5),
KC_TRNS, TO(6)),

LAYOUT(
TO(0),
RGB_SAI, RGB_SAD),

LAYOUT(
TO(0),
RGB_VAI, RGB_VAD),

LAYOUT(
TO(8),
TO(9), KC_TRNS),

LAYOUT(
TO(0),
CK_TOGG, MU_TOG),

LAYOUT(
TO(0),
RESET, EEPROM_RESET),
};

void matrix_init_user(void) {
debug_config.matrix = 1;
debug_config.keyboard = 1;
debug_config.enable = 1;
}

void encoder_update_user(int8_t index, bool clockwise) {
if (index == 0) {
if (clockwise) {
tap_code(KC_VOLD);
} else {
tap_code(KC_VOLU);
}
# ifdef AUDIO_CLICKY
clockwise ? clicky_freq_up() : clicky_freq_down();
# endif
}
}

17 changes: 17 additions & 0 deletions keyboards/keysofkings/twokey/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# TWOKEY

![Twokey](https://i.imgur.com/UiLwPld.jpeg)
===
King-Icewind marked this conversation as resolved.
Show resolved Hide resolved

A Two Key mini keyboard with Rotary Encoder/Switch along with Backlight keys, RGB Underglow, and Piezo Buzzer. Supports Cherry, Choc, Matias switches.

Keyboard Maintainer: Keys of Kings
Keyboard Designer: King Icewind
Hardware Supported: Twokey PCB, Pro Micro
Hardware Availability: www.keysofkings.com
King-Icewind marked this conversation as resolved.
Show resolved Hide resolved

Make example for this keyboard (after setting up your build environment):

make keysofkings/twokey: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).
27 changes: 27 additions & 0 deletions keyboards/keysofkings/twokey/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# MCU name
MCU = atmega32u4

# Bootloader selection
# Teensy halfkay
# Pro Micro caterina
# Atmel DFU atmel-dfu
# LUFA DFU lufa-dfu
# QMK DFU qmk-dfu
# ATmega32A bootloadHID
# ATmega328P USBasp
King-Icewind marked this conversation as resolved.
Show resolved Hide resolved
BOOTLOADER = caterina

# Build Options
# comment out to disable the options.
#
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
MOUSEKEY_ENABLE = no # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = no # Console for debug
COMMAND_ENABLE = no # Commands for debug and configuration
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
NKRO_ENABLE = no # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = no
AUDIO_ENABLE = yes
RGBLIGHT_ENABLE = yes
ENCODER_ENABLE = yes
King-Icewind marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions keyboards/keysofkings/twokey/twokey.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "twokey.h"
drashna marked this conversation as resolved.
Show resolved Hide resolved
12 changes: 12 additions & 0 deletions keyboards/keysofkings/twokey/twokey.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#pragma once
drashna marked this conversation as resolved.
Show resolved Hide resolved

#include "quantum.h"

#define LAYOUT( \
K00, \
K10, K11 \
) { \
{ K00, KC_NO }, \
{ K10, K11 } \
}