Compare commits

..

9 Commits

Author SHA1 Message Date
Zach White
4ee623fdd5 Fix compiling json files (#9210) 2020-05-26 14:29:48 -07:00
Zach White
751316c344 [CLI] Add a subcommand for getting information about a keyboard (#8666)
You can now use `qmk info` to get information about keyboards and keymaps.

Co-authored-by: Erovia <Erovia@users.noreply.github.com>
2020-05-26 13:05:41 -07:00
nathanvercaemert
5d3bf8a050 [Keymap] Contributing Home-Row-Centric-Mousekey Layout (#9195)
* adding personal keymap to repository

* starting to customize documentation to keymap

* updated readme

* updated readme
2020-05-26 11:46:02 -07:00
Erovia
6501377070 CLI: fix json2c subcommand and add/fix tests (#9206)
Co-authored-by: Zach White <skullydazed@users.noreply.github.com>
2020-05-26 17:43:33 +02:00
Leivince John Marte
af2ca13604 [Keymap] Ported ok60 to via (#9179)
* Initialize ok60/via

* Update vendorId for ok60 to K6 0x4b36

* Update keyboards/ok60/config.h
2020-05-26 03:35:06 -07:00
umi
451c472d1d [Docs] Japanese translation of docs/feature_pointing_device.md (#8993)
* add feature_pointing_device.md translation

* update based on comment

* update based on comment

* update based on comment

* update based on comment
2020-05-26 17:14:58 +09:00
yttyx
bfe76053ba [Keymap] Niu keymap and README update (#9190)
* - Balance 12 layers now in their final form
- Added Plover layer
- Updated README to use layout images

* Add headings to layer images.

* - Remove redundent TO(_BA) from FC layer
- Link to new FC layer image from README

* Highlight home keys.

* Changes following review.
2020-05-25 21:24:16 -07:00
Jumail Mundekkat
9d41281a1d [Keyboard] Add Key 65 by Fox Lab (#9116)
* 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
2020-05-25 21:10:48 -07:00
Yasuhiro SHIMIZU
ba5e1f1bae [Keymap] update helix/rev2:yshrsmz keymap (#9047)
* update helix keymap

* use set_single_persistent_default_layer
2020-05-25 20:16:03 -07:00
53 changed files with 2916 additions and 452 deletions

View File

@@ -6,6 +6,8 @@
This command allows you to compile firmware from any directory. You can compile JSON exports from <https://config.qmk.fm>, compile keymaps in the repo, or compile the keyboard in the current working directory.
This command is directory aware. It will automatically fill in KEYBOARD and/or KEYMAP if you are in a keyboard or keymap directory.
**Usage for Configurator Exports**:
```
@@ -73,8 +75,9 @@ $ qmk compile -kb dz60
## `qmk flash`
This command is similar to `qmk compile`, but can also target a bootloader. The bootloader is optional, and is set to `:flash` by default.
To specify a different bootloader, use `-bl <bootloader>`. Visit the [Flashing Firmware](flashing.md) guide for more details of the available bootloaders.
This command is similar to `qmk compile`, but can also target a bootloader. The bootloader is optional, and is set to `:flash` by default. To specify a different bootloader, use `-bl <bootloader>`. Visit the [Flashing Firmware](flashing.md) guide for more details of the available bootloaders.
This command is directory aware. It will automatically fill in KEYBOARD and/or KEYMAP if you are in a keyboard or keymap directory.
**Usage for Configurator Exports**:
@@ -128,6 +131,32 @@ Check your environment and report problems only:
qmk doctor -n
## `qmk info`
Displays information about keyboards and keymaps in QMK. You can use this to get information about a keyboard, show the layouts, display the underlying key matrix, or to pretty-print JSON keymaps.
**Usage**:
```
qmk info [-f FORMAT] [-m] [-l] [-km KEYMAP] [-kb KEYBOARD]
```
This command is directory aware. It will automatically fill in KEYBOARD and/or KEYMAP if you are in a keyboard or keymap directory.
**Examples**:
Show basic information for a keyboard:
qmk info -kb planck/rev5
Show the matrix for a keyboard:
qmk info -kb ergodox_ez -m
Show a JSON keymap for a keyboard:
qmk info -kb clueboard/california -km default
## `qmk json2c`
Creates a keymap.c from a QMK Configurator export.
@@ -152,6 +181,8 @@ qmk list-keyboards
This command lists all the keymaps for a specified keyboard (and revision).
This command is directory aware. It will automatically fill in KEYBOARD if you are in a keyboard directory.
**Usage**:
```
@@ -162,6 +193,8 @@ qmk list-keymaps -kb planck/ez
This command creates a new keymap based on a keyboard's existing default keymap.
This command is directory aware. It will automatically fill in KEYBOARD and/or KEYMAP if you are in a keyboard or keymap directory.
**Usage**:
```

View File

@@ -0,0 +1,49 @@
# ポインティングデバイス :id=pointing-device
<!---
original document: 0.8.182:docs/feature_pointing_device.md
git diff 0.8.182 HEAD -- docs/feature_pointing_device.md | cat
-->
ポインティングデバイスは汎用的な機能の総称です: システムポインタを移動します。マウスキーのような他のオプションも確かにありますが、これは簡単に変更可能で軽量であることを目指しています。機能を制御するためにカスタムキーを実装したり、他の周辺機器から情報を収集してここに直接挿入したりできます - QMK に処理を任せてください。
ポインティングデバイスを有効にするには、rules.mk の以下の行のコメントを解除します:
```makefile
POINTING_DEVICE_ENABLE = yes
```
マウスレポートを操作するために、以下の関数を使うことができます:
* `pointing_device_get_report()` - ホストコンピュータに送信された情報を表す現在の report_mouse_t を返します。
* `pointing_device_set_report(report_mouse_t newMouseReport)` - ホストコンピュータに送信される report_mouse_t を上書き保存します。
report_mouse_t (ここでは "mouseReport") が以下のプロパティを持つことを覚えておいてください:
* `mouseReport.x` - これは、x軸の動き(+ 右へ、- 左へ)を表す -127 から 127 (128ではなく、USB HID 仕様で定義されています)の符号付き整数です。
* `mouseReport.y` - これは、y軸の動き(+ 上へ、- 下へ)を表す -127 から 127 (128ではなく、USB HID 仕様で定義されています)の符号付き整数です。
* `mouseReport.v` - これは、垂直スクロール(+ 上へ、- 下へ)を表す -127 から 127 (128ではなく、USB HID 仕様で定義されています)の符号付き整数です。
* `mouseReport.h` - これは、水平スクロール(+ 右へ、- 左へ)を表す -127 から 127 (128ではなく、USB HID 仕様で定義されています)の符号付き整数です。
* `mouseReport.buttons` - これは uint8_t で、上位の5ビットを使っています。これらのビットはマウスボタンの状態を表します - ビット 3 はマウスボタン 5、ビット 7 はマウスボタン 1 です。
マウスレポートが送信されると、x、y、v、h のいずれの値も 0 に設定されます (これは "pointing_device_send()" で行われます。この挙動を回避するためにオーバーライドすることができます)。このように、ボタンの状態は持続しますが、動きは1度だけ起こります。さらにカスタマイズするために、`pointing_device_init``pointing_device_task` のどちらもオーバーライドすることができます。
以下の例では、カスタムキーを使ってマウスをクリックし垂直および水平方向に127単位スクロールし、リリースされた時にそれを全て元に戻します - なぜならこれは完全に便利な機能だからです。いいですか、以下はひとつの例です:
```c
case MS_SPECIAL:
report_mouse_t currentReport = pointing_device_get_report();
if (record->event.pressed) {
currentReport.v = 127;
currentReport.h = 127;
currentReport.buttons |= MOUSE_BTN1; // this is defined in report.h
} else {
currentReport.v = -127;
currentReport.h = -127;
currentReport.buttons &= ~MOUSE_BTN1;
}
pointing_device_set_report(currentReport);
break;
```
マウスレポートは送信されるたびに 0 (ボタンを除く)に設定されることを思い出してください。そのため、スクロールはそれぞれの場合に1度だけ発生します。

View File

@@ -0,0 +1,29 @@
/*
Set any config.h overrides for your specific keymap here.
See config.h options at https://docs.qmk.fm/#/config_options?id=the-configh-file
*/
#define ORYX_CONFIGURATOR
#undef TAPPING_TERM
#define TAPPING_TERM 175
#undef MOUSEKEY_DELAY
#define MOUSEKEY_DELAY 20
#undef MOUSEKEY_MAX_SPEED
#define MOUSEKEY_MAX_SPEED 14
#undef MOUSEKEY_TIME_TO_MAX
#define MOUSEKEY_TIME_TO_MAX 30
#undef MOUSEKEY_WHEEL_INTERVAL
#define MOUSEKEY_WHEEL_INTERVAL 50
// /* Temporarily defining a tapping term that is ridiculous to see if i can tell if lt is working. */
// #undef TAPPING_TERM
// #define TAPPING_TERM 499
/* Turning permissive hold and ignore mod tap interrupt off in order to test the tapping term. */
#undef PERMISSIVE_HOLD
#define PERMISSIVE_HOLD
#undef IGNORE_MOD_TAP_INTERRUPT
#define IGNORE_MOD_TAP_INTERRUPT

View File

@@ -0,0 +1,351 @@
#include QMK_KEYBOARD_H
#include "version.h"
#include "keymap_german.h"
#include "keymap_nordic.h"
#include "keymap_french.h"
#include "keymap_spanish.h"
#include "keymap_hungarian.h"
#include "keymap_swedish.h"
#include "keymap_br_abnt2.h"
#include "keymap_canadian_multilingual.h"
#include "keymap_german_ch.h"
#include "keymap_jp.h"
#include "keymap_bepo.h"
#define KC_MAC_UNDO LGUI(KC_Z)
#define KC_MAC_CUT LGUI(KC_X)
#define KC_MAC_COPY LGUI(KC_C)
#define KC_MAC_PASTE LGUI(KC_V)
#define KC_PC_UNDO LCTL(KC_Z)
#define KC_PC_CUT LCTL(KC_X)
#define KC_PC_COPY LCTL(KC_C)
#define KC_PC_PASTE LCTL(KC_V)
#define ES_LESS_MAC KC_GRAVE
#define ES_GRTR_MAC LSFT(KC_GRAVE)
#define ES_BSLS_MAC ALGR(KC_6)
#define NO_PIPE_ALT KC_GRAVE
#define NO_BSLS_ALT KC_EQUAL
enum custom_keycodes {
RGB_SLD = EZ_SAFE_RANGE,
};
// tapdance keycodes
enum td_keycodes {
CTRL_TO12,
SHIFT_TO13,
ALT_TO11
};
// define a type containing as many tapdance states as you need
typedef enum {
SINGLE_TAP,
SINGLE_HOLD,
} td_state_t;
// create a global instance of the tapdance state type
static td_state_t td_state;
// declare your tapdance functions:
// function to determine the current tapdance state
int cur_dance (qk_tap_dance_state_t *state);
// `finished` and `reset` functions for each tapdance keycode
void ctrlto12_finished (qk_tap_dance_state_t *state, void *user_data);
void ctrlto12_reset (qk_tap_dance_state_t *state, void *user_data);
void altto11_finished (qk_tap_dance_state_t *state, void *user_data);
void altto11_reset (qk_tap_dance_state_t *state, void *user_data);
void shiftto13_finished (qk_tap_dance_state_t *state, void *user_data);
void shiftto13_reset (qk_tap_dance_state_t *state, void *user_data);
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_ergodox_pretty(
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
KC_INSERT, KC_Q, LGUI_T(KC_W), MT(MOD_HYPR, KC_E),LT(5,KC_R), KC_T, KC_NO, KC_NO, KC_Y, LT(6,KC_U), MT(MOD_HYPR, KC_I),RGUI_T(KC_O), KC_P, KC_PSCREEN,
KC_ESCAPE, LSFT_T(KC_A), LCTL_T(KC_S), LALT_T(KC_D), LT(1,KC_F), KC_G, KC_H, LT(2,KC_J), RALT_T(KC_K), RCTL_T(KC_L), RSFT_T(KC_SCOLON),KC_CAPSLOCK,
KC_HOME, LT(9,KC_Z), MT(MOD_LGUI | MOD_LCTL,KC_X), LT(7,KC_C), LT(3,KC_V), KC_B, KC_NO, KC_NO, KC_N, LT(4,KC_M), LT(8,KC_COMMA), MT(MOD_RGUI | MOD_RCTL, KC_DOT), KC_QUOTE, KC_END,
KC_NO, KC_NO, KC_NO, KC_NO, KC_DELETE, KC_TAB, KC_NO, KC_NO, KC_NO, KC_NO,
KC_NO, KC_NO, KC_NO, KC_NO,
KC_NO, KC_NO,
TO(10), KC_BSPACE, KC_NO, KC_NO, KC_ENTER, KC_SPACE
),
[1] = LAYOUT_ergodox_pretty(
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, KC_LGUI, KC_HYPR, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_7, KC_8, KC_9, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_LSHIFT, KC_LCTRL, KC_LALT, KC_TRANSPARENT, KC_NO, KC_NO, KC_4, KC_5, KC_6, KC_0, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, MT(MOD_LGUI | MOD_LCTL,KC_NO), KC_NO, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_1, KC_2, KC_3, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT
),
[2] = LAYOUT_ergodox_pretty(
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_HYPR, KC_RGUI, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_LPRN, KC_RPRN, KC_ASTR, KC_SLASH, KC_NO, KC_NO, KC_TRANSPARENT, KC_RALT, KC_RCTRL, KC_RSHIFT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, MT(MOD_RGUI | MOD_RCTL, KC_NO), KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT
),
[3] = LAYOUT_ergodox_pretty(
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, KC_LGUI, KC_HYPR, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRANSPARENT,
KC_TRANSPARENT, KC_LSHIFT, KC_LCTRL, KC_LALT, KC_NO, KC_NO, KC_NO, KC_F5, KC_F6, KC_F7, KC_F8, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, MT(MOD_LGUI | MOD_LCTL,KC_NO), KC_NO, KC_TRANSPARENT, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT
),
[4] = LAYOUT_ergodox_pretty(
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_HYPR, KC_RGUI, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_LBRACKET, KC_RBRACKET, KC_QUES, KC_EXLM, KC_NO, KC_NO, KC_NO, KC_RALT, KC_RCTRL, KC_RSHIFT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_TRANSPARENT, KC_NO, MT(MOD_RGUI | MOD_RCTL, KC_NO), KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT
),
[5] = LAYOUT_ergodox_pretty(
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, KC_LGUI, KC_HYPR, KC_TRANSPARENT, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_LSHIFT, KC_LCTRL, KC_LALT, KC_NO, KC_NO, KC_NO, KC_HASH, KC_BSLASH, KC_GRAVE, KC_TILD, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, MT(MOD_LGUI | MOD_LCTL,KC_NO), KC_NO, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT
),
[6] = LAYOUT_ergodox_pretty(
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_TRANSPARENT, KC_HYPR, KC_RGUI, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_UNDS, KC_EQUAL, KC_MINUS, KC_PLUS, KC_NO, KC_NO, KC_NO, KC_RALT, KC_RCTRL, KC_RSHIFT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, MT(MOD_RGUI | MOD_RCTL, KC_NO), KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT
),
[7] = LAYOUT_ergodox_pretty(
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_AT, KC_DLR, KC_PERC, KC_CIRC, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, KC_NO, KC_TRANSPARENT, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT
),
[8] = LAYOUT_ergodox_pretty(
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_LCBR, KC_RCBR, KC_AMPR, KC_PIPE, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_TRANSPARENT, KC_NO, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT
),
[9] = LAYOUT_ergodox_pretty(
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_AUDIO_VOL_UP,KC_NO, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MEDIA_PREV_TRACK,KC_AUDIO_VOL_DOWN,KC_MEDIA_NEXT_TRACK,KC_MEDIA_PLAY_PAUSE,KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT
),
[10] = LAYOUT_ergodox_pretty(
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, KC_LGUI, KC_MS_BTN2, KC_NO, KC_NO, KC_TRANSPARENT, MT(MOD_RCTL, KC_A), KC_NO, KC_NO, KC_MS_UP, KC_NO, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, TD(SHIFT_TO13), TD(CTRL_TO12), TD(ALT_TO11), KC_MS_BTN1, KC_NO, KC_NO, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, MT(MOD_LGUI | MOD_LCTL,KC_NO), KC_NO, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, TO(0)
),
[11] = LAYOUT_ergodox_pretty(
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, KC_LGUI, KC_HYPR, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_UP, KC_NO, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_LSHIFT, KC_LCTRL, KC_LALT, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RIGHT, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, MT(MOD_LGUI | MOD_LCTL,KC_NO), KC_NO, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, TO(0)
),
[12] = LAYOUT_ergodox_pretty(
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, KC_LGUI, KC_HYPR, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_MS_WH_UP, KC_NO, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_LSHIFT, KC_LCTRL, KC_LALT, KC_NO, KC_NO, KC_NO, KC_MS_WH_LEFT, KC_MS_WH_DOWN, KC_MS_WH_RIGHT, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, MT(MOD_LGUI | MOD_LCTL,KC_NO), KC_NO, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, TO(0)
),
[13] = LAYOUT_ergodox_pretty(
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, KC_LGUI, KC_HYPR, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_PGUP, KC_NO, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_LSHIFT, KC_LCTRL, KC_LALT, KC_NO, KC_NO, KC_NO, KC_NO, KC_PGDOWN, KC_NO, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_NO, MT(MOD_LGUI | MOD_LCTL,KC_NO), KC_NO, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, TO(0)
),
};
/* Commenting out for debug purposes */
// bool process_record_user(uint16_t keycode, keyrecord_t *record) {
// switch (keycode) {
// }
// return true;
// }
uint32_t layer_state_set_user(uint32_t state) {
uint8_t layer = biton32(state);
ergodox_board_led_off();
ergodox_right_led_1_off();
ergodox_right_led_2_off();
ergodox_right_led_3_off();
switch (layer) {
case 1:
ergodox_right_led_1_on();
break;
case 2:
ergodox_right_led_2_on();
break;
case 3:
ergodox_right_led_3_on();
break;
case 4:
ergodox_right_led_1_on();
ergodox_right_led_2_on();
break;
case 5:
ergodox_right_led_1_on();
ergodox_right_led_3_on();
break;
case 6:
ergodox_right_led_2_on();
ergodox_right_led_3_on();
break;
case 7:
ergodox_right_led_1_on();
ergodox_right_led_2_on();
ergodox_right_led_3_on();
break;
default:
break;
}
return state;
};
// determine the tapdance state to return
int cur_dance (qk_tap_dance_state_t *state) {
if (state->count == 1) {
if (state->interrupted || !state->pressed) { return SINGLE_TAP; }
else { return SINGLE_HOLD; }
}
else { return 2; } // any number higher than the maximum state value you return above
}
void ctrlto12_finished (qk_tap_dance_state_t *state, void *user_data) {
td_state = cur_dance(state);
switch (td_state) {
case SINGLE_TAP:
layer_on(12);
break;
case SINGLE_HOLD:
register_mods(MOD_BIT(KC_LCTRL)); // for a layer-tap key, use `layer_on(_MY_LAYER)` here
break;
}
}
void ctrlto12_reset (qk_tap_dance_state_t *state, void *user_data) {
switch (td_state) {
case SINGLE_TAP:
break;
case SINGLE_HOLD:
unregister_mods(MOD_BIT(KC_LCTRL)); // for a layer-tap key, use `layer_off(_MY_LAYER)` here
break;
}
}
void shiftto13_finished (qk_tap_dance_state_t *state, void *user_data) {
td_state = cur_dance(state);
switch (td_state) {
case SINGLE_TAP:
layer_on(13);
break;
case SINGLE_HOLD:
register_mods(MOD_BIT(KC_LSHIFT)); // for a layer-tap key, use `layer_on(_MY_LAYER)` here
break;
}
}
void shiftto13_reset (qk_tap_dance_state_t *state, void *user_data) {
switch (td_state) {
case SINGLE_TAP:
break;
case SINGLE_HOLD:
unregister_mods(MOD_BIT(KC_LSHIFT)); // for a layer-tap key, use `layer_off(_MY_LAYER)` here
break;
}
}
void altto11_finished (qk_tap_dance_state_t *state, void *user_data) {
td_state = cur_dance(state);
switch (td_state) {
case SINGLE_TAP:
layer_on(11);
break;
case SINGLE_HOLD:
register_mods(MOD_BIT(KC_LALT)); // for a layer-tap key, use `layer_on(_MY_LAYER)` here
break;
}
}
void altto11_reset (qk_tap_dance_state_t *state, void *user_data) {
switch (td_state) {
case SINGLE_TAP:
break;
case SINGLE_HOLD:
unregister_mods(MOD_BIT(KC_LALT)); // for a layer-tap key, use `layer_off(_MY_LAYER)` here
break;
}
}
// define `ACTION_TAP_DANCE_FN_ADVANCED()` for each tapdance keycode, passing in `finished` and `reset` functions
qk_tap_dance_action_t tap_dance_actions[] = {
[CTRL_TO12] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ctrlto12_finished, ctrlto12_reset),
[SHIFT_TO13] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, shiftto13_finished, shiftto13_reset),
[ALT_TO11] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, altto11_finished, altto11_reset)
};
/* Debugging functions */
void keyboard_post_init_user(void) {
// Customise these values to desired behaviour
// debug_enable=true;
// debug_matrix=true;
// debug_keyboard=true;
// debug_mouse=true;
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
// If console is enabled, it will print the matrix position and status of each key pressed
// #ifdef CONSOLE_ENABLE
// uprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed);
// #endif
return true;
}

View File

@@ -0,0 +1,26 @@
# The nathanvercaemert ErgoDox EZ configuration
Centered around the home row and the use of mouse keys, this configuration focuses
on minimal finger movement. No key is more than one unit away from a finger on the home row.
## Layers
* Base Layer
* The two main thumb keys provide a loop to the mouse key layer. Pressing the left followed by the right always guarantees that you are on the base layer.
* There are a lot of dual function keys on the base layer.
* The layout of the letters is qwerty.
* Pinkys, ring fingers, and middle fingers apply dual function modifiers (along with the keys above and below the ring fingers.)
* Numbers, Symbols, and Function Keys.
* From the base layer, many keys are dual function layer switches.
* The switch on one hand changes the home row of the other hand to a row of symbols in most cases.
* The left index finger, and the key below it, change the right hand to the numbers and function keys
respectfully.
* Mouse Layer
* Clicking the main left thumb key navigates to the mouse layer (10.) Some dual function keys (technically tap dance functions) allow the left hand to apply modifiers to mouse clicks while tapping switches to
navigation layers.
* Navigation Layers
* From the Mouse Layer, taps to the left home row navigate to scroll keys, arrow keys, and page keys.
Here is the image of my keymap:
![Default](https://i.imgur.com/kXywQIq.png)

View File

@@ -0,0 +1,10 @@
# Set any rules.mk overrides for your specific keymap here.
# See rules at https://docs.qmk.fm/#/config_options?id=the-rulesmk-file
LINK_TIME_OPTIMIZATION_ENABLE = yes
COMMAND_ENABLE = no
RGBLIGHT_ENABLE = no
TAP_DANCE_ENABLE=yes
#Beginning debugging process for LT() and permissive hold
CONSOLE_ENABLE = yes

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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 }, \
}

View File

@@ -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}
]
}
}
}

View File

@@ -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, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______
),
};

View File

@@ -0,0 +1,48 @@
/* 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, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______
),
[2] = LAYOUT(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______
),
[3] = LAYOUT(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______
),
};

View File

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

View File

@@ -0,0 +1,18 @@
# Foxlab Key 65 Hotswap
![Key 65](https://i.imgur.com/28Qck8ul.jpg)
Key 65 is featured with the three-layer case and dual-gasket structure. The plate mounting system is an improved version of the gasket sandwich on Leaf 60. In addition, we add gaskets between the middle case and the bottom case. There's an optional rubber sheet between the PCB and the plate. The numerous options will offer you the most freedom to make the keyboard look and feel as you wish.
* Keyboard Maintainer: QMK
* Hardware Supported: Key 65 Hotswap PCB
* Hardware Availability: [Group Buy](https://geekhack.org/index.php?topic=102609.0)
This version is for the hotswap variant with the fixed layout below:
![Layout](https://i.imgur.com/NDqjqJml.png)
Make example for this keyboard (after setting up your build environment):
make foxlab/key65/hotswap: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,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
BOOTLOADER = atmel-dfu
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
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
NKRO_ENABLE = no # USB Nkey Rollover
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
MIDI_ENABLE = no # MIDI support
AUDIO_ENABLE = no # Audio output
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches

View File

@@ -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 0x0004
#define DEVICE_VER 0x0001
#define MANUFACTURER Fox Lab
#define PRODUCT Key 65 Universal
#define DESCRIPTION Key 65 Universal
/* key matrix size */
#define MATRIX_ROWS 5
#define MATRIX_COLS 16
/*
* 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 { D0, D1, F0, F4, F1 }
#define MATRIX_COL_PINS { B1, F5, F6, F7, C7, C6, B6, B5, B4, D7, D6, D4, D5, D3, D2, B0 }
/* 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 6
#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

View File

@@ -0,0 +1,306 @@
{
"keyboard_name": "Key 65 Universal",
"url": "",
"maintainer": "qmk",
"width": 16,
"height": 5,
"layouts": {
"LAYOUT_65_ansi_blocker_split_bs": {
"key_count": 68,
"layout": [
{"label":"K00 (D0,B1)", "x":0, "y":0},
{"label":"K01 (D0,F5)", "x":1, "y":0},
{"label":"K02 (D0,F6)", "x":2, "y":0},
{"label":"K03 (D0,F7)", "x":3, "y":0},
{"label":"K04 (D0,C7)", "x":4, "y":0},
{"label":"K05 (D0,C6)", "x":5, "y":0},
{"label":"K06 (D0,B6)", "x":6, "y":0},
{"label":"K07 (D0,B5)", "x":7, "y":0},
{"label":"K08 (D0,B4)", "x":8, "y":0},
{"label":"K09 (D0,D7)", "x":9, "y":0},
{"label":"K0A (D0,D6)", "x":10, "y":0},
{"label":"K0B (D0,D4)", "x":11, "y":0},
{"label":"K0C (D0,D5)", "x":12, "y":0},
{"label":"K0D (D0,D3)", "x":13, "y":0},
{"label":"K0E (D0,D2)", "x":14, "y":0},
{"label":"K0F (D0,B0)", "x":15, "y":0},
{"label":"K10 (D1,B1)", "x":0, "y":1, "w":1.5},
{"label":"K11 (D1,F5)", "x":1.5, "y":1},
{"label":"K12 (D1,F6)", "x":2.5, "y":1},
{"label":"K13 (D1,F7)", "x":3.5, "y":1},
{"label":"K14 (D1,C7)", "x":4.5, "y":1},
{"label":"K15 (D1,C6)", "x":5.5, "y":1},
{"label":"K16 (D1,B6)", "x":6.5, "y":1},
{"label":"K17 (D1,B5)", "x":7.5, "y":1},
{"label":"K18 (D1,B4)", "x":8.5, "y":1},
{"label":"K19 (D1,D7)", "x":9.5, "y":1},
{"label":"K1A (D1,D6)", "x":10.5, "y":1},
{"label":"K1B (D1,D4)", "x":11.5, "y":1},
{"label":"K1C (D1,D5)", "x":12.5, "y":1},
{"label":"K1D (D1,D3)", "x":13.5, "y":1, "w":1.5},
{"label":"K1F (D1,B0)", "x":15, "y":1},
{"label":"K20 (F0,B1)", "x":0, "y":2, "w":1.75},
{"label":"K21 (F0,F5)", "x":1.75, "y":2},
{"label":"K22 (F0,F6)", "x":2.75, "y":2},
{"label":"K23 (F0,F7)", "x":3.75, "y":2},
{"label":"K24 (F0,C7)", "x":4.75, "y":2},
{"label":"K25 (F0,C6)", "x":5.75, "y":2},
{"label":"K26 (F0,B6)", "x":6.75, "y":2},
{"label":"K27 (F0,B5)", "x":7.75, "y":2},
{"label":"K28 (F0,B4)", "x":8.75, "y":2},
{"label":"K29 (F0,D7)", "x":9.75, "y":2},
{"label":"K2A (F0,D6)", "x":10.75, "y":2},
{"label":"K2B (F0,D4)", "x":11.75, "y":2},
{"label":"K2D (F0,D3)", "x":12.75, "y":2, "w":2.25},
{"label":"K2F (F0,B0)", "x":15, "y":2},
{"label":"K30 (F4,B1)", "x":0, "y":3, "w":2.25},
{"label":"K32 (F4,F6)", "x":2.25, "y":3},
{"label":"K33 (F4,F7)", "x":3.25, "y":3},
{"label":"K34 (F4,C7)", "x":4.25, "y":3},
{"label":"K35 (F4,C6)", "x":5.25, "y":3},
{"label":"K36 (F4,B6)", "x":6.25, "y":3},
{"label":"K37 (F4,B5)", "x":7.25, "y":3},
{"label":"K38 (F4,B4)", "x":8.25, "y":3},
{"label":"K39 (F4,D7)", "x":9.25, "y":3},
{"label":"K3A (F4,D6)", "x":10.25, "y":3},
{"label":"K3B (F4,D4)", "x":11.25, "y":3},
{"label":"K3C (F4,D5)", "x":12.25, "y":3, "w":1.75},
{"label":"K3D (F4,D3)", "x":14, "y":3},
{"label":"K3F (F4,B0)", "x":15, "y":3},
{"label":"K40 (F1,B1)", "x":0, "y":4, "w":1.25},
{"label":"K41 (F1,F5)", "x":1.25, "y":4, "w":1.25},
{"label":"K42 (F1,F6)", "x":2.5, "y":4, "w":1.25},
{"label":"K46 (F1,B6)", "x":3.75, "y":4, "w":6.25},
{"label":"K4A (F1,D6)", "x":10, "y":4, "w":1.25},
{"label":"K4B (F1,D4)", "x":11.25, "y":4, "w":1.25},
{"label":"K4C (F1,D5)", "x":13, "y":4},
{"label":"K4D (F1,D3)", "x":14, "y":4},
{"label":"K4F (F1,B0)", "x":15, "y":4}
]
},
"LAYOUT_65_ansi_blocker_tsangan_split_bs": {
"key_count": 67,
"layout": [
{"label":"K00 (D0,B1)", "x":0, "y":0},
{"label":"K01 (D0,F5)", "x":1, "y":0},
{"label":"K02 (D0,F6)", "x":2, "y":0},
{"label":"K03 (D0,F7)", "x":3, "y":0},
{"label":"K04 (D0,C7)", "x":4, "y":0},
{"label":"K05 (D0,C6)", "x":5, "y":0},
{"label":"K06 (D0,B6)", "x":6, "y":0},
{"label":"K07 (D0,B5)", "x":7, "y":0},
{"label":"K08 (D0,B4)", "x":8, "y":0},
{"label":"K09 (D0,D7)", "x":9, "y":0},
{"label":"K0A (D0,D6)", "x":10, "y":0},
{"label":"K0B (D0,D4)", "x":11, "y":0},
{"label":"K0C (D0,D5)", "x":12, "y":0},
{"label":"K0D (D0,D3)", "x":13, "y":0},
{"label":"K0E (D0,D2)", "x":14, "y":0},
{"label":"K0F (D0,B0)", "x":15, "y":0},
{"label":"K10 (D1,B1)", "x":0, "y":1, "w":1.5},
{"label":"K11 (D1,F5)", "x":1.5, "y":1},
{"label":"K12 (D1,F6)", "x":2.5, "y":1},
{"label":"K13 (D1,F7)", "x":3.5, "y":1},
{"label":"K14 (D1,C7)", "x":4.5, "y":1},
{"label":"K15 (D1,C6)", "x":5.5, "y":1},
{"label":"K16 (D1,B6)", "x":6.5, "y":1},
{"label":"K17 (D1,B5)", "x":7.5, "y":1},
{"label":"K18 (D1,B4)", "x":8.5, "y":1},
{"label":"K19 (D1,D7)", "x":9.5, "y":1},
{"label":"K1A (D1,D6)", "x":10.5, "y":1},
{"label":"K1B (D1,D4)", "x":11.5, "y":1},
{"label":"K1C (D1,D5)", "x":12.5, "y":1},
{"label":"K1D (D1,D3)", "x":13.5, "y":1, "w":1.5},
{"label":"K1F (D1,B0)", "x":15, "y":1},
{"label":"K20 (F0,B1)", "x":0, "y":2, "w":1.75},
{"label":"K21 (F0,F5)", "x":1.75, "y":2},
{"label":"K22 (F0,F6)", "x":2.75, "y":2},
{"label":"K23 (F0,F7)", "x":3.75, "y":2},
{"label":"K24 (F0,C7)", "x":4.75, "y":2},
{"label":"K25 (F0,C6)", "x":5.75, "y":2},
{"label":"K26 (F0,B6)", "x":6.75, "y":2},
{"label":"K27 (F0,B5)", "x":7.75, "y":2},
{"label":"K28 (F0,B4)", "x":8.75, "y":2},
{"label":"K29 (F0,D7)", "x":9.75, "y":2},
{"label":"K2A (F0,D6)", "x":10.75, "y":2},
{"label":"K2B (F0,D4)", "x":11.75, "y":2},
{"label":"K2D (F0,D3)", "x":12.75, "y":2, "w":2.25},
{"label":"K2F (F0,B0)", "x":15, "y":2},
{"label":"K30 (F4,B1)", "x":0, "y":3, "w":2.25},
{"label":"K32 (F4,F6)", "x":2.25, "y":3},
{"label":"K33 (F4,F7)", "x":3.25, "y":3},
{"label":"K34 (F4,C7)", "x":4.25, "y":3},
{"label":"K35 (F4,C6)", "x":5.25, "y":3},
{"label":"K36 (F4,B6)", "x":6.25, "y":3},
{"label":"K37 (F4,B5)", "x":7.25, "y":3},
{"label":"K38 (F4,B4)", "x":8.25, "y":3},
{"label":"K39 (F4,D7)", "x":9.25, "y":3},
{"label":"K3A (F4,D6)", "x":10.25, "y":3},
{"label":"K3B (F4,D4)", "x":11.25, "y":3},
{"label":"K3C (F4,D5)", "x":12.25, "y":3, "w":1.75},
{"label":"K3D (F4,D3)", "x":14, "y":3},
{"label":"K3F (F4,B0)", "x":15, "y":3},
{"label":"K40 (F1,B1)", "x":0, "y":4, "w":1.5},
{"label":"K41 (F1,F5)", "x":1.5, "y":4},
{"label":"K42 (F1,F6)", "x":2.5, "y":4, "w":1.5},
{"label":"K46 (F1,B6)", "x":4, "y":4, "w":7},
{"label":"K4A (F1,D6)", "x":11, "y":4, "w":1.5},
{"label":"K4C (F1,D5)", "x":13, "y":4},
{"label":"K4D (F1,D3)", "x":14, "y":4},
{"label":"K4F (F1,B0)", "x":15, "y":4}
]
},
"LAYOUT_iso_all": {
"key_count": 71,
"layout": [
{"label":"K00 (D0,B1)", "x":0, "y":0},
{"label":"K01 (D0,F5)", "x":1, "y":0},
{"label":"K02 (D0,F6)", "x":2, "y":0},
{"label":"K03 (D0,F7)", "x":3, "y":0},
{"label":"K04 (D0,C7)", "x":4, "y":0},
{"label":"K05 (D0,C6)", "x":5, "y":0},
{"label":"K06 (D0,B6)", "x":6, "y":0},
{"label":"K07 (D0,B5)", "x":7, "y":0},
{"label":"K08 (D0,B4)", "x":8, "y":0},
{"label":"K09 (D0,D7)", "x":9, "y":0},
{"label":"K0A (D0,D6)", "x":10, "y":0},
{"label":"K0B (D0,D4)", "x":11, "y":0},
{"label":"K0C (D0,D5)", "x":12, "y":0},
{"label":"K0D (D0,D3)", "x":13, "y":0},
{"label":"K0E (D0,D2)", "x":14, "y":0},
{"label":"K0F (D0,B0)", "x":15, "y":0},
{"label":"K10 (D1,B1)", "x":0, "y":1, "w":1.5},
{"label":"K11 (D1,F5)", "x":1.5, "y":1},
{"label":"K12 (D1,F6)", "x":2.5, "y":1},
{"label":"K13 (D1,F7)", "x":3.5, "y":1},
{"label":"K14 (D1,C7)", "x":4.5, "y":1},
{"label":"K15 (D1,C6)", "x":5.5, "y":1},
{"label":"K16 (D1,B6)", "x":6.5, "y":1},
{"label":"K17 (D1,B5)", "x":7.5, "y":1},
{"label":"K18 (D1,B4)", "x":8.5, "y":1},
{"label":"K19 (D1,D7)", "x":9.5, "y":1},
{"label":"K1A (D1,D6)", "x":10.5, "y":1},
{"label":"K1B (D1,D4)", "x":11.5, "y":1},
{"label":"K1C (D1,D5)", "x":12.5, "y":1},
{"label":"K1F (D1,B0)", "x":15, "y":1},
{"label":"K20 (F0,B1)", "x":0, "y":2, "w":1.75},
{"label":"K21 (F0,F5)", "x":1.75, "y":2},
{"label":"K22 (F0,F6)", "x":2.75, "y":2},
{"label":"K23 (F0,F7)", "x":3.75, "y":2},
{"label":"K24 (F0,C7)", "x":4.75, "y":2},
{"label":"K25 (F0,C6)", "x":5.75, "y":2},
{"label":"K26 (F0,B6)", "x":6.75, "y":2},
{"label":"K27 (F0,B5)", "x":7.75, "y":2},
{"label":"K28 (F0,B4)", "x":8.75, "y":2},
{"label":"K29 (F0,D7)", "x":9.75, "y":2},
{"label":"K2A (F0,D6)", "x":10.75, "y":2},
{"label":"K2B (F0,D4)", "x":11.75, "y":2},
{"label":"K1D (D1,D3)", "x":12.75, "y":2},
{"label":"K2D (F0,D3)", "x":13.75, "y":1, "w":1.25, "h":2},
{"label":"K2F (F0,B0)", "x":15, "y":2},
{"label":"K30 (F4,B1)", "x":0, "y":3, "w":1.25},
{"label":"K31 (F4,F5)", "x":1.25, "y":3},
{"label":"K32 (F4,F6)", "x":2.25, "y":3},
{"label":"K33 (F4,F7)", "x":3.25, "y":3},
{"label":"K34 (F4,C7)", "x":4.25, "y":3},
{"label":"K35 (F4,C6)", "x":5.25, "y":3},
{"label":"K36 (F4,B6)", "x":6.25, "y":3},
{"label":"K37 (F4,B5)", "x":7.25, "y":3},
{"label":"K38 (F4,B4)", "x":8.25, "y":3},
{"label":"K39 (F4,D7)", "x":9.25, "y":3},
{"label":"K3A (F4,D6)", "x":10.25, "y":3},
{"label":"K3B (F4,D4)", "x":11.25, "y":3},
{"label":"K3C (F4,D5)", "x":12.25, "y":3, "w":1.75},
{"label":"K3D (F4,D3)", "x":14, "y":3},
{"label":"K3F (F4,B0)", "x":15, "y":3},
{"label":"K40 (F1,B1)", "x":0, "y":4, "w":1.25},
{"label":"K41 (F1,F5)", "x":1.25, "y":4, "w":1.25},
{"label":"K42 (F1,F6)", "x":2.5, "y":4, "w":1.25},
{"label":"K44 (F1,C7)", "x":3.75, "y":4, "w":2.25},
{"label":"K46 (F1,B6)", "x":6, "y":4, "w":1.25},
{"label":"K48 (F1,B4)", "x":7.25, "y":4, "w":2.75},
{"label":"K4A (F1,D6)", "x":10, "y":4, "w":1.25},
{"label":"K4B (F1,D4)", "x":11.25, "y":4, "w":1.25},
{"label":"K4C (F1,D5)", "x":13, "y":4},
{"label":"K4D (F1,D3)", "x":14, "y":4},
{"label":"K4F (F1,B0)", "x":15, "y":4}
]
},
"LAYOUT_all": {
"key_count": 71,
"layout": [
{"label":"K00 (D0,B1)", "x":0, "y":0},
{"label":"K01 (D0,F5)", "x":1, "y":0},
{"label":"K02 (D0,F6)", "x":2, "y":0},
{"label":"K03 (D0,F7)", "x":3, "y":0},
{"label":"K04 (D0,C7)", "x":4, "y":0},
{"label":"K05 (D0,C6)", "x":5, "y":0},
{"label":"K06 (D0,B6)", "x":6, "y":0},
{"label":"K07 (D0,B5)", "x":7, "y":0},
{"label":"K08 (D0,B4)", "x":8, "y":0},
{"label":"K09 (D0,D7)", "x":9, "y":0},
{"label":"K0A (D0,D6)", "x":10, "y":0},
{"label":"K0B (D0,D4)", "x":11, "y":0},
{"label":"K0C (D0,D5)", "x":12, "y":0},
{"label":"K0D (D0,D3)", "x":13, "y":0},
{"label":"K0E (D0,D2)", "x":14, "y":0},
{"label":"K0F (D0,B0)", "x":15, "y":0},
{"label":"K10 (D1,B1)", "x":0, "y":1, "w":1.5},
{"label":"K11 (D1,F5)", "x":1.5, "y":1},
{"label":"K12 (D1,F6)", "x":2.5, "y":1},
{"label":"K13 (D1,F7)", "x":3.5, "y":1},
{"label":"K14 (D1,C7)", "x":4.5, "y":1},
{"label":"K15 (D1,C6)", "x":5.5, "y":1},
{"label":"K16 (D1,B6)", "x":6.5, "y":1},
{"label":"K17 (D1,B5)", "x":7.5, "y":1},
{"label":"K18 (D1,B4)", "x":8.5, "y":1},
{"label":"K19 (D1,D7)", "x":9.5, "y":1},
{"label":"K1A (D1,D6)", "x":10.5, "y":1},
{"label":"K1B (D1,D4)", "x":11.5, "y":1},
{"label":"K1C (D1,D5)", "x":12.5, "y":1},
{"label":"K1D (D1,D3)", "x":13.5, "y":1, "w":1.5},
{"label":"K1F (D1,B0)", "x":15, "y":1},
{"label":"K20 (F0,B1)", "x":0, "y":2, "w":1.75},
{"label":"K21 (F0,F5)", "x":1.75, "y":2},
{"label":"K22 (F0,F6)", "x":2.75, "y":2},
{"label":"K23 (F0,F7)", "x":3.75, "y":2},
{"label":"K24 (F0,C7)", "x":4.75, "y":2},
{"label":"K25 (F0,C6)", "x":5.75, "y":2},
{"label":"K26 (F0,B6)", "x":6.75, "y":2},
{"label":"K27 (F0,B5)", "x":7.75, "y":2},
{"label":"K28 (F0,B4)", "x":8.75, "y":2},
{"label":"K29 (F0,D7)", "x":9.75, "y":2},
{"label":"K2A (F0,D6)", "x":10.75, "y":2},
{"label":"K2B (F0,D4)", "x":11.75, "y":2},
{"label":"K2D (F0,D3)", "x":12.75, "y":2, "w":2.25},
{"label":"K2F (F0,B0)", "x":15, "y":2},
{"label":"K30 (F4,B1)", "x":0, "y":3, "w":1.25},
{"label":"K31 (F4,F5)", "x":1.25, "y":3},
{"label":"K32 (F4,F6)", "x":2.25, "y":3},
{"label":"K33 (F4,F7)", "x":3.25, "y":3},
{"label":"K34 (F4,C7)", "x":4.25, "y":3},
{"label":"K35 (F4,C6)", "x":5.25, "y":3},
{"label":"K36 (F4,B6)", "x":6.25, "y":3},
{"label":"K37 (F4,B5)", "x":7.25, "y":3},
{"label":"K38 (F4,B4)", "x":8.25, "y":3},
{"label":"K39 (F4,D7)", "x":9.25, "y":3},
{"label":"K3A (F4,D6)", "x":10.25, "y":3},
{"label":"K3B (F4,D4)", "x":11.25, "y":3},
{"label":"K3C (F4,D5)", "x":12.25, "y":3, "w":1.75},
{"label":"K3D (F4,D3)", "x":14, "y":3},
{"label":"K3F (F4,B0)", "x":15, "y":3},
{"label":"K40 (F1,B1)", "x":0, "y":4, "w":1.25},
{"label":"K41 (F1,F5)", "x":1.25, "y":4, "w":1.25},
{"label":"K42 (F1,F6)", "x":2.5, "y":4, "w":1.25},
{"label":"K44 (F1,C7)", "x":3.75, "y":4, "w":2.25},
{"label":"K46 (F1,B6)", "x":6, "y":4, "w":1.25},
{"label":"K48 (F1,B4)", "x":7.25, "y":4, "w":2.75},
{"label":"K4A (F1,D6)", "x":10, "y":4, "w":1.25},
{"label":"K4B (F1,D4)", "x":11.25, "y":4, "w":1.25},
{"label":"K4C (F1,D5)", "x":13, "y":4},
{"label":"K4D (F1,D3)", "x":14, "y":4},
{"label":"K4F (F1,B0)", "x":15, "y":4}
]
}
}
}

View File

@@ -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_all(
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_BSPC, KC_DEL,
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_INS,
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_PGUP,
KC_LSFT, KC_SPC, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT
),
[1] = LAYOUT_all(
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, _______, _______, _______,
_______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, BL_TOGG, BL_DEC, BL_INC, BL_STEP, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
};

View File

@@ -0,0 +1,48 @@
/* 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_all(
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_BSPC, KC_DEL,
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_INS,
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_PGUP,
KC_LSFT, KC_SPC, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT
),
[1] = LAYOUT_all(
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, _______, _______, _______,
_______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, BL_TOGG, BL_DEC, BL_INC, BL_STEP, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
[2] = LAYOUT_all(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
[3] = LAYOUT_all(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
};

View File

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

View File

@@ -0,0 +1,22 @@
# Foxlab Key 65 Universal
![Key 65](https://i.imgur.com/28Qck8ul.jpg)
Key 65 is featured with the three-layer case and dual-gasket structure. The plate mounting system is an improved version of the gasket sandwich on Leaf 60. In addition, we add gaskets between the middle case and the bottom case. There's an optional rubber sheet between the PCB and the plate. The numerous options will offer you the most freedom to make the keyboard look and feel as you wish.
* Keyboard Maintainer: QMK
* Hardware Supported: Key 65 Universal PCB
* Hardware Availability: [Group Buy](https://geekhack.org/index.php?topic=102609.0)
This version is for the universal variant with the layouts below available:
![Layout](https://i.imgur.com/MQTZV0ol.png)
Make example for this keyboard (after setting up your build environment):
make foxlab/key65/universal: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).
## RGB LED support
The universal PCB supports RGB LEDs as an LED strip, but is not supplied with one. To use RGB LEDs, you should configure the RGBLED_NUM to match the number of LEDs on your strip.

View File

@@ -0,0 +1,29 @@
# 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
BOOTLOADER = atmel-dfu
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
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
NKRO_ENABLE = no # USB Nkey Rollover
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
MIDI_ENABLE = no # MIDI support
AUDIO_ENABLE = no # Audio output
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
LAYOUTS = 65_ansi_blocker_split_bs # Support community layouts

View File

@@ -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 "universal.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;
}

View File

@@ -0,0 +1,75 @@
/* 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_65_ansi_blocker_split_bs( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, \
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1F, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2F, \
K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3F, \
K40, K41, K42, K46, K4A, K4B, K4C, K4D, K4F \
) { \
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F }, \
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, KC_NO, K1F }, \
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D, KC_NO, K2F }, \
{ K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, KC_NO, K3F }, \
{ K40, K41, K42, KC_NO, KC_NO, KC_NO, K46, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D, KC_NO, K4F }, \
}
#define LAYOUT_65_ansi_blocker_tsangan_split_bs( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, \
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1F, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2F, \
K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3F, \
K40, K41, K42, K46, K4B, K4C, K4D, K4F \
) { \
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F }, \
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, KC_NO, K1F }, \
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D, KC_NO, K2F }, \
{ K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, KC_NO, K3F }, \
{ K40, K41, K42, KC_NO, KC_NO, KC_NO, K46, KC_NO, KC_NO, KC_NO, KC_NO, K4B, K4C, K4D, KC_NO, K4F }, \
}
#define LAYOUT_iso_all( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, \
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1F, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K1D, K2D, K2F, \
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3F, \
K40, K41, K42, K44, K46, K48, K4A, K4B, K4C, K4D, K4F \
) { \
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F }, \
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, KC_NO, K1F }, \
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D, KC_NO, K2F }, \
{ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, KC_NO, K3F }, \
{ K40, K41, K42, KC_NO, K44, KC_NO, K46, KC_NO, K48, KC_NO, K4A, K4B, K4C, K4D, KC_NO, K4F }, \
}
#define LAYOUT_all( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, \
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1F, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2F, \
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3F, \
K40, K41, K42, K44, K46, K48, K4A, K4B, K4C, K4D, K4F \
) { \
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F }, \
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, KC_NO, K1F }, \
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D, KC_NO, K2F }, \
{ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, KC_NO, K3F }, \
{ K40, K41, K42, KC_NO, K44, KC_NO, K46, KC_NO, K48, KC_NO, K4A, K4B, K4C, K4D, KC_NO, K4F }, \
}

View File

@@ -0,0 +1,9 @@
{
"keyboard":"handwired/onekey/pytest",
"keymap":"default_json",
"layout":"LAYOUT",
"layers":[["KC_A"]],
"author":"qmk",
"notes":"This file is a keymap.json file for handwired/onekey/pytest",
"version":1
}

View File

@@ -1 +1,2 @@
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {__KEYMAP_GOES_HERE__};

View File

@@ -17,10 +17,10 @@ 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
/* auto shift config */
#define AUTO_SHIFT_TIMEOUT 150
// place overrides here
// If you need more program area, try select and reduce rgblight modes to use.

View File

@@ -11,7 +11,6 @@
#include "ssd1306.h"
#endif
extern keymap_config_t keymap_config;
#ifdef RGBLIGHT_ENABLE
//Following line allows macro to read current RGB settings
@@ -26,20 +25,24 @@ extern uint8_t is_master;
// entirely and just use numbers.
enum layer_number {
_QWERTY = 0,
_COLEMAK,
_DVORAK,
_LOWER,
_RAISE,
_FUNC,
_ADJUST
};
enum custom_keycodes {
QWERTY = SAFE_RANGE,
COLEMAK,
DVORAK,
LOWER,
RAISE,
FUNC,
ADJUST,
BACKLIT,
EISU,
KANA
KANA,
RGBRST
};
enum macro_keycodes {
@@ -54,23 +57,65 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty
* ,-----------------------------------------. ,-----------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | = |
* | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | Tab | Q | W | E | R | T | | Y | U | I | O | P | - |
* | Tab | Q | W | E | R | T | | Y | U | I | O | P | Bksp |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | ESC | A | S | D | F | G | | H | J | K | L | ; | ' |
* | Ctrl | A | S | D | F | G | | H | J | K | L | ; | ' |
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
* |Shift | Z | X | C | V | B | Fn | Fn | N | M | , | . | / |Shift |
* | Shift| Z | X | C | V | B | [ | ] | N | M | , | . | / |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
* | EISU | Ctrl | Alt | GUI |Lower |Space | Bksp |Enter |Space |Raise | GUI | Alt | Ctrl | KANA |
* |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right |
* `-------------------------------------------------------------------------------------------------'
*/
[_QWERTY] = LAYOUT( \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, \
KC_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, FUNC, FUNC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
EISU, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_BSPC, KC_ENT, KC_SPC, RAISE, KC_RGUI, KC_RALT, KC_RCTL, KANA \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
KC_LCTL, 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_LBRC, KC_RBRC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
),
/* Colemak
* ,-----------------------------------------. ,-----------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | Tab | Q | W | F | P | G | | J | L | U | Y | ; | Bksp |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | Ctrl | A | R | S | T | D | | H | N | E | I | O | ' |
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | [ | ] | K | M | , | . | / |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
* |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right |
* `-------------------------------------------------------------------------------------------------'
*/
[_COLEMAK] = LAYOUT( \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \
KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \
KC_LCTL, 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_LBRC, KC_RBRC, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
),
/* Dvorak
* ,-----------------------------------------. ,-----------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | Tab | ' | , | . | P | Y | | F | G | C | R | L | Del |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | Ctrl | A | O | E | U | I | | D | H | T | N | S | / |
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
* | Shift| ; | Q | J | K | X | [ | ] | B | M | W | V | Z |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
* |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right |
* `-------------------------------------------------------------------------------------------------'
*/
[_DVORAK] = LAYOUT( \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, \
KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_LBRC, KC_RBRC, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \
ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
),
/* Lower
@@ -79,9 +124,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | Del | F1 | F2 | F3 | F4 | F5 | | F6 | _ | + | { | } | | |
* | | F1 | F2 | F3 | F4 | F5 | | F6 | _ | + | { | } | | |
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
* | | F7 | F8 | F9 | F10 | F11 | | | F12 | | | | | |
* | | F7 | F8 | F9 | F10 | F11 | ( | ) | F12 | | | Home | End | |
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | Next | Vol- | Vol+ | Play |
* `-------------------------------------------------------------------------------------------------'
@@ -89,8 +134,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_LOWER] = LAYOUT( \
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \
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_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, KC_F12, _______, _______, _______, _______, _______, \
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_LPRN, KC_RPRN, KC_F12, _______, _______, KC_HOME, KC_END, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
),
@@ -100,9 +145,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | Del | F1 | F2 | F3 | F4 | F5 | | F6 | - | = | [ | ] | \ |
* | | F1 | F2 | F3 | F4 | F5 | | F6 | - | = | [ | ] | \ |
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
* | | F7 | F8 | F9 | F10 | F11 | | | F12 | | | | | |
* | | F7 | F8 | F9 | F10 | F11 | | | F12 | | |PageDn|PageUp| |
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | Next | Vol- | Vol+ | Play |
* `-------------------------------------------------------------------------------------------------'
@@ -110,29 +155,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_RAISE] = LAYOUT( \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, KC_F12, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
),
/* Func
* ,-----------------------------------------. ,-----------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | | | | | | | | LEFT | DOWN | UP |RIGHT | PGUP | |
* |------+------+------+------+------+------|------+------|------+------+------+------+------+------|
* | | | | | | | | | HOME | END |Alt+← |Alt+→ | PGDN | |
* |------+------+------+------+------+------+-------------+------+------+------+------+------+------|
* | | | | | | | | | | | Next | Vol- | Vol+ | Play |
* `-------------------------------------------------------------------------------------------------'
*/
[_FUNC] = LAYOUT( \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \
_______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_PGUP, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_END, LALT(KC_LEFT), LALT(KC_RGHT), KC_PGDN, _______, \
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, KC_F12, _______, _______, KC_PGDN, KC_PGUP, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
),
@@ -140,9 +164,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* ,-----------------------------------------. ,-----------------------------------------.
* | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | | Reset| | | | | | | | | | | Del |
* | | Reset|RGBRST| | | | | | | | | | Del |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | | | |Aud on|Audoff| Mac | | Win |Qwerty| | | | |
* | | | |Aud on|Audoff| Mac | | Win |Qwerty|Colemk|Dvorak| | |
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | |RGB ON| HUE+ | SAT+ | VAL+ |
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
@@ -151,8 +175,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
[_ADJUST] = LAYOUT( \
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \
_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \
_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, \
_______, RESET, RGBRST, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \
_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD \
)
@@ -164,81 +188,99 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty
* ,-----------------------------------------. ,-----------------------------------------.
* | = | Q | W | E | R | T | | Y | U | I | O | P | - |
* | Tab | Q | W | E | R | T | | Y | U | I | O | P | Bksp |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | Esc | A | S | D | F | G | | H | J | K | L | ; | ' |
* | Ctrl | A | S | D | F | G | | H | J | K | L | ; | ' |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | | N | M | , | . | / |Enter |
* |------+------+------+------+------+------+-------------+------+------+------+------+------+------|
* | EISU | Ctrl | Alt | GUI |ESC/Lower | Func | Bksp |Enter |Space |Raise | GUI | Alt | Ctrl | KANA |
* |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right |
* `-------------------------------------------------------------------------------------------------'
*/
[_QWERTY] = LAYOUT( \
KC_EQL, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, \
KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
KC_LCTL, 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, KC_ENT , \
EISU, KC_LCTL, KC_LALT, KC_LGUI, LT(_LOWER, KC_ESC), FUNC, KC_BSPC, KC_ENT, KC_SPC, RAISE, KC_RGUI, KC_RALT, KC_RCTL, KANA \
ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
),
/* Colemak
* ,-----------------------------------------. ,-----------------------------------------.
* | Tab | Q | W | F | P | G | | J | L | U | Y | ; | Bksp |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | Ctrl | A | R | S | T | D | | H | N | E | I | O | ' |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | | K | M | , | . | / |Enter |
* |------+------+------+------+------+------+-------------+------+------+------+------+------+------|
* |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right |
* `-------------------------------------------------------------------------------------------------'
*/
[_COLEMAK] = LAYOUT( \
KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \
KC_LCTL, 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, KC_ENT , \
ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
),
/* Dvorak
* ,-----------------------------------------. ,-----------------------------------------.
* | Tab | ' | , | . | P | Y | | F | G | C | R | L | Del |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | Ctrl | A | O | E | U | I | | D | H | T | N | S | / |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | Shift| ; | Q | J | K | X | | B | M | W | V | Z |Enter |
* |------+------+------+------+------+------+-------------+------+------+------+------+------+------|
* |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right |
* `-------------------------------------------------------------------------------------------------'
*/
[_DVORAK] = LAYOUT( \
KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, \
KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \
ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
),
/* Lower
* ,-----------------------------------------. ,-----------------------------------------.
* | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | Del | F1 | F2 | F3 | F4 | F5 | | F6 | _ | + | { | } | | |
* | | F1 | F2 | F3 | F4 | F5 | | F6 | _ | + | { | } | | |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | | F7 | F8 | F9 | F10 | F11 | | F12 | | | | | |
* | | F7 | F8 | F9 | F10 | F11 | | F12 | | | Home | End | |
* |------+------+------+------+------+------+-------------+------+------+------+------+------+------|
* | | | | | | | | | | | Next | Vol- | Vol+ | Play |
* `-------------------------------------------------------------------------------------------------'
*/
[_LOWER] = LAYOUT( \
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_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, \
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_HOME, KC_END, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
),
/* Raise
* ,-----------------------------------------. ,-----------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | |
* | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | Del | F1 | F2 | F3 | F4 | F5 | | F6 | - | = | [ | ] | \ |
* | | F1 | F2 | F3 | F4 | F5 | | F6 | - | = | [ | ] | \ |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | | F7 | F8 | F9 | F10 | F11 | | F12 | | | | | |
* | | F7 | F8 | F9 | F10 | F11 | | F12 | | |PageDn|PageUp| |
* |------+------+------+------+------+------+-------------+------+------+------+------+------+------|
* | | | | | | | | | | | Next | Vol- | Vol+ | Play |
* `-------------------------------------------------------------------------------------------------'
*/
[_RAISE] = LAYOUT( \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, \
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
),
/* Func
* ,-----------------------------------------. ,-----------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | | | | | | | | LEFT | DOWN | UP |RIGHT | PGUP | |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | | | | | | | | HOME | END |Alt+← |Alt+→ | PGDN | |
* |------+------+------+------+------+------+-------------+------+------+------+------+------+------|
* | | | | | | | | | | | Next | Vol- | Vol+ | Play |
* `-------------------------------------------------------------------------------------------------'
*/
[_FUNC] = LAYOUT( \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \
_______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_PGUP, _______, \
_______, _______, _______, _______, _______, _______, KC_HOME, KC_END, LALT(KC_LEFT), LALT(KC_RGHT), KC_PGDN, _______, \
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_PGDN, KC_PGUP, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
),
/* Adjust (Lower + Raise)
* ,-----------------------------------------. ,-----------------------------------------.
* | | Reset| | | | | | | | | | | Del |
* | | Reset|RGBRST| | | | | | | | | | Del |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | | | |Aud on|Audoff| Mac | | Win |Qwerty| | | | |
* | | | |Aud on|Audoff| Mac | | Win |Qwerty|Colemk|Dvorak| | |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | | | | | | | | | |RGB ON| HUE+ | SAT+ | VAL+ |
* |------+------+------+------+------+------+-------------+------+------+------+------+------+------|
@@ -246,8 +288,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-------------------------------------------------------------------------------------------------'
*/
[_ADJUST] = LAYOUT( \
_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \
_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, \
_______, RESET, RGBRST, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \
_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD \
)
@@ -272,11 +314,6 @@ float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
bool TOG_STATUS = false;
int RGB_current_mode;
void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
// Setting ADJUST layer RGB back to default
void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) {
if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) {
@@ -296,7 +333,25 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_qwerty);
#endif
persistent_default_layer_set(1UL<<_QWERTY);
set_single_persistent_default_layer(_QWERTY);
}
return false;
break;
case COLEMAK:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_colemak);
#endif
set_single_persistent_default_layer(_COLEMAK);
}
return false;
break;
case DVORAK:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_dvorak);
#endif
set_single_persistent_default_layer(_DVORAK);
}
return false;
break;
@@ -346,14 +401,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
return false;
break;
case FUNC:
if (record->event.pressed) {
layer_on(_FUNC);
} else {
layer_off(_FUNC);
}
return false;
break;
case ADJUST:
if (record->event.pressed) {
layer_on(_ADJUST);
@@ -397,6 +444,15 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
return false;
break;
case RGBRST:
#ifdef RGBLIGHT_ENABLE
if (record->event.pressed) {
eeconfig_update_rgblight_default();
rgblight_enable();
RGB_current_mode = rgblight_config.mode;
}
#endif
break;
}
return true;
}
@@ -444,14 +500,7 @@ void music_scale_user(void)
//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h
#ifdef SSD1306OLED
// hook point for 'led_test' keymap
// 'default' keymap's led_test_init() is empty function, do nothing
// 'led_test' keymap's led_test_init() force rgblight_mode_noeeprom(RGBLIGHT_MODE_RGB_TEST);
__attribute__ ((weak))
void led_test_init(void) {}
void matrix_scan_user(void) {
led_test_init();
iota_gfx_task(); // this is what updates the display continuously
}
@@ -467,41 +516,42 @@ void matrix_update(struct CharacterMatrix *dest,
#define L_BASE 0
#define L_LOWER (1<<_LOWER)
#define L_RAISE (1<<_RAISE)
#define L_FUNC (1<<_FUNC)
#define L_ADJUST (1<<_ADJUST)
#define L_ADJUST_TRI (L_ADJUST|L_RAISE|L_LOWER)
static void render_logo(struct CharacterMatrix *matrix) {
static char logo[]={
static const char helix_logo[] PROGMEM ={
0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,
0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,
0};
matrix_write(matrix, logo);
matrix_write_P(matrix, helix_logo);
//matrix_write_P(&matrix, PSTR(" Split keyboard kit"));
}
void render_status(struct CharacterMatrix *matrix) {
// Render to mode icon
static char logo[][2][3]={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}};
if(keymap_config.swap_lalt_lgui==false){
matrix_write(matrix, logo[0][0]);
matrix_write_P(matrix, PSTR("\n"));
matrix_write(matrix, logo[0][1]);
}else{
matrix_write(matrix, logo[1][0]);
matrix_write_P(matrix, PSTR("\n"));
matrix_write(matrix, logo[1][1]);
static void render_rgbled_status(bool full, struct CharacterMatrix *matrix) {
#ifdef RGBLIGHT_ENABLE
char buf[30];
if (RGBLIGHT_MODES > 1 && rgblight_config.enable) {
if (full) {
snprintf(buf, sizeof(buf), " LED %2d: %d,%d,%d ",
rgblight_config.mode,
rgblight_config.hue/RGBLIGHT_HUE_STEP,
rgblight_config.sat/RGBLIGHT_SAT_STEP,
rgblight_config.val/RGBLIGHT_VAL_STEP);
} else {
snprintf(buf, sizeof(buf), "[%2d] ",rgblight_config.mode);
}
matrix_write(matrix, buf);
}
#endif
}
static void render_layer_status(struct CharacterMatrix *matrix) {
// Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below
char buf[40];
snprintf(buf,sizeof(buf), "Undef-%ld", layer_state);
matrix_write_P(matrix, PSTR("\nLayer: "));
char buf[10];
matrix_write_P(matrix, PSTR("Layer: "));
switch (layer_state) {
case L_BASE:
matrix_write_P(matrix, PSTR("Default"));
@@ -512,24 +562,44 @@ void render_status(struct CharacterMatrix *matrix) {
case L_LOWER:
matrix_write_P(matrix, PSTR("Lower"));
break;
case L_FUNC:
matrix_write_P(matrix, PSTR("Func"));
break;
case L_ADJUST:
case L_ADJUST_TRI:
matrix_write_P(matrix, PSTR("Adjust"));
break;
default:
matrix_write_P(matrix, PSTR("Undef-"));
snprintf(buf,sizeof(buf), "%ld", layer_state);
matrix_write(matrix, buf);
}
}
void render_status(struct CharacterMatrix *matrix) {
// Render to mode icon
static const char os_logo[][2][3] PROGMEM ={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}};
if(keymap_config.swap_lalt_lgui==false){
matrix_write_P(matrix, os_logo[0][0]);
matrix_write_P(matrix, PSTR("\n"));
matrix_write_P(matrix, os_logo[0][1]);
}else{
matrix_write_P(matrix, os_logo[1][0]);
matrix_write_P(matrix, PSTR("\n"));
matrix_write_P(matrix, os_logo[1][1]);
}
matrix_write_P(matrix, PSTR(" "));
render_layer_status(matrix);
matrix_write_P(matrix, PSTR("\n"));
// Host Keyboard LED Status
char led[40];
snprintf(led, sizeof(led), "\n%s %s %s",
(host_keyboard_leds() & (1<<USB_LED_NUM_LOCK)) ? "NUMLOCK" : " ",
(host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) ? "CAPS" : " ",
(host_keyboard_leds() & (1<<USB_LED_SCROLL_LOCK)) ? "SCLK" : " ");
matrix_write(matrix, led);
matrix_write_P(matrix, (host_keyboard_leds() & (1<<USB_LED_NUM_LOCK)) ?
PSTR("NUMLOCK") : PSTR(" "));
matrix_write_P(matrix, (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) ?
PSTR("CAPS") : PSTR(" "));
matrix_write_P(matrix, (host_keyboard_leds() & (1<<USB_LED_SCROLL_LOCK)) ?
PSTR("SCLK") : PSTR(" "));
matrix_write_P(matrix, PSTR("\n"));
render_rgbled_status(true, matrix);
}
@@ -547,6 +617,8 @@ void iota_gfx_task_user(void) {
render_status(&matrix);
}else{
render_logo(&matrix);
render_rgbled_status(false, &matrix);
render_layer_status(&matrix);
}
matrix_update(&display, &matrix);
}

View File

@@ -6,12 +6,11 @@
# See TOP/docs/config_options.md for more information.
#
LINK_TIME_OPTIMIZATION_ENABLE = no # if firmware size over limit, try this option
AUTO_SHIFT_ENABLE = yes
# Helix Spacific Build Options
# you can uncomment and edit follows 7 Variables
# jp: 以下の7つの変数を必要に応じて編集し、コメントアウトをはずします。
HELIX_ROWS = 4 # Helix Rows is 4 or 5
# HELIX_ROWS = 5 # Helix Rows is 4 or 5
OLED_ENABLE = yes # OLED_ENABLE
# LOCAL_GLCDFONT = no # use each keymaps "helixfont.h" insted of "common/glcdfont.c"
# LED_BACK_ENABLE = no # LED backlight (Enable WS2812 RGB underlight.)

View File

@@ -1,7 +1,7 @@
# Overview
This layout is based on Balance Twelve (mirror variant) by Sasha Viminitz. Please see [this page](https://mathematicalmulticore.wordpress.com/the-keyboard-layout-project/)
for more information. It's designed for left-handers who use their right hand for the mouse.
This layout uses a mirror variant of Balance 12, created by Sasha Viminitz. See [this page](https://mathematicalmulticore.wordpress.com/the-keyboard-layout-project/)
for more information.
## To build
@@ -19,74 +19,14 @@ sudo dfu-programmer atmega32u4 launch
## Layers
### Base:
### Balance 12 base (BA) layer
![Base layer](https://i.imgur.com/I0TkIHT.png)
.--------.-------.-------.-------.--------. .-------.-------.-------.-------.------.
| P | L | C | D | W | | U | O | Y | K | Q |
|--------+-------+-------+-------+--------| |-------+-------+-------+-------+------|
| N | R | S | T | M | | A | E | I | H | V |
|--------+-------+-------+-------+--------| |-------+-------+-------+-------+------|
| Z Sft | J Ctl | F Alt | G | B | | , | . Alt | ; Ctl | X Sft | Sup |
'--------'-------'-------+-------+--------+-----. .-----+-------+-------+-------'-------'------'
| BS P1 | Spc P2 | P3 | | | Sft | |
'-------'--------'-----' '-----'-------'-------'
### Numeric/Punctuation (NP) layer
![Numeric/Punctuation layer](https://i.imgur.com/GgZ0PCq.png)
### P1: Punctuation (1)
### Function/Cursor (FC) layer
![Function/Cursor layer](https://i.imgur.com/zcVID2d.png)
.--------.-------.-------.-------.-------. .------.-------.-------.-------.------.
| Esc | | | | | | | | / | ^ | £ | ~ |
|--------+-------+-------+-------+-------| |------+-------+-------+-------+------|
| Tab | | | | | | & | \ | ` | $ | Ent |
|--------+-------+-------+-------+-------| |------+-------+-------+-------+------|
| Sft | Ctl | Alt | Del | | | % | Alt | Ctl | Sft | Sup |
'--------'-------'-------+-------+-------+-----. .-----+------+-------+-------'-------'------'
| P1 | | | | | Sft | |
'-------'-------'-----' '-----'------'-------'
### P2: Punctuation (2)
.-------.-------.-------.-------.-------. .-------.-------.-------.-------.------.
| Esc | | NC | FV | | | ( | ) | " | ? | |
|-------+-------+-------+-------+-------| |-------+-------+-------+-------+------|
| Tab | Ctl-X | Ctl-C | Ctl-V | Ctl-Z | | { | } | ' | ! | Ent |
|-------+-------+-------+-------+-------| |-------+-------+-------+-------+------|
| Sft | Ctl | Alt | Del | Ent | | # | Alt | Ctl | Sft | Sup |
'-------'-------'-------+-------+-------+-----. .-----+-------+-------+-------'-------'------'
| BS | P2 | | | | Sft | |
'-------'-------'-----' '-----'-------'-------'
### P3: Punctuation (3)
.-------.-------.-------.-------.-------. .------.-------.-------.-------.------.
| Esc | | Break | Pscr | ScLk | | < | > | + | _ | = |
|-------+-------+-------+-------+-------| |------+-------+-------+-------+------|
| Tab | | | Caps | | | [ | ] | * | - | Ent |
|-------+-------+-------+-------+-------| |------+-------+-------+-------+------|
| Sft | Ctl | Alt | Del | | | @ | Alt | Ctl | Sft | Sup |
'-------'-------'-------+-------+-------+-----. .-----+------+-------+-------'-------'------'
| BS | | P3 | | | Sft | |
'-------'-------'-----' '-----'------'-------'
### Numerals / Cursor control
.-------.-------.-------.------.-------. .------.-------.-------.------.------.
| 1 | 2 | 3 | 4 | 5 | | Home | Up | End | PgUp | |
|-------+-------+-------+------+-------| |------+-------+-------+------+------|
| 6 | 7 | 8 | 9 | 0 | | Left | Down | Right | PgDn | |
|-------+-------+-------+------+-------| |------+-------+-------+------+------|
| Sft | Ctl | Alt | Del | . | | Ins | Alt | Ctl | Sft | Sup |
'-------'-------'-------+------+-------+-----. .-----+------+-------+-------'------'------'
| BS | BA | | | | Sft | |
'------'-------'-----' '-----'------'-------'
### FV: Function keys / Cursor control (Vim)
.-------.------.-------.-----.-------. .------.-------.-----.-------.------.
| F1 | F2 | F3 | F4 | F5 | | 0 | K | $ | Ctl-B | |
|-------+------+-------+-----+-------| |------+-------+-----+-------+------|
| F6 | F7 | F8 | F9 | F10 | | H | J | L | Ctl-F | |
|-------+------+-------+-----+-------| |------+-------+-----+-------+------|
| Sft | Ctl | Alt | F11 | F12 | | | Alt | Ctl | Sft | Sup |
'-------'------'-------+-----+-------+-----. .-----+------+-------+-----'-------'------'
| BS | BA | | | | Sft | |
'-----'-------'-----' '-----'------'-------'
### Plover (PL) layer
![Plover layer](https://i.imgur.com/RikOGXe.png)

View File

@@ -1,141 +1,95 @@
#include QMK_KEYBOARD_H
#include "keymap_steno.h"
enum layers {
BA, // Base (Balance Twelve mirror variant)
P1, // Punctuation (1)
P2, // Punctuation (2)
P3, // Punctuation (2)
NC, // Numerals / Cursor control
FV // Function keys / Cursor control (Vim)
_BA, // Base (Balance Twelve mirror variant)
_NP, // Numeric/Punctuation
_FC, // Function
_PL // Plover
};
// Abbreviations - base
#define KX_P1_BSPC LT(P1, KC_BSPC)
#define KX_P2_SPC LT(P2, KC_SPC)
#define KX_SFT_Z MT(MOD_LSFT, KC_Z)
#define KX_CTL_J MT(MOD_LCTL, KC_J)
#define KX_ALT_F MT(MOD_LALT, KC_F)
#define KX_ALT_DOT MT(MOD_LALT, KC_DOT)
#define KX_CTL_SCLN MT(MOD_LCTL, KC_SCLN)
#define KX_SFT_X MT(MOD_LSFT, KC_X)
#define KX_AT LSFT(KC_QUOT)
#define KX_DQUOT LSFT(KC_2)
#define KX_PIPE LSFT(KC_NUBS)
#define KX_TILDA LSFT(KC_NUHS)
// Abbreviations
#define KX_SFT_Z MT(MOD_LSFT, KC_Z)
#define KX_SFT_X MT(MOD_LSFT, KC_X)
#define LT_ESC_FC LT(_FC, KC_ESC)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
.--------.-------.-------.-------.--------. .-------.-------.-------.-------.------.
| P | L | C | D | W | | U | O | Y | K | Q |
|--------+-------+-------+-------+--------| |-------+-------+-------+-------+------|
| N | R | S | T | M | | A | E | I | H | V |
|--------+-------+-------+-------+--------| |-------+-------+-------+-------+------|
| Z Sft | J Ctl | F Alt | G | B | | , | . Alt | ; Ctl | X Sft | Sup |
'--------'-------'-------+-------+--------+-----. .-----+-------+-------+-------'-------'------'
| BS P1 | Spc P2 | P3 | | | Sft | |
'-------'--------'-----' '-----'-------'-------'
*/
[BA] = LAYOUT(
KC_P, KC_L, KC_C, KC_D, KC_W, XXXXXXX, XXXXXXX, KC_U, KC_O, KC_Y, KC_K, KC_Q,
KC_N, KC_R, KC_S, KC_T, KC_M, XXXXXXX, XXXXXXX, KC_A, KC_E, KC_I, KC_H, KC_V,
KX_SFT_Z, KX_CTL_J, KX_ALT_F, KC_G, KC_B, XXXXXXX, XXXXXXX, KC_COMM, KX_ALT_DOT, KX_CTL_SCLN, KX_SFT_X, KC_LGUI,
XXXXXXX, XXXXXXX, XXXXXXX, KX_P1_BSPC, KX_P2_SPC, MO(P3), XXXXXXX, KC_RSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
/* Base
.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.
| P | L | C | D | W | | | U | O | Y | K | Q |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| N | R | S | T | M | | BS | A | E | I | H | V |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| Z Sft | J | F | G | B | | Ent | ' @ | , < | . > | X Sft | |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| Ctl | Alt | Sup | NP | Spc | Esc FC | Sft | Sft | Sup | Alt | Ctl | |
'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'
*/
[_BA] = LAYOUT(
KC_P, KC_L, KC_C, KC_D, KC_W, XXXXXXX, XXXXXXX, KC_U, KC_O, KC_Y, KC_K, KC_Q,
KC_N, KC_R, KC_S, KC_T, KC_M, XXXXXXX, KC_BSPC, KC_A, KC_E, KC_I, KC_H, KC_V,
KX_SFT_Z, KC_J, KC_F, KC_G, KC_B, XXXXXXX, KC_ENT, KC_QUOT, KC_COMM, KC_DOT, KX_SFT_X, XXXXXXX,
KC_LCTL, KC_LALT, KC_LGUI, MO(_NP), KC_SPC, LT_ESC_FC, KC_LSFT, KC_LSFT, KC_LGUI, KC_LALT, KC_LCTL, XXXXXXX
),
/* P1: Punctuation (1)
.--------.-------.-------.-------.-------. .------.-------.-------.-------.------.
| Esc | | | | | | | | / | ^ | £ | ~ |
|--------+-------+-------+-------+-------| |------+-------+-------+-------+------|
| Tab | | | | | | & | \ | ` | $ | Ent |
|--------+-------+-------+-------+-------| |------+-------+-------+-------+------|
| Sft | Ctl | Alt | Del | | | % | Alt | Ctl | Sft | Sup |
'--------'-------'-------+-------+-------+-----. .-----+------+-------+-------'-------'------'
| P1 | | | | | Sft | |
'-------'-------'-----' '-----'------'-------'
*/
[P1] = LAYOUT(
KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KX_PIPE, KC_SLSH, KC_CIRC, KC_HASH, KX_TILDA,
KC_TAB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_AMPR, KC_NUBS, KC_GRV, KC_DLR, KC_ENT,
KC_LSFT, KC_LCTL, KC_LALT, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, KC_PERC, KC_LALT, KC_LCTL, KC_LSFT, _______,
XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
/* Numeric/Punctuation (NP)
.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.
| 1 ! | 2 " | 3 £ | 4 $ | 5 % | PL | | 6 ^ | 7 & | 8 * | 9 ( | 0 ) |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| Tab | Ctl-X | Ctl-C | Ctl-V | Ctl-Z | | | [ { | ] } | - _ | ; : | \ | |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| Sft | | | Del | Ins | | | / ? | = + | # ~ | ` | |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| Ctl | Alt | Sup | NP | Spc | | Sft | Sft | Sup | Alt | Ctl | |
'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'
*/
[_NP] = LAYOUT(
KC_1, KC_2, KC_3, KC_4, KC_5, TO(_PL), XXXXXXX, KC_6, KC_7, KC_8, KC_9, KC_0,
KC_TAB, C(KC_X), C(KC_C), C(KC_V), C(KC_Z), XXXXXXX, _______, KC_LBRC, KC_RBRC, KC_MINS, KC_SCLN, KC_NUBS,
KC_LSFT, XXXXXXX, XXXXXXX, KC_DEL, KC_INS, XXXXXXX, XXXXXXX, KC_SLSH, KC_EQL, KC_NUHS, KC_GRV, XXXXXXX,
_______, _______, _______, _______, _______, XXXXXXX, _______, _______, _______, _______, _______, XXXXXXX
),
/* P2: Punctuation (2)
.-------.-------.-------.-------.-------. .-------.-------.-------.-------.------.
| Esc | | NC | FV | | | ( | ) | " | ? | |
|-------+-------+-------+-------+-------| |-------+-------+-------+-------+------|
| Tab | Ctl-X | Ctl-C | Ctl-V | Ctl-Z | | { | } | ' | ! | Ent |
|-------+-------+-------+-------+-------| |-------+-------+-------+-------+------|
| Sft | Ctl | Alt | Del | Ent | | # | Alt | Ctl | Sft | Sup |
'-------'-------'-------+-------+-------+-----. .-----+-------+-------+-------'-------'------'
| BS | P2 | | | | Sft | |
'-------'-------'-----' '-----'-------'-------'
/* Function/Cursor (FC)
.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.
| F1 | F2 | F3 | F4 | F5 | | | Home | Up | End | PgUp | |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| F6 | F7 | F8 | F9 | F10 | | | Left | Down | Right | PgDn | |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| Sft | | | F11 | F12 | | | PScr | Break | ScLk | Caps | |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| Ctl | Alt | Sup | | Spc | | Sft | Sft | Sup | Alt | Ctl | |
'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'
*/
[P2] = LAYOUT(
KC_ESC, XXXXXXX, TO(NC), TO(FV), XXXXXXX, XXXXXXX, XXXXXXX, KC_LPRN, KC_RPRN, KX_DQUOT, KC_QUES, XXXXXXX,
KC_TAB, LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), LCTL(KC_Z), XXXXXXX, XXXXXXX, KC_LCBR, KC_RCBR, KC_QUOT, KC_EXLM, KC_ENT,
KC_LSFT, KC_LCTL, KC_LALT, KC_DEL, KC_ENT, XXXXXXX, XXXXXXX, KC_NUHS, KC_LALT, KC_LCTL, KC_LSFT, _______,
XXXXXXX, XXXXXXX, XXXXXXX, KC_BSPC, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
[_FC] = LAYOUT(
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_END, KC_PGUP, XXXXXXX,
KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, XXXXXXX,
_______, XXXXXXX, XXXXXXX, KC_F11, KC_F12, XXXXXXX, XXXXXXX, KC_PSCR, KC_BRK, KC_SLCK, KC_CAPS, XXXXXXX,
_______, _______, _______, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, XXXXXXX
),
/* P3: Punctuation (3)
.-------.-------.-------.-------.-------. .------.-------.-------.-------.------.
| Esc | | Break | Pscr | ScLk | | < | > | + | _ | = |
|-------+-------+-------+-------+-------| |------+-------+-------+-------+------|
| Tab | | | Caps | | | [ | ] | * | - | Ent |
|-------+-------+-------+-------+-------| |------+-------+-------+-------+------|
| Sft | Ctl | Alt | Del | | | @ | Alt | Ctl | Sft | Sup |
'-------'-------'-------+-------+-------+-----. .-----+------+-------+-------'-------'------'
| BS | | P3 | | | Sft | |
'-------'-------'-----' '-----'------'-------'
/* Plover (PL)
.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.--------.
| # | # | # | # | # | BA | # | # | # | # | # | # |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| S | T | P | H | * | | * | F | P | L | T | D |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| S | K | W | R | * | | * | R | B | G | S | Z |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| | | | A | O | | E | U | | | | |
'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'--------'
*/
[P3] = LAYOUT(
KC_ESC, XXXXXXX, KC_BRK, KC_PSCR, KC_SLCK, XXXXXXX, XXXXXXX, KC_LABK, KC_RABK, KC_PLUS, KC_UNDS, KC_EQL,
KC_TAB, XXXXXXX, XXXXXXX, KC_CAPS, XXXXXXX, XXXXXXX, XXXXXXX, KC_LBRC, KC_RBRC, KC_ASTR, KC_MINS, KC_ENT,
KC_LSFT, KC_LCTL, KC_LALT, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, KX_AT, KC_LALT, KC_LCTL, KC_LSFT, _______,
XXXXXXX, XXXXXXX, XXXXXXX, KC_BSPC, XXXXXXX, _______, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
),
/* NC: Numerals / Cursor control
.-------.-------.-------.------.-------. .------.-------.-------.------.------.
| 1 | 2 | 3 | 4 | 5 | | Home | Up | End | PgUp | |
|-------+-------+-------+------+-------| |------+-------+-------+------+------|
| 6 | 7 | 8 | 9 | 0 | | Left | Down | Right | PgDn | |
|-------+-------+-------+------+-------| |------+-------+-------+------+------|
| Sft | Ctl | Alt | Del | . | | Ins | Alt | Ctl | Sft | Sup |
'-------'-------'-------+------+-------+-----. .-----+------+-------+-------'------'------'
| BS | BA | | | | Sft | |
'------'-------'-----' '-----'------'-------'
*/
[NC] = LAYOUT(
KC_1, KC_2, KC_3, KC_4, KC_5, XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_END, KC_PGUP, XXXXXXX,
KC_6, KC_7, KC_8, KC_9, KC_0, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, XXXXXXX,
KC_LSFT, KC_LCTL, KC_LALT, KC_DEL, KC_DOT, XXXXXXX, XXXXXXX, KC_INS, KC_LALT, KC_LCTL, KC_LSFT, _______,
XXXXXXX, XXXXXXX, XXXXXXX, KC_BSPC, TO(BA), XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
),
/* FV: Function keys / Cursor control (Vim)
.-------.------.-------.-----.-------. .------.-------.-----.-------.------.
| F1 | F2 | F3 | F4 | F5 | | 0 | K | $ | Ctl-B | |
|-------+------+-------+-----+-------| |------+-------+-----+-------+------|
| F6 | F7 | F8 | F9 | F10 | | H | J | L | Ctl-F | |
|-------+------+-------+-----+-------| |------+-------+-----+-------+------|
| Sft | Ctl | Alt | F11 | F12 | | | Alt | Ctl | Sft | Sup |
'-------'------'-------+-----+-------+-----. .-----+------+-------+-----'-------'------'
| BS | BA | | | | Sft | |
'-----'-------'-----' '-----'------'-------'
*/
[FV] = LAYOUT(
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, XXXXXXX, XXXXXXX, KC_0, KC_K, KC_DLR, LCTL(KC_B), XXXXXXX,
KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, XXXXXXX, KC_H, KC_J, KC_L, LCTL(KC_F), XXXXXXX,
KC_LSFT, KC_LCTL, KC_LALT, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, KC_LALT, KC_LCTL, KC_LSFT, _______,
XXXXXXX, XXXXXXX, XXXXXXX, KC_BSPC, TO(BA), XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
[_PL] = LAYOUT(
STN_NUM, STN_NUM, STN_NUM, STN_NUM, STN_NUM, TO(_BA), STN_NUM, STN_NUM, STN_NUM, STN_NUM, STN_NUM, STN_NUM,
STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, XXXXXXX, STN_ST1, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR,
STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, XXXXXXX, STN_ST2, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR,
XXXXXXX, XXXXXXX, XXXXXXX, STN_A, STN_O, XXXXXXX, STN_E, STN_U, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
)
};
void matrix_init_user() {
steno_set_mode(STENO_MODE_GEMINI);
}

View File

@@ -6,5 +6,5 @@ MIDI_ENABLE = no
MOUSEKEY_ENABLE = no
NKRO_ENABLE = yes
RGBLIGHT_ENABLE = no
STENO_ENABLE = no
VIRTSER_ENABLE = no
STENO_ENABLE = yes
VIRTSER_ENABLE = yes

View File

@@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
#define VENDOR_ID 0x4B36 // K6 - ok60
#define PRODUCT_ID 0x6060
#define DEVICE_VER 0x0001
#define MANUFACTURER OK60

View File

@@ -0,0 +1,36 @@
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_60_ansi(
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_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_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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL
),
[1] = LAYOUT_60_ansi(
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, KC_DEL,
_______, RGB_TOG, KC_UP, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______,
_______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, BL_DEC, BL_TOGG, BL_INC, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______
),
[2] = LAYOUT_60_ansi(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______
),
[3] = LAYOUT_60_ansi(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______
),
};

View File

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

161
lib/python/qmk/c_parse.py Normal file
View File

@@ -0,0 +1,161 @@
"""Functions for working with config.h files.
"""
from pathlib import Path
from milc import cli
from qmk.comment_remover import comment_remover
default_key_entry = {'x': -1, 'y': 0, 'w': 1}
def c_source_files(dir_names):
"""Returns a list of all *.c, *.h, and *.cpp files for a given list of directories
Args:
dir_names
List of directories relative to `qmk_firmware`.
"""
files = []
for dir in dir_names:
files.extend(file for file in Path(dir).glob('**/*') if file.suffix in ['.c', '.h', '.cpp'])
return files
def find_layouts(file):
"""Returns list of parsed LAYOUT preprocessor macros found in the supplied include file.
"""
file = Path(file)
aliases = {} # Populated with all `#define`s that aren't functions
parsed_layouts = {}
# Search the file for LAYOUT macros and aliases
file_contents = file.read_text()
file_contents = comment_remover(file_contents)
file_contents = file_contents.replace('\\\n', '')
for line in file_contents.split('\n'):
if line.startswith('#define') and '(' in line and 'LAYOUT' in line:
# We've found a LAYOUT macro
macro_name, layout, matrix = _parse_layout_macro(line.strip())
# Reject bad macro names
if macro_name.startswith('LAYOUT_kc') or not macro_name.startswith('LAYOUT'):
continue
# Parse the matrix data
matrix_locations = _parse_matrix_locations(matrix, file, macro_name)
# Parse the layout entries into a basic structure
default_key_entry['x'] = -1 # Set to -1 so _default_key(key) will increment it to 0
layout = layout.strip()
parsed_layout = [_default_key(key) for key in layout.split(',')]
for key in parsed_layout:
key['matrix'] = matrix_locations.get(key['label'])
parsed_layouts[macro_name] = {
'key_count': len(parsed_layout),
'layout': parsed_layout,
'filename': str(file),
}
elif '#define' in line:
# Attempt to extract a new layout alias
try:
_, pp_macro_name, pp_macro_text = line.strip().split(' ', 2)
aliases[pp_macro_name] = pp_macro_text
except ValueError:
continue
# Populate our aliases
for alias, text in aliases.items():
if text in parsed_layouts and 'KEYMAP' not in alias:
parsed_layouts[alias] = parsed_layouts[text]
return parsed_layouts
def parse_config_h_file(config_h_file, config_h=None):
"""Extract defines from a config.h file.
"""
if not config_h:
config_h = {}
config_h_file = Path(config_h_file)
if config_h_file.exists():
config_h_text = config_h_file.read_text()
config_h_text = config_h_text.replace('\\\n', '')
for linenum, line in enumerate(config_h_text.split('\n')):
line = line.strip()
if '//' in line:
line = line[:line.index('//')].strip()
if not line:
continue
line = line.split()
if line[0] == '#define':
if len(line) == 1:
cli.log.error('%s: Incomplete #define! On or around line %s' % (config_h_file, linenum))
elif len(line) == 2:
config_h[line[1]] = True
else:
config_h[line[1]] = ' '.join(line[2:])
elif line[0] == '#undef':
if len(line) == 2:
if line[1] in config_h:
if config_h[line[1]] is True:
del config_h[line[1]]
else:
config_h[line[1]] = False
else:
cli.log.error('%s: Incomplete #undef! On or around line %s' % (config_h_file, linenum))
return config_h
def _default_key(label=None):
"""Increment x and return a copy of the default_key_entry.
"""
default_key_entry['x'] += 1
new_key = default_key_entry.copy()
if label:
new_key['label'] = label
return new_key
def _parse_layout_macro(layout_macro):
"""Split the LAYOUT macro into its constituent parts
"""
layout_macro = layout_macro.replace('\\', '').replace(' ', '').replace('\t', '').replace('#define', '')
macro_name, layout = layout_macro.split('(', 1)
layout, matrix = layout.split(')', 1)
return macro_name, layout, matrix
def _parse_matrix_locations(matrix, file, macro_name):
"""Parse raw matrix data into a dictionary keyed by the LAYOUT identifier.
"""
matrix_locations = {}
for row_num, row in enumerate(matrix.split('},{')):
if row.startswith('LAYOUT'):
cli.log.error('%s: %s: Nested layout macro detected. Matrix data not available!', file, macro_name)
break
row = row.replace('{', '').replace('}', '')
for col_num, identifier in enumerate(row.split(',')):
if identifier != 'KC_NO':
matrix_locations[identifier] = (row_num, col_num)
return matrix_locations

View File

@@ -13,6 +13,7 @@ from . import docs
from . import doctor
from . import flash
from . import hello
from . import info
from . import json
from . import json2c
from . import list

View File

@@ -4,7 +4,9 @@ import subprocess
from shutil import which
from milc import cli
import qmk.path
from qmk.path import normpath
from qmk.c_parse import c_source_files
def cformat_run(files, all_files):
@@ -45,10 +47,10 @@ def cformat(cli):
ignores = ['tmk_core/protocol/usb_hid', 'quantum/template']
# Find the list of files to format
if cli.args.files:
files.extend(qmk.path.normpath(file) for file in cli.args.files)
files.extend(normpath(file) for file in cli.args.files)
# If -a is specified
elif cli.args.all_files:
all_files = qmk.path.c_source_files(core_dirs)
all_files = c_source_files(core_dirs)
# The following statement checks each file to see if the file path is in the ignored directories.
files.extend(file for file in all_files if not any(i in str(file) for i in ignores))
# No files specified & no -a flag
@@ -56,7 +58,7 @@ def cformat(cli):
base_args = ['git', 'diff', '--name-only', cli.args.base_branch]
out = subprocess.run(base_args + core_dirs, check=True, stdout=subprocess.PIPE)
changed_files = filter(None, out.stdout.decode('UTF-8').split('\n'))
filtered_files = [qmk.path.normpath(file) for file in changed_files if not any(i in file for i in ignores)]
filtered_files = [normpath(file) for file in changed_files if not any(i in file for i in ignores)]
files.extend(file for file in filtered_files if file.exists() and file.suffix in ['.c', '.h', '.cpp'])
# Run clang-format on the files we've found

141
lib/python/qmk/cli/info.py Executable file
View File

@@ -0,0 +1,141 @@
"""Keyboard information script.
Compile an info.json for a particular keyboard and pretty-print it.
"""
import json
from milc import cli
from qmk.decorators import automagic_keyboard, automagic_keymap
from qmk.keyboard import render_layouts, render_layout
from qmk.keymap import locate_keymap
from qmk.info import info_json
from qmk.path import is_keyboard
ROW_LETTERS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnop'
COL_LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijilmnopqrstuvwxyz'
def show_keymap(info_json, title_caps=True):
"""Render the keymap in ascii art.
"""
keymap_path = locate_keymap(cli.config.info.keyboard, cli.config.info.keymap)
if keymap_path and keymap_path.suffix == '.json':
if title_caps:
cli.echo('{fg_blue}Keymap "%s"{fg_reset}:', cli.config.info.keymap)
else:
cli.echo('{fg_blue}keymap_%s{fg_reset}:', cli.config.info.keymap)
keymap_data = json.load(keymap_path.open())
layout_name = keymap_data['layout']
for layer_num, layer in enumerate(keymap_data['layers']):
if title_caps:
cli.echo('{fg_cyan}Layer %s{fg_reset}:', layer_num)
else:
cli.echo('{fg_cyan}layer_%s{fg_reset}:', layer_num)
print(render_layout(info_json['layouts'][layout_name]['layout'], layer))
def show_layouts(kb_info_json, title_caps=True):
"""Render the layouts with info.json labels.
"""
for layout_name, layout_art in render_layouts(kb_info_json).items():
title = layout_name.title() if title_caps else layout_name
cli.echo('{fg_cyan}%s{fg_reset}:', title)
print(layout_art) # Avoid passing dirty data to cli.echo()
def show_matrix(info_json, title_caps=True):
"""Render the layout with matrix labels in ascii art.
"""
for layout_name, layout in info_json['layouts'].items():
# Build our label list
labels = []
for key in layout['layout']:
if key['matrix']:
row = ROW_LETTERS[key['matrix'][0]]
col = COL_LETTERS[key['matrix'][1]]
labels.append(row + col)
else:
labels.append('')
# Print the header
if title_caps:
cli.echo('{fg_blue}Matrix for "%s"{fg_reset}:', layout_name)
else:
cli.echo('{fg_blue}matrix_%s{fg_reset}:', layout_name)
print(render_layout(info_json['layouts'][layout_name]['layout'], labels))
@cli.argument('-kb', '--keyboard', help='Keyboard to show info for.')
@cli.argument('-km', '--keymap', help='Show the layers for a JSON keymap too.')
@cli.argument('-l', '--layouts', action='store_true', help='Render the layouts.')
@cli.argument('-m', '--matrix', action='store_true', help='Render the layouts with matrix information.')
@cli.argument('-f', '--format', default='friendly', arg_only=True, help='Format to display the data in (friendly, text, json) (Default: friendly).')
@cli.subcommand('Keyboard information.')
@automagic_keyboard
@automagic_keymap
def info(cli):
"""Compile an info.json for a particular keyboard and pretty-print it.
"""
# Determine our keyboard(s)
if not is_keyboard(cli.config.info.keyboard):
cli.log.error('Invalid keyboard: %s!', cli.config.info.keyboard)
exit(1)
# Build the info.json file
kb_info_json = info_json(cli.config.info.keyboard)
# Output in the requested format
if cli.args.format == 'json':
print(json.dumps(kb_info_json))
exit()
if cli.args.format == 'text':
for key in sorted(kb_info_json):
if key == 'layouts':
cli.echo('{fg_blue}layouts{fg_reset}: %s', ', '.join(sorted(kb_info_json['layouts'].keys())))
else:
cli.echo('{fg_blue}%s{fg_reset}: %s', key, kb_info_json[key])
if cli.config.info.layouts:
show_layouts(kb_info_json, False)
if cli.config.info.matrix:
show_matrix(kb_info_json, False)
if cli.config_source.info.keymap and cli.config_source.info.keymap != 'config_file':
show_keymap(kb_info_json, False)
elif cli.args.format == 'friendly':
cli.echo('{fg_blue}Keyboard Name{fg_reset}: %s', kb_info_json.get('keyboard_name', 'Unknown'))
cli.echo('{fg_blue}Manufacturer{fg_reset}: %s', kb_info_json.get('manufacturer', 'Unknown'))
if 'url' in kb_info_json:
cli.echo('{fg_blue}Website{fg_reset}: %s', kb_info_json['url'])
if kb_info_json.get('maintainer') == 'qmk':
cli.echo('{fg_blue}Maintainer{fg_reset}: QMK Community')
else:
cli.echo('{fg_blue}Maintainer{fg_reset}: %s', kb_info_json.get('maintainer', 'qmk'))
cli.echo('{fg_blue}Keyboard Folder{fg_reset}: %s', kb_info_json.get('keyboard_folder', 'Unknown'))
cli.echo('{fg_blue}Layouts{fg_reset}: %s', ', '.join(sorted(kb_info_json['layouts'].keys())))
if 'width' in kb_info_json and 'height' in kb_info_json:
cli.echo('{fg_blue}Size{fg_reset}: %s x %s' % (kb_info_json['width'], kb_info_json['height']))
cli.echo('{fg_blue}Processor{fg_reset}: %s', kb_info_json.get('processor', 'Unknown'))
cli.echo('{fg_blue}Bootloader{fg_reset}: %s', kb_info_json.get('bootloader', 'Unknown'))
if cli.config.info.layouts:
show_layouts(kb_info_json, True)
if cli.config.info.matrix:
show_matrix(kb_info_json, True)
if cli.config_source.info.keymap and cli.config_source.info.keymap != 'config_file':
show_keymap(kb_info_json, True)
else:
cli.log.error('Unknown format: %s', cli.args.format)

View File

@@ -18,19 +18,19 @@ def json2c(cli):
This command uses the `qmk.keymap` module to generate a keymap.c from a configurator export. The generated keymap is written to stdout, or to a file if -o is provided.
"""
# Error checking
if not cli.args.filename.exists():
cli.log.error('JSON file does not exist!')
cli.print_usage()
exit(1)
if cli.args.filename.name == '-':
if cli.args.filename and cli.args.filename.name == '-':
# TODO(skullydazed/anyone): Read file contents from STDIN
cli.log.error('Reading from STDIN is not (yet) supported.')
cli.print_usage()
exit(1)
if not cli.args.filename.exists():
cli.log.error('JSON file does not exist!')
cli.print_usage()
exit(1)
# Environment processing
if cli.args.output.name == ('-'):
if cli.args.output and cli.args.output.name == '-':
cli.args.output = None
# Parse the configurator json

View File

@@ -4,7 +4,7 @@ from milc import cli
import qmk.keymap
from qmk.decorators import automagic_keyboard
from qmk.errors import NoSuchKeyboardError
from qmk.path import is_keyboard
@cli.argument("-kb", "--keyboard", help="Specify keyboard name. Example: 1upkeyboards/1up60hse")
@@ -13,13 +13,9 @@ from qmk.errors import NoSuchKeyboardError
def list_keymaps(cli):
"""List the keymaps for a specific keyboard
"""
try:
for name in qmk.keymap.list_keymaps(cli.config.list_keymaps.keyboard):
# We echo instead of cli.log.info to allow easier piping of this output
cli.echo('%s', name)
except NoSuchKeyboardError as e:
cli.echo("{fg_red}%s: %s", cli.config.list_keymaps.keyboard, e.message)
except (FileNotFoundError, PermissionError) as e:
cli.echo("{fg_red}%s: %s", cli.config.list_keymaps.keyboard, e)
except TypeError:
cli.echo("{fg_red}Something went wrong. Did you specify a keyboard?")
if not is_keyboard(cli.config.list_keymaps.keyboard):
cli.log.error('Keyboard %s does not exist!', cli.config.list_keymaps.keyboard)
exit(1)
for name in qmk.keymap.list_keymaps(cli.config.list_keymaps.keyboard):
print(name)

View File

@@ -64,6 +64,7 @@ def compile_configurator_json(user_keymap, bootloader=None):
def parse_configurator_json(configurator_file):
"""Open and parse a configurator json export
"""
# FIXME(skullydazed/anyone): Add validation here
user_keymap = json.load(configurator_file)
return user_keymap

View File

@@ -0,0 +1,20 @@
"""Removes C/C++ style comments from text.
Gratefully adapted from https://stackoverflow.com/a/241506
"""
import re
comment_pattern = re.compile(r'//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"', re.DOTALL | re.MULTILINE)
def _comment_stripper(match):
"""Removes C/C++ style comments from a regex match.
"""
s = match.group(0)
return ' ' if s.startswith('/') else s
def comment_remover(text):
"""Remove C/C++ style comments from text.
"""
return re.sub(comment_pattern, _comment_stripper, text)

View File

@@ -7,3 +7,9 @@ QMK_FIRMWARE = Path.cwd()
# This is the number of directories under `qmk_firmware/keyboards` that will be traversed. This is currently a limitation of our make system.
MAX_KEYBOARD_SUBFOLDERS = 5
# Supported processor types
ARM_PROCESSORS = 'cortex-m0', 'cortex-m0plus', 'cortex-m3', 'cortex-m4', 'MKL26Z64', 'MK20DX128', 'MK20DX256', 'STM32F042', 'STM32F072', 'STM32F103', 'STM32F303'
AVR_PROCESSORS = 'at90usb1286', 'at90usb646', 'atmega16u2', 'atmega328p', 'atmega32a', 'atmega32u2', 'atmega32u4', None
ALL_PROCESSORS = ARM_PROCESSORS + AVR_PROCESSORS
VUSB_PROCESSORS = 'atmega328p', 'atmega32a'

View File

@@ -5,7 +5,8 @@ from pathlib import Path
from milc import cli
from qmk.path import is_keyboard, is_keymap_dir, under_qmk_firmware
from qmk.keymap import is_keymap_dir
from qmk.path import is_keyboard, under_qmk_firmware
def automagic_keyboard(func):
@@ -67,18 +68,18 @@ def automagic_keymap(func):
while current_path.parent.name != 'keymaps':
current_path = current_path.parent
cli.config[cli._entrypoint.__name__]['keymap'] = current_path.name
cli.config_source[cli._entrypoint.__name__]['keyboard'] = 'keymap_directory'
cli.config_source[cli._entrypoint.__name__]['keymap'] = 'keymap_directory'
# If we're in `qmk_firmware/layouts` guess the name from the community keymap they're in
elif relative_cwd.parts[0] == 'layouts' and is_keymap_dir(relative_cwd):
cli.config[cli._entrypoint.__name__]['keymap'] = relative_cwd.name
cli.config_source[cli._entrypoint.__name__]['keyboard'] = 'layouts_directory'
cli.config_source[cli._entrypoint.__name__]['keymap'] = 'layouts_directory'
# If we're in `qmk_firmware/users` guess the name from the userspace they're in
elif relative_cwd.parts[0] == 'users':
# Guess the keymap name based on which userspace they're in
cli.config[cli._entrypoint.__name__]['keymap'] = relative_cwd.parts[1]
cli.config_source[cli._entrypoint.__name__]['keyboard'] = 'users_directory'
cli.config_source[cli._entrypoint.__name__]['keymap'] = 'users_directory'
return func(*args, **kwargs)

249
lib/python/qmk/info.py Normal file
View File

@@ -0,0 +1,249 @@
"""Functions that help us generate and use info.json files.
"""
import json
from glob import glob
from pathlib import Path
from milc import cli
from qmk.constants import ARM_PROCESSORS, AVR_PROCESSORS, VUSB_PROCESSORS
from qmk.c_parse import find_layouts
from qmk.keyboard import config_h, rules_mk
from qmk.math import compute
def info_json(keyboard):
"""Generate the info.json data for a specific keyboard.
"""
info_data = {
'keyboard_name': str(keyboard),
'keyboard_folder': str(keyboard),
'layouts': {},
'maintainer': 'qmk',
}
for layout_name, layout_json in _find_all_layouts(keyboard).items():
if not layout_name.startswith('LAYOUT_kc'):
info_data['layouts'][layout_name] = layout_json
info_data = merge_info_jsons(keyboard, info_data)
info_data = _extract_config_h(info_data)
info_data = _extract_rules_mk(info_data)
return info_data
def _extract_config_h(info_data):
"""Pull some keyboard information from existing rules.mk files
"""
config_c = config_h(info_data['keyboard_folder'])
row_pins = config_c.get('MATRIX_ROW_PINS', '').replace('{', '').replace('}', '').strip()
col_pins = config_c.get('MATRIX_COL_PINS', '').replace('{', '').replace('}', '').strip()
direct_pins = config_c.get('DIRECT_PINS', '').replace(' ', '')[1:-1]
info_data['diode_direction'] = config_c.get('DIODE_DIRECTION')
info_data['matrix_size'] = {
'rows': compute(config_c.get('MATRIX_ROWS', '0')),
'cols': compute(config_c.get('MATRIX_COLS', '0')),
}
info_data['matrix_pins'] = {}
if row_pins:
info_data['matrix_pins']['rows'] = row_pins.split(',')
if col_pins:
info_data['matrix_pins']['cols'] = col_pins.split(',')
if direct_pins:
direct_pin_array = []
for row in direct_pins.split('},{'):
if row.startswith('{'):
row = row[1:]
if row.endswith('}'):
row = row[:-1]
direct_pin_array.append([])
for pin in row.split(','):
if pin == 'NO_PIN':
pin = None
direct_pin_array[-1].append(pin)
info_data['matrix_pins']['direct'] = direct_pin_array
info_data['usb'] = {
'vid': config_c.get('VENDOR_ID'),
'pid': config_c.get('PRODUCT_ID'),
'device_ver': config_c.get('DEVICE_VER'),
'manufacturer': config_c.get('MANUFACTURER'),
'product': config_c.get('PRODUCT'),
'description': config_c.get('DESCRIPTION'),
}
return info_data
def _extract_rules_mk(info_data):
"""Pull some keyboard information from existing rules.mk files
"""
rules = rules_mk(info_data['keyboard_folder'])
mcu = rules.get('MCU')
if mcu in ARM_PROCESSORS:
arm_processor_rules(info_data, rules)
elif mcu in AVR_PROCESSORS:
avr_processor_rules(info_data, rules)
else:
cli.log.warning("%s: Unknown MCU: %s" % (info_data['keyboard_folder'], mcu))
unknown_processor_rules(info_data, rules)
return info_data
def _find_all_layouts(keyboard):
"""Looks for layout macros associated with this keyboard.
"""
layouts = {}
rules = rules_mk(keyboard)
keyboard_path = Path(rules.get('DEFAULT_FOLDER', keyboard))
# Pull in all layouts defined in the standard files
current_path = Path('keyboards/')
for directory in keyboard_path.parts:
current_path = current_path / directory
keyboard_h = '%s.h' % (directory,)
keyboard_h_path = current_path / keyboard_h
if keyboard_h_path.exists():
layouts.update(find_layouts(keyboard_h_path))
if not layouts:
# If we didn't find any layouts above we widen our search. This is error
# prone which is why we want to encourage people to follow the standard above.
cli.log.warning('%s: Falling back to searching for KEYMAP/LAYOUT macros.' % (keyboard))
for file in glob('keyboards/%s/*.h' % keyboard):
if file.endswith('.h'):
these_layouts = find_layouts(file)
if these_layouts:
layouts.update(these_layouts)
if 'LAYOUTS' in rules:
# Match these up against the supplied layouts
supported_layouts = rules['LAYOUTS'].strip().split()
for layout_name in sorted(layouts):
if not layout_name.startswith('LAYOUT_'):
continue
layout_name = layout_name[7:]
if layout_name in supported_layouts:
supported_layouts.remove(layout_name)
if supported_layouts:
cli.log.error('%s: Missing LAYOUT() macro for %s' % (keyboard, ', '.join(supported_layouts)))
return layouts
def arm_processor_rules(info_data, rules):
"""Setup the default info for an ARM board.
"""
info_data['processor_type'] = 'arm'
info_data['bootloader'] = rules['BOOTLOADER'] if 'BOOTLOADER' in rules else 'unknown'
info_data['processor'] = rules['MCU'] if 'MCU' in rules else 'unknown'
info_data['protocol'] = 'ChibiOS'
if info_data['bootloader'] == 'unknown':
if 'STM32' in info_data['processor']:
info_data['bootloader'] = 'stm32-dfu'
elif info_data.get('manufacturer') == 'Input Club':
info_data['bootloader'] = 'kiibohd-dfu'
if 'STM32' in info_data['processor']:
info_data['platform'] = 'STM32'
elif 'MCU_SERIES' in rules:
info_data['platform'] = rules['MCU_SERIES']
elif 'ARM_ATSAM' in rules:
info_data['platform'] = 'ARM_ATSAM'
return info_data
def avr_processor_rules(info_data, rules):
"""Setup the default info for an AVR board.
"""
info_data['processor_type'] = 'avr'
info_data['bootloader'] = rules['BOOTLOADER'] if 'BOOTLOADER' in rules else 'atmel-dfu'
info_data['platform'] = rules['ARCH'] if 'ARCH' in rules else 'unknown'
info_data['processor'] = rules['MCU'] if 'MCU' in rules else 'unknown'
info_data['protocol'] = 'V-USB' if rules.get('MCU') in VUSB_PROCESSORS else 'LUFA'
# FIXME(fauxpark/anyone): Eventually we should detect the protocol by looking at PROTOCOL inherited from mcu_selection.mk:
# info_data['protocol'] = 'V-USB' if rules.get('PROTOCOL') == 'VUSB' else 'LUFA'
return info_data
def unknown_processor_rules(info_data, rules):
"""Setup the default keyboard info for unknown boards.
"""
info_data['bootloader'] = 'unknown'
info_data['platform'] = 'unknown'
info_data['processor'] = 'unknown'
info_data['processor_type'] = 'unknown'
info_data['protocol'] = 'unknown'
return info_data
def merge_info_jsons(keyboard, info_data):
"""Return a merged copy of all the info.json files for a keyboard.
"""
for info_file in find_info_json(keyboard):
# Load and validate the JSON data
with info_file.open('r') as info_fd:
new_info_data = json.load(info_fd)
if not isinstance(new_info_data, dict):
cli.log.error("Invalid file %s, root object should be a dictionary.", str(info_file))
continue
# Copy whitelisted keys into `info_data`
for key in ('keyboard_name', 'manufacturer', 'identifier', 'url', 'maintainer', 'processor', 'bootloader', 'width', 'height'):
if key in new_info_data:
info_data[key] = new_info_data[key]
# Merge the layouts in
if 'layouts' in new_info_data:
for layout_name, json_layout in new_info_data['layouts'].items():
# Only pull in layouts we have a macro for
if layout_name in info_data['layouts']:
if info_data['layouts'][layout_name]['key_count'] != len(json_layout['layout']):
cli.log.error('%s: %s: Number of elements in info.json does not match! info.json:%s != %s:%s', info_data['keyboard_folder'], layout_name, len(json_layout['layout']), layout_name, len(info_data['layouts'][layout_name]['layout']))
else:
for i, key in enumerate(info_data['layouts'][layout_name]['layout']):
key.update(json_layout['layout'][i])
return info_data
def find_info_json(keyboard):
"""Finds all the info.json files associated with a keyboard.
"""
# Find the most specific first
base_path = Path('keyboards')
keyboard_path = base_path / keyboard
keyboard_parent = keyboard_path.parent
info_jsons = [keyboard_path / 'info.json']
# Add DEFAULT_FOLDER before parents, if present
rules = rules_mk(keyboard)
if 'DEFAULT_FOLDER' in rules:
info_jsons.append(Path(rules['DEFAULT_FOLDER']) / 'info.json')
# Add in parent folders for least specific
for _ in range(5):
info_jsons.append(keyboard_parent / 'info.json')
if keyboard_parent.parent == base_path:
break
keyboard_parent = keyboard_parent.parent
# Return a list of the info.json files that actually exist
return [info_json for info_json in info_jsons if info_json.exists()]

111
lib/python/qmk/keyboard.py Normal file
View File

@@ -0,0 +1,111 @@
"""Functions that help us work with keyboards.
"""
from array import array
from math import ceil
from pathlib import Path
from qmk.c_parse import parse_config_h_file
from qmk.makefile import parse_rules_mk_file
def config_h(keyboard):
"""Parses all the config.h files for a keyboard.
Args:
keyboard: name of the keyboard
Returns:
a dictionary representing the content of the entire config.h tree for a keyboard
"""
config = {}
cur_dir = Path('keyboards')
rules = rules_mk(keyboard)
keyboard = Path(rules['DEFAULT_FOLDER'] if 'DEFAULT_FOLDER' in rules else keyboard)
for dir in keyboard.parts:
cur_dir = cur_dir / dir
config = {**config, **parse_config_h_file(cur_dir / 'config.h')}
return config
def rules_mk(keyboard):
"""Get a rules.mk for a keyboard
Args:
keyboard: name of the keyboard
Returns:
a dictionary representing the content of the entire rules.mk tree for a keyboard
"""
keyboard = Path(keyboard)
cur_dir = Path('keyboards')
rules = parse_rules_mk_file(cur_dir / keyboard / 'rules.mk')
if 'DEFAULT_FOLDER' in rules:
keyboard = Path(rules['DEFAULT_FOLDER'])
for i, dir in enumerate(keyboard.parts):
cur_dir = cur_dir / dir
rules = parse_rules_mk_file(cur_dir / 'rules.mk', rules)
return rules
def render_layout(layout_data, key_labels=None):
"""Renders a single layout.
"""
textpad = [array('u', ' ' * 200) for x in range(50)]
for key in layout_data:
x = ceil(key.get('x', 0) * 4)
y = ceil(key.get('y', 0) * 3)
w = ceil(key.get('w', 1) * 4)
h = ceil(key.get('h', 1) * 3)
if key_labels:
label = key_labels.pop(0)
if label.startswith('KC_'):
label = label[3:]
else:
label = key.get('label', '')
label_len = w - 2
label_leftover = label_len - len(label)
if len(label) > label_len:
label = label[:label_len]
label_blank = ' ' * label_len
label_border = '' * label_len
label_middle = label + ' '*label_leftover # noqa: yapf insists there be no whitespace around *
top_line = array('u', '' + label_border + '')
lab_line = array('u', '' + label_middle + '')
mid_line = array('u', '' + label_blank + '')
bot_line = array('u', '' + label_border + "")
textpad[y][x:x + w] = top_line
textpad[y + 1][x:x + w] = lab_line
for i in range(h - 3):
textpad[y + i + 2][x:x + w] = mid_line
textpad[y + h - 1][x:x + w] = bot_line
lines = []
for line in textpad:
if line.tounicode().strip():
lines.append(line.tounicode().rstrip())
return '\n'.join(lines)
def render_layouts(info_json):
"""Renders all the layouts from an `info_json` structure.
"""
layouts = {}
for layout in info_json['layouts']:
layout_data = info_json['layouts'][layout]['layout']
layouts[layout] = render_layout(layout_data)
return layouts

View File

@@ -2,8 +2,8 @@
"""
from pathlib import Path
from qmk.keyboard import rules_mk
import qmk.path
import qmk.makefile
# The `keymap.c` template to use when a keyboard doesn't have its own
DEFAULT_KEYMAP_C = """#include QMK_KEYBOARD_H
@@ -47,6 +47,14 @@ def _strip_any(keycode):
return keycode
def is_keymap_dir(keymap):
"""Return True if Path object `keymap` has a keymap file inside.
"""
for file in ('keymap.c', 'keymap.json'):
if (keymap / file).is_file():
return True
def generate(keyboard, layout, layers):
"""Returns a keymap.c for the specified keyboard, layout, and layers.
@@ -95,7 +103,7 @@ def write(keyboard, keymap, layout, layers):
An array of arrays describing the keymap. Each item in the inner array should be a string that is a valid QMK keycode.
"""
keymap_c = generate(keyboard, layout, layers)
keymap_file = qmk.path.keymap(keyboard) / keymap / 'keymap.c'
keymap_file = qmk.path.keymap(keyboard) / 'keymap.c'
keymap_file.parent.mkdir(parents=True, exist_ok=True)
keymap_file.write_text(keymap_c)
@@ -103,37 +111,76 @@ def write(keyboard, keymap, layout, layers):
return keymap_file
def list_keymaps(keyboard_name):
def locate_keymap(keyboard, keymap):
"""Returns the path to a keymap for a specific keyboard.
"""
if not qmk.path.is_keyboard(keyboard):
raise KeyError('Invalid keyboard: ' + repr(keyboard))
# Check the keyboard folder first, last match wins
checked_dirs = ''
keymap_path = ''
for dir in keyboard.split('/'):
if checked_dirs:
checked_dirs = '/'.join((checked_dirs, dir))
else:
checked_dirs = dir
keymap_dir = Path('keyboards') / checked_dirs / 'keymaps'
if (keymap_dir / keymap / 'keymap.c').exists():
keymap_path = keymap_dir / keymap / 'keymap.c'
if (keymap_dir / keymap / 'keymap.json').exists():
keymap_path = keymap_dir / keymap / 'keymap.json'
if keymap_path:
return keymap_path
# Check community layouts as a fallback
rules = rules_mk(keyboard)
if "LAYOUTS" in rules:
for layout in rules["LAYOUTS"].split():
community_layout = Path('layouts/community') / layout / keymap
if community_layout.exists():
if (community_layout / 'keymap.json').exists():
return community_layout / 'keymap.json'
if (community_layout / 'keymap.c').exists():
return community_layout / 'keymap.c'
def list_keymaps(keyboard):
""" List the available keymaps for a keyboard.
Args:
keyboard_name: the keyboards full name with vendor and revision if necessary, example: clueboard/66/rev3
keyboard: the keyboards full name with vendor and revision if necessary, example: clueboard/66/rev3
Returns:
a set with the names of the available keymaps
"""
# parse all the rules.mk files for the keyboard
rules_mk = qmk.makefile.get_rules_mk(keyboard_name)
rules = rules_mk(keyboard)
names = set()
if rules_mk:
if rules:
# qmk_firmware/keyboards
keyboards_dir = Path.cwd() / "keyboards"
keyboards_dir = Path('keyboards')
# path to the keyboard's directory
kb_path = keyboards_dir / keyboard_name
kb_path = keyboards_dir / keyboard
# walk up the directory tree until keyboards_dir
# and collect all directories' name with keymap.c file in it
while kb_path != keyboards_dir:
keymaps_dir = kb_path / "keymaps"
if keymaps_dir.exists():
names = names.union([keymap for keymap in keymaps_dir.iterdir() if (keymaps_dir / keymap / "keymap.c").is_file()])
names = names.union([keymap.name for keymap in keymaps_dir.iterdir() if is_keymap_dir(keymap)])
kb_path = kb_path.parent
# if community layouts are supported, get them
if "LAYOUTS" in rules_mk:
for layout in rules_mk["LAYOUTS"].split():
cl_path = Path.cwd() / "layouts" / "community" / layout
if "LAYOUTS" in rules:
for layout in rules["LAYOUTS"].split():
cl_path = Path('layouts/community') / layout
if cl_path.exists():
names = names.union([keymap for keymap in cl_path.iterdir() if (cl_path / keymap / "keymap.c").is_file()])
names = names.union([keymap.name for keymap in cl_path.iterdir() if is_keymap_dir(keymap)])
return sorted(names)

View File

@@ -2,8 +2,6 @@
"""
from pathlib import Path
from qmk.errors import NoSuchKeyboardError
def parse_rules_mk_file(file, rules_mk=None):
"""Turn a rules.mk file into a dictionary.
@@ -51,33 +49,3 @@ def parse_rules_mk_file(file, rules_mk=None):
rules_mk[key.strip()] = value.strip()
return rules_mk
def get_rules_mk(keyboard):
""" Get a rules.mk for a keyboard
Args:
keyboard: name of the keyboard
Raises:
NoSuchKeyboardError: when the keyboard does not exists
Returns:
a dictionary with the content of the rules.mk file
"""
# Start with qmk_firmware/keyboards
kb_path = Path.cwd() / "keyboards"
# walk down the directory tree
# and collect all rules.mk files
kb_dir = kb_path / keyboard
if kb_dir.exists():
rules_mk = dict()
for directory in Path(keyboard).parts:
kb_path = kb_path / directory
rules_mk_path = kb_path / "rules.mk"
if rules_mk_path.exists():
rules_mk = parse_rules_mk_file(rules_mk_path, rules_mk)
else:
raise NoSuchKeyboardError("The requested keyboard and/or revision does not exist.")
return rules_mk

33
lib/python/qmk/math.py Normal file
View File

@@ -0,0 +1,33 @@
"""Parse arbitrary math equations in a safe way.
Gratefully copied from https://stackoverflow.com/a/9558001
"""
import ast
import operator as op
# supported operators
operators = {ast.Add: op.add, ast.Sub: op.sub, ast.Mult: op.mul, ast.Div: op.truediv, ast.Pow: op.pow, ast.BitXor: op.xor, ast.USub: op.neg}
def compute(expr):
"""Parse a mathematical expression and return the answer.
>>> compute('2^6')
4
>>> compute('2**6')
64
>>> compute('1 + 2*3**(4^5) / (6 + -7)')
-5.0
"""
return _eval(ast.parse(expr, mode='eval').body)
def _eval(node):
if isinstance(node, ast.Num): # <number>
return node.n
elif isinstance(node, ast.BinOp): # <left> <operator> <right>
return operators[type(node.op)](_eval(node.left), _eval(node.right))
elif isinstance(node, ast.UnaryOp): # <operator> <operand> e.g., -1
return operators[type(node.op)](_eval(node.operand))
else:
raise TypeError(node)

View File

@@ -4,20 +4,10 @@ import logging
import os
from pathlib import Path
from qmk.constants import QMK_FIRMWARE, MAX_KEYBOARD_SUBFOLDERS
from qmk.constants import MAX_KEYBOARD_SUBFOLDERS, QMK_FIRMWARE
from qmk.errors import NoSuchKeyboardError
def is_keymap_dir(keymap_path):
"""Returns True if `keymap_path` is a valid keymap directory.
"""
keymap_path = Path(keymap_path)
keymap_c = keymap_path / 'keymap.c'
keymap_json = keymap_path / 'keymap.json'
return any((keymap_c.exists(), keymap_json.exists()))
def is_keyboard(keyboard_name):
"""Returns True if `keyboard_name` is a keyboard we can compile.
"""
@@ -68,17 +58,3 @@ def normpath(path):
return path
return Path(os.environ['ORIG_CWD']) / path
def c_source_files(dir_names):
"""Returns a list of all *.c, *.h, and *.cpp files for a given list of directories
Args:
dir_names
List of directories, relative pathing starts at qmk's cwd
"""
files = []
for dir in dir_names:
files.extend(file for file in Path(dir).glob('**/*') if file.suffix in ['.c', '.h', '.cpp'])
return files

View File

@@ -4,83 +4,151 @@ from qmk.commands import run
def check_subcommand(command, *args):
cmd = ['bin/qmk', command] + list(args)
return run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
result = run(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True)
return result
def check_returncode(result, expected=0):
"""Print stdout if `result.returncode` does not match `expected`.
"""
if result.returncode != expected:
print('`%s` stdout:' % ' '.join(result.args))
print(result.stdout)
print('returncode:', result.returncode)
assert result.returncode == expected
def test_cformat():
result = check_subcommand('cformat', 'quantum/matrix.c')
assert result.returncode == 0
check_returncode(result)
def test_compile():
assert check_subcommand('compile', '-kb', 'handwired/onekey/pytest', '-km', 'default').returncode == 0
result = check_subcommand('compile', '-kb', 'handwired/onekey/pytest', '-km', 'default', '-n')
check_returncode(result)
def test_flash():
assert check_subcommand('flash', '-b').returncode == 1
assert check_subcommand('flash').returncode == 1
result = check_subcommand('flash', '-kb', 'handwired/onekey/pytest', '-km', 'default', '-n')
check_returncode(result)
def test_flash_bootloaders():
result = check_subcommand('flash', '-b')
check_returncode(result, 1)
def test_config():
result = check_subcommand('config')
assert result.returncode == 0
check_returncode(result)
assert 'general.color' in result.stdout
def test_kle2json():
assert check_subcommand('kle2json', 'kle.txt', '-f').returncode == 0
result = check_subcommand('kle2json', 'kle.txt', '-f')
check_returncode(result)
def test_doctor():
result = check_subcommand('doctor', '-n')
assert result.returncode == 0
assert 'QMK Doctor is checking your environment.' in result.stderr
assert 'QMK is ready to go' in result.stderr
check_returncode(result)
assert 'QMK Doctor is checking your environment.' in result.stdout
assert 'QMK is ready to go' in result.stdout
def test_hello():
result = check_subcommand('hello')
assert result.returncode == 0
assert 'Hello,' in result.stderr
check_returncode(result)
assert 'Hello,' in result.stdout
def test_pyformat():
result = check_subcommand('pyformat')
assert result.returncode == 0
assert 'Successfully formatted the python code' in result.stderr
check_returncode(result)
assert 'Successfully formatted the python code' in result.stdout
def test_list_keyboards():
result = check_subcommand('list-keyboards')
check_returncode(result)
# check to see if a known keyboard is returned
# this will fail if handwired/onekey/pytest is removed
assert 'handwired/onekey/pytest' in result.stdout
def test_list_keymaps():
result = check_subcommand('list-keymaps', '-kb', 'handwired/onekey/pytest')
assert result.returncode == 0
check_returncode(result, 0)
assert 'default' and 'test' in result.stdout
def test_list_keymaps_long():
result = check_subcommand('list-keymaps', '--keyboard', 'handwired/onekey/pytest')
assert result.returncode == 0
check_returncode(result, 0)
assert 'default' and 'test' in result.stdout
def test_list_keymaps_kb_only():
result = check_subcommand('list-keymaps', '-kb', 'niu_mini')
assert result.returncode == 0
check_returncode(result, 0)
assert 'default' and 'via' in result.stdout
def test_list_keymaps_vendor_kb():
result = check_subcommand('list-keymaps', '-kb', 'ai03/lunar')
assert result.returncode == 0
check_returncode(result, 0)
assert 'default' and 'via' in result.stdout
def test_list_keymaps_vendor_kb_rev():
result = check_subcommand('list-keymaps', '-kb', 'kbdfans/kbd67/mkiirgb/v2')
assert result.returncode == 0
check_returncode(result, 0)
assert 'default' and 'via' in result.stdout
def test_list_keymaps_no_keyboard_found():
result = check_subcommand('list-keymaps', '-kb', 'asdfghjkl')
assert result.returncode == 0
check_returncode(result, 1)
assert 'does not exist' in result.stdout
def test_json2c():
result = check_subcommand('json2c', 'keyboards/handwired/onekey/keymaps/default_json/keymap.json')
check_returncode(result, 0)
assert result.stdout == '#include QMK_KEYBOARD_H\nconst uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {\t[0] = LAYOUT(KC_A)};\n\n'
def test_info():
result = check_subcommand('info', '-kb', 'handwired/onekey/pytest')
check_returncode(result)
assert 'Keyboard Name: handwired/onekey/pytest' in result.stdout
assert 'Processor: STM32F303' in result.stdout
assert 'Layout:' not in result.stdout
assert 'k0' not in result.stdout
def test_info_keyboard_render():
result = check_subcommand('info', '-kb', 'handwired/onekey/pytest', '-l')
check_returncode(result)
assert 'Keyboard Name: handwired/onekey/pytest' in result.stdout
assert 'Processor: STM32F303' in result.stdout
assert 'Layout:' in result.stdout
assert 'k0' in result.stdout
def test_info_keymap_render():
result = check_subcommand('info', '-kb', 'handwired/onekey/pytest', '-km', 'default_json')
check_returncode(result)
assert 'Keyboard Name: handwired/onekey/pytest' in result.stdout
assert 'Processor: STM32F303' in result.stdout
assert '│A │' in result.stdout
def test_info_matrix_render():
result = check_subcommand('info', '-kb', 'handwired/onekey/pytest', '-m')
check_returncode(result)
assert 'Keyboard Name: handwired/onekey/pytest' in result.stdout
assert 'Processor: STM32F303' in result.stdout
assert 'LAYOUT' in result.stdout
assert '│0A│' in result.stdout
assert 'Matrix for "LAYOUT"' in result.stdout

View File

@@ -8,12 +8,12 @@ def test_template_onekey_proton_c():
def test_template_onekey_pytest():
templ = qmk.keymap.template('handwired/onekey/pytest')
assert templ == 'const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {__KEYMAP_GOES_HERE__};\n'
assert templ == '#include QMK_KEYBOARD_H\nconst uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {__KEYMAP_GOES_HERE__};\n'
def test_generate_onekey_pytest():
templ = qmk.keymap.generate('handwired/onekey/pytest', 'LAYOUT', [['KC_A']])
assert templ == 'const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT(KC_A)};\n'
assert templ == '#include QMK_KEYBOARD_H\nconst uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {\t[0] = LAYOUT(KC_A)};\n'
# FIXME(skullydazed): Add a test for qmk.keymap.write that mocks up an FD.