aboutsummaryrefslogtreecommitdiff
path: root/keyboards/orthocode
diff options
context:
space:
mode:
authorJordan Blackbourn <blackbournj@gmail.com>2022-01-11 13:44:18 +1300
committerGitHub <noreply@github.com>2022-01-10 16:44:18 -0800
commitcd12b54650b4ac9023e697f036911c81b2eed693 (patch)
treefcc398acc0be6fe671903e790388ad4ea598dfcd /keyboards/orthocode
parent372c9102e23b1c669e27262f905d76299f52e628 (diff)
downloadqmk_firmware-cd12b54650b4ac9023e697f036911c81b2eed693.tar.gz
qmk_firmware-cd12b54650b4ac9023e697f036911c81b2eed693.zip
[Keyboard] Added via support for orthocode (#15777)
Diffstat (limited to 'keyboards/orthocode')
-rw-r--r--keyboards/orthocode/config.h4
-rw-r--r--keyboards/orthocode/keymaps/default/keymap.c4
-rw-r--r--keyboards/orthocode/keymaps/via/keymap.c92
-rw-r--r--keyboards/orthocode/keymaps/via/rules.mk1
-rw-r--r--keyboards/orthocode/orthocode.c30
-rw-r--r--keyboards/orthocode/orthocode.h14
-rw-r--r--keyboards/orthocode/rules.mk1
7 files changed, 140 insertions, 6 deletions
diff --git a/keyboards/orthocode/config.h b/keyboards/orthocode/config.h
index 823a48e36..e548fe1d4 100644
--- a/keyboards/orthocode/config.h
+++ b/keyboards/orthocode/config.h
@@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
18 18
19#include "config_common.h" 19#include "config_common.h"
20 20
21#define VENDOR_ID 0xFEED 21#define VENDOR_ID 0x3415 // orthocodekb.com
22#define PRODUCT_ID 0x0000 22#define PRODUCT_ID 0x0001 // orthocode
23#define DEVICE_VER 0x0001 23#define DEVICE_VER 0x0001
24#define MANUFACTURER Jrodna 24#define MANUFACTURER Jrodna
25#define PRODUCT OrthoCode 25#define PRODUCT OrthoCode
diff --git a/keyboards/orthocode/keymaps/default/keymap.c b/keyboards/orthocode/keymaps/default/keymap.c
index 800886a63..75bac5ff3 100644
--- a/keyboards/orthocode/keymaps/default/keymap.c
+++ b/keyboards/orthocode/keymaps/default/keymap.c
@@ -15,10 +15,6 @@
15 */ 15 */
16#include QMK_KEYBOARD_H 16#include QMK_KEYBOARD_H
17 17
18enum custom_keycodes {
19 QWERTY = SAFE_RANGE,
20};
21
22const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
23 [0] = LAYOUT( 19 [0] = LAYOUT(
24 /* Rotary */ 20 /* Rotary */
diff --git a/keyboards/orthocode/keymaps/via/keymap.c b/keyboards/orthocode/keymaps/via/keymap.c
new file mode 100644
index 000000000..0030bbb00
--- /dev/null
+++ b/keyboards/orthocode/keymaps/via/keymap.c
@@ -0,0 +1,92 @@
1/* Copyright 2020 Jrodna
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include QMK_KEYBOARD_H
17
18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19 [0] = LAYOUT(
20 /* Rotary */
21 KC__MUTE,
22 /* esc 1 2 3 4 5 6 7 8 9 0 - = home */
23 RGB_TOG, 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_HOME,
24 /* tab Q W E R T Y U I O P \ delete end */
25 RGB_MOD, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_DEL, KC_END,
26 /* caps A S D F G H J K L ; ' enter */
27 RGB_RMOD, 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,
28 /* shift Z X C V B N M , . / up */
29 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP,
30 /* ctrl win alt fn th1 th2 th3 th4 fn alt ctrl left down right */
31 KC_LCTL, KC_LGUI, KC_LALT, MO(1), KC_RSFT, KC_ENT, KC_BSPC, KC_SPC, MO(1), KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT
32 ),
33 [1] = LAYOUT(
34 /* Rotary */
35 TG(2),
36 /* esc 1 2 3 4 5 6 7 8 9 0 - = home */
37 KC_TRNS, 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_TRNS,
38 /* tab Q W E R T Y U I O P \ delete end */
39 RGB_HUI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS,KC_TRNS, KC_TRNS, LSFT(KC_LBRC), LSFT(KC_RBRC), KC_TRNS, KC_TRNS, KC_PAUS, KC_TRNS,
40 /* caps A S D F G H J K L ; ' enter */
41 RGB_HUD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_TRNS, KC_TRNS, KC_TRNS,
42 /* shift Z X C V B N M , . / up */
43 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, LSFT(KC_EQL), LSFT(KC_9), LSFT(KC_0), KC_TRNS, KC_VOLU,
44 /* ctrl win alt fn th1 th2 th3 th4 fn alt ctrl left down right*/
45 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_VOLD, KC_TRNS
46 ),
47 [2] = LAYOUT(
48 /* Rotary */
49 KC_TRNS,
50 /* esc 1 2 3 4 5 6 7 8 9 0 - = home */
51 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,
52 /* tab Q W E R T Y U I O P \ delete end */
53 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,
54 /* caps A S D F G H J K L ; ' enter */
55 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_RBRC, KC_TRNS, KC_TRNS, KC_TRNS,
56 /* shift Z X C V B N M , . / up */
57 KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
58 /* ctrl win alt fn th1 th2 th3 th4 fn alt ctrl left down right */
59 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
60
61 ),
62 [3] = LAYOUT(
63 /* Rotary */
64 KC_TRNS,
65 /* esc 1 2 3 4 5 6 7 8 9 0 - = home */
66 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,
67 /* tab Q W E R T Y U I O P \ delete end */
68 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,
69 /* caps A S D F G H J K L ; ' enter */
70 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_RBRC, KC_TRNS, KC_TRNS, KC_TRNS,
71 /* shift Z X C V B N M , . / up */
72 KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
73 /* ctrl win alt fn th1 th2 th3 th4 fn alt ctrl left down right */
74 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
75
76 ),
77 [4] = LAYOUT(
78 /* Rotary */
79 KC_TRNS,
80 /* esc 1 2 3 4 5 6 7 8 9 0 - = home */
81 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,
82 /* tab Q W E R T Y U I O P \ delete end */
83 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,
84 /* caps A S D F G H J K L ; ' enter */
85 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_RBRC, KC_TRNS, KC_TRNS, KC_TRNS,
86 /* shift Z X C V B N M , . / up */
87 KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
88 /* ctrl win alt fn th1 th2 th3 th4 fn alt ctrl left down right */
89 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
90
91 )
92};
diff --git a/keyboards/orthocode/keymaps/via/rules.mk b/keyboards/orthocode/keymaps/via/rules.mk
new file mode 100644
index 000000000..1e5b99807
--- /dev/null
+++ b/keyboards/orthocode/keymaps/via/rules.mk
@@ -0,0 +1 @@
VIA_ENABLE = yes
diff --git a/keyboards/orthocode/orthocode.c b/keyboards/orthocode/orthocode.c
index 23596d3e5..8ddd32c39 100644
--- a/keyboards/orthocode/orthocode.c
+++ b/keyboards/orthocode/orthocode.c
@@ -15,6 +15,36 @@
15 */ 15 */
16#include "orthocode.h" 16#include "orthocode.h"
17 17
18bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
19 if (!process_record_user(keycode, record)) {
20 return false;
21 }
22
23 static bool shiftspace_mods = false;
24 switch (keycode) {
25 case SHIFTSPACE:
26 if (record->event.pressed) {
27 if(get_mods() & MOD_BIT(KC_RSFT)) {
28 register_code(KC_MINS);
29 shiftspace_mods = true;
30 }
31 else {
32 register_code(KC_SPC);
33 }
34 } else {
35 if (shiftspace_mods) {
36 unregister_code(KC_MINS);
37 shiftspace_mods = false;
38 } else {
39 unregister_code(KC_SPC);
40 }
41 }
42 return false;
43 break;
44 }
45 return true;
46}
47
18#ifdef ENCODER_ENABLE 48#ifdef ENCODER_ENABLE
19bool encoder_update_kb(uint8_t index, bool clockwise) { 49bool encoder_update_kb(uint8_t index, bool clockwise) {
20 if (!encoder_update_user(index, clockwise)) { return false; } 50 if (!encoder_update_user(index, clockwise)) { return false; }
diff --git a/keyboards/orthocode/orthocode.h b/keyboards/orthocode/orthocode.h
index 3abcd48c0..57f122a47 100644
--- a/keyboards/orthocode/orthocode.h
+++ b/keyboards/orthocode/orthocode.h
@@ -17,6 +17,7 @@
17#pragma once 17#pragma once
18 18
19#define _x_ KC_NO 19#define _x_ KC_NO
20#define KC_SHSP SHIFTSPACE
20 21
21#include "quantum.h" 22#include "quantum.h"
22 23
@@ -34,3 +35,16 @@
34{ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, _x_, K3D, _x_ }, \ 35{ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, _x_, K3D, _x_ }, \
35{ _x_, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4E} \ 36{ _x_, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4E} \
36} 37}
38
39enum custom_keycodes {
40#ifdef VIA_ENABLE
41 SHIFTSPACE = USER00,
42#else
43 SHIFTSPACE = SAFE_RANGE,
44#endif
45#ifdef VIA_ENABLE
46 QWERTY = SAFE_RANGE
47#else
48 QWERTY
49#endif
50};
diff --git a/keyboards/orthocode/rules.mk b/keyboards/orthocode/rules.mk
index 3d44d1f85..66c72d602 100644
--- a/keyboards/orthocode/rules.mk
+++ b/keyboards/orthocode/rules.mk
@@ -20,3 +20,4 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
20RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow 20RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
21AUDIO_ENABLE = no # Audio output 21AUDIO_ENABLE = no # Audio output
22ENCODER_ENABLE = yes # Enables the use of one or more encoders 22ENCODER_ENABLE = yes # Enables the use of one or more encoders
23LTO_ENABLE = yes