소스 검색

[Keyboard] refactor signum30 (#14527)

Co-authored-by: Drashna Jaelre <drashna@live.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
Co-authored-by: Stan Gurenkov <stan.gurenkov@docusign.com>
Stan Gurenkov 3 년 전
부모
커밋
4493a05b74

+ 32 - 0
keyboards/signum/3_0/config.h

@@ -0,0 +1,32 @@
+/* Copyright 2021 Stan Gurenkov <rococo04_fox@icloud.com>
+ *
+ * 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 0xFEED
+#define PRODUCT_ID 0x6060
+#define DEVICE_VER 0x0001
+#define MANUFACTURER Troy Fletcher
+#define PRODUCT Signum30
+
+/* key matrix size */
+#define MATRIX_ROWS 4
+#define MATRIX_COLS 12
+
+/* COL2ROW or ROW2COL */
+#define DIODE_DIRECTION COL2ROW

+ 0 - 22
keyboards/signum/3_0/elitec/config.h

@@ -2,29 +2,7 @@
 
 #include "config_common.h"
 
-/* USB Device descriptor parameter */
-#define VENDOR_ID       0xF1E7
-#define PRODUCT_ID      0x5163
-#define DEVICE_VER      0x0000
-#define MANUFACTURER    troyfletcher
-#define PRODUCT         Signum
-
-/* mouse settings */
-#define MK_KINETIC_SPEED
-
-/* key matrix size */
-#define MATRIX_ROWS 4
-#define MATRIX_COLS 12
-
 /* key matrix pins */
 #define MATRIX_ROW_PINS { D2, D1, F5, B5 }
 #define MATRIX_COL_PINS { B4, D7, D0, E6, D4, F6, F4, F7, B1, B3, C6, B2 }
 #define UNUSED_PINS
-
-#define DIODE_DIRECTION COL2ROW
-
-/* Set 0 if debouncing isn't needed */
-#define DEBOUNCE 5
-
-/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
-#define LOCKING_SUPPORT_ENABLE

+ 1 - 12
keyboards/signum/3_0/elitec/elitec.h

@@ -1,15 +1,4 @@
 #pragma once
 
 #include "quantum.h"
-
-#define LAYOUT_ortho_4x12( \
-	K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \
-	K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, \
-	K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, \
-	K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311 \
-) { \
-	{ K000,  K001,  K002,  K003,  K004,  K005,  K006,  K007,  K008,  K009, K010, K011 }, \
-	{ K100,  K101,  K102,  K103,  K104,  K105,  K106,  K107,  K108,  K109, K110, K111 }, \
-	{ K200,  K201,  K202,  K203,  K204,  K205,  K206,  K207,  K208,  K209, K210, K211 }, \
-	{ K300,  K301,  K302,  K303,  K304,  K305,  K306,  K307,  K308,  K309, K310, K311 } \
-}
+#include "signum.h"

+ 0 - 28
keyboards/signum/3_0/elitec/rules.mk

@@ -1,28 +0,0 @@
-# MCU name
-MCU = atmega32u4
-
-# Bootloader selection
-BOOTLOADER = atmel-dfu
-
-# Build Options
-#   comment out to disable the options.
-#
-BOOTMAGIC_ENABLE = lite     # Enable Bootmagic Lite
-MOUSEKEY_ENABLE = yes	# Mouse keys
-EXTRAKEY_ENABLE = yes	# Audio control and System control
-CONSOLE_ENABLE = no	# Console for debug
-COMMAND_ENABLE = no    # Commands for debug and configuration
-SLEEP_LED_ENABLE = no  # Breathing sleep LED during USB suspend
-NKRO_ENABLE = yes		# USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
-BACKLIGHT_ENABLE = no  # Enable keyboard backlight functionality
-AUDIO_ENABLE = no
-RGBLIGHT_ENABLE = no
-
-UNICODEMAP_ENABLE = no
-
-LAYOUTS = ortho_4x12
-
-# Disable unsupported hardware
-RGBLIGHT_SUPPORTED = no
-AUDIO_SUPPORTED = no
-BACKLIGHT_SUPPORTED = no

+ 0 - 0
keyboards/signum/3_0/elitec/info.json → keyboards/signum/3_0/info.json


+ 0 - 0
keyboards/signum/3_0/elitec/keymaps/default/generate_km.py → keyboards/signum/3_0/keymaps/default/generate_km.py


+ 0 - 0
keyboards/signum/3_0/elitec/keymaps/default/keymap.c → keyboards/signum/3_0/keymaps/default/keymap.c


+ 0 - 0
keyboards/signum/3_0/elitec/keymaps/default/km_template.txt → keyboards/signum/3_0/keymaps/default/km_template.txt


+ 0 - 0
keyboards/signum/3_0/elitec/keymaps/default/layout.py → keyboards/signum/3_0/keymaps/default/layout.py


+ 0 - 0
keyboards/signum/3_0/elitec/keymaps/default/readme.md → keyboards/signum/3_0/keymaps/default/readme.md


+ 0 - 0
keyboards/signum/3_0/elitec/keymaps/default/rules.mk → keyboards/signum/3_0/keymaps/default/rules.mk


+ 45 - 0
keyboards/signum/3_0/keymaps/sgurenkov/config.h

@@ -0,0 +1,45 @@
+/* Copyright 2021 Stan Gurenkov <rococo04_fox@icloud.com>
+ *
+ * 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 ONESHOT_TAP_TOGGLE 2
+#define ONESHOT_TIMEOUT 5000
+#define LEADER_TIMEOUT 600
+#define LEADER_PER_KEY_TIMING 300
+
+// default but used in macros
+#define TAPPING_TERM 300
+
+// Prevent normal rollover on alphas from accidentally triggering mods.
+#define IGNORE_MOD_TAP_INTERRUPT
+
+// Auto Shift and Retro Shift (Auto Shift for Tap Hold).
+#define AUTO_SHIFT_TIMEOUT TAPPING_TERM
+
+// Recommended for heavy chording.
+#define QMK_KEYS_PER_SCAN 4
+
+// Mouse key speed and acceleration.
+#undef MOUSEKEY_DELAY
+#define MOUSEKEY_DELAY 0
+#undef MOUSEKEY_INTERVAL
+#define MOUSEKEY_INTERVAL 16
+#undef MOUSEKEY_WHEEL_DELAY
+#define MOUSEKEY_WHEEL_DELAY 0
+#undef MOUSEKEY_MAX_SPEED
+#define MOUSEKEY_MAX_SPEED 6
+#undef MOUSEKEY_TIME_TO_MAX
+#define MOUSEKEY_TIME_TO_MAX 64

+ 128 - 0
keyboards/signum/3_0/keymaps/sgurenkov/keymap.c

@@ -0,0 +1,128 @@
+/* Copyright 2021 Stan Gurenkov <rococo04_fox@icloud.com>
+ *
+ * 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
+
+#define M0(kc) MT(MOD_HYPR, kc)
+#define M1(kc) MT(MOD_LGUI, kc)
+#define M2(kc) MT(MOD_LCTL, kc)
+#define M3(kc) MT(MOD_LALT, kc)
+#define M4(kc) MT(MOD_LSFT, kc)
+#define LTH1 LT(L_LEFT, KC_SPC)
+#define LTH2 LT(L_NUM, KC_BSPC)
+#define RTH1 LT(L_RIGHT, KC_SPC)
+#define RTH2 LT(L_NUM, KC_ENT)
+#define COPY LCMD(KC_C)
+#define PASTE LCMD(KC_V)
+// Layers
+#define L_BASE 0
+#define L_LEFT 1
+#define L_RIGHT 2
+#define L_NUM 3
+
+bool is_cmd_tab_active = false;
+
+enum custom_keycodes {
+    CMD_TAB = SAFE_RANGE,
+};
+// clang-format off
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+// L_BASE
+	LAYOUT(
+    KC_ESC,         KC_Q,      KC_W,       KC_E,      KC_R,      KC_T,       KC_Y,     KC_U,     KC_I,     KC_O,     KC_P,         KC_DEL,
+    KC_TAB,         M4(KC_A),  M3(KC_S),   M2(KC_D),  M1(KC_F),  M0(KC_G),   M0(KC_H), M1(KC_J), M2(KC_K), M3(KC_L), M4(KC_COLN),  KC_QUOT,
+    KC_GRV,         KC_Z,      KC_X,       KC_C,      KC_V,      KC_B,       KC_N,     KC_M,     KC_COMM,  KC_DOT,   KC_SLSH,      KC_BSLS,
+    OSM(MOD_LSFT),  KC_LEAD,   KC_LGUI,    LTH1,      XXXXXXX,   LTH2,       RTH2,     XXXXXXX,  RTH1,     KC_RGUI,  KC_LEAD,      OSM(MOD_HYPR)),
+
+// L_LEFT
+    LAYOUT(
+    _______, XXXXXXX,   XXXXXXX, KC_EQL,  KC_PERC, KC_AT,        COPY,     KC_UNDS, KC_HASH, RALT(KC_SPC), KC_PLUS,  _______,
+    _______, KC_LSHIFT, KC_LALT, KC_LCTL, KC_LGUI, KC_HYPR,      KC_LEFT,  KC_DOWN, KC_UP,   KC_RIGHT,     KC_LBRC,  KC_RBRC,
+    _______, XXXXXXX,   KC_EXLM, KC_CIRC, XXXXXXX, KC_HOME,      KC_END,   KC_MINS, KC_LPRN, KC_RPRN,      PASTE,    XXXXXXX,
+    _______, KC_BRID,   KC_BRIU, _______, _______,  _______,     _______, _______, _______,  KC_VOLD,      KC_VOLU,  _______),
+
+// L_RIGHT
+    LAYOUT(
+    _______, XXXXXXX, XXXXXXX, KC_EQL,  KC_PERC,      KC_AT,        COPY,    KC_UNDS, KC_HASH,  RALT(KC_SPC), KC_PLUS,  _______,
+    _______, KC_AMPR, KC_ASTR, KC_DLR,  LGUI(KC_GRV), XXXXXXX,      KC_LEFT, KC_DOWN, KC_UP,    KC_RIGHT,     KC_RSFT,  KC_RBRC,
+    _______, XXXXXXX, KC_EXLM, KC_CIRC, XXXXXXX,      KC_HOME,      KC_END,  KC_MINS, KC_LPRN,  KC_RPRN,      PASTE,    XXXXXXX,
+    _______, KC_BRID, KC_BRIU, _______, _______,      _______,      _______, _______, _______,  KC_VOLD,      KC_VOLU,  _______),
+
+// L_NUM
+  	LAYOUT(
+    _______,  XXXXXXX,     KC_F7,     KC_F8,     KC_F9,     KC_F12,         KC_MINS,    KC_7,     KC_8,     KC_9,                  KC_COMM,              _______,
+    _______,  M4(KC_LSFT), M3(KC_F4), M2(KC_F5), M1(KC_F6), M0(KC_F11),     M0(KC_DOT), M1(KC_4), M2(KC_5), M3(KC_6),              M4(KC_0),             _______,
+    _______,  XXXXXXX,     KC_F1,     KC_F2,     KC_F3,     KC_F10,         KC_PLUS,    KC_1,     KC_2,     KC_3,                  KC_DOT,               _______,
+    _______,  _______,     _______,   _______,   _______,   _______,        _______,    _______,  _______,  KC_MEDIA_PREV_TRACK ,  KC_MEDIA_NEXT_TRACK,  KC_MEDIA_PLAY_PAUSE),
+
+    LAYOUT(
+    _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+    _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+    _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+    _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
+};
+// clang-format on
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+    switch (keycode) {
+        case CMD_TAB:
+            if (record->event.pressed) {
+                register_code(KC_LCMD);
+                tap_code(KC_TAB);
+                layer_on(2);
+            } else {
+                unregister_code(KC_LCMD);
+                layer_off(2);
+            }
+            break;
+        case KC_ESC:
+            layer_clear();
+    }
+    return true;
+}
+
+LEADER_EXTERNS();
+
+void matrix_scan_user(void) {
+    LEADER_DICTIONARY() {
+        leading = false;
+        leader_end();
+
+        // Cancel task CTRL+C
+        SEQ_ONE_KEY(KC_C) { tap_code16(C(KC_C)); }
+        // copy
+        SEQ_ONE_KEY(KC_Y) { tap_code16(G(KC_C)); }
+        // cut
+        SEQ_ONE_KEY(KC_X) { tap_code16(G(KC_X)); }
+        // paste
+        SEQ_ONE_KEY(KC_P) { tap_code16(G(KC_V)); }
+        // undo
+        SEQ_ONE_KEY(KC_U) { tap_code16(G(KC_Z)); }
+        // redo
+        SEQ_ONE_KEY(KC_R) { tap_code16(S(G(KC_Z))); }
+        // delete line
+        SEQ_TWO_KEYS(KC_D, KC_D) {
+            register_code(KC_LGUI);
+
+            tap_code(KC_RIGHT);
+
+            tap_code(KC_BSPACE);
+
+            unregister_code(KC_LGUI);
+        }
+        // go to the beginning of the string
+        SEQ_ONE_KEY(KC_H) { tap_code16(G(KC_LEFT)); }
+        // go to the end of the string
+        SEQ_ONE_KEY(KC_L) { tap_code16(G(KC_RIGHT)); }
+    }

+ 2 - 0
keyboards/signum/3_0/keymaps/sgurenkov/rules.mk

@@ -0,0 +1,2 @@
+LEADER_ENABLE = yes
+AUTO_SHIFT_ENABLE = no

+ 1 - 0
keyboards/signum/3_0/elitec/readme.md → keyboards/signum/3_0/readme.md

@@ -10,5 +10,6 @@ Hardware available here: [Troy Fletcher](http://troyfletcher.net/keyboard_sales.
 Make example for this keyboard (after setting up your build environment):
 
     make signum/3_0/elitec:default
+    make signum/3_0/teensy: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).

+ 28 - 0
keyboards/signum/3_0/rules.mk

@@ -0,0 +1,28 @@
+# MCU name
+MCU = atmega32u4
+
+# Bootloader selection
+BOOTLOADER = atmel-dfu
+
+# Build Options
+# change yes to no to disable
+#
+BOOTMAGIC_ENABLE = yes      # Enable Bootmagic Lite
+MOUSEKEY_ENABLE = yes       # 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 = yes           # USB Nkey Rollover
+BACKLIGHT_ENABLE = no       # Enable keyboard backlight functionality
+RGBLIGHT_ENABLE = no        # Enable keyboard RGB underglow
+AUDIO_ENABLE = no           # Audio output
+
+LAYOUTS = ortho_4x12
+
+# Disable unsupported hardware
+RGBLIGHT_SUPPORTED = no
+AUDIO_SUPPORTED = no
+BACKLIGHT_SUPPORTED = no

+ 16 - 0
keyboards/signum/3_0/signum.c

@@ -0,0 +1,16 @@
+/* Copyright 2021 Stan Gurenkov <rococo04_fox@icloud.com>
+ *
+ * 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 "signum.h"

+ 33 - 0
keyboards/signum/3_0/signum.h

@@ -0,0 +1,33 @@
+/* Copyright 2021 Stan Gurenkov <rococo04_fox@icloud.com>
+ *
+ * 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"
+
+// clang-format off
+# define LAYOUT( \
+	K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \
+	K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, \
+	K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, \
+	K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311  \
+) { \
+	{ K000,  K001,  K002,  K003,  K004,  K005,  K006,  K007,  K008,  K009,  K010,  K011 }, \
+	{ K100,  K101,  K102,  K103,  K104,  K105,  K106,  K107,  K108,  K109,  K110,  K111 }, \
+	{ K200,  K201,  K202,  K203,  K204,  K205,  K206,  K207,  K208,  K209,  K210,  K211 }, \
+	{ K300,  K301,  K302,  K303,  K304,  K305,  K306,  K307,  K308,  K309,  K310,  K311 }  \
+}
+// clang-format on
+#define LAYOUT_ortho_4x12 LAYOUT

+ 23 - 0
keyboards/signum/3_0/teensy/config.h

@@ -0,0 +1,23 @@
+/* Copyright 2021 Stan Gurenkov <rococo04_fox@icloud.com>
+ *
+ * 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
+
+/* key matrix pins */
+// clang-format off
+#define MATRIX_ROW_PINS { B0, B3, F6, C7 }
+#define MATRIX_COL_PINS { C6, D2, B7, D3, D0, F7, F5, B6, B5, B4, D1, D7 }
+#define UNUSED_PINS
+// clang-format on

+ 1 - 0
keyboards/signum/3_0/teensy/rules.mk

@@ -0,0 +1 @@
+

+ 16 - 0
keyboards/signum/3_0/teensy/teensy.c

@@ -0,0 +1,16 @@
+/* Copyright 2021 Stan Gurenkov <rococo04_fox@icloud.com>
+ *
+ * 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 "teensy.h"

+ 19 - 0
keyboards/signum/3_0/teensy/teensy.h

@@ -0,0 +1,19 @@
+/* Copyright 2021 Stan Gurenkov <rococo04_fox@icloud.com>
+ *
+ * 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"
+#include "signum.h"