From bc89c4f104a9066a6d5eb80c92c504724a976cd5 Mon Sep 17 00:00:00 2001
From: Eric <22215921+ericywl@users.noreply.github.com>
Date: Mon, 30 Apr 2018 22:45:38 +0800
Subject: [PATCH] QMK Configurator Support for KBD66 and RAMA M6-A (#2849)
* Added KBD66 Config
* Added RAMA M6-A Config
* Changed KEYMAP to LAYOUT for KBD66 and M6-A
---
keyboards/kbd66/info.json | 84 +++
keyboards/kbd66/kbd66.h | 2 +-
keyboards/kbd66/keymaps/ansi/keymap.c | 6 +-
keyboards/kbd66/keymaps/default/keymap.c | 6 +-
keyboards/kbd66/keymaps/iso/keymap.c | 6 +-
keyboards/kbd66/keymaps/maartenwut/keymap.c | 10 +-
keyboards/rama/m6_a/info.json | 19 +
keyboards/rama/m6_a/keymaps/default/keymap.c | 546 ++++++++++---------
keyboards/rama/m6_a/keymaps/knops/keymap.c | 171 +++---
keyboards/rama/m6_a/keymaps/krusli/README.md | 10 +-
keyboards/rama/m6_a/keymaps/krusli/keymap.c | 100 ++--
keyboards/rama/m6_a/keymaps/naut/keymap.c | 21 +-
keyboards/rama/m6_a/m6_a.h | 10 +-
13 files changed, 566 insertions(+), 425 deletions(-)
create mode 100644 keyboards/kbd66/info.json
create mode 100644 keyboards/rama/m6_a/info.json
diff --git a/keyboards/kbd66/info.json b/keyboards/kbd66/info.json
new file mode 100644
index 000000000..c242abb9f
--- /dev/null
+++ b/keyboards/kbd66/info.json
@@ -0,0 +1,84 @@
+{
+ "keyboard_name": "kbd66",
+ "url": "",
+ "maintainer": "qmk",
+ "width": 16.5,
+ "height": 5,
+ "layouts": {
+ "LAYOUT": {
+ "layout": [
+ { "label": "~", "x": 0, "y": 0 },
+ { "label": "!", "x": 1, "y": 0 },
+ { "label": "@", "x": 2, "y": 0 },
+ { "label": "#", "x": 3, "y": 0 },
+ { "label": "$", "x": 4, "y": 0 },
+ { "label": "%", "x": 5, "y": 0 },
+ { "label": "^", "x": 6, "y": 0 },
+ { "label": "&", "x": 7, "y": 0 },
+ { "label": "*", "x": 8, "y": 0 },
+ { "label": "(", "x": 9, "y": 0 },
+ { "label": ")", "x": 10, "y": 0 },
+ { "label": "_", "x": 11, "y": 0 },
+ { "label": "+", "x": 12, "y": 0 },
+ { "label": "Bkspc", "x": 13, "y": 0 },
+ { "label": "Bkspc", "x": 14, "y": 0 },
+ { "x": 15.5, "y": 0 },
+ { "label": "Tab", "x": 0, "y": 1, "w": 1.5 },
+ { "label": "Q", "x": 1.5, "y": 1 },
+ { "label": "W", "x": 2.5, "y": 1 },
+ { "label": "E", "x": 3.5, "y": 1 },
+ { "label": "R", "x": 4.5, "y": 1 },
+ { "label": "T", "x": 5.5, "y": 1 },
+ { "label": "Y", "x": 6.5, "y": 1 },
+ { "label": "U", "x": 7.5, "y": 1 },
+ { "label": "I", "x": 8.5, "y": 1 },
+ { "label": "O", "x": 9.5, "y": 1 },
+ { "label": "P", "x": 10.5, "y": 1 },
+ { "label": "{", "x": 11.5, "y": 1 },
+ { "label": "}", "x": 12.5, "y": 1 },
+ { "label": "|", "x": 13.5, "y": 1, "w": 1.5 },
+ { "x": 15.5, "y": 1 },
+ { "label": "Caps Lock", "x": 0, "y": 2, "w": 1.75 },
+ { "label": "A", "x": 1.75, "y": 2 },
+ { "label": "S", "x": 2.75, "y": 2 },
+ { "label": "D", "x": 3.75, "y": 2 },
+ { "label": "F", "x": 4.75, "y": 2 },
+ { "label": "G", "x": 5.75, "y": 2 },
+ { "label": "H", "x": 6.75, "y": 2 },
+ { "label": "J", "x": 7.75, "y": 2 },
+ { "label": "K", "x": 8.75, "y": 2 },
+ { "label": "L", "x": 9.75, "y": 2 },
+ { "label": ":", "x": 10.75, "y": 2 },
+ { "label": "\"", "x": 11.75, "y": 2 },
+ { "x": 12.75, "y": 2 },
+ { "label": "Enter", "x": 13.75, "y": 2, "w": 1.25 },
+ { "label": "Shift", "x": 0, "y": 3, "w": 1.25 },
+ { "x": 1.25, "y": 3 },
+ { "label": "Z", "x": 2.25, "y": 3 },
+ { "label": "X", "x": 3.25, "y": 3 },
+ { "label": "C", "x": 4.25, "y": 3 },
+ { "label": "V", "x": 5.25, "y": 3 },
+ { "label": "B", "x": 6.25, "y": 3 },
+ { "label": "N", "x": 7.25, "y": 3 },
+ { "label": "M", "x": 8.25, "y": 3 },
+ { "label": "<", "x": 9.25, "y": 3 },
+ { "label": ">", "x": 10.25, "y": 3 },
+ { "label": "?", "x": 11.25, "y": 3 },
+ { "label": "Shift", "x": 12.25, "y": 3, "w": 1.25 },
+ { "label": "Fn", "x": 13.5, "y": 3 },
+ { "label": "Up", "x": 14.5, "y": 3 },
+ { "label": "Ctrl", "x": 0, "y": 4, "w": 1.5 },
+ { "label": "Win", "x": 1.5, "y": 4, "w": 1.25 },
+ { "label": "Alt", "x": 2.75, "y": 4, "w": 1.25 },
+ { "x": 4, "y": 4, "w": 2.75 },
+ { "x": 6.75, "y": 4, "w": 2.75 },
+ { "label": "Alt", "x": 9.5, "y": 4, "w": 1.25 },
+ { "label": "Win", "x": 10.75, "y": 4, "w": 1.25 },
+ { "label": "Menu", "x": 12, "y": 4, "w": 1.5 },
+ { "label": "Left", "x": 13.5, "y": 4 },
+ { "label": "Down", "x": 14.5, "y": 4 },
+ { "label": "Right", "x": 15.5, "y": 4 }
+ ]
+ }
+ }
+}
diff --git a/keyboards/kbd66/kbd66.h b/keyboards/kbd66/kbd66.h
index af1156e5e..784e8e493 100644
--- a/keyboards/kbd66/kbd66.h
+++ b/keyboards/kbd66/kbd66.h
@@ -19,7 +19,7 @@
#include "quantum.h"
// This a shortcut to help you visually see your layout.
-#define KEYMAP( \
+#define LAYOUT( \
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, \
diff --git a/keyboards/kbd66/keymaps/ansi/keymap.c b/keyboards/kbd66/keymaps/ansi/keymap.c
index f5ffa7b75..253d8d5db 100644
--- a/keyboards/kbd66/keymaps/ansi/keymap.c
+++ b/keyboards/kbd66/keymaps/ansi/keymap.c
@@ -13,7 +13,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-#include "kbd66.h"
+#include QMK_KEYBOARD_H
#define _____ KC_TRNS
#define XXXXX KC_NO
@@ -35,7 +35,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |Ctl |OS |Alt | Space |Alt | Fn |Ctl |LFT|DWN|RIG|
* `-------------------------------------------------------------------'
*/
-[_L0] = KEYMAP(
+[_L0] = LAYOUT(
KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, XXXXX, KC_BSPC, KC_INS,
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_DEL,
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,
@@ -56,7 +56,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | |PDn|SLk|
* `-------------------------------------------------------------------'
*/
-[_L1] = KEYMAP(
+[_L1] = LAYOUT(
KC_GRV, 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_HOME,
_____, _____, _____, _____, _____, _____, _____, _____, _____, _____, KC_PSCR, KC_VOLD, KC_VOLU, KC_MUTE, KC_END,
RESET, _____, _____, _____, _____, _____, _____, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, _____, _____,
diff --git a/keyboards/kbd66/keymaps/default/keymap.c b/keyboards/kbd66/keymaps/default/keymap.c
index 551df1418..3e8a90ee5 100644
--- a/keyboards/kbd66/keymaps/default/keymap.c
+++ b/keyboards/kbd66/keymaps/default/keymap.c
@@ -13,7 +13,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-#include "kbd66.h"
+#include QMK_KEYBOARD_H
#define _____ KC_TRNS
#define XXXXX KC_NO
@@ -35,7 +35,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |Ctl |OS |Alt | Space |Alt | Fn |Ctl |LFT|DWN|RIG|
* `-------------------------------------------------------------------'
*/
-[_L0] = KEYMAP(
+[_L0] = LAYOUT(
KC_GESC, 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_GRV, KC_BSPC, KC_INS,
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_DEL,
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,
@@ -56,7 +56,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | |PDn|SLk|
* `-------------------------------------------------------------------'
*/
-[_L1] = KEYMAP(
+[_L1] = LAYOUT(
KC_GRV, 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_HOME,
_____, _____, _____, _____, _____, _____, _____, _____, _____, _____, KC_PSCR, KC_VOLD, KC_VOLU, KC_MUTE, KC_END,
RESET, _____, _____, _____, _____, _____, _____, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, _____, _____,
diff --git a/keyboards/kbd66/keymaps/iso/keymap.c b/keyboards/kbd66/keymaps/iso/keymap.c
index fa9202cad..6b9b7ac4d 100644
--- a/keyboards/kbd66/keymaps/iso/keymap.c
+++ b/keyboards/kbd66/keymaps/iso/keymap.c
@@ -13,7 +13,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-#include "kbd66.h"
+#include QMK_KEYBOARD_H
#define _____ KC_TRNS
#define XXXXX KC_NO
@@ -35,7 +35,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |Ctl |OS |Alt | Space |Alt | Fn |Ctl |LFT|DWN|RIG|
* `-------------------------------------------------------------------'
*/
-[_L0] = KEYMAP(
+[_L0] = LAYOUT(
KC_GESC, 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_GRV, KC_BSPC, KC_INS,
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_NUHS, KC_DEL,
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,
@@ -56,7 +56,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | |PDn|SLk|
* `-------------------------------------------------------------------'
*/
-[_L1] = KEYMAP(
+[_L1] = LAYOUT(
KC_GRV, 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_HOME,
_____, _____, _____, _____, _____, _____, _____, _____, _____, _____, KC_PSCR, KC_VOLD, KC_VOLU, KC_MUTE, KC_END,
RESET, _____, _____, _____, _____, _____, _____, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, _____, _____,
diff --git a/keyboards/kbd66/keymaps/maartenwut/keymap.c b/keyboards/kbd66/keymaps/maartenwut/keymap.c
index 4ca794c96..da438022e 100755
--- a/keyboards/kbd66/keymaps/maartenwut/keymap.c
+++ b/keyboards/kbd66/keymaps/maartenwut/keymap.c
@@ -1,4 +1,4 @@
-#include "kbd66.h"
+#include QMK_KEYBOARD_H
#define _MA 0
#define _GA 1
@@ -14,7 +14,7 @@
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// Main Layer
-[_MA] = KEYMAP(
+[_MA] = LAYOUT(
KC_GESC, 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_MPLY,
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_DEL,
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,
@@ -22,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_LCTL, KC_LGUI, KC_LALT, SPACE, SPACE, KC_RALT, KC_RCTRL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT),
//Function Layer
-[_FL] = KEYMAP(
+[_FL] = LAYOUT(
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, TRNS, RESET, KC_PSCR,
TRNS, ______, ______, ______, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, ______,
TRNS, ______, ______, ______, TRNS, TG(_GA), TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,
@@ -30,7 +30,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, ______, KC_PGDN, ______),
//Arrow keys layer (space bar)
-[_AR] = KEYMAP(
+[_AR] = LAYOUT(
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, TRNS, TRNS, TRNS,
TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,
TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,
@@ -38,7 +38,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS),
//Game layer (fn + g)
-[_GA] = KEYMAP(
+[_GA] = LAYOUT(
TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,
TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,
TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,
diff --git a/keyboards/rama/m6_a/info.json b/keyboards/rama/m6_a/info.json
new file mode 100644
index 000000000..28dd733da
--- /dev/null
+++ b/keyboards/rama/m6_a/info.json
@@ -0,0 +1,19 @@
+{
+ "keyboard_name": "m6-a",
+ "url": "",
+ "maintainer": "qmk",
+ "width": 3,
+ "height": 2,
+ "layouts": {
+ "LAYOUT": {
+ "layout": [
+ { "x": 0, "y": 0 },
+ { "x": 1, "y": 0 },
+ { "x": 2, "y": 0 },
+ { "x": 0, "y": 1 },
+ { "x": 1, "y": 1 },
+ { "x": 2, "y": 1 }
+ ]
+ }
+ }
+}
diff --git a/keyboards/rama/m6_a/keymaps/default/keymap.c b/keyboards/rama/m6_a/keymaps/default/keymap.c
index 1323ba6f2..6b15f3cd1 100644
--- a/keyboards/rama/m6_a/keymaps/default/keymap.c
+++ b/keyboards/rama/m6_a/keymaps/default/keymap.c
@@ -1,298 +1,324 @@
-#include "../../m6_a.h"
+#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
- KEYMAP(
- TO(1), KC_A, KC_B, KC_C, KC_D, KC_E),
+ LAYOUT(
+ TO(1), KC_A, KC_B, KC_C, KC_D, KC_E),
- KEYMAP(
- TO(2), KC_F, KC_G, KC_H, KC_I, KC_J),
+ LAYOUT(
+ TO(2), KC_F, KC_G, KC_H, KC_I, KC_J),
- KEYMAP(
- TO(3), KC_K, KC_L, KC_M, KC_N, KC_O),
+ LAYOUT(
+ TO(3), KC_K, KC_L, KC_M, KC_N, KC_O),
- KEYMAP(
- TO(4), KC_P, KC_Q, KC_R, KC_S, KC_T),
+ LAYOUT(
+ TO(4), KC_P, KC_Q, KC_R, KC_S, KC_T),
- KEYMAP(
- TO(5), KC_U, KC_V, KC_W, KC_X, KC_Y),
+ LAYOUT(
+ TO(5), KC_U, KC_V, KC_W, KC_X, KC_Y),
- KEYMAP(
- TO(0), KC_Z, KC_1, KC_2, KC_3, KC_4)
-};
+ LAYOUT(
+ TO(0), KC_Z, KC_1, KC_2, KC_3, KC_4)};
-const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
- //keyevent_t event = record->event;
+const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
+{
+ //keyevent_t event = record->event;
- switch (id) {
- case 0:
- if (record->event.pressed) {
- return MACRO( T(T), T(G), T(L), T(H), T(F), T(ENT), END );
- }
- break;
- case 1:
- if (record->event.pressed) {
- return MACRO( T(T), T(G), T(G), T(ENT), END );
- }
- break;
- case 2:
- if (record->event.pressed) {
- return MACRO( D(NO), T(L), U(NO), END );
- }
- break;
- case 3:
- if (record->event.pressed) {
- return MACRO( D(LCTL), T(Z), U(LCTL), END );
- }
- break;
- case 4:
- if (record->event.pressed) {
- return MACRO( D(LCTL), D(LSFT), T(Z), U(LSFT), U(LCTL), END );
- }
- break;
- case 5:
- if (record->event.pressed) {
- return MACRO( D(LCTL), T(X), U(LCTL), END );
- }
- break;
- case 6:
- if (record->event.pressed) {
- return MACRO( D(LCTL), T(C), U(LCTL), END );
- }
- break;
- case 7:
- if (record->event.pressed) {
- return MACRO( D(LCTL), T(V), U(LCTL), END );
- }
- break;
- }
- return MACRO_NONE;
+ switch (id)
+ {
+ case 0:
+ if (record->event.pressed)
+ {
+ return MACRO(T(T), T(G), T(L), T(H), T(F), T(ENT), END);
+ }
+ break;
+ case 1:
+ if (record->event.pressed)
+ {
+ return MACRO(T(T), T(G), T(G), T(ENT), END);
+ }
+ break;
+ case 2:
+ if (record->event.pressed)
+ {
+ return MACRO(D(NO), T(L), U(NO), END);
+ }
+ break;
+ case 3:
+ if (record->event.pressed)
+ {
+ return MACRO(D(LCTL), T(Z), U(LCTL), END);
+ }
+ break;
+ case 4:
+ if (record->event.pressed)
+ {
+ return MACRO(D(LCTL), D(LSFT), T(Z), U(LSFT), U(LCTL), END);
+ }
+ break;
+ case 5:
+ if (record->event.pressed)
+ {
+ return MACRO(D(LCTL), T(X), U(LCTL), END);
+ }
+ break;
+ case 6:
+ if (record->event.pressed)
+ {
+ return MACRO(D(LCTL), T(C), U(LCTL), END);
+ }
+ break;
+ case 7:
+ if (record->event.pressed)
+ {
+ return MACRO(D(LCTL), T(V), U(LCTL), END);
+ }
+ break;
+ }
+ return MACRO_NONE;
}
// M6-A LEDs are connected to D6, B6, F5, B4, C7, F7
// This is 1-based because I copied it from Knops code.
-void set_switch_led(int ledId, bool state) {
- if(state) {
- switch(ledId) {
- case 1:
- PORTD |= (1<<6);
- break;
- case 2:
- PORTB |= (1<<6);
- break;
- case 3:
- PORTF |= (1<<5);
- break;
- case 4:
- PORTB |= (1<<4);
- break;
- case 5:
- PORTC |= (1<<7);
- break;
- case 6:
- PORTF |= (1<<7);
- break;
- }
- } else {
- switch(ledId) {
- case 1:
- PORTD &= ~(1<<6);
- break;
- case 2:
- PORTB &= ~(1<<6);
- break;
- case 3:
- PORTF &= ~(1<<5);
- break;
- case 4:
- PORTB &= ~(1<<4);
- break;
- case 5:
- PORTC &= ~(1<<7);
- break;
- case 6:
- PORTF &= ~(1<<7);
- break;
- }
- }
+void set_switch_led(int ledId, bool state)
+{
+ if (state)
+ {
+ switch (ledId)
+ {
+ case 1:
+ PORTD |= (1 << 6);
+ break;
+ case 2:
+ PORTB |= (1 << 6);
+ break;
+ case 3:
+ PORTF |= (1 << 5);
+ break;
+ case 4:
+ PORTB |= (1 << 4);
+ break;
+ case 5:
+ PORTC |= (1 << 7);
+ break;
+ case 6:
+ PORTF |= (1 << 7);
+ break;
+ }
+ }
+ else
+ {
+ switch (ledId)
+ {
+ case 1:
+ PORTD &= ~(1 << 6);
+ break;
+ case 2:
+ PORTB &= ~(1 << 6);
+ break;
+ case 3:
+ PORTF &= ~(1 << 5);
+ break;
+ case 4:
+ PORTB &= ~(1 << 4);
+ break;
+ case 5:
+ PORTC &= ~(1 << 7);
+ break;
+ case 6:
+ PORTF &= ~(1 << 7);
+ break;
+ }
+ }
}
-
-void set_layer_led(int layerId) {
- // UNUSED
+void set_layer_led(int layerId)
+{
+ // UNUSED
}
void led_set_layer(int layer);
-void matrix_init_user(void) {
- led_init_ports();
- led_set_layer(0);
+void matrix_init_user(void)
+{
+ led_init_ports();
+ led_set_layer(0);
}
-void matrix_scan_user(void) {
+void matrix_scan_user(void)
+{
}
// M6-A LEDs are connected to D6, B6, F5, B4, C7, F7
-void led_init_ports() {
- // Switch #1
- DDRD |= (1<<6);
- PORTD &= ~(1<<6);
-
- // Switch #2
- DDRB |= (1<<6);
- PORTB &= ~(1<<6);
-
- // Switch #3
- DDRF |= (1<<5);
- PORTF &= ~(1<<5);
-
- // Switch #4
- DDRB |= (1<<4);
- PORTB &= ~(1<<4);
+void led_init_ports()
+{
+ // Switch #1
+ DDRD |= (1 << 6);
+ PORTD &= ~(1 << 6);
- // Switch #5
- DDRC |= (1<<7);
- PORTC &= ~(1<<7);
-
- // Switch #6
- DDRF |= (1<<7);
- PORTF &= ~(1<<7);
+ // Switch #2
+ DDRB |= (1 << 6);
+ PORTB &= ~(1 << 6);
+
+ // Switch #3
+ DDRF |= (1 << 5);
+ PORTF &= ~(1 << 5);
+
+ // Switch #4
+ DDRB |= (1 << 4);
+ PORTB &= ~(1 << 4);
+
+ // Switch #5
+ DDRC |= (1 << 7);
+ PORTC &= ~(1 << 7);
+
+ // Switch #6
+ DDRF |= (1 << 7);
+ PORTF &= ~(1 << 7);
}
-void led_set_user(uint8_t usb_led) {
+void led_set_user(uint8_t usb_led)
+{
- if (usb_led & (1 << USB_LED_NUM_LOCK)) {
-
- } else {
-
- }
+ if (usb_led & (1 << USB_LED_NUM_LOCK))
+ {
+ }
+ else
+ {
+ }
- if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
+ if (usb_led & (1 << USB_LED_CAPS_LOCK))
+ {
+ }
+ else
+ {
+ }
- } else {
+ if (usb_led & (1 << USB_LED_SCROLL_LOCK))
+ {
+ }
+ else
+ {
+ }
- }
-
- if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
-
- } else {
-
- }
-
- if (usb_led & (1 << USB_LED_COMPOSE)) {
-
- } else {
-
- }
-
- if (usb_led & (1 << USB_LED_KANA)) {
-
- } else {
-
- }
+ if (usb_led & (1 << USB_LED_COMPOSE))
+ {
+ }
+ else
+ {
+ }
+ if (usb_led & (1 << USB_LED_KANA))
+ {
+ }
+ else
+ {
+ }
}
-void led_set_layer(int layer) {
- switch(layer) {
- case 0:
- set_switch_led(1, true);
- set_switch_led(2, false);
- set_switch_led(3, false);
- set_switch_led(4, false);
- set_switch_led(5, false);
- set_switch_led(6, false);
- break;
- case 1:
- set_switch_led(1, false);
- set_switch_led(2, true);
- set_switch_led(3, false);
- set_switch_led(4, false);
- set_switch_led(5, false);
- set_switch_led(6, false);
- break;
- case 2:
- set_switch_led(1, false);
- set_switch_led(2, false);
- set_switch_led(3, true);
- set_switch_led(4, false);
- set_switch_led(5, false);
- set_switch_led(6, false);
- break;
- case 3:
- set_switch_led(1, false);
- set_switch_led(2, false);
- set_switch_led(3, false);
- set_switch_led(4, true);
- set_switch_led(5, false);
- set_switch_led(6, false);
- break;
- case 4:
- set_switch_led(1, false);
- set_switch_led(2, false);
- set_switch_led(3, false);
- set_switch_led(4, false);
- set_switch_led(5, true);
- set_switch_led(6, false);
- break;
- case 5:
- set_switch_led(1, false);
- set_switch_led(2, false);
- set_switch_led(3, false);
- set_switch_led(4, false);
- set_switch_led(5, false);
- set_switch_led(6, true);
- break;
- default:
- set_switch_led(1, true);
- set_switch_led(2, true);
- set_switch_led(3, true);
- set_switch_led(4, true);
- set_switch_led(5, true);
- set_switch_led(6, true);
- break;
- }
+void led_set_layer(int layer)
+{
+ switch (layer)
+ {
+ case 0:
+ set_switch_led(1, true);
+ set_switch_led(2, false);
+ set_switch_led(3, false);
+ set_switch_led(4, false);
+ set_switch_led(5, false);
+ set_switch_led(6, false);
+ break;
+ case 1:
+ set_switch_led(1, false);
+ set_switch_led(2, true);
+ set_switch_led(3, false);
+ set_switch_led(4, false);
+ set_switch_led(5, false);
+ set_switch_led(6, false);
+ break;
+ case 2:
+ set_switch_led(1, false);
+ set_switch_led(2, false);
+ set_switch_led(3, true);
+ set_switch_led(4, false);
+ set_switch_led(5, false);
+ set_switch_led(6, false);
+ break;
+ case 3:
+ set_switch_led(1, false);
+ set_switch_led(2, false);
+ set_switch_led(3, false);
+ set_switch_led(4, true);
+ set_switch_led(5, false);
+ set_switch_led(6, false);
+ break;
+ case 4:
+ set_switch_led(1, false);
+ set_switch_led(2, false);
+ set_switch_led(3, false);
+ set_switch_led(4, false);
+ set_switch_led(5, true);
+ set_switch_led(6, false);
+ break;
+ case 5:
+ set_switch_led(1, false);
+ set_switch_led(2, false);
+ set_switch_led(3, false);
+ set_switch_led(4, false);
+ set_switch_led(5, false);
+ set_switch_led(6, true);
+ break;
+ default:
+ set_switch_led(1, true);
+ set_switch_led(2, true);
+ set_switch_led(3, true);
+ set_switch_led(4, true);
+ set_switch_led(5, true);
+ set_switch_led(6, true);
+ break;
+ }
}
-bool process_record_user (uint16_t keycode, keyrecord_t *record) {
- switch ( keycode )
- {
- case TO( 0 ):
- if ( record->event.pressed )
- {
- led_set_layer( 0 );
- }
- break;
- case TO( 1 ):
- if ( record->event.pressed )
- {
- led_set_layer( 1 );
- }
- break;
- case TO( 2 ):
- if ( record->event.pressed )
- {
- led_set_layer( 2 );
- }
- break;
- case TO( 3 ):
- if ( record->event.pressed )
- {
- led_set_layer( 3 );
- }
- break;
- case TO( 4 ):
- if ( record->event.pressed )
- {
- led_set_layer( 4 );
- }
- break;
- case TO( 5 ):
- if ( record->event.pressed )
- {
- led_set_layer( 5 );
- }
- break;
- }
- return true;
+bool process_record_user(uint16_t keycode, keyrecord_t *record)
+{
+ switch (keycode)
+ {
+ case TO(0):
+ if (record->event.pressed)
+ {
+ led_set_layer(0);
+ }
+ break;
+ case TO(1):
+ if (record->event.pressed)
+ {
+ led_set_layer(1);
+ }
+ break;
+ case TO(2):
+ if (record->event.pressed)
+ {
+ led_set_layer(2);
+ }
+ break;
+ case TO(3):
+ if (record->event.pressed)
+ {
+ led_set_layer(3);
+ }
+ break;
+ case TO(4):
+ if (record->event.pressed)
+ {
+ led_set_layer(4);
+ }
+ break;
+ case TO(5):
+ if (record->event.pressed)
+ {
+ led_set_layer(5);
+ }
+ break;
+ }
+ return true;
}
diff --git a/keyboards/rama/m6_a/keymaps/knops/keymap.c b/keyboards/rama/m6_a/keymaps/knops/keymap.c
index 912147f4b..d687fe851 100644
--- a/keyboards/rama/m6_a/keymaps/knops/keymap.c
+++ b/keyboards/rama/m6_a/keymaps/knops/keymap.c
@@ -1,92 +1,100 @@
-#include "../../m6_a.h"
+#include QMK_KEYBOARD_H
/*KNOPS_MISC*/
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
- /*KNOPS_KEYMAP*/
+ /*KNOPS_LAYOUT*/
};
-void set_led_state(int ledId, bool state) {
- if(state) {
- switch(ledId) {
- case 0:
- PORTD |= (1<<6);
- break;
- case 1:
- PORTB |= (1<<6);
- break;
- case 2:
- PORTF |= (1<<5);
- break;
- case 3:
- PORTB |= (1<<4);
- break;
- case 4:
- PORTC |= (1<<7);
- break;
- case 5:
- PORTF |= (1<<7);
- break;
- }
- } else {
- switch(ledId) {
- case 0:
- PORTD &= ~(1<<6);
- break;
- case 1:
- PORTB &= ~(1<<6);
- break;
- case 2:
- PORTF &= ~(1<<5);
- break;
- case 3:
- PORTB &= ~(1<<4);
- break;
- case 4:
- PORTC &= ~(1<<7);
- break;
- case 5:
- PORTF &= ~(1<<7);
- break;
- }
- }
+void set_led_state(int ledId, bool state)
+{
+ if (state)
+ {
+ switch (ledId)
+ {
+ case 0:
+ PORTD |= (1 << 6);
+ break;
+ case 1:
+ PORTB |= (1 << 6);
+ break;
+ case 2:
+ PORTF |= (1 << 5);
+ break;
+ case 3:
+ PORTB |= (1 << 4);
+ break;
+ case 4:
+ PORTC |= (1 << 7);
+ break;
+ case 5:
+ PORTF |= (1 << 7);
+ break;
+ }
+ }
+ else
+ {
+ switch (ledId)
+ {
+ case 0:
+ PORTD &= ~(1 << 6);
+ break;
+ case 1:
+ PORTB &= ~(1 << 6);
+ break;
+ case 2:
+ PORTF &= ~(1 << 5);
+ break;
+ case 3:
+ PORTB &= ~(1 << 4);
+ break;
+ case 4:
+ PORTC &= ~(1 << 7);
+ break;
+ case 5:
+ PORTF &= ~(1 << 7);
+ break;
+ }
+ }
}
-void led_init_ports() {
- // Switch #1
- DDRD |= (1<<6);
- PORTD &= ~(1<<6);
-
- // Switch #2
- DDRB |= (1<<6);
- PORTB &= ~(1<<6);
-
- // Switch #3
- DDRF |= (1<<5);
- PORTF &= ~(1<<5);
-
- // Switch #4
- DDRB |= (1<<4);
- PORTB &= ~(1<<4);
+void led_init_ports()
+{
+ // Switch #1
+ DDRD |= (1 << 6);
+ PORTD &= ~(1 << 6);
- // Switch #5
- DDRC |= (1<<7);
- PORTC &= ~(1<<7);
-
- // Switch #6
- DDRF |= (1<<7);
- PORTF &= ~(1<<7);
+ // Switch #2
+ DDRB |= (1 << 6);
+ PORTB &= ~(1 << 6);
+
+ // Switch #3
+ DDRF |= (1 << 5);
+ PORTF &= ~(1 << 5);
+
+ // Switch #4
+ DDRB |= (1 << 4);
+ PORTB &= ~(1 << 4);
+
+ // Switch #5
+ DDRC |= (1 << 7);
+ PORTC &= ~(1 << 7);
+
+ // Switch #6
+ DDRF |= (1 << 7);
+ PORTF &= ~(1 << 7);
}
-void led_set_layer(int layer) {
+void led_set_layer(int layer)
+{
/*KNOPS_SIMPLELED_STATES*/
-
}
-void matrix_init_user(void) {
+void matrix_init_user(void)
+{
led_init_ports();
led_set_layer(0);
@@ -94,27 +102,28 @@ void matrix_init_user(void) {
/*KNOPS_INIT*/
}
-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)
+{
//keyevent_t event = record->event;
/*KNOPS_MACRO*/
- return NULL;
+ return NULL;
}
-void matrix_scan_user(void) {
+void matrix_scan_user(void)
+{
/*KNOPS_SCAN*/
}
-void led_set_user(uint8_t usb_led) {
+void led_set_user(uint8_t usb_led)
+{
/*KNOPS_FUNCTIONALLED_STATES*/
-
}
-bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+bool process_record_user(uint16_t keycode, keyrecord_t *record)
+{
/*KNOPS_PROCESS_STATE*/
- return NULL;
+ return NULL;
}
-
-
diff --git a/keyboards/rama/m6_a/keymaps/krusli/README.md b/keyboards/rama/m6_a/keymaps/krusli/README.md
index 771b47a47..7c1fa38fc 100644
--- a/keyboards/rama/m6_a/keymaps/krusli/README.md
+++ b/keyboards/rama/m6_a/keymaps/krusli/README.md
@@ -6,12 +6,14 @@ Keymap was from my own port for the M6-A before official support was added, thus
Top-right button acts as a "toggle between layers" button. Layer 0 -> Layer 1 -> Layer 2 -> Layer 0 -> ...
-- Layer 0: Git and Discord shortcuts
-- Layer 1: Media playback and volume controls
-- Layer 2: Osu! gamepad layer
+* Layer 0: Git and Discord shortcuts
+* Layer 1: Media playback and volume controls
+* Layer 2: Osu! gamepad layer
## Helpful alternative keymaps (WIP)
+
### Arrow cluster
+
Use [karabiner-elements](https://github.com/tekezo/Karabiner-Elements) on macOS so that the state of the modifiers (shift, caps lock) are synchronised between keyboards (for shift + arrow key text selection, for example). It's also a handy tool for customising keyboard behaviour on a Mac.
On Windows/Linux modifier state should be shared between all keyboards by default.
@@ -19,7 +21,7 @@ On Windows/Linux modifier state should be shared between all keyboards by defaul
Installation: install [homebrew](https://brew.sh) and run `brew install Caskroom/cask/karabiner-elements`.
```C
-KEYMAP(
+LAYOUT(
KC_ESC, KC_UP, TO(_LAYER0),
KC_LEFT, KC_DOWN, KC_RIGHT
)
diff --git a/keyboards/rama/m6_a/keymaps/krusli/keymap.c b/keyboards/rama/m6_a/keymaps/krusli/keymap.c
index 679d0bc43..c8775f4ea 100644
--- a/keyboards/rama/m6_a/keymaps/krusli/keymap.c
+++ b/keyboards/rama/m6_a/keymaps/krusli/keymap.c
@@ -1,4 +1,4 @@
-#include "../../m6_a.h"
+#include QMK_KEYBOARD_H
#include "action_layer.h"
#include "eeconfig.h"
@@ -9,64 +9,66 @@ extern keymap_config_t keymap_config;
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
-enum layers {
- _LAYER0,
- _LAYER1,
- _LAYER2
+enum layers
+{
+ _LAYER0,
+ _LAYER1,
+ _LAYER2
};
-enum custom_keycodes {
- GIT_ADD = SAFE_RANGE,
- GIT_COMMIT,
- GIT_PUSH,
- MUTE,
- DEAFEN
+enum custom_keycodes
+{
+ GIT_ADD = SAFE_RANGE,
+ GIT_COMMIT,
+ GIT_PUSH,
+ MUTE,
+ DEAFEN
};
-bool process_record_user(uint16_t keycode, keyrecord_t *record) {
- if (record->event.pressed) {
- switch(keycode) {
- case GIT_ADD:
- SEND_STRING("git add ."SS_TAP(X_ENTER));
- break;
- case GIT_COMMIT:
- SEND_STRING("git commit -m "SS_DOWN(X_LSHIFT)SS_TAP(X_QUOTE)SS_UP(X_LSHIFT));
- break;
- case GIT_PUSH:
- SEND_STRING("git push"SS_TAP(X_ENTER));
- break;
- case MUTE:
- SEND_STRING(SS_LGUI(SS_LSFT("M")));
- break;
- case DEAFEN:
- SEND_STRING(SS_LGUI(SS_LSFT("D")));
- break;
- return false;
- }
- }
- return true;
+bool process_record_user(uint16_t keycode, keyrecord_t *record)
+{
+ if (record->event.pressed)
+ {
+ switch (keycode)
+ {
+ case GIT_ADD:
+ SEND_STRING("git add ." SS_TAP(X_ENTER));
+ break;
+ case GIT_COMMIT:
+ SEND_STRING("git commit -m " SS_DOWN(X_LSHIFT) SS_TAP(X_QUOTE) SS_UP(X_LSHIFT));
+ break;
+ case GIT_PUSH:
+ SEND_STRING("git push" SS_TAP(X_ENTER));
+ break;
+ case MUTE:
+ SEND_STRING(SS_LGUI(SS_LSFT("M")));
+ break;
+ case DEAFEN:
+ SEND_STRING(SS_LGUI(SS_LSFT("D")));
+ break;
+ return false;
+ }
+ }
+ return true;
};
#define _______ KC_TRNS
#define XXXXXXX KC_NO
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
- [_LAYER0] = KEYMAP(
- MUTE, DEAFEN, TO(_LAYER1),
- GIT_ADD, GIT_COMMIT, GIT_PUSH
- ),
- [_LAYER1] = KEYMAP(
- KC_VOLD, KC_VOLU, TO(_LAYER2),
- KC_MRWD, KC_MPLY, KC_MNXT
- ),
- [_LAYER2] = KEYMAP(
- KC_ESC, KC_UP, TO(_LAYER0),
- KC_Z, KC_X, KC_SPACE
- )
-};
+ [_LAYER0] = LAYOUT(
+ MUTE, DEAFEN, TO(_LAYER1),
+ GIT_ADD, GIT_COMMIT, GIT_PUSH),
+ [_LAYER1] = LAYOUT(
+ KC_VOLD, KC_VOLU, TO(_LAYER2),
+ KC_MRWD, KC_MPLY, KC_MNXT),
+ [_LAYER2] = LAYOUT(
+ KC_ESC, KC_UP, TO(_LAYER0),
+ KC_Z, KC_X, KC_SPACE)};
-void matrix_init_user(void) {
- #ifdef BACKLIGHT_ENABLE
+void matrix_init_user(void)
+{
+#ifdef BACKLIGHT_ENABLE
backlight_level(0);
- #endif
+#endif
}
diff --git a/keyboards/rama/m6_a/keymaps/naut/keymap.c b/keyboards/rama/m6_a/keymaps/naut/keymap.c
index 6ef59e01a..df4cf9be3 100644
--- a/keyboards/rama/m6_a/keymaps/naut/keymap.c
+++ b/keyboards/rama/m6_a/keymaps/naut/keymap.c
@@ -1,18 +1,17 @@
-#include "../../m6_a.h"
+#include QMK_KEYBOARD_H
// Define Layers
#define _BASE 0
-#define _FNX 1
+#define _FNX 1
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-// Base Layer
- [_BASE] = KEYMAP(
- TO(1), KC_UP, KC_PGDN,
- KC_LEFT,KC_DOWN,KC_RGHT),
+ // Base Layer
+ [_BASE] = LAYOUT(
+ TO(1), KC_UP, KC_PGDN,
+ KC_LEFT, KC_DOWN, KC_RGHT),
-// Fn Layer
- [_FNX] = KEYMAP(
- TO(0),KC_VOLU,KC_MPLY,
- KC_MRWD,KC_VOLD,KC_MFFD)
-};
\ No newline at end of file
+ // Fn Layer
+ [_FNX] = LAYOUT(
+ TO(0), KC_VOLU, KC_MPLY,
+ KC_MRWD, KC_VOLD, KC_MFFD)};
\ No newline at end of file
diff --git a/keyboards/rama/m6_a/m6_a.h b/keyboards/rama/m6_a/m6_a.h
index 6809c2cc9..d3c7bad33 100644
--- a/keyboards/rama/m6_a/m6_a.h
+++ b/keyboards/rama/m6_a/m6_a.h
@@ -21,9 +21,9 @@
// This a shortcut to help you visually see your layout.
// The first section contains all of the arguments
// The second converts the arguments into a two-dimensional array
-#define KEYMAP( \
- K00, K01, K02, K03, K04, K05 \
-) { \
- { K00, K01, K02, K03, K04, K05 }, \
-}
+#define LAYOUT( \
+ K00, K01, K02, K03, K04, K05) \
+ { \
+ {K00, K01, K02, K03, K04, K05}, \
+ }
#endif // RAMA_M6_A