From 690a879d77485a32a33c34d85a6563f96899fc64 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Mon, 29 Nov 2021 09:18:05 +0100 Subject: [PATCH 1/2] feat: adding carlosala keymap (#15281) --- .../keymaps/carlosala/config.h | 6 +++++ .../keymaps/carlosala/keymap.c | 25 +++++++++++++++++++ .../keymaps/carlosala/rules.mk | 2 ++ 3 files changed, 33 insertions(+) create mode 100644 keyboards/kprepublic/bm60hsrgb_poker/keymaps/carlosala/config.h create mode 100644 keyboards/kprepublic/bm60hsrgb_poker/keymaps/carlosala/keymap.c create mode 100644 keyboards/kprepublic/bm60hsrgb_poker/keymaps/carlosala/rules.mk diff --git a/keyboards/kprepublic/bm60hsrgb_poker/keymaps/carlosala/config.h b/keyboards/kprepublic/bm60hsrgb_poker/keymaps/carlosala/config.h new file mode 100644 index 00000000000..b8dea6a76a6 --- /dev/null +++ b/keyboards/kprepublic/bm60hsrgb_poker/keymaps/carlosala/config.h @@ -0,0 +1,6 @@ +// Copiright 2021 Carlo Sala (@carlosala) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#define UNICODE_SELECTED_MODES UC_LNX diff --git a/keyboards/kprepublic/bm60hsrgb_poker/keymaps/carlosala/keymap.c b/keyboards/kprepublic/bm60hsrgb_poker/keymaps/carlosala/keymap.c new file mode 100644 index 00000000000..6cd57417864 --- /dev/null +++ b/keyboards/kprepublic/bm60hsrgb_poker/keymaps/carlosala/keymap.c @@ -0,0 +1,25 @@ +// Copiright 2021 Carlo Sala (@carlosala) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_60_ansi( + KC_GRV, 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, + LT(2, 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_ESC, 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, RSFT_T(KC_CAPS), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL), + [1] = LAYOUT_60_ansi( + KC_TRNS, 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_TRNS, + KC_TRNS, RGB_MOD, RGB_SPI, RGB_HUI, RGB_SAI, RGB_VAI, KC_TRNS, KC_HOME, KC_END, KC_TRNS, KC_PSCR, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD, RGB_SPD, RGB_HUD, RGB_SAD, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_TOG, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_BRID, KC_BRIU, KC_TRNS, KC_TRNS, KC_TRNS, LALT(KC_F4), + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + [2] = LAYOUT_60_ansi( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, UC(0x00B7), KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET) +}; diff --git a/keyboards/kprepublic/bm60hsrgb_poker/keymaps/carlosala/rules.mk b/keyboards/kprepublic/bm60hsrgb_poker/keymaps/carlosala/rules.mk new file mode 100644 index 00000000000..fd581f26db4 --- /dev/null +++ b/keyboards/kprepublic/bm60hsrgb_poker/keymaps/carlosala/rules.mk @@ -0,0 +1,2 @@ +MOUSEKEY_ENABLE = no +UNICODE_ENABLE = yes From 35a18a8bcd393bf17f4be326d8ef067ce6bfaf50 Mon Sep 17 00:00:00 2001 From: Albert Y <76888457+filterpaper@users.noreply.github.com> Date: Mon, 29 Nov 2021 16:18:33 +0800 Subject: [PATCH 2/2] [Keyboard] Code updates for macro3 (#15280) Co-authored-by: filterpaper --- keyboards/macro3/config.h | 18 +------------- keyboards/macro3/keymaps/default/keymap.c | 18 +++----------- keyboards/macro3/macro3.c | 30 +++++++---------------- keyboards/macro3/macro3.h | 14 +---------- keyboards/macro3/post_config.h | 17 +++++++++++++ keyboards/macro3/readme.md | 6 ++--- 6 files changed, 34 insertions(+), 69 deletions(-) create mode 100644 keyboards/macro3/post_config.h diff --git a/keyboards/macro3/config.h b/keyboards/macro3/config.h index 59f7a151c7a..84f8c8fd9d7 100644 --- a/keyboards/macro3/config.h +++ b/keyboards/macro3/config.h @@ -1,18 +1,6 @@ /* Copyright 2020 David Philip Barr <@davidphilipbarr> * Copyright 2021 @filterpaper - * - * 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 . + * SPDX-License-Identifier: GPL-2.0+ */ #pragma once @@ -49,7 +37,3 @@ /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* Top right key */ -#define BOOTMAGIC_LITE_ROW 0 -#define BOOTMAGIC_LITE_COLUMN 3 - diff --git a/keyboards/macro3/keymaps/default/keymap.c b/keyboards/macro3/keymaps/default/keymap.c index ca4db51f3e3..11ebeff0230 100644 --- a/keyboards/macro3/keymaps/default/keymap.c +++ b/keyboards/macro3/keymaps/default/keymap.c @@ -1,26 +1,14 @@ /* Copyright 2020 David Philip Barr <@davidphilipbarr> * Copyright 2021 @filterpaper - * - * 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 . + * SPDX-License-Identifier: GPL-2.0+ */ #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT( - KC_HOME, KC_MUTE, KC_MPLY, KC_MSEL, - KC_UNDO, KC_CUT, KC_COPY, LT(1,KC_PSTE) + KC_MUTE, KC_MPLY, KC_MRWD, LT(1,KC_MFFD), + C(KC_Z), C(KC_X), C(KC_C), C(KC_V) ), [1] = LAYOUT( _______, _______, _______, _______, diff --git a/keyboards/macro3/macro3.c b/keyboards/macro3/macro3.c index cc12c0268aa..90bb9825091 100644 --- a/keyboards/macro3/macro3.c +++ b/keyboards/macro3/macro3.c @@ -1,18 +1,6 @@ /* Copyright 2020 David Philip Barr <@davidphilipbarr> * Copyright 2021 @filterpaper - * - * 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 . + * SPDX-License-Identifier: GPL-2.0+ */ #include "macro3.h" @@ -20,17 +8,17 @@ #ifdef ENCODER_ENABLE bool encoder_update_kb(uint8_t index, bool clockwise) { if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 1) { + if (index == 0) { if (clockwise) { - tap_code(KC_VOLD); - } else { tap_code(KC_VOLU); - } - } else if (index == 0) { - if (clockwise) { - tap_code(KC_WH_D); } else { - tap_code(KC_WH_U); + tap_code(KC_VOLD); + } + } else if (index == 1) { + if (clockwise) { + tap_code(KC_MNXT); + } else { + tap_code(KC_MPRV); } } return true; diff --git a/keyboards/macro3/macro3.h b/keyboards/macro3/macro3.h index 12621d2c09d..d95f504083e 100644 --- a/keyboards/macro3/macro3.h +++ b/keyboards/macro3/macro3.h @@ -1,18 +1,6 @@ /* Copyright 2020 David Philip Barr <@davidphilipbarr> * Copyright 2021 @filterpaper - * - * 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 . + * SPDX-License-Identifier: GPL-2.0+ */ #include "quantum.h" diff --git a/keyboards/macro3/post_config.h b/keyboards/macro3/post_config.h new file mode 100644 index 00000000000..0f94fe19e1a --- /dev/null +++ b/keyboards/macro3/post_config.h @@ -0,0 +1,17 @@ +/* Copyright 2020 David Philip Barr <@davidphilipbarr> + * Copyright 2021 @filterpaper + * SPDX-License-Identifier: GPL-2.0+ + */ + +/* Top right key */ +#ifndef BOOTMAGIC_LITE_ROW +# define BOOTMAGIC_LITE_ROW 0 +#endif +#ifndef BOOTMAGIC_LITE_COLUMN +# define BOOTMAGIC_LITE_COLUMN 3 +#endif + +#ifndef ENCODER_RESOLUTION +# define ENCODER_RESOLUTION 2 +#endif + diff --git a/keyboards/macro3/readme.md b/keyboards/macro3/readme.md index 66a142ecdfc..02347411745 100644 --- a/keyboards/macro3/readme.md +++ b/keyboards/macro3/readme.md @@ -1,8 +1,8 @@ # Macro3 -![Macro3](https://github.com/davidphilipbarr/Macropads/raw/main/macro3/IMG_20200703_170424.jpg) +![Macro3](https://github.com/filterpaper/filterpaper.github.io/raw/main/images/macro3.png) -Macro3 is a low-profile macro pad with encoder support designed by [@davidphilipbarr](https://github.com/davidphilipbarr) using direct micro-controller pin wiring. +Macro3 is a low-profile macro pad with dual encoder support designed by [@davidphilipbarr](https://github.com/davidphilipbarr). ## Keyboard Info @@ -21,6 +21,6 @@ See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_to Enter the bootloader in 3 ways: * **Bootmagic reset**: Hold down the top right key and plug in the controller. -* **Physical reset button**: Briefly press the reset button soldered on the PCB. * **Keycode in layout**: Press the key mapped to `RESET` if it is configured. +* **Physical reset pins**: Briefly short the RST and GND pins on the microcontroller using tweezers, a paperclip, or any other conductive material.