summaryrefslogtreecommitdiffstats
path: root/keyboards/ckeys/nakey
diff options
context:
space:
mode:
authornoroadsleft <18669334+noroadsleft@users.noreply.github.com>2018-08-18 01:12:22 +0200
committerDrashna Jaelre <drashna@live.com>2018-08-18 01:12:22 +0200
commit19fdfccca28f923a12351fbee6c8c8282dca004e (patch)
treecfd4f63a47fbdb4bcfaeb0738956738582c5d4bf /keyboards/ckeys/nakey
parent9175eebc8796f31a481ba16b1ca2ba9e4432502e (diff)
downloadqmk_firmware-19fdfccca28f923a12351fbee6c8c8282dca004e.tar.gz
qmk_firmware-19fdfccca28f923a12351fbee6c8c8282dca004e.tar.xz
Keyboard: Ckeys refactor (#3681)
* Obelus Refactor: LAYOUT to LAYOUT_ortho_4x4 - Keymap also now uses #include QMK_KEYBOARD_H - Readability and white space changes - rules.mk now has LAYOUTS = ortho_4x4 - added info.json * naKey Refactor: LAYOUT to LAYOUT_numpad_5x4 - Matrix LAYOUT renamed to LAYOUT_numpad_5x4 - Now supports community layout numpad_5x4 - White space changes * naKey Configurator update Updated order of JSON objects to match new matrix order.
Diffstat (limited to 'keyboards/ckeys/nakey')
-rw-r--r--keyboards/ckeys/nakey/info.json6
-rw-r--r--keyboards/ckeys/nakey/keymaps/default/keymap.c35
-rw-r--r--keyboards/ckeys/nakey/nakey.h13
-rw-r--r--keyboards/ckeys/nakey/rules.mk2
4 files changed, 28 insertions, 28 deletions
diff --git a/keyboards/ckeys/nakey/info.json b/keyboards/ckeys/nakey/info.json
index b44d0daf7..093e61d0e 100644
--- a/keyboards/ckeys/nakey/info.json
+++ b/keyboards/ckeys/nakey/info.json
@@ -5,8 +5,8 @@
"width": 4,
"height": 5,
"layouts": {
- "LAYOUT": {
- "layout": [{"label":"Num Lock", "x":0, "y":0}, {"label":"/", "x":1, "y":0}, {"label":"*", "x":2, "y":0}, {"label":"-", "x":3, "y":0}, {"label":"7", "x":0, "y":1}, {"label":"8", "x":1, "y":1}, {"label":"9", "x":2, "y":1}, {"label":"+", "x":3, "y":1, "h":2}, {"label":"4", "x":0, "y":2}, {"label":"5", "x":1, "y":2}, {"label":"6", "x":2, "y":2}, {"label":"1", "x":0, "y":3}, {"label":"2", "x":1, "y":3}, {"label":"3", "x":2, "y":3}, {"label":"Enter", "x":3, "y":3, "h":2}, {"label":"0", "x":0, "y":4, "w":2}, {"label":".", "x":2, "y":4}]
- }
+ "LAYOUT_numpad_5x4": {
+ "layout": [{"label":"Num Lock", "x":0, "y":0}, {"label":"/", "x":1, "y":0}, {"label":"*", "x":2, "y":0}, {"label":"-", "x":3, "y":0}, {"label":"7", "x":0, "y":1}, {"label":"8", "x":1, "y":1}, {"label":"9", "x":2, "y":1}, {"label":"4", "x":0, "y":2}, {"label":"5", "x":1, "y":2}, {"label":"6", "x":2, "y":2}, {"label":"+", "x":3, "y":1, "h":2}, {"label":"1", "x":0, "y":3}, {"label":"2", "x":1, "y":3}, {"label":"3", "x":2, "y":3}, {"label":"0", "x":0, "y":4, "w":2}, {"label":".", "x":2, "y":4}, {"label":"Enter", "x":3, "y":3, "h":2}]
+ }
}
}
diff --git a/keyboards/ckeys/nakey/keymaps/default/keymap.c b/keyboards/ckeys/nakey/keymaps/default/keymap.c
index ebbb128bd..9c3e45b94 100644
--- a/keyboards/ckeys/nakey/keymaps/default/keymap.c
+++ b/keyboards/ckeys/nakey/keymaps/default/keymap.c
@@ -16,32 +16,31 @@
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-[0] = LAYOUT( /* Base */
- KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \
- KC_P7, KC_P8, KC_P9, KC_PPLS, \
- KC_P4, KC_P5, KC_P6, \
- KC_P1, KC_P2, KC_P3, KC_PENT, \
- KC_P0, KC_PDOT \
-),
+ [0] = LAYOUT_numpad_5x4( /* Base */
+ KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \
+ KC_P7, KC_P8, KC_P9, \
+ KC_P4, KC_P5, KC_P6, KC_PPLS, \
+ KC_P1, KC_P2, KC_P3, \
+ KC_P0, KC_PDOT, KC_PENT \
+ ),
};
const uint16_t PROGMEM fn_actions[] = {
};
-const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
-{
+const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
// MACRODOWN only works in this function
- switch(id) {
- case 0:
- if (record->event.pressed) {
- register_code(KC_RSFT);
- } else {
- unregister_code(KC_RSFT);
- }
- break;
+ switch(id) {
+ case 0:
+ if (record->event.pressed) {
+ register_code(KC_RSFT);
+ } else {
+ unregister_code(KC_RSFT);
}
- return MACRO_NONE;
+ break;
+ }
+ return MACRO_NONE;
};
diff --git a/keyboards/ckeys/nakey/nakey.h b/keyboards/ckeys/nakey/nakey.h
index 3cbfda844..bbf531fb6 100644
--- a/keyboards/ckeys/nakey/nakey.h
+++ b/keyboards/ckeys/nakey/nakey.h
@@ -22,14 +22,13 @@
// The following is an example using the Planck MIT layout
// The first section contains all of the arguments
// The second converts the arguments into a two-dimensional array
-#define LAYOUT( \
+#define LAYOUT_numpad_5x4( \
k00, k01, k02, k03, \
- k10, k11, k12, k13, \
- k20, k21, k22, \
- k30, k31, k32, k33, \
- k40, k41 \
-) \
-{ \
+ k10, k11, k12, \
+ k20, k21, k22, k13, \
+ k30, k31, k32, \
+ k40, k41, k33 \
+) { \
{ k00, k01, k02, k03 }, \
{ k10, k11, k12, k13 }, \
{ k20, k21, k22, KC_NO }, \
diff --git a/keyboards/ckeys/nakey/rules.mk b/keyboards/ckeys/nakey/rules.mk
index a3571e8de..36b2193aa 100644
--- a/keyboards/ckeys/nakey/rules.mk
+++ b/keyboards/ckeys/nakey/rules.mk
@@ -66,3 +66,5 @@ UNICODE_ENABLE ?= no # Unicode
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE ?= no # Audio output on port C6
FAUXCLICKY_ENABLE ?= no # Use buzzer to emulate clicky switches
+
+LAYOUTS = numpad_5x4