summaryrefslogtreecommitdiffstats
path: root/keyboards/bandominedoni
diff options
context:
space:
mode:
authorlokher <lokher@gmail.com>2022-09-13 11:13:00 +0800
committerlokher <lokher@gmail.com>2022-09-13 11:13:00 +0800
commitfe13cedf8c09fa34d5cec4e4c624738095176625 (patch)
tree818436626d49c7f22f325632b2053edba10d4358 /keyboards/bandominedoni
parentfa207545a9759c50b9f230eb608d86a9085801d4 (diff)
parentf46379f308783994b8178f95adc686f4b4c3ebd8 (diff)
merge upstream master
Diffstat (limited to 'keyboards/bandominedoni')
-rw-r--r--keyboards/bandominedoni/bandominedoni.c52
-rw-r--r--keyboards/bandominedoni/bandominedoni.h7
-rw-r--r--keyboards/bandominedoni/config.h13
-rw-r--r--keyboards/bandominedoni/info.json3
-rw-r--r--keyboards/bandominedoni/keymaps/default/keymap.c31
-rw-r--r--keyboards/bandominedoni/keymaps/default/rules.mk1
-rw-r--r--keyboards/bandominedoni/keymaps/led/config.h18
-rw-r--r--keyboards/bandominedoni/keymaps/led/keymap.c43
-rw-r--r--keyboards/bandominedoni/keymaps/led/readme.md2
-rw-r--r--keyboards/bandominedoni/keymaps/led/rules.mk2
-rw-r--r--keyboards/bandominedoni/keymaps/lednotg/keymap.c254
-rw-r--r--keyboards/bandominedoni/keymaps/lednotg/readme.md1
-rw-r--r--keyboards/bandominedoni/keymaps/lednotg/rules.mk4
-rw-r--r--keyboards/bandominedoni/keymaps/via/keymap.c37
-rw-r--r--keyboards/bandominedoni/keymaps/via/rules.mk2
15 files changed, 384 insertions, 86 deletions
diff --git a/keyboards/bandominedoni/bandominedoni.c b/keyboards/bandominedoni/bandominedoni.c
index eacbb40fa0..27df3598d4 100644
--- a/keyboards/bandominedoni/bandominedoni.c
+++ b/keyboards/bandominedoni/bandominedoni.c
@@ -117,55 +117,3 @@ static enum { UNKNOWN, LEFT, RIGHT } hand_side = UNKNOWN;
return (hand_side == LEFT);
}
}
-
-#ifdef ENCODER_ENABLE
-# ifdef ENCODERS
-static uint8_t encoder_state[ENCODERS] = {0};
-static keypos_t encoder_cw[ENCODERS] = ENCODERS_CW_KEY;
-static keypos_t encoder_ccw[ENCODERS] = ENCODERS_CCW_KEY;
-# endif
-
-void encoder_action_unregister(void) {
-# ifdef ENCODERS
- for (int index = 0; index < ENCODERS; ++index) {
- if (encoder_state[index]) {
- keyevent_t encoder_event = (keyevent_t) {
- .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index],
- .pressed = false,
- .time = (timer_read() | 1)
- };
- encoder_state[index] = 0;
- action_exec(encoder_event);
- }
- }
-# endif
-}
-
-void encoder_action_register(uint8_t index, bool clockwise) {
-# ifdef ENCODERS
- keyevent_t encoder_event = (keyevent_t) {
- .key = clockwise ? encoder_cw[index] : encoder_ccw[index],
- .pressed = true,
- .time = (timer_read() | 1)
- };
- encoder_state[index] = (clockwise ^ 1) | (clockwise << 1);
-# ifdef CONSOLE_ENABLE
- uprintf("encoder_action_register index = %u, clockwise = %u, row = %u, col = %u\n", index, clockwise, encoder_event.key.row, encoder_event.key.col);
-# endif
- action_exec(encoder_event);
-# endif
-}
-
-void matrix_scan_kb(void) {
- encoder_action_unregister();
- matrix_scan_user();
-}
-
-bool encoder_update_kb(uint8_t index, bool clockwise) {
- encoder_action_register(index, clockwise);
- // don't return user actions, because they are in the keymap
- // encoder_update_user(index, clockwise);
- return true;
-};
-
-#endif
diff --git a/keyboards/bandominedoni/bandominedoni.h b/keyboards/bandominedoni/bandominedoni.h
index 1eca4f8d98..6011a2cc71 100644
--- a/keyboards/bandominedoni/bandominedoni.h
+++ b/keyboards/bandominedoni/bandominedoni.h
@@ -38,7 +38,7 @@
l40, l41, l42, l43, l44, l45, l46, l47, \
\
oc, r00, r01, r02, r03, fn, \
- r10, r11, r12, r13, r14, ccw, cw,\
+ r10, r11, r12, r13, r14, \
r20, r21, r22, r23, r24, r25, \
r30, r31, r32, r33, r34, r35, r36, r37, \
r40, r41, r42, r43, r44, r45, r46, r47, \
@@ -49,7 +49,7 @@
{ l20, l21, l22, l23, l24, l25, l26 }, \
{ l30, l31, l32, l33, l34, l35, l36 }, \
{ l41, l42, l43, l44, l45, l46, l47 }, \
- { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, ccw, cw }, \
+ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
{ r50, r40, r31, r20, r10, r00, r30 }, \
{ r51, r41, r32, r21, r11, r01, oc }, \
{ r52, r42, r33, r22, r12, r02, fn }, \
@@ -83,6 +83,3 @@
// However, It enables to decide the handedness by the HW by adding one condition: "not to press any keys (especially r30) dusing startup."
bool is_keyboard_left(void);
-void encoder_action_unregister(void);
-
-void encoder_action_register(uint8_t index, bool clockwise);
diff --git a/keyboards/bandominedoni/config.h b/keyboards/bandominedoni/config.h
index 0e37d96d41..17f5675f60 100644
--- a/keyboards/bandominedoni/config.h
+++ b/keyboards/bandominedoni/config.h
@@ -33,7 +33,6 @@
*/
#define MATRIX_ROW_PINS { B5, B4, D7, F6, C6, D4 }
#define MATRIX_COL_PINS { D1, E6, F7, B1, B3, B2, D0 }
-#define UNUSED_PINS
#define MASTER_RIGHT
#ifndef MASTER_RIGHT
@@ -49,6 +48,8 @@
*/
#define SOFT_SERIAL_PIN D2 // or D1, D2, D3, E6
+#define SPLIT_USB_DETECT
+
//#define LED_NUM_LOCK_PIN B0
//#define LED_CAPS_LOCK_PIN B1
//#define LED_SCROLL_LOCK_PIN B2
@@ -247,13 +248,11 @@
* Encoder options
*/
#ifdef ENCODER_ENABLE
-# define ENCODERS_PAD_A { C7 } // dummy
-# define ENCODERS_PAD_B { B7 } // dummy
+# define ENCODERS_PAD_A { }
+# define ENCODERS_PAD_B { }
+# define ENCODER_RESOLUTIONS { }
# define ENCODERS_PAD_A_RIGHT { F5 }
# define ENCODERS_PAD_B_RIGHT { F4 }
-# define ENCODER_RESOLUTION 4
+# define ENCODER_RESOLUTIONS_RIGHT { 4 }
# define TAP_CODE_DELAY 10
-# define ENCODERS 2
-# define ENCODERS_CW_KEY { {4, 5}, {6, 5} }
-# define ENCODERS_CCW_KEY { {3, 5}, {5, 5} }
#endif // ENCODER_ENABLE
diff --git a/keyboards/bandominedoni/info.json b/keyboards/bandominedoni/info.json
index 040526b39c..f78621ec41 100644
--- a/keyboards/bandominedoni/info.json
+++ b/keyboards/bandominedoni/info.json
@@ -65,9 +65,6 @@
{"label": "r13", "x": 14, "y": 1},
{"label": "r14", "x": 15, "y": 1},
- {"label": "ccw", "x": 16.5, "y": 1},
- {"label": "cw", "x": 17.5, "y": 1},
-
{"label": "r20", "x": 10.5, "y": 2},
{"label": "r21", "x": 11.5, "y": 2},
{"label": "r22", "x": 12.5, "y": 2},
diff --git a/keyboards/bandominedoni/keymaps/default/keymap.c b/keyboards/bandominedoni/keymaps/default/keymap.c
index bfa49dfe17..90e3f3417e 100644
--- a/keyboards/bandominedoni/keymaps/default/keymap.c
+++ b/keyboards/bandominedoni/keymaps/default/keymap.c
@@ -14,6 +14,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
+#include "version.h"
// Defines names for use in layer keycodes and the keymap
enum layer_names {
@@ -27,6 +28,9 @@ enum layer_names {
_FN
};
+enum custom_keycodes {
+ VERSION = SAFE_RANGE
+};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_OPEN] = LAYOUT(
@@ -37,7 +41,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
MI_D_1, MI_B_1, MI_G_3, MI_A_3, MI_Ds_3, MI_Fs_2, MI_Ds_1, MI_C_1,
MO_SWAP, MI_B_5, MI_Gs_5, MI_G_5, MI_F_5, FN_MUTE,
- MI_Cs_3, MI_A_5, MI_Fs_5, MI_E_5, MI_Ds_5, KC_VOLD, KC_VOLU,
+ MI_Cs_3, MI_A_5, MI_Fs_5, MI_E_5, MI_Ds_5,
MI_C_3, MI_D_3, MI_G_3, MI_As_4, MI_C_5, MI_D_5,
TG_SWAP, MI_B_2, MI_E_3, MI_Cs_4, MI_Fs_3, MI_A_3, MI_C_4, MI_E_4,
MI_A_2, MI_F_3, MI_As_3, MI_Gs_3, MI_B_3, MI_D_4, MI_Gs_4, MI_B_4,
@@ -52,7 +56,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
MI_E_1, MI_E_2, MI_Fs_3, MI_Gs_3, MI_B_3, MI_F_2, MI_Cs_1, MI_F_1,
MO_SWAP, MI_A_5, MI_Gs_5, MI_Fs_5, MI_F_5, FN_MUTE,
- MI_C_3, MI_G_5, MI_As_4, MI_C_5, MI_Ds_5, KC_VOLD, KC_VOLU,
+ MI_C_3, MI_G_5, MI_As_4, MI_C_5, MI_Ds_5,
MI_D_3, MI_Cs_3, MI_Gs_3, MI_As_3, MI_C_4, MI_D_5,
TG_SWAP, MI_B_2, MI_Fs_3, MI_Fs_4, MI_G_3, MI_B_3, MI_D_4, MI_G_4,
MI_A_2, MI_F_3, MI_E_3, MI_A_3, MI_Cs_4, MI_E_4, MI_A_4, MI_Cs_5,
@@ -67,14 +71,22 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
_______, MI_OCTD, MI_OCTU, MI_VELD, MI_VELU, _______,
- XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
- XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
+ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
+ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, VERSION,
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
)
};
+#if defined(ENCODER_MAP_ENABLE)
+const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
+ [_OPEN] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
+ [_CLOSE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
+ [_FN] = { ENCODER_CCW_CW(_______, _______) },
+};
+#endif
+
void keyboard_post_init_user(void) {
// Set octave to MI_OCT_0
midi_config.octave = MI_OCT_0 - MIDI_OCTAVE_MIN;
@@ -82,3 +94,14 @@ void keyboard_post_init_user(void) {
// avoid using 127 since it is used as a special number in some sound sources.
midi_config.velocity = MIDI_INITIAL_VELOCITY;
};
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ switch (keycode) {
+ case VERSION: // Output firmware info.
+ if (record->event.pressed) {
+ SEND_STRING(QMK_KEYBOARD ":" QMK_KEYMAP " @ " QMK_VERSION " | " QMK_BUILDDATE);
+ }
+ break;
+ }
+ return true;
+}
diff --git a/keyboards/bandominedoni/keymaps/default/rules.mk b/keyboards/bandominedoni/keymaps/default/rules.mk
new file mode 100644
index 0000000000..8006608ea9
--- /dev/null
+++ b/keyboards/bandominedoni/keymaps/default/rules.mk
@@ -0,0 +1 @@
+ENCODER_MAP_ENABLE = yes # replacing ENCODERS_CW_KEY method to this on 2022/08/31.
diff --git a/keyboards/bandominedoni/keymaps/led/config.h b/keyboards/bandominedoni/keymaps/led/config.h
new file mode 100644
index 0000000000..04bd66bf1a
--- /dev/null
+++ b/keyboards/bandominedoni/keymaps/led/config.h
@@ -0,0 +1,18 @@
+/* Copyright 2021 3araht
+ *
+ * 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
+
+#define DYNAMIC_KEYMAP_LAYER_COUNT 6
diff --git a/keyboards/bandominedoni/keymaps/led/keymap.c b/keyboards/bandominedoni/keymaps/led/keymap.c
index 305756b5b1..8659697a91 100644
--- a/keyboards/bandominedoni/keymaps/led/keymap.c
+++ b/keyboards/bandominedoni/keymaps/led/keymap.c
@@ -14,6 +14,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
+#include "version.h"
#define DF_COLE DF(_COLEMAK)
@@ -54,6 +55,10 @@ enum layer_names {
_FN
};
+enum custom_keycodes {
+ VERSION = SAFE_RANGE
+};
+
// Alias layout macros that expand groups of keys.
#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__)
@@ -66,7 +71,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
MI_D_1, MI_B_1, MI_G_3, MI_A_3, MI_Ds_3, MI_Fs_2, MI_Ds_1, MI_C_1,
MO_SWAP, MI_B_5, MI_Gs_5, MI_G_5, MI_F_5, FN_MUTE,
- MI_Cs_3, MI_A_5, MI_Fs_5, MI_E_5, MI_Ds_5, KC_VOLD, KC_VOLU,
+ MI_Cs_3, MI_A_5, MI_Fs_5, MI_E_5, MI_Ds_5,
MI_C_3, MI_D_3, MI_G_3, MI_As_4, MI_C_5, MI_D_5,
TG_SWAP, MI_B_2, MI_E_3, MI_Cs_4, MI_Fs_3, MI_A_3, MI_C_4, MI_E_4,
MI_A_2, MI_F_3, MI_As_3, MI_Gs_3, MI_B_3, MI_D_4, MI_Gs_4, MI_B_4,
@@ -81,7 +86,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
MI_E_1, MI_E_2, MI_Fs_3, MI_Gs_3, MI_B_3, MI_F_2, MI_Cs_1, MI_F_1,
MO_SWAP, MI_A_5, MI_Gs_5, MI_Fs_5, MI_F_5, FN_MUTE,
- MI_C_3, MI_G_5, MI_As_4, MI_C_5, MI_Ds_5, KC_VOLD, KC_VOLU,
+ MI_C_3, MI_G_5, MI_As_4, MI_C_5, MI_Ds_5,
MI_D_3, MI_Cs_3, MI_Gs_3, MI_As_3, MI_C_4, MI_D_5,
TG_SWAP, MI_B_2, MI_Fs_3, MI_Fs_4, MI_G_3, MI_B_3, MI_D_4, MI_G_4,
MI_A_2, MI_F_3, MI_E_3, MI_A_3, MI_Cs_4, MI_E_4, MI_A_4, MI_Cs_5,
@@ -96,7 +101,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_LCTL, KC_GRV, KC_LGUI, KC_LALT, MIS_EIS, KC_SPC, KC_SPC, KC_PSCR,
MO(_MISC), KC_LBRC, KC_RBRC, KC_BSLS, KC_0, _______,
- KC_6, KC_7, KC_8, KC_9, KC_BSPC, _______, _______,
+ KC_6, KC_7, KC_8, KC_9, KC_BSPC,
_________________QWERTY_R1_________________, KC_DEL,
KC_PGUP, KC_G, _________________QWERTY_R2_________________, KC_ENT,
KC_PGDN, KC_B, _________________QWERTY_R3_________________, KC_RSFT,
@@ -111,7 +116,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_CAPS, KC_GRV, KC_LGUI, KC_LALT, MIS_EIS, KC_SPC, KC_SPC, KC_PSCR,
MO(_MISC), KC_LBRC, KC_RBRC, KC_BSLS, KC_0, _______,
- KC_6, KC_7, KC_8, KC_9, KC_BSPC, _______, _______,
+ KC_6, KC_7, KC_8, KC_9, KC_BSPC,
_________________COLEMAK_R1________________, KC_DEL,
KC_PGUP, KC_D, _________________COLEMAK_R2________________, KC_ENT,
KC_PGDN, KC_B, _________________COLEMAK_R3________________, KC_RSFT,
@@ -126,7 +131,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, KC_F10, _______,
- KC_F6, KC_F7, KC_F8, KC_F9, _______, _______, _______,
+ KC_F6, KC_F7, KC_F8, KC_F9, _______,
_______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, KC_QUOT, _______,
_______, _______, _______, _______, _______, _______, _______, _______,
@@ -141,14 +146,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
XXXXXXX, XXXXXXX, AG_NORM, AG_SWAP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
_______, MI_OCTD, MI_OCTU, MI_VELD, MI_VELU, _______,
- XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_RMOD, RGB_MOD,
- XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
+ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
+ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, VERSION,
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
RGB_SAD, RGB_SAI, RGB_HUD, RGB_HUI, RGB_SPD, RGB_SPI, RGB_VAD, RGB_VAI,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_RMOD, RGB_MOD, EEP_RST, RGB_TOG
)
};
+#if defined(ENCODER_MAP_ENABLE)
+const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
+ [_OPEN] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
+ [_CLOSE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
+ [_QWERTY] = { ENCODER_CCW_CW(_______, _______) },
+ [_COLEMAK] = { ENCODER_CCW_CW(_______, _______) },
+ [_MISC] = { ENCODER_CCW_CW(_______, _______) },
+ [_FN] = { ENCODER_CCW_CW(RGB_RMOD, RGB_MOD) },
+};
+#endif
+
void my_init(void){
// Set octave to MI_OCT_0
midi_config.octave = MI_OCT_0 - MIDI_OCTAVE_MIN;
@@ -177,10 +193,21 @@ void keyboard_post_init_user(void) {
rgb_matrix_mode(RGB_MATRIX_RAINBOW_MOVING_CHEVRON);
};
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ switch (keycode) {
+ case VERSION: // Output firmware info.
+ if (record->event.pressed) {
+ SEND_STRING(QMK_KEYBOARD ":" QMK_KEYMAP " @ " QMK_VERSION " | " QMK_BUILDDATE);
+ }
+ break;
+ }
+ return true;
+}
+
#ifdef RGB_MATRIX_ENABLE
void rgb_matrix_indicators_user(void) {
if (rgb_matrix_is_enabled()) { // turn the lights on when it is enabled.
- uint8_t layer = biton32(layer_state);
+ uint8_t layer = get_highest_layer(layer_state);
switch (layer) {
case _CLOSE:
// rgb_matrix_set_color(pgm_read_byte(&convert_led_location2number[11]), RGB_RED); // RGB_TOG <- too heavy.
diff --git a/keyboards/bandominedoni/keymaps/led/readme.md b/keyboards/bandominedoni/keymaps/led/readme.md
index e6ec2ad10d..77e709c70b 100644
--- a/keyboards/bandominedoni/keymaps/led/readme.md
+++ b/keyboards/bandominedoni/keymaps/led/readme.md
@@ -1 +1 @@
-# The default keymap for bandominedoni
+# The keymap with led for bandominedoni
diff --git a/keyboards/bandominedoni/keymaps/led/rules.mk b/keyboards/bandominedoni/keymaps/led/rules.mk
index 08ed472ad6..0a1c4b1858 100644
--- a/keyboards/bandominedoni/keymaps/led/rules.mk
+++ b/keyboards/bandominedoni/keymaps/led/rules.mk
@@ -1,2 +1,4 @@
RGB_MATRIX_ENABLE = yes # Use RGB matrix (Don't enable this when RGBLIGHT_ENABLE is used.)
RGB_MATRIX_CUSTOM_KB = yes #
+
+ENCODER_MAP_ENABLE = yes # replacing ENCODERS_CW_KEY method to this on 2022/08/31.
diff --git a/keyboards/bandominedoni/keymaps/lednotg/keymap.c b/keyboards/bandominedoni/keymaps/lednotg/keymap.c
new file mode 100644
index 0000000000..ba25c1d55f
--- /dev/null
+++ b/keyboards/bandominedoni/keymaps/lednotg/keymap.c
@@ -0,0 +1,254 @@
+/* Copyright 2021 3araht
+ *
+ * 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
+#include "version.h"
+
+#define DF_COLE DF(_COLEMAK)
+
+#define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T
+#define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G
+#define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B
+
+#define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P
+#define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN
+#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH
+
+#define _________________COLEMAK_L1________________ KC_Q, KC_W, KC_F, KC_P, KC_G
+#define _________________COLEMAK_L2________________ KC_A, KC_R, KC_S, KC_T, KC_D
+#define _________________COLEMAK_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_B
+
+#define _________________COLEMAK_R1________________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN
+#define _________________COLEMAK_R2________________ KC_H, KC_N, KC_E, KC_I, KC_O
+#define _________________COLEMAK_R3________________ KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH
+
+#define _________________NUMBER_L__________________ KC_1, KC_2, KC_3, KC_4, KC_5
+// #define _________________NUMBER_R__________________ KC_6, KC_7, KC_8, KC_9, KC_0
+
+#define _________________FUNC__L___________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5
+// #define _________________FUNC__R___________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10
+
+// Defines names for use in layer keycodes and the keymap
+enum layer_names {
+#ifndef PEDAL_NORMALLY_CLOSED
+ _OPEN,
+#endif
+ _CLOSE,
+#ifdef PEDAL_NORMALLY_CLOSED
+ _OPEN,
+#endif
+ _QWERTY,
+ _COLEMAK,
+ _MISC,
+ _FN
+};
+
+enum custom_keycodes {
+ VERSION = SAFE_RANGE
+};
+
+// Alias layout macros that expand groups of keys.
+#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__)
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ [_OPEN] = LAYOUT(
+ MI_Gs_1, MI_As_1, MI_Cs_2, MI_F_2, MI_Gs_3,
+ MI_E_1, MI_A_1, MI_G_2, MI_Ds_2, MI_F_3, MI_As_2, MI_F_1,
+ MI_D_2, MI_A_2, MI_C_3, MI_E_3, MI_C_2, MI_G_1, MI_B,
+ MI_E_2, MI_Gs_2, MI_B_2, MI_D_3, MI_Fs_3, MI_Cs_3, MI_Fs_1,
+ MI_D_1, MI_B_1, MI_G_3, MI_A_3, MI_Ds_3, MI_Fs_2, MI_Ds_1, MI_C_1,
+
+ MO_SWAP, MI_B_5, MI_Gs_5, MI_G_5, MI_F_5, FN_MUTE,
+ MI_Cs_3, MI_A_5, MI_Fs_5, MI_E_5, MI_Ds_5,
+ MI_C_3, MI_D_3, MI_G_3, MI_As_4, MI_C_5, MI_D_5,
+ MI_G_2, MI_B_2, MI_E_3, MI_Cs_4, MI_Fs_3, MI_A_3, MI_C_4, MI_E_4,
+ MI_A_2, MI_F_3, MI_As_3, MI_Gs_3, MI_B_3, MI_D_4, MI_Gs_4, MI_B_4,
+ MI_Gs_2, MI_As_2, MI_Ds_3, MI_F_4, MI_Ds_4, MI_Fs_4, MI_A_4, MI_Cs_5, MI_G_4
+ ),
+
+ [_CLOSE] = LAYOUT(
+ MI_Gs_1, MI_As_1, MI_Ds_2, MI_Ds_3, MI_G_3,
+ MI_D_1, MI_D_2, MI_As_2, MI_C_3, MI_Cs_2, MI_C_2, MI_Fs_1,
+ MI_G_1, MI_G_2, MI_B_2, MI_D_3, MI_F_3, MI_Fs_2, MI_B,
+ MI_A_1, MI_E_2, MI_A_2, MI_Cs_3, MI_E_3, MI_Gs_2, MI_B_1,
+ MI_E_1, MI_E_2, MI_Fs_3, MI_Gs_3, MI_B_3, MI_F_2, MI_Cs_1, MI_F_1,
+
+ MO_SWAP, MI_A_5, MI_Gs_5, MI_Fs_5, MI_F_5, FN_MUTE,
+ MI_C_3, MI_G_5, MI_As_4, MI_C_5, MI_Ds_5,
+ MI_D_3, MI_Cs_3, MI_Gs_3, MI_As_3, MI_C_4, MI_D_5,
+ MI_G_2, MI_B_2, MI_Fs_3, MI_Fs_4, MI_G_3, MI_B_3, MI_D_4, MI_G_4,
+ MI_A_2, MI_F_3, MI_E_3, MI_A_3, MI_Cs_4, MI_E_4, MI_A_4, MI_Cs_5,
+ MI_Gs_2, MI_As_2, MI_Ds_3, MI_F_4, MI_E_4, MI_Gs_4, MI_B_4, MI_E_5, MI_Ds_4
+ ),
+
+ [_QWERTY] = LAYOUT_wrapper(
+ _________________NUMBER_L__________________,
+ KC_GESC, KC_TAB, _________________QWERTY_L1_________________,
+ KC_CAPS, _________________QWERTY_L2_________________, KC_H,
+ KC_LSFT, _________________QWERTY_L3_________________, KC_N,
+ KC_LCTL, KC_GRV, KC_LGUI, KC_LALT, MIS_EIS, KC_SPC, KC_SPC, KC_PSCR,
+
+ MO(_MISC), KC_LBRC, KC_RBRC, KC_BSLS, KC_0, _______,
+ KC_6, KC_7, KC_8, KC_9, KC_BSPC,
+ _________________QWERTY_R1_________________, KC_DEL,
+ KC_PGUP, KC_G, _________________QWERTY_R2_________________, KC_ENT,
+ KC_PGDN, KC_B, _________________QWERTY_R3_________________, KC_RSFT,
+ KC_HOME, KC_END, KC_SPC, MIS_KAN, KC_RALT, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
+ ),
+
+ [_COLEMAK] = LAYOUT_wrapper(
+ _________________NUMBER_L__________________,
+ KC_GESC, KC_TAB, _________________COLEMAK_L1________________,
+ KC_LCTL, _________________COLEMAK_L2________________, KC_ENT,
+ KC_LSFT, _________________COLEMAK_L3________________, KC_M,
+ KC_CAPS, KC_GRV, KC_LGUI, KC_LALT, MIS_EIS, KC_SPC, KC_SPC, KC_PSCR,
+
+ MO(_MISC), KC_LBRC, KC_RBRC, KC_BSLS, KC_0, _______,
+ KC_6, KC_7, KC_8, KC_9, KC_BSPC,
+ _________________COLEMAK_R1________________, KC_DEL,
+ KC_PGUP, KC_D, _________________COLEMAK_R2________________, KC_ENT,
+ KC_PGDN, KC_B, _________________COLEMAK_R3________________, KC_RSFT,
+ KC_HOME, KC_END, KC_SPC, MIS_KAN, KC_RALT, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
+ ),
+
+ [_MISC] = LAYOUT_wrapper(
+ _________________FUNC__L___________________,
+ _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______,
+
+ _______, _______, _______, _______, KC_F10, _______,
+ KC_F6, KC_F7, KC_F8, KC_F9, _______,
+ _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, KC_QUOT, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______
+ ),
+
+ [_FN] = LAYOUT(
+ DF_SWAP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
+ XXXXXXX, DF_QWER, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
+ DF_COLE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______,
+ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
+ XXXXXXX, XXXXXXX, AG_NORM, AG_SWAP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
+
+ _______, KC_VOLD, KC_VOLU, MI_VELD, MI_VELU, _______,
+ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
+ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, VERSION,
+ _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
+ RGB_SAD, RGB_SAI, RGB_HUD, RGB_HUI, RGB_SPD, RGB_SPI, RGB_VAD, RGB_VAI,
+ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_RMOD, RGB_MOD, EEP_RST, RGB_TOG
+ )
+};
+
+#if defined(ENCODER_MAP_ENABLE)
+const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
+ [_OPEN] = { ENCODER_CCW_CW(MI_OCTD, MI_OCTU) },
+ [_CLOSE] = { ENCODER_CCW_CW(MI_OCTD, MI_OCTU) },
+ [_QWERTY] = { ENCODER_CCW_CW(_______, _______) },
+ [_COLEMAK] = { ENCODER_CCW_CW(_______, _______) },
+ [_MISC] = { ENCODER_CCW_CW(_______, _______) },
+ [_FN] = { ENCODER_CCW_CW(RGB_RMOD, RGB_MOD) },
+};
+#endif
+
+void my_init(void){
+ // Set octave to MI_OCT_0
+ midi_config.octave = MI_OCT_0 - MIDI_OCTAVE_MIN;
+
+ // avoid using 127 since it is used as a special number in some sound sources.
+ midi_config.velocity = MIDI_INITIAL_VELOCITY;
+}
+
+void eeconfig_init_user(void) { // EEPROM is getting reset!
+ midi_init();
+ my_init();
+#ifdef RGB_MATRIX_ENABLE
+ rgb_matrix_enable();
+ rgb_matrix_set_speed(RGB_MATRIX_STARTUP_SPD);
+ rgb_matrix_sethsv(HSV_BLUE);
+
+ rgb_matrix_mode(RGB_MATRIX_SOLID_REACTIVE);
+ // rgb_matrix_mode(RGB_MATRIX_RAINBOW_MOVING_CHEVRON);
+#endif
+}
+
+void keyboard_post_init_user(void) {
+ my_init();
+
+ // party mode (for LED soldering test. Enable rainbow color effect, and disable led_indicator to check all LEDs)
+ rgb_matrix_mode(RGB_MATRIX_RAINBOW_MOVING_CHEVRON);
+};
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ switch (keycode) {
+ case VERSION: // Output firmware info.
+ if (record->event.pressed) {
+ SEND_STRING(QMK_KEYBOARD ":" QMK_KEYMAP " @ " QMK_VERSION " | " QMK_BUILDDATE);
+ }
+ break;
+ }
+ return true;
+}
+
+#ifdef RGB_MATRIX_ENABLE
+void rgb_matrix_indicators_user(void) {
+ if (rgb_matrix_is_enabled()) { // turn the lights on when it is enabled.
+ uint8_t layer = biton32(layer_state);
+ switch (layer) {
+ case _CLOSE:
+ // rgb_matrix_set_color(pgm_read_byte(&convert_led_location2number[11]), RGB_RED); // RGB_TOG <- too heavy.
+
+ // Close state indicator
+ rgb_matrix_set_color( 0, RGB_DARKWHITE); // oc
+ break;
+
+ case _FN:
+ // left hand side
+ rgb_matrix_set_color( 46, RGB_DARKORANGE); // DF_OPEN
+ rgb_matrix_set_color( 48, RGB_DARKWHITE); // DF_QWER
+ rgb_matrix_set_color( 60, RGB_DARKWHITE); // DF_COLE
+
+ rgb_matrix_set_color( 73, RGB_DARKYELLOW); // AG_SWAP
+ rgb_matrix_set_color( 72, RGB_DARKYELLOW); // AG_NORM
+
+
+ // right hand side
+ rgb_matrix_set_color( 1, RGB_DARKYELLOW); // MI_OCTD
+ rgb_matrix_set_color(13, RGB_DARKGREEN); // MI_OCTU
+ rgb_matrix_set_color(14, RGB_DARKYELLOW); // MI_VELD
+ rgb_matrix_set_color(25, RGB_DARKGREEN); // MI_VELU
+
+ rgb_matrix_set_color( 6, RGB_DARKBLUE); // RGB_SAD
+ rgb_matrix_set_color( 9, RGB_DARKBLUE); // RGB_SAI
+ rgb_matrix_set_color(18, RGB_DARKBLUE); // RGB_HUD
+ rgb_matrix_set_color(21, RGB_DARKBLUE); // RGB_HUI
+ rgb_matrix_set_color(29, RGB_DARKBLUE); // RGB_SPD
+ rgb_matrix_set_color(32, RGB_DARKBLUE); // RGB_SPI
+ rgb_matrix_set_color(36, RGB_DARKBLUE); // RGB_VAD
+ rgb_matrix_set_color(39, RGB_DARKBLUE); // RGB_VAI
+
+ rgb_matrix_set_color(31, RGB_DARKBLUE); // RGB_RMOD
+ rgb_matrix_set_color(37, RGB_DARKBLUE); // RGB_MOD
+ rgb_matrix_set_color(38, RGB_DARKPINK); // EEP_RST
+ rgb_matrix_set_color(40, RGB_DARKRED); // RGB_TOG
+
+ rgb_matrix_set_color(41, RGB_DARKORANGE); // _FN
+ break;
+ }
+ }
+}
+#endif
diff --git a/keyboards/bandominedoni/keymaps/lednotg/readme.md b/keyboards/bandominedoni/keymaps/lednotg/readme.md
new file mode 100644
index 0000000000..803d1d39f8
--- /dev/null
+++ b/keyboards/bandominedoni/keymaps/lednotg/readme.md
@@ -0,0 +1 @@
+# The keymap with led and no TG keys on the layout for bandominedoni
diff --git a/keyboards/bandominedoni/keymaps/lednotg/rules.mk b/keyboards/bandominedoni/keymaps/lednotg/rules.mk
new file mode 100644
index 0000000000..0a1c4b1858
--- /dev/null
+++ b/keyboards/bandominedoni/keymaps/lednotg/rules.mk
@@ -0,0 +1,4 @@
+RGB_MATRIX_ENABLE = yes # Use RGB matrix (Don't enable this when RGBLIGHT_ENABLE is used.)
+RGB_MATRIX_CUSTOM_KB = yes #
+
+ENCODER_MAP_ENABLE = yes # replacing ENCODERS_CW_KEY method to this on 2022/08/31.
diff --git a/keyboards/bandominedoni/keymaps/via/keymap.c b/keyboards/bandominedoni/keymaps/via/keymap.c
index ad6833d692..aa668af154 100644
--- a/keyboards/bandominedoni/keymaps/via/keymap.c
+++ b/keyboards/bandominedoni/keymaps/via/keymap.c
@@ -14,6 +14,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
+#include "version.h"
// Defines names for use in layer keycodes and the keymap
enum layer_names {
@@ -28,6 +29,10 @@ enum layer_names {
_FN
};
+enum custom_keycodes {
+ VERSION = USER00
+};
+
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_OPEN] = LAYOUT(
MI_Gs_1, MI_As_1, MI_Cs_2, MI_F_2, MI_Gs_3,
@@ -37,7 +42,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
MI_D_1, MI_B_1, MI_G_3, MI_A_3, MI_Ds_3, MI_Fs_2, MI_Ds_1, MI_C_1,
MO_SWAP, MI_B_5, MI_Gs_5, MI_G_5, MI_F_5, FN_MUTE,
- MI_Cs_3, MI_A_5, MI_Fs_5, MI_E_5, MI_Ds_5, KC_VOLD, KC_VOLU,
+ MI_Cs_3, MI_A_5, MI_Fs_5, MI_E_5, MI_Ds_5,
MI_C_3, MI_D_3, MI_G_3, MI_As_4, MI_C_5, MI_D_5,
TG_SWAP, MI_B_2, MI_E_3, MI_Cs_4, MI_Fs_3, MI_A_3, MI_C_4, MI_E_4,
MI_A_2, MI_F_3, MI_As_3, MI_Gs_3, MI_B_3, MI_D_4, MI_Gs_4, MI_B_4,
@@ -52,7 +57,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
MI_E_1, MI_E_2, MI_Fs_3, MI_Gs_3, MI_B_3, MI_F_2, MI_Cs_1, MI_F_1,
MO_SWAP, MI_A_5, MI_Gs_5, MI_Fs_5, MI_F_5, FN_MUTE,
- MI_C_3, MI_G_5, MI_As_4, MI_C_5, MI_Ds_5, KC_VOLD, KC_VOLU,
+ MI_C_3, MI_G_5, MI_As_4, MI_C_5, MI_Ds_5,
MI_D_3, MI_Cs_3, MI_Gs_3, MI_As_3, MI_C_4, MI_D_5,
TG_SWAP, MI_B_2, MI_Fs_3, MI_Fs_4, MI_G_3, MI_B_3, MI_D_4, MI_G_4,
MI_A_2, MI_F_3, MI_E_3, MI_A_3, MI_Cs_4, MI_E_4, MI_A_4, MI_Cs_5,
@@ -67,7 +72,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______,
- _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______,
@@ -82,14 +87,23 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
_______, MI_OCTD, MI_OCTU, MI_VELD, MI_VELU, _______,
- XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_RMOD, RGB_MOD,
- XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
+ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
+ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, VERSION,
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
RGB_SAD, RGB_SAI, RGB_HUD, RGB_HUI, RGB_SPD, RGB_SPI, RGB_VAD, RGB_VAI,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_RMOD, RGB_MOD, EEP_RST, RGB_TOG
)
};
+#if defined(ENCODER_MAP_ENABLE)
+const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
+ [_OPEN] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
+ [_CLOSE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
+ [_MISC] = { ENCODER_CCW_CW(_______, _______) },
+ [_FN] = { ENCODER_CCW_CW(RGB_RMOD, RGB_MOD) },
+};
+#endif
+
void my_init(void){
// Set octave to MI_OCT_0
midi_config.octave = MI_OCT_0 - MIDI_OCTAVE_MIN;
@@ -115,10 +129,21 @@ void keyboard_post_init_user(void) {
my_init();
};
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ switch (keycode) {
+ case VERSION: // Output firmware info.
+ if (record->event.pressed) {
+ SEND_STRING(QMK_KEYBOARD ":" QMK_KEYMAP " @ " QMK_VERSION " | " QMK_BUILDDATE);