From c1297ceb972d45407cc1f518fd0527efda7ee796 Mon Sep 17 00:00:00 2001 From: Stefan Kerkmann Date: Mon, 29 Nov 2021 17:22:10 +0100 Subject: [Core] Remove matrix_is_modified() and debounce_is_active() (#15349) --- keyboards/handwired/dactyl/matrix.c | 8 -------- keyboards/handwired/frenchdev/matrix.c | 6 ------ keyboards/handwired/not_so_minidox/matrix.c | 6 ------ keyboards/handwired/promethium/matrix.c | 8 -------- keyboards/handwired/pterodactyl/matrix.c | 8 -------- 5 files changed, 36 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/dactyl/matrix.c b/keyboards/handwired/dactyl/matrix.c index a21cd08e14..a70e8c5aca 100644 --- a/keyboards/handwired/dactyl/matrix.c +++ b/keyboards/handwired/dactyl/matrix.c @@ -281,14 +281,6 @@ uint8_t matrix_scan(void) return 1; } -bool matrix_is_modified(void) // deprecated and evidently not called. -{ -#if (DEBOUNCE > 0) - if (debouncing) return false; -#endif - return true; -} - inline bool matrix_is_on(uint8_t row, uint8_t col) { diff --git a/keyboards/handwired/frenchdev/matrix.c b/keyboards/handwired/frenchdev/matrix.c index 5ab254a6f9..a043f78538 100644 --- a/keyboards/handwired/frenchdev/matrix.c +++ b/keyboards/handwired/frenchdev/matrix.c @@ -174,12 +174,6 @@ uint8_t matrix_scan(void) return 1; } -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - inline bool matrix_is_on(uint8_t row, uint8_t col) { diff --git a/keyboards/handwired/not_so_minidox/matrix.c b/keyboards/handwired/not_so_minidox/matrix.c index b7cec9370c..d2bbf7d303 100644 --- a/keyboards/handwired/not_so_minidox/matrix.c +++ b/keyboards/handwired/not_so_minidox/matrix.c @@ -239,12 +239,6 @@ void matrix_slave_scan(void) { #endif } -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - inline bool matrix_is_on(uint8_t row, uint8_t col) { diff --git a/keyboards/handwired/promethium/matrix.c b/keyboards/handwired/promethium/matrix.c index e3a41af288..90dbce14a9 100644 --- a/keyboards/handwired/promethium/matrix.c +++ b/keyboards/handwired/promethium/matrix.c @@ -148,14 +148,6 @@ uint8_t matrix_scan(void) return 1; } -bool matrix_is_modified(void) -{ -#if (DEBOUNCE > 0) - if (debouncing) return false; -#endif - return true; -} - inline bool matrix_is_on(uint8_t row, uint8_t col) diff --git a/keyboards/handwired/pterodactyl/matrix.c b/keyboards/handwired/pterodactyl/matrix.c index 21e6a128df..d0f74802a0 100644 --- a/keyboards/handwired/pterodactyl/matrix.c +++ b/keyboards/handwired/pterodactyl/matrix.c @@ -282,14 +282,6 @@ uint8_t matrix_scan(void) return 1; } -bool matrix_is_modified(void) // deprecated and evidently not called. -{ -#if (DEBOUNCE > 0) - if (debouncing) return false; -#endif - return true; -} - inline bool matrix_is_on(uint8_t row, uint8_t col) { -- cgit v1.2.3 From b7cdda7dcd02719efd91817a36ab9268182f1224 Mon Sep 17 00:00:00 2001 From: xiao <307671+xia0@users.noreply.github.com> Date: Tue, 30 Nov 2021 03:23:58 +1100 Subject: [Keyboard] Added Wakizashi 40 (#15336) Co-authored-by: Ryan --- keyboards/handwired/wakizashi40/config.h | 20 +++++ keyboards/handwired/wakizashi40/info.json | 88 +++++++++++++++++++++ .../handwired/wakizashi40/keymaps/default/keymap.c | 44 +++++++++++ .../handwired/wakizashi40/keymaps/via/keymap.c | 92 ++++++++++++++++++++++ .../handwired/wakizashi40/keymaps/via/rules.mk | 4 + keyboards/handwired/wakizashi40/readme.md | 19 +++++ keyboards/handwired/wakizashi40/rules.mk | 1 + 7 files changed, 268 insertions(+) create mode 100644 keyboards/handwired/wakizashi40/config.h create mode 100644 keyboards/handwired/wakizashi40/info.json create mode 100644 keyboards/handwired/wakizashi40/keymaps/default/keymap.c create mode 100644 keyboards/handwired/wakizashi40/keymaps/via/keymap.c create mode 100644 keyboards/handwired/wakizashi40/keymaps/via/rules.mk create mode 100644 keyboards/handwired/wakizashi40/readme.md create mode 100644 keyboards/handwired/wakizashi40/rules.mk (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/wakizashi40/config.h b/keyboards/handwired/wakizashi40/config.h new file mode 100644 index 0000000000..78f85f2197 --- /dev/null +++ b/keyboards/handwired/wakizashi40/config.h @@ -0,0 +1,20 @@ +/* Copyright 2021 xiao (@xia0) + * + * 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 . + */ + +#pragma once + +#include "config_common.h" +#define DYNAMIC_KEYMAP_LAYER_COUNT 12 diff --git a/keyboards/handwired/wakizashi40/info.json b/keyboards/handwired/wakizashi40/info.json new file mode 100644 index 0000000000..b64ab55116 --- /dev/null +++ b/keyboards/handwired/wakizashi40/info.json @@ -0,0 +1,88 @@ +{ + "manufacturer": "fumbucker", + "keyboard_name": "Wakizashi 40", + "maintainer": "fumbucker", + "debounce": 5, + "processor": "at90usb1286", + "diode_direction": "COL2ROW", + "features": { + "audio": false, + "backlight": false, + "bluetooth": false, + "bootmagic": true, + "command": false, + "console": true, + "extrakey": true, + "midi": false, + "mousekey": true, + "nkro": true, + "rgblight": false, + "unicode": false + }, + "matrix_pins": { + "cols": ["C5", "C4", "D2", "D3", "D4", "D5", "C6", "D7", "B0", "B1", "B2", "B3", "B4"], + "rows": ["C0", "C1", "C2", "C3"] + }, + "usb": { + "device_ver": "0x0001", + "pid": "0x7740", + "vid": "0x6662" + }, + "layout_aliases": { + "LAYOUT": "LAYOUT_all" + }, + "layouts": { + "LAYOUT_all": { + "layout": [ + { "label": "TAB", "matrix": [0, 0], "w": 1.5, "x": 0, "y": 0 }, + { "label": "Q", "matrix": [0, 2], "w": 1, "x": 1.5, "y": 0 }, + { "label": "W", "matrix": [0, 3], "w": 1, "x": 2.5, "y": 0 }, + { "label": "E", "matrix": [0, 4], "w": 1, "x": 3.5, "y": 0 }, + { "label": "R", "matrix": [0, 5], "w": 1, "x": 4.5, "y": 0 }, + { "label": "T", "matrix": [0, 6], "w": 1, "x": 5.5, "y": 0 }, + { "label": "Y", "matrix": [0, 7], "w": 1, "x": 6.5, "y": 0 }, + { "label": "U", "matrix": [0, 8], "w": 1, "x": 7.5, "y": 0 }, + { "label": "I", "matrix": [0, 9], "w": 1, "x": 8.5, "y": 0 }, + { "label": "O", "matrix": [0, 10], "w": 1, "x": 9.5, "y": 0 }, + { "label": "P", "matrix": [0, 11], "w": 1, "x": 10.5, "y": 0 }, + { "label": "BACKSPACE", "matrix": [0, 12], "w": 1.5, "x": 11.5, "y": 0 }, + + { "label": "CAPSLOCK", "matrix": [1, 0], "w": 1.25, "x": 0, "y": 1 }, + { "label": "A", "matrix": [1, 1], "w": 1, "x": 1.25, "y": 1 }, + { "label": "S", "matrix": [1, 2], "w": 1, "x": 2.25, "y": 1 }, + { "label": "D", "matrix": [1, 3], "w": 1, "x": 3.25, "y": 1 }, + { "label": "F", "matrix": [1, 4], "w": 1, "x": 4.25, "y": 1 }, + { "label": "G", "matrix": [1, 5], "w": 1, "x": 5.75, "y": 1 }, + { "label": "H", "matrix": [1, 7], "w": 1, "x": 6.75, "y": 1 }, + { "label": "J", "matrix": [1, 8], "w": 1, "x": 7.75, "y": 1 }, + { "label": "K", "matrix": [1, 9], "w": 1, "x": 8.75, "y": 1 }, + { "label": "L", "matrix": [1, 10], "w": 1, "x": 9.75, "y": 1 }, + { "label": "SEMICOLON", "matrix": [1, 11], "w": 1, "x": 10.75, "y": 1 }, + { "label": "ENTER", "matrix": [1, 12], "w": 1.25, "x": 11.75, "y": 1 }, + + { "label": "LSHIFT", "matrix": [2, 0], "w": 1, "x": 0, "y": 2 }, + { "label": "Z", "matrix": [2, 1], "w": 1, "x": 1, "y": 2 }, + { "label": "X", "matrix": [2, 2], "w": 1, "x": 2, "y": 2 }, + { "label": "C", "matrix": [2, 3], "w": 1, "x": 3, "y": 2 }, + { "label": "V", "matrix": [2, 4], "w": 1, "x": 4, "y": 2 }, + { "label": "B", "matrix": [2, 5], "w": 1, "x": 5, "y": 2 }, + { "label": "ESCAPE", "matrix": [2, 6], "w": 1, "x": 6, "y": 2 }, + { "label": "N", "matrix": [2, 7], "w": 1, "x": 7, "y": 2 }, + { "label": "M", "matrix": [2, 8], "w": 1, "x": 8, "y": 2 }, + { "label": "COMMA", "matrix": [2, 9], "w": 1, "x": 9, "y": 2 }, + { "label": "PERIOD", "matrix": [2, 10], "w": 1, "x": 10, "y": 2 }, + { "label": "SLASH", "matrix": [2, 11], "w": 1, "x": 11, "y": 2 }, + { "label": "RSHIFT", "matrix": [2, 12], "w": 1, "x": 12, "y": 2 }, + + { "label": "LCTRL", "matrix": [3, 0], "w": 1.25, "x": 0, "y": 3 }, + { "label": "LWIN", "matrix": [3, 1], "w": 1.25, "x": 1.25, "y": 3 }, + { "label": "LALT", "matrix": [3, 3], "w": 1.25, "x": 2.5, "y": 3 }, + { "label": "SPACE1", "matrix": [3, 5], "w": 2.75, "x": 3.75, "y": 3 }, + { "label": "SPACE2", "matrix": [3, 7], "w": 2.75, "x": 6.5, "y": 3 }, + { "label": "RALT", "matrix": [3, 9], "w": 1.25, "x": 9.25, "y": 3 }, + { "label": "MENU", "matrix": [3, 11], "w": 1.25, "x": 10.5, "y": 3 }, + { "label": "RCTRL", "matrix": [3, 12], "w": 1.25, "x": 11.75, "y": 3 } + ] + } + } +} diff --git a/keyboards/handwired/wakizashi40/keymaps/default/keymap.c b/keyboards/handwired/wakizashi40/keymaps/default/keymap.c new file mode 100644 index 0000000000..910e5bde12 --- /dev/null +++ b/keyboards/handwired/wakizashi40/keymaps/default/keymap.c @@ -0,0 +1,44 @@ +/* Copyright 2021 xiao (@xia0) + * + * 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 . + */ + +#include QMK_KEYBOARD_H +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_all( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + MO(3), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_ESC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, LT(1, KC_SPC), LT(2, KC_SPC), KC_LALT, KC_MENU, KC_LCTL), + + [1] = LAYOUT_all( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F5, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + MO(3), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_TRNS, KC_EQL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_SPC, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS), + + [2] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, + MO(11), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_QUOT, + 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_SPC, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS), + + [3] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_QUOT, + 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) + +}; diff --git a/keyboards/handwired/wakizashi40/keymaps/via/keymap.c b/keyboards/handwired/wakizashi40/keymaps/via/keymap.c new file mode 100644 index 0000000000..d456b8b40a --- /dev/null +++ b/keyboards/handwired/wakizashi40/keymaps/via/keymap.c @@ -0,0 +1,92 @@ +/* Copyright 2021 xiao (@xia0) + * + * 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 . + */ + +#include QMK_KEYBOARD_H +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_all( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + MO(3), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_ESC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, LT(1, KC_SPC), LT(2, KC_SPC), KC_LALT, KC_MENU, KC_LCTL), + + [1] = LAYOUT_all( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F5, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + MO(11), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_TRNS, KC_EQL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_SPC, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS), + + [2] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, + MO(11), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_QUOT, + 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_SPC, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS), + + [3] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_QUOT, + 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), + + [4] = LAYOUT_all( + 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_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), + + [5] = LAYOUT_all( + 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_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), + + [6] = LAYOUT_all( + 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_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), + + [7] = LAYOUT_all( + 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_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), + + [8] = LAYOUT_all( + 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_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), + + [9] = LAYOUT_all( + 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_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), + + [10] = LAYOUT_all( + 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_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), + + [11] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, 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_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) + +}; diff --git a/keyboards/handwired/wakizashi40/keymaps/via/rules.mk b/keyboards/handwired/wakizashi40/keymaps/via/rules.mk new file mode 100644 index 0000000000..7a49719505 --- /dev/null +++ b/keyboards/handwired/wakizashi40/keymaps/via/rules.mk @@ -0,0 +1,4 @@ +# rules.mk overrides to enable VIA + +VIA_ENABLE = yes +LTO_ENABLE = yes diff --git a/keyboards/handwired/wakizashi40/readme.md b/keyboards/handwired/wakizashi40/readme.md new file mode 100644 index 0000000000..d94a75651c --- /dev/null +++ b/keyboards/handwired/wakizashi40/readme.md @@ -0,0 +1,19 @@ +# Wakizashi 40 + +![Wakizashi40](https://cdn.thingiverse.com/renders/51/50/81/13/a9/7078248666f70b422127c6662cf79563_preview_featured.jpg) + +Reverse stagger 40% keyboard based on the Katana 60. + +* Keyboard Maintainer: [fumbucker](https://github.com/xia0) +* Hardware Supported: Teensy2++ +* Hardware Availability: [thingiverse](https://www.thingiverse.com/thing:3467930) + +Make example for this keyboard (after setting up your build environment): + + make handwired/wakizashi40:default + +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. + +## Bootloader + +* **Keycode in layout**: Press the key mapped to `RESET` if it is available (Capslock + R). diff --git a/keyboards/handwired/wakizashi40/rules.mk b/keyboards/handwired/wakizashi40/rules.mk new file mode 100644 index 0000000000..6e7633bfe0 --- /dev/null +++ b/keyboards/handwired/wakizashi40/rules.mk @@ -0,0 +1 @@ +# This file intentionally left blank -- cgit v1.2.3 From 3d06860f3cd8af5d9a2b4e9736b3024d0f37343f Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Wed, 1 Dec 2021 11:19:07 +0000 Subject: Convert not_so_minidox to SPLIT_KEYBOARD (#15306) --- keyboards/handwired/not_so_minidox/config.h | 5 + keyboards/handwired/not_so_minidox/i2c.c | 162 ----------- keyboards/handwired/not_so_minidox/i2c.h | 46 ---- .../not_so_minidox/keymaps/default/keymap.c | 56 +--- keyboards/handwired/not_so_minidox/matrix.c | 302 --------------------- keyboards/handwired/not_so_minidox/rules.mk | 27 +- keyboards/handwired/not_so_minidox/serial.c | 228 ---------------- keyboards/handwired/not_so_minidox/serial.h | 23 -- keyboards/handwired/not_so_minidox/split_util.c | 84 ------ keyboards/handwired/not_so_minidox/split_util.h | 17 -- 10 files changed, 21 insertions(+), 929 deletions(-) delete mode 100644 keyboards/handwired/not_so_minidox/i2c.c delete mode 100644 keyboards/handwired/not_so_minidox/i2c.h delete mode 100644 keyboards/handwired/not_so_minidox/matrix.c delete mode 100644 keyboards/handwired/not_so_minidox/serial.c delete mode 100644 keyboards/handwired/not_so_minidox/serial.h delete mode 100644 keyboards/handwired/not_so_minidox/split_util.c delete mode 100644 keyboards/handwired/not_so_minidox/split_util.h (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/not_so_minidox/config.h b/keyboards/handwired/not_so_minidox/config.h index de9286eda5..177552e2a6 100644 --- a/keyboards/handwired/not_so_minidox/config.h +++ b/keyboards/handwired/not_so_minidox/config.h @@ -40,6 +40,11 @@ along with this program. If not, see . #define USE_SERIAL +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + //#define EE_HANDS #define MASTER_LEFT diff --git a/keyboards/handwired/not_so_minidox/i2c.c b/keyboards/handwired/not_so_minidox/i2c.c deleted file mode 100644 index 084c890c40..0000000000 --- a/keyboards/handwired/not_so_minidox/i2c.c +++ /dev/null @@ -1,162 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "i2c.h" - -#ifdef USE_I2C - -// Limits the amount of we wait for any one i2c transaction. -// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is -// 9 bits, a single transaction will take around 90μs to complete. -// -// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit -// poll loop takes at least 8 clock cycles to execute -#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 - -#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) - -volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -static volatile uint8_t slave_buffer_pos; -static volatile bool slave_has_register_set = false; - -// Wait for an i2c operation to finish -inline static -void i2c_delay(void) { - uint16_t lim = 0; - while(!(TWCR & (1<10. - // Check datasheets for more info. - TWBR = ((F_CPU/SCL_CLOCK)-16)/2; -} - -// Start a transaction with the given i2c slave address. The direction of the -// transfer is set with I2C_READ and I2C_WRITE. -// returns: 0 => success -// 1 => error -uint8_t i2c_master_start(uint8_t address) { - TWCR = (1< slave ACK -// 1 => slave NACK -uint8_t i2c_master_write(uint8_t data) { - TWDR = data; - TWCR = (1<= SLAVE_BUFFER_SIZE ) { - ack = 0; - slave_buffer_pos = 0; - } - slave_has_register_set = true; - } else { - i2c_slave_buffer[slave_buffer_pos] = TWDR; - BUFFER_POS_INC(); - } - break; - - case TW_ST_SLA_ACK: - case TW_ST_DATA_ACK: - // master has addressed this device as a slave transmitter and is - // requesting data. - TWDR = i2c_slave_buffer[slave_buffer_pos]; - BUFFER_POS_INC(); - break; - - case TW_BUS_ERROR: // something went wrong, reset twi state - TWCR = 0; - default: - break; - } - // Reset everything, so we are ready for the next TWI interrupt - TWCR |= (1< - -#ifndef F_CPU -#define F_CPU 16000000UL -#endif - -#define I2C_READ 1 -#define I2C_WRITE 0 - -#define I2C_ACK 1 -#define I2C_NACK 0 - -#define SLAVE_BUFFER_SIZE 0x10 - -// i2c SCL clock frequency -#define SCL_CLOCK 400000L - -extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -void i2c_master_init(void); -uint8_t i2c_master_start(uint8_t address); -void i2c_master_stop(void); -uint8_t i2c_master_write(uint8_t data); -uint8_t i2c_master_read(int); -void i2c_reset_state(void); -void i2c_slave_init(uint8_t address); - - -static inline unsigned char i2c_start_read(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_READ); -} - -static inline unsigned char i2c_start_write(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_WRITE); -} - -// from SSD1306 scrips -extern unsigned char i2c_rep_start(unsigned char addr); -extern void i2c_start_wait(unsigned char addr); -extern unsigned char i2c_readAck(void); -extern unsigned char i2c_readNak(void); -extern unsigned char i2c_read(unsigned char ack); - -#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); diff --git a/keyboards/handwired/not_so_minidox/keymaps/default/keymap.c b/keyboards/handwired/not_so_minidox/keymaps/default/keymap.c index 296a7a281d..435eed2f1f 100644 --- a/keyboards/handwired/not_so_minidox/keymaps/default/keymap.c +++ b/keyboards/handwired/not_so_minidox/keymaps/default/keymap.c @@ -8,17 +8,10 @@ #define _QWERTY 0 #define _LOWER 1 #define _RAISE 2 -#define _ADJUST 16 +#define _ADJUST 3 -enum custom_keycodes { - QWERTY = SAFE_RANGE, - LOWER, - RAISE, - ADJUST, -}; - -#define KC_LOWR LOWER -#define KC_RASE RAISE +#define KC_LOWR MO(_LOWER) +#define KC_RASE MO(_RAISE) #define KC_RST RESET #define KC_CAD LCTL(LALT(KC_DEL)) @@ -72,45 +65,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - set_single_persistent_default_layer(_QWERTY); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_ADJUST); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - } - return true; +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); } diff --git a/keyboards/handwired/not_so_minidox/matrix.c b/keyboards/handwired/not_so_minidox/matrix.c deleted file mode 100644 index d2bbf7d303..0000000000 --- a/keyboards/handwired/not_so_minidox/matrix.c +++ /dev/null @@ -1,302 +0,0 @@ -/* -Copyright 2012 Jun Wako - -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 . -*/ - -/* - * scan matrix - */ -#include -#include -#include -#include -#include -#include -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "split_util.h" -#include "config.h" -#include "quantum.h" - -#ifdef USE_I2C -# include "i2c.h" -#else // USE_SERIAL -# include "serial.h" -#endif - -#ifndef DEBOUNCE -# define DEBOUNCE 5 -#endif - -#define ERROR_DISCONNECT_COUNT 5 - -static uint8_t debouncing = DEBOUNCE; -static const int ROWS_PER_HAND = MATRIX_ROWS/2; -static uint8_t error_count = 0; - -static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static matrix_row_t read_cols(void); -static void init_cols(void); -static void unselect_rows(void); -static void select_row(uint8_t row); - - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -__attribute__ ((weak)) -void matrix_init_user(void) { -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { -} - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - debug_enable = true; - debug_matrix = true; - debug_mouse = true; - // initialize row and col - unselect_rows(); - init_cols(); - - setPinOutput(B0); - setPinOutput(D5); - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - } - - matrix_init_quantum(); -} - -uint8_t _matrix_scan(void) -{ - // Right hand is stored after the left in the matirx so, we need to offset it - int offset = isLeftHand ? 0 : (ROWS_PER_HAND); - - for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { - select_row(i); - _delay_us(30); // without this wait read unstable value. - matrix_row_t cols = read_cols(); - if (matrix_debouncing[i+offset] != cols) { - matrix_debouncing[i+offset] = cols; - debouncing = DEBOUNCE; - } - unselect_rows(); - } - - if (debouncing) { - if (--debouncing) { - _delay_ms(1); - } else { - for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { - matrix[i+offset] = matrix_debouncing[i+offset]; - } - } - } - - return 1; -} - -#ifdef USE_I2C - -// Get rows from other half over i2c -int i2c_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); - if (err) goto i2c_error; - - // start of matrix stored at 0x00 - err = i2c_master_write(0x00); - if (err) goto i2c_error; - - // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); - if (err) goto i2c_error; - - if (!err) { - int i; - for (i = 0; i < ROWS_PER_HAND-1; ++i) { - matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); - } - matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); - i2c_master_stop(); - } else { -i2c_error: // the cable is disconnceted, or something else went wrong - i2c_reset_state(); - return err; - } - - return 0; -} - -#else // USE_SERIAL - -int serial_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - if (serial_update_buffers()) { - return 1; - } - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = serial_slave_buffer[i]; - } - return 0; -} -#endif - -uint8_t matrix_scan(void) -{ - int ret = _matrix_scan(); - - - -#ifdef USE_I2C - if( i2c_transaction() ) { -#else // USE_SERIAL - if( serial_transaction() ) { -#endif - // turn on the indicator led when halves are disconnected - writePinLow(D5); - - error_count++; - - if (error_count > ERROR_DISCONNECT_COUNT) { - // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; - } - } - } else { - // turn off the indicator led on no error - writePinHigh(D5); - error_count = 0; - } - matrix_scan_quantum(); - return ret; -} - -void matrix_slave_scan(void) { - _matrix_scan(); - - int offset = (isLeftHand) ? 0 : (MATRIX_ROWS / 2); - -#ifdef USE_I2C - for (int i = 0; i < ROWS_PER_HAND; ++i) { - /* i2c_slave_buffer[i] = matrix[offset+i]; */ - i2c_slave_buffer[i] = matrix[offset+i]; - } -#else // USE_SERIAL - for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_slave_buffer[i] = matrix[offset+i]; - } -#endif -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(col_pins[x] & 0xF); - _SFR_IO8((col_pins[x] >> 4) + 2) |= _BV(col_pins[x] & 0xF); - } -} - -static matrix_row_t read_cols(void) -{ - matrix_row_t result = 0; - for(int x = 0; x < MATRIX_COLS; x++) { - result |= (_SFR_IO8(col_pins[x] >> 4) & _BV(col_pins[x] & 0xF)) ? 0 : (1 << x); - } - return result; -} - -static void unselect_rows(void) -{ - for(int x = 0; x < ROWS_PER_HAND; x++) { - _SFR_IO8((row_pins[x] >> 4) + 1) &= ~_BV(row_pins[x] & 0xF); - _SFR_IO8((row_pins[x] >> 4) + 2) |= _BV(row_pins[x] & 0xF); - } -} - -static void select_row(uint8_t row) -{ - _SFR_IO8((row_pins[row] >> 4) + 1) |= _BV(row_pins[row] & 0xF); - _SFR_IO8((row_pins[row] >> 4) + 2) &= ~_BV(row_pins[row] & 0xF); -} diff --git a/keyboards/handwired/not_so_minidox/rules.mk b/keyboards/handwired/not_so_minidox/rules.mk index f322b2c914..0ce4c12edd 100644 --- a/keyboards/handwired/not_so_minidox/rules.mk +++ b/keyboards/handwired/not_so_minidox/rules.mk @@ -5,24 +5,19 @@ MCU = atmega32u4 BOOTLOADER = caterina # Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically +# change yes to no to disable # -BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite MOUSEKEY_ENABLE = yes # Mouse keys -EXTRAKEY_ENABLE = no # Audio control and System control +EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug -COMMAND_ENABLE = yes # Commands for debug and configuration -NKRO_ENABLE = no # 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 # Audio output -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -USE_I2C = no +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 +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 = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output -CUSTOM_MATRIX = yes -SRC += matrix.c \ - i2c.c \ - split_util.c \ - serial.c +SPLIT_KEYBOARD = yes diff --git a/keyboards/handwired/not_so_minidox/serial.c b/keyboards/handwired/not_so_minidox/serial.c deleted file mode 100644 index 74bcbb6bf6..0000000000 --- a/keyboards/handwired/not_so_minidox/serial.c +++ /dev/null @@ -1,228 +0,0 @@ -/* - * WARNING: be careful changing this code, it is very timing dependent - */ - -#ifndef F_CPU -#define F_CPU 16000000 -#endif - -#include -#include -#include -#include -#include "serial.h" - -#ifndef USE_I2C - -// Serial pulse period in microseconds. Its probably a bad idea to lower this -// value. -#define SERIAL_DELAY 24 - -uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; -uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; - -#define SLAVE_DATA_CORRUPT (1<<0) -volatile uint8_t status = 0; - -inline static -void serial_delay(void) { - _delay_us(SERIAL_DELAY); -} - -inline static -void serial_output(void) { - SERIAL_PIN_DDR |= SERIAL_PIN_MASK; -} - -// make the serial pin an input with pull-up resistor -inline static -void serial_input(void) { - SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -inline static -uint8_t serial_read_pin(void) { - return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); -} - -inline static -void serial_low(void) { - SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; -} - -inline static -void serial_high(void) { - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -void serial_master_init(void) { - serial_output(); - serial_high(); -} - -void serial_slave_init(void) { - serial_input(); - - // Enable INT0 - EIMSK |= _BV(INT0); - // Trigger on falling edge of INT0 - EICRA &= ~(_BV(ISC00) | _BV(ISC01)); -} - -// Used by the master to synchronize timing with the slave. -static -void sync_recv(void) { - serial_input(); - // This shouldn't hang if the slave disconnects because the - // serial line will float to high if the slave does disconnect. - while (!serial_read_pin()); - serial_delay(); -} - -// Used by the slave to send a synchronization signal to the master. -static -void sync_send(void) { - serial_output(); - - serial_low(); - serial_delay(); - - serial_high(); -} - -// Reads a byte from the serial line -static -uint8_t serial_read_byte(void) { - uint8_t byte = 0; - serial_input(); - for ( uint8_t i = 0; i < 8; ++i) { - byte = (byte << 1) | serial_read_pin(); - serial_delay(); - _delay_us(1); - } - - return byte; -} - -// Sends a byte with MSB ordering -static -void serial_write_byte(uint8_t data) { - uint8_t b = 8; - serial_output(); - while( b-- ) { - if(data & (1 << b)) { - serial_high(); - } else { - serial_low(); - } - serial_delay(); - } -} - -// interrupt handle to be used by the slave device -ISR(SERIAL_PIN_INTERRUPT) { - sync_send(); - - uint8_t checksum = 0; - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_slave_buffer[i]); - sync_send(); - checksum += serial_slave_buffer[i]; - } - serial_write_byte(checksum); - sync_send(); - - // wait for the sync to finish sending - serial_delay(); - - // read the middle of pulses - _delay_us(SERIAL_DELAY/2); - - uint8_t checksum_computed = 0; - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_master_buffer[i] = serial_read_byte(); - sync_send(); - checksum_computed += serial_master_buffer[i]; - } - uint8_t checksum_received = serial_read_byte(); - sync_send(); - - serial_input(); // end transaction - - if ( checksum_computed != checksum_received ) { - status |= SLAVE_DATA_CORRUPT; - } else { - status &= ~SLAVE_DATA_CORRUPT; - } -} - -inline -bool serial_slave_DATA_CORRUPT(void) { - return status & SLAVE_DATA_CORRUPT; -} - -// Copies the serial_slave_buffer to the master and sends the -// serial_master_buffer to the slave. -// -// Returns: -// 0 => no error -// 1 => slave did not respond -int serial_update_buffers(void) { - // this code is very time dependent, so we need to disable interrupts - cli(); - - // signal to the slave that we want to start a transaction - serial_output(); - serial_low(); - _delay_us(1); - - // wait for the slaves response - serial_input(); - serial_high(); - _delay_us(SERIAL_DELAY); - - // check if the slave is present - if (serial_read_pin()) { - // slave failed to pull the line low, assume not present - sei(); - return 1; - } - - // if the slave is present syncronize with it - sync_recv(); - - uint8_t checksum_computed = 0; - // receive data from the slave - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_slave_buffer[i] = serial_read_byte(); - sync_recv(); - checksum_computed += serial_slave_buffer[i]; - } - uint8_t checksum_received = serial_read_byte(); - sync_recv(); - - if (checksum_computed != checksum_received) { - sei(); - return 1; - } - - uint8_t checksum = 0; - // send data to the slave - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_master_buffer[i]); - sync_recv(); - checksum += serial_master_buffer[i]; - } - serial_write_byte(checksum); - sync_recv(); - - // always, release the line when not in use - serial_output(); - serial_high(); - - sei(); - return 0; -} - -#endif diff --git a/keyboards/handwired/not_so_minidox/serial.h b/keyboards/handwired/not_so_minidox/serial.h deleted file mode 100644 index 28fcc56ce7..0000000000 --- a/keyboards/handwired/not_so_minidox/serial.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -#include "config.h" -#include - -/* TODO: some defines for interrupt setup */ -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_INPUT PIND -#define SERIAL_PIN_MASK _BV(PD0) -#define SERIAL_PIN_INTERRUPT INT0_vect - -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -#define SERIAL_MASTER_BUFFER_LENGTH 1 - -// Buffers for master - slave communication -extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; -extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; - -void serial_master_init(void); -void serial_slave_init(void); -int serial_update_buffers(void); -bool serial_slave_data_corrupt(void); diff --git a/keyboards/handwired/not_so_minidox/split_util.c b/keyboards/handwired/not_so_minidox/split_util.c deleted file mode 100644 index 39639c3b4b..0000000000 --- a/keyboards/handwired/not_so_minidox/split_util.c +++ /dev/null @@ -1,84 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "split_util.h" -#include "matrix.h" -#include "keyboard.h" -#include "config.h" - -#ifdef USE_I2C -# include "i2c.h" -#else -# include "serial.h" -#endif - -volatile bool isLeftHand = true; - -static void setup_handedness(void) { - #ifdef EE_HANDS - isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); - #else - // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c - #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) - isLeftHand = !has_usb(); - #else - isLeftHand = has_usb(); - #endif - #endif -} - -static void keyboard_master_setup(void) { -#ifdef USE_I2C - i2c_master_init(); -#ifdef SSD1306OLED - matrix_master_OLED_init (); -#endif -#else - serial_master_init(); -#endif -} - -static void keyboard_slave_setup(void) { -#ifdef USE_I2C - i2c_slave_init(SLAVE_I2C_ADDRESS); -#else - serial_slave_init(); -#endif -} - -bool has_usb(void) { - USBCON |= (1 << OTGPADE); //enables VBUS pad - _delay_us(5); - return (USBSTA & (1< -#include "eeconfig.h" - -#define SLAVE_I2C_ADDRESS 0x32 - -extern volatile bool isLeftHand; - -// slave version of matix scan, defined in matrix.c -void matrix_slave_scan(void); - -void split_keyboard_setup(void); -bool has_usb(void); -void keyboard_slave_loop(void); - -void matrix_master_OLED_init (void); -- cgit v1.2.3 From 6bc870d899c474bce82457699ec4b753d1538123 Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 27 Dec 2021 21:10:07 +1100 Subject: Refactor `bootloader_jump()` implementations (#15450) * Refactor `bootloader_jump()` implementations * Fix tests? * Rename `atmel-samba` to `md-boot` --- keyboards/handwired/onekey/teensy_32/rules.mk | 3 +++ keyboards/handwired/onekey/teensy_lc/rules.mk | 3 +++ 2 files changed, 6 insertions(+) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/onekey/teensy_32/rules.mk b/keyboards/handwired/onekey/teensy_32/rules.mk index c1b90d0d2b..937c9d5103 100644 --- a/keyboards/handwired/onekey/teensy_32/rules.mk +++ b/keyboards/handwired/onekey/teensy_32/rules.mk @@ -1,5 +1,8 @@ # MCU name MCU = MK20DX256 +# Bootloader selection +BOOTLOADER = halfkay + # Enter lower-power sleep mode when on the ChibiOS idle thread OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE diff --git a/keyboards/handwired/onekey/teensy_lc/rules.mk b/keyboards/handwired/onekey/teensy_lc/rules.mk index b3daabe317..0e3c7edf7a 100644 --- a/keyboards/handwired/onekey/teensy_lc/rules.mk +++ b/keyboards/handwired/onekey/teensy_lc/rules.mk @@ -2,5 +2,8 @@ MCU = MKL26Z64 USE_CHIBIOS_CONTRIB = yes +# Bootloader selection +BOOTLOADER = halfkay + # Enter lower-power sleep mode when on the ChibiOS idle thread OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE -- cgit v1.2.3 From 9d801cb03db7d5f11d1b82a22f401e30c343d0ee Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 28 Dec 2021 20:25:06 -0800 Subject: [Keyboard] Update Tractyl Manuform to use Split Pointing Device Sync --- .../handwired/tractyl_manuform/5x6_right/config.h | 1 - .../5x6_right/keymaps/drashna/keymap.c | 2 +- .../handwired/tractyl_manuform/5x6_right/rules.mk | 2 - keyboards/handwired/tractyl_manuform/config.h | 5 +- keyboards/handwired/tractyl_manuform/tm_sync.c | 180 --------------------- .../handwired/tractyl_manuform/tractyl_manuform.c | 56 +++++-- .../handwired/tractyl_manuform/tractyl_manuform.h | 15 +- 7 files changed, 57 insertions(+), 204 deletions(-) delete mode 100644 keyboards/handwired/tractyl_manuform/tm_sync.c (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/config.h b/keyboards/handwired/tractyl_manuform/5x6_right/config.h index d7618912f7..b9d8e86c09 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/config.h +++ b/keyboards/handwired/tractyl_manuform/5x6_right/config.h @@ -52,5 +52,4 @@ along with this program. If not, see . #define OLED_DISPLAY_128X64 -#define POINTING_DEVICE_TASK_THROTTLE #define POINTING_DEVICE_RIGHT diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c index 958f694172..65f8a5260d 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c +++ b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c @@ -301,7 +301,7 @@ void oled_driver_render_logo_left(void) { # endif oled_set_cursor(6, 3); # if defined(KEYBOARD_handwired_tractyl_manuform_5x6_right) - render_pointing_dpi_status(0); + render_pointing_dpi_status(kb_config_data.device_cpi, 0); # endif oled_set_cursor(0, 4); } diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/rules.mk b/keyboards/handwired/tractyl_manuform/5x6_right/rules.mk index 37bbbb4dae..a689be3dd5 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/rules.mk +++ b/keyboards/handwired/tractyl_manuform/5x6_right/rules.mk @@ -18,6 +18,4 @@ MOUSE_SHARED_EP = yes SPLIT_KEYBOARD = yes -QUANTUM_LIB_SRC += tm_sync.c - DEFAULT_FOLDER = handwired/tractyl_manuform/5x6_right/teensy2pp diff --git a/keyboards/handwired/tractyl_manuform/config.h b/keyboards/handwired/tractyl_manuform/config.h index cc8a7546f4..15c8102b8f 100644 --- a/keyboards/handwired/tractyl_manuform/config.h +++ b/keyboards/handwired/tractyl_manuform/config.h @@ -39,4 +39,7 @@ along with this program. If not, see . #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION -#define SPLIT_TRANSACTION_IDS_KB RPC_ID_KB_CONFIG_SYNC, RPC_ID_POINTER_STATE_SYNC +#define SPLIT_POINTING_ENABLE +#define POINTING_DEVICE_TASK_THROTTLE_MS 1 + +#define SPLIT_TRANSACTION_IDS_KB RPC_ID_KB_CONFIG_SYNC diff --git a/keyboards/handwired/tractyl_manuform/tm_sync.c b/keyboards/handwired/tractyl_manuform/tm_sync.c deleted file mode 100644 index 549a17a22f..0000000000 --- a/keyboards/handwired/tractyl_manuform/tm_sync.c +++ /dev/null @@ -1,180 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * Copyright 2021 Dasky (@daskygit) - - * 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 . - */ - -#include QMK_KEYBOARD_H -#include "pointing_device.h" -#include "transactions.h" -#include -#ifdef MOUSEKEY_ENABLE -# include "mousekey.h" -#endif - -// typedef struct { -// uint16_t device_cpi; -// } kb_config_data_t; - -kb_config_data_t kb_config; -static report_mouse_t shared_mouse_report; -extern const pointing_device_driver_t pointing_device_driver; - -void kb_pointer_sync_handler(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) { - shared_mouse_report = pointing_device_driver.get_report(shared_mouse_report); - memcpy(target2initiator_buffer, &shared_mouse_report, sizeof(report_mouse_t)); - shared_mouse_report.x = 0; - shared_mouse_report.y = 0; - shared_mouse_report.h = 0; - shared_mouse_report.v = 0; -} - -void kb_config_sync_handler(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) { - if (initiator2target_buffer_size == sizeof(kb_config)) { - memcpy(&kb_config, initiator2target_buffer, sizeof(kb_config)); - } - - static uint16_t cpi = 0; - // Check if the state values are different - if (cpi != kb_config.device_cpi) { - cpi = kb_config.device_cpi; - if (!is_keyboard_left()) { - pointing_device_set_cpi(cpi); - } - } -} - -void keyboard_pre_init_sync(void) { - memset(&kb_config, 0, sizeof(kb_config)); - memset(&shared_mouse_report, 0, sizeof(shared_mouse_report)); -} - -void keyboard_post_init_sync(void) { - // Register keyboard state sync split transaction - transaction_register_rpc(RPC_ID_KB_CONFIG_SYNC, kb_config_sync_handler); - transaction_register_rpc(RPC_ID_POINTER_STATE_SYNC, kb_pointer_sync_handler); -} - -void housekeeping_task_sync(void) { - if (is_keyboard_master()) { - // Keep track of the last state, so that we can tell if we need to propagate to slave - static kb_config_data_t last_kb_config; - static uint32_t last_sync = 0; - bool needs_sync = false; - - // Check if the state values are different - if (memcmp(&kb_config, &last_kb_config, sizeof(kb_config))) { - needs_sync = true; - memcpy(&last_kb_config, &kb_config, sizeof(kb_config)); - } - // Send to slave every 500ms regardless of state change - if (timer_elapsed32(last_sync) > 500) { - needs_sync = true; - } - - // Perform the sync if requested - if (needs_sync) { - if (transaction_rpc_send(RPC_ID_KB_CONFIG_SYNC, sizeof(kb_config), &kb_config)) { - last_sync = timer_read32(); - } - } - } -} - -void trackball_set_cpi(uint16_t cpi) { - kb_config.device_cpi = cpi; - if (!is_keyboard_left()) { - pointing_device_set_cpi(cpi); - } -} - -void pointing_device_task(void) { - if (!is_keyboard_master()) { - return; - } - -#if defined(POINTING_DEVICE_TASK_THROTTLE) - static uint32_t last_exec = 0; - if (timer_elapsed32(last_exec) < 1) { - return; - } - last_exec = timer_read32(); -#endif - - report_mouse_t local_report = pointing_device_get_report(); - - // Gather report info -#ifdef POINTING_DEVICE_MOTION_PIN - if (!readPin(POINTING_DEVICE_MOTION_PIN)) -#endif -#if defined(POINTING_DEVICE_COMBINED) - local_report = pointing_device_driver.get_report(local_report); - transaction_rpc_recv(RPC_ID_POINTER_STATE_SYNC, sizeof(report_mouse_t), &shared_mouse_report); - local_report.x = local_report.x | shared_mouse_report.x; - local_report.y = local_report.y | shared_mouse_report.y; - local_report.h = local_report.h | shared_mouse_report.h; - local_report.v = local_report.v | shared_mouse_report.v; -#elif defined(POINTING_DEVICE_LEFT) - if (is_keyboard_left()) { - local_report = pointing_device_driver.get_report(local_report); - } else { - transaction_rpc_recv(RPC_ID_POINTER_STATE_SYNC, sizeof(report_mouse_t), &local_report); - } -#elif defined(POINTING_DEVICE_RIGHT) - if (!is_keyboard_left()) { - local_report = pointing_device_driver.get_report(local_report); - } else { - transaction_rpc_recv(RPC_ID_POINTER_STATE_SYNC, sizeof(report_mouse_t), &local_report); - } -#else -# error "You need to define the side(s) the pointing device is on. POINTING_DEVICE_COMBINED / POINTING_DEVICE_LEFT / POINTING_DEVICE_RIGHT" -#endif - - // Support rotation of the sensor data -#if defined(POINTING_DEVICE_ROTATION_90) || defined(POINTING_DEVICE_ROTATION_180) || defined(POINTING_DEVICE_ROTATION_270) - int8_t x = local_report.x, y = local_report.y; -# if defined(POINTING_DEVICE_ROTATION_90) - local_report.x = y; - local_report.y = -x; -# elif defined(POINTING_DEVICE_ROTATION_180) - local_report.x = -x; - local_report.y = -y; -# elif defined(POINTING_DEVICE_ROTATION_270) - local_report.x = -y; - local_report.y = x; -# else -# error "How the heck did you get here?!" -# endif -#endif - // Support Inverting the X and Y Axises -#if defined(POINTING_DEVICE_INVERT_X) - local_report.x = -local_report.x; -#endif -#if defined(POINTING_DEVICE_INVERT_Y) - local_report.y = -local_report.y; -#endif - - // allow kb to intercept and modify report - local_report = pointing_device_task_kb(local_report); - // combine with mouse report to ensure that the combined is sent correctly -#ifdef MOUSEKEY_ENABLE - report_mouse_t mousekey_report = mousekey_get_report(); - local_report.buttons = local_report.buttons | mousekey_report.buttons; -#endif -#if defined(POINTING_DEVICE_COMBINED) - local_report.buttons = local_report.buttons | shared_mouse_report.buttons; -#endif - pointing_device_set_report(local_report); - pointing_device_send(); -} diff --git a/keyboards/handwired/tractyl_manuform/tractyl_manuform.c b/keyboards/handwired/tractyl_manuform/tractyl_manuform.c index 6095bfb7e2..5bdc57ca09 100644 --- a/keyboards/handwired/tractyl_manuform/tractyl_manuform.c +++ b/keyboards/handwired/tractyl_manuform/tractyl_manuform.c @@ -17,7 +17,6 @@ #include "tractyl_manuform.h" #include "transactions.h" #include -#include "drivers/sensors/pmw3360.h" #ifndef TRACKBALL_DPI_OPTIONS # define TRACKBALL_DPI_OPTIONS \ @@ -31,11 +30,10 @@ #endif keyboard_config_t keyboard_config; +kb_config_data_t kb_config_data; uint16_t dpi_array[] = TRACKBALL_DPI_OPTIONS; #define DPI_OPTION_SIZE (sizeof(dpi_array) / sizeof(uint16_t)) - - bool process_record_kb(uint16_t keycode, keyrecord_t* record) { if (!process_record_user(keycode, record)) { return false; @@ -49,7 +47,8 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) { keyboard_config.dpi_config = (keyboard_config.dpi_config + 1) % DPI_OPTION_SIZE; } eeconfig_update_kb(keyboard_config.raw); - trackball_set_cpi(dpi_array[keyboard_config.dpi_config]); + kb_config_data.device_cpi = dpi_array[keyboard_config.dpi_config]; + pointing_device_set_cpi(kb_config_data.device_cpi); } #endif @@ -69,7 +68,6 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) { return true; } -__attribute__((weak)) void keyboard_pre_init_sync(void) {} __attribute__((weak)) void keyboard_pre_init_sub(void) {} void keyboard_pre_init_kb(void) { // debug_enable = true; @@ -83,20 +81,22 @@ void keyboard_pre_init_kb(void) { writePin(DEBUG_LED_PIN, !debug_enable); #endif + memset(&kb_config_data, 0, sizeof(kb_config_data)); + keyboard_pre_init_sub(); - keyboard_pre_init_sync(); keyboard_pre_init_user(); } -__attribute__((weak)) void keyboard_post_init_sync(void) {} -void keyboard_post_init_kb(void) { - keyboard_post_init_sync(); +void keyboard_post_init_kb(void) { + transaction_register_rpc(RPC_ID_KB_CONFIG_SYNC, kb_config_sync_handler); + keyboard_post_init_user(); } #ifdef POINTING_DEVICE_ENABLE void pointing_device_init_kb(void) { - trackball_set_cpi(dpi_array[keyboard_config.dpi_config]); + kb_config_data.device_cpi = dpi_array[keyboard_config.dpi_config]; + pointing_device_set_cpi(kb_config_data.device_cpi); pointing_device_init_user(); } @@ -111,7 +111,8 @@ report_mouse_t pointing_device_task_kb(report_mouse_t mouse_report) { void eeconfig_init_kb(void) { keyboard_config.dpi_config = TRACKBALL_DPI_DEFAULT; #ifdef POINTING_DEVICE_ENABLE - trackball_set_cpi(dpi_array[keyboard_config.dpi_config]); + kb_config_data.device_cpi = dpi_array[keyboard_config.dpi_config]; + pointing_device_set_cpi(kb_config_data.device_cpi); #endif eeconfig_update_kb(keyboard_config.raw); eeconfig_init_user(); @@ -135,12 +136,39 @@ void matrix_scan_kb(void) { matrix_scan_user(); } -__attribute__((weak)) void housekeeping_task_sync(void) {} -void housekeeping_task_kb(void) { - housekeeping_task_sync(); +void housekeeping_task_kb(void) { + if (is_keyboard_master()) { + // Keep track of the last state, so that we can tell if we need to propagate to slave + static kb_config_data_t last_kb_config; + static uint32_t last_sync = 0; + bool needs_sync = false; + + // Check if the state values are different + if (memcmp(&kb_config_data, &last_kb_config, sizeof(kb_config_data))) { + needs_sync = true; + memcpy(&last_kb_config, &kb_config_data, sizeof(kb_config_data)); + } + // Send to slave every 500ms regardless of state change + if (timer_elapsed32(last_sync) > 500) { + needs_sync = true; + } + + // Perform the sync if requested + if (needs_sync) { + if (transaction_rpc_send(RPC_ID_KB_CONFIG_SYNC, sizeof(kb_config_data), &kb_config_data)) { + last_sync = timer_read32(); + } + } + } // no need for user function, is called already } +void kb_config_sync_handler(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) { + if (initiator2target_buffer_size == sizeof(kb_config_data)) { + memcpy(&kb_config_data, initiator2target_buffer, sizeof(kb_config_data)); + } +} + #ifdef POINTING_DEVICE_ENABLE void matrix_power_up(void) { pointing_device_task(); } #endif diff --git a/keyboards/handwired/tractyl_manuform/tractyl_manuform.h b/keyboards/handwired/tractyl_manuform/tractyl_manuform.h index 6aa40fc18b..3f8aca4551 100644 --- a/keyboards/handwired/tractyl_manuform/tractyl_manuform.h +++ b/keyboards/handwired/tractyl_manuform/tractyl_manuform.h @@ -32,21 +32,26 @@ typedef union { }; } keyboard_config_t; +typedef union { + uint32_t raw; + struct { + uint16_t device_cpi; + }; +} kb_config_data_t; + extern keyboard_config_t keyboard_config; +extern kb_config_data_t kb_config_data; enum ploopy_keycodes { DPI_CONFIG = SAFE_RANGE, KEYMAP_SAFE_RANGE, }; -typedef struct { - uint16_t device_cpi; -} kb_config_data_t; - -void trackball_set_cpi(uint16_t cpi); void matrix_init_sub_kb(void); void matrix_scan_sub_kb(void); void keyboard_pre_init_sync(void); void keyboard_post_init_sync(void); void housekeeping_task_sync(void); + +void kb_config_sync_handler(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer); -- cgit v1.2.3 From f85b945c328ee5a26a8f6ae7a34930237cf69184 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 29 Dec 2021 05:54:57 -0800 Subject: [Keyboard] Fix compiler issue with tractyl manuform 4x6 (#15646) --- keyboards/handwired/tractyl_manuform/4x6_right/rules.mk | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/tractyl_manuform/4x6_right/rules.mk b/keyboards/handwired/tractyl_manuform/4x6_right/rules.mk index e83e9a7bba..c497bb2ee8 100644 --- a/keyboards/handwired/tractyl_manuform/4x6_right/rules.mk +++ b/keyboards/handwired/tractyl_manuform/4x6_right/rules.mk @@ -21,9 +21,7 @@ RGB_MATRIX_DRIVER = WS2812 POINTING_DEVICE_ENABLE = yes -MOUSE_SHARED_EP = no +POINTING_DEVICE_DRIVER = pmw3360 +MOUSE_SHARED_EP = yes SPLIT_KEYBOARD = yes - -SRC += drivers/sensors/pmw3360.c -QUANTUM_LIB_SRC += spi_master.c tm_sync.c -- cgit v1.2.3 From c72ed7c02473dec4da6cb263c1e0fb2ca4856b94 Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 17 Jan 2022 08:44:34 +1100 Subject: CLI: Parse USB device version BCD (#14580) * CLI: Parse USB device version BCD * Apply suggestions --- keyboards/handwired/qc60/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/qc60/config.h b/keyboards/handwired/qc60/config.h index 0c27755910..db3d88dcf4 100644 --- a/keyboards/handwired/qc60/config.h +++ b/keyboards/handwired/qc60/config.h @@ -5,7 +5,7 @@ /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x0C60 -#define DEVICE_VER 0x00C6 +#define DEVICE_VER 0x0100 #define MANUFACTURER PeiorisBoards #define PRODUCT QC60 -- cgit v1.2.3 From 77062e9a36b3167ea1ff747e5577a67969273c31 Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Mon, 24 Jan 2022 08:49:36 +1100 Subject: Add L432, L442. (#16016) --- keyboards/handwired/onekey/nucleo_l432kc/config.h | 21 +++++++++++++++++++++ keyboards/handwired/onekey/nucleo_l432kc/readme.md | 5 +++++ keyboards/handwired/onekey/nucleo_l432kc/rules.mk | 5 +++++ 3 files changed, 31 insertions(+) create mode 100644 keyboards/handwired/onekey/nucleo_l432kc/config.h create mode 100644 keyboards/handwired/onekey/nucleo_l432kc/readme.md create mode 100644 keyboards/handwired/onekey/nucleo_l432kc/rules.mk (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/onekey/nucleo_l432kc/config.h b/keyboards/handwired/onekey/nucleo_l432kc/config.h new file mode 100644 index 0000000000..7aa74f6682 --- /dev/null +++ b/keyboards/handwired/onekey/nucleo_l432kc/config.h @@ -0,0 +1,21 @@ +// Copyright 2021 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#include "config_common.h" + +#define PRODUCT Onekey L432KC + +#define MATRIX_COL_PINS { A2 } +#define MATRIX_ROW_PINS { A1 } +#define UNUSED_PINS + +#define BACKLIGHT_PIN B8 +#define BACKLIGHT_PWM_DRIVER PWMD4 +#define BACKLIGHT_PWM_CHANNEL 3 +#define BACKLIGHT_PAL_MODE 2 + +#define RGB_DI_PIN A0 +#define RGB_CI_PIN B13 + +#define ADC_PIN A0 diff --git a/keyboards/handwired/onekey/nucleo_l432kc/readme.md b/keyboards/handwired/onekey/nucleo_l432kc/readme.md new file mode 100644 index 0000000000..c7d13cb973 --- /dev/null +++ b/keyboards/handwired/onekey/nucleo_l432kc/readme.md @@ -0,0 +1,5 @@ +# STM32 Nucleo-L432 onekey + +To trigger keypress, short together pins *A1* and *A2*. + +You'll also need to connect `VIN`, `GND`, USB `D+` to `PA12`/`D2`, and USB `D-` to `PA11`/`D10`. diff --git a/keyboards/handwired/onekey/nucleo_l432kc/rules.mk b/keyboards/handwired/onekey/nucleo_l432kc/rules.mk new file mode 100644 index 0000000000..64dae7746e --- /dev/null +++ b/keyboards/handwired/onekey/nucleo_l432kc/rules.mk @@ -0,0 +1,5 @@ +# MCU name +MCU = STM32L432 + +# Bootloader selection +BOOTLOADER = stm32-dfu -- cgit v1.2.3 From 2da12182f33b2909338b653420cf8ae0eed53414 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Tue, 25 Jan 2022 13:10:51 +0000 Subject: Fix handwired/ms_sculpt_mobile default keymap (#16032) --- keyboards/handwired/ms_sculpt_mobile/babblePaste.c | 460 --------------------- keyboards/handwired/ms_sculpt_mobile/babblePaste.h | 238 ----------- .../handwired/ms_sculpt_mobile/babblePaste.txt | 123 ------ .../keymaps/milestogo/babblePaste.c | 460 +++++++++++++++++++++ .../keymaps/milestogo/babblePaste.h | 238 +++++++++++ .../keymaps/milestogo/babblePaste.txt | 123 ++++++ .../ms_sculpt_mobile/keymaps/milestogo/rules.mk | 3 + keyboards/handwired/ms_sculpt_mobile/rules.mk | 3 - 8 files changed, 824 insertions(+), 824 deletions(-) delete mode 100644 keyboards/handwired/ms_sculpt_mobile/babblePaste.c delete mode 100644 keyboards/handwired/ms_sculpt_mobile/babblePaste.h delete mode 100644 keyboards/handwired/ms_sculpt_mobile/babblePaste.txt create mode 100644 keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/babblePaste.c create mode 100644 keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/babblePaste.h create mode 100644 keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/babblePaste.txt (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/ms_sculpt_mobile/babblePaste.c b/keyboards/handwired/ms_sculpt_mobile/babblePaste.c deleted file mode 100644 index e035648706..0000000000 --- a/keyboards/handwired/ms_sculpt_mobile/babblePaste.c +++ /dev/null @@ -1,460 +0,0 @@ -/* A library to output the right key shortcut in any common app. -Given a global variable babble_mode to show the environment and a -key that calls the paste macro, do the right type of paste. -Setting the context is done by another macro, or TBD interaction with the host. - -Huge thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts -and https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/jeebak/keymap.c -*/ - -#include "babblePaste.h" - -#include "action_macro.h" - -#ifdef USE_BABLPASTE - -// GLOBAL variable to determine mode. Sets startup default if no eeppom -uint8_t babble_mode =0 ; - -// small function that we might also want to call from a keymap. - -macro_t* switch_babble_mode( uint8_t id) { - babble_mode= id; - return MACRO_NONE; //less typing where called -} - - -// Today I learned that the preprocessor can not create a switch statement label from an argument -// And else statements have problems, see https://gcc.gnu.org/onlinedocs/gcc-3.0.1/cpp_3.html#SEC15 -#define BABLM(ent, macro...) \ - if ( ent == shortcut ) \ - { action_macro_play( MACRO(macro)); return MACRO_NONE; } - - -/* this function runs the appropriate babblepaste macro, given -the global babble_mode, and a shortcut from the ENUM in babblePaste.h -TODO, the pointers in this function should be stored in a PROGMEM array, not ram. -But that requires even more clever preprocessor foo. -*/ -const macro_t *babblePaste (keyrecord_t *record, uint8_t shortcut) { -/* - if ( shortcut < BABL_START_NUM || \ - shortcut >= (BABL_START_NUM + BABL_NUM_MACROS ) ) { - return MACRO_NONE; - } -*/ - - -#ifdef MS_MODE - if ( BABL_WINDOWS == shortcut ) { return switch_babble_mode(MS_MODE); } -#endif -#ifdef MAC_MODE - if ( BABL_MAC == shortcut) { return switch_babble_mode(MAC_MODE); } -#endif -#ifdef LINUX_MODE - if ( BABL_LINUX == shortcut ) { return switch_babble_mode(LINUX_MODE); } -#endif - #ifdef READMUX_MODE - if ( BABL_READLINE == shortcut ) { switch_babble_mode(READMUX_MODE); return MACRO_NONE; } -#endif -#ifdef VI_MODE - if ( BABL_VI == shortcut ) { return switch_babble_mode(VI_MODE); } -#endif -#ifdef EMACS_MODE - if ( BABL_EMACS == shortcut ) { return switch_babble_mode(EMACS_MODE); } -#endif - - - - switch(babble_mode) { - -#ifdef MS_MODE - - case MS_MODE: - BABLM( BABL_GO_LEFT_1C, T(LEFT), END ); - BABLM( BABL_GO_RIGHT_1C , T(RIGHT), END ); - BABLM( BABL_GO_LEFT_WORD, D(LCTL), T(LEFT), U(LCTL), END ); - BABLM( BABL_GO_RIGHT_WORD, D(LCTL), T(RIGHT), U(LCTL), END ); - BABLM( BABL_GO_START_LINE, T(HOME), END ); - BABLM( BABL_GO_END_LINE, T(END), END ); - BABLM( BABL_GO_START_DOC, D(LCTL),T(HOME), U(LCTL),END ); - BABLM( BABL_GO_END_DOC, D(LCTL),T(END), U(LCTL),END ); - BABLM( BABL_GO_NEXT_LINE, T(DOWN), END ); - BABLM( BABL_GO_PREV_LINE, T(UP), END ); - BABLM( BABL_PGDN, T(PGDN), END ); - BABLM( BABL_PGUP, T(PGUP), END ); - BABLM( BABL_DEL_RIGHT_1C, T(DEL), END ); - BABLM( BABL_DEL_LEFT_WORD, D(LCTL), T(BSPACE), U(LCTL), END ); - BABLM( BABL_DEL_RIGHT_WORD, D(LCTL), T(DEL), U(LCTL), END ); - BABLM( BABL_DEL_TO_LINE_END, D(RSFT), T(HOME), U(RSFT), T(DEL), END); - BABLM( BABL_DEL_TO_LINE_START, D(RSFT), T(END), U(RSFT), T(DEL), END ); -#ifndef BABL_MOVEMENTONLY - BABLM( BABL_UNDO, D(LCTL), T(Z), U(LCTL), END ); - BABLM( BABL_REDO, D(LCTL), T(Y), U(LCTL), END ); - BABLM( BABL_CUT, D(LCTL), T(X), U(LCTL), END ); - BABLM( BABL_COPY, D(LCTL), T(C), U(LCTL), END ); - BABLM( BABL_PASTE, D(LCTL), T(V), U(LCTL), END ); - BABLM( BABL_SELECT_ALL, D(LCTL), T(A), U(LCTL), END ); - BABLM( BABL_FIND, D(LCTL),T(F), U(LCTL),END ); - BABLM( BABL_FIND_NEXT, T(F3),END ); - BABLM( BABL_FIND_REPLACE, D(LCTL),T(H), U(LCTL),END ); - BABLM( BABL_RUNAPP, D(LGUI),T(R), U(LGUI),END ); - BABLM( BABL_SWITCH_APP_NEXT, D(LALT),T(TAB), U(LALT),END ); - BABLM( BABL_SWITCH_APP_LAST, D(LSFT),D(LALT),T(TAB), U(LALT), U(LSFT),END ); - BABLM( BABL_CLOSE_APP, D(LALT),T(F4), U(LALT),END ); - BABLM( BABL_HELP, T(F1),END ); -#ifndef BABL_NOBROWSER - BABLM( BABL_BROWSER_NEW_TAB, D(LCTL), T(T), U(LCTL),END ); - BABLM( BABL_BROWSER_CLOSE_TAB, D(LCTL), T(W), U(LCTL),END ); - BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LCTL), D(RSFT),T(T), U(RSFT),U(LCTL),END ); - BABLM( BABL_BROWSER_NEXT_TAB, D(LCTL), T(TAB), U(LCTL),END ); - BABLM( BABL_BROWSER_PREV_TAB, D(LCTL), D(RSFT), T(TAB), U(RSFT), U(LCTL),END ); - BABLM( BABL_BROWSER_URL_BAR, D(LCTL), T(L), U(LCTL),END ); - BABLM( BABL_BROWSER_FORWARD, D(LALT), T(RIGHT), U(LALT),END ); - BABLM( BABL_BROWSER_BACK, D(LALT), T(LEFT), U(LALT),END ); - BABLM( BABL_BROWSER_FIND, D(LCTL), T(F), U(LCTL),END ); - BABLM( BABL_BROWSER_BOOKMARK, D(LCTL), T(D), U(LCTL),END ); - //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LCTL),END ); // EDGE - BABLM( BABL_BROWSER_DEV_TOOLS, D(LCTL), T(T), U(LCTL),END ); // Chrome - // Chrome - BABLM( BABL_BROWSER_RELOAD, D(LCTL), T(F5), U(LCTL),END ); // hard reload w/o cache - BABLM( BABL_BROWSER_FULLSCREEN, T(F11),END ); //command shift F - BABLM( BABL_BROWSER_ZOOM_IN, D(LCTL), D(RSFT), T(EQL), U(RSFT), U(LCTL),END ); // ctr+ + - BABLM( BABL_BROWSER_ZOOM_OUT, D(LCTL), T(MINS), U(LCTL),END ); -#endif -#endif - - // Todo, ring bell, flash light, show user this isn't supported - return MACRO_NONE; - - -#endif /* MS_MODE*/ - - -#ifdef LINUX_MODE - - case LINUX_MODE: - BABLM( BABL_GO_LEFT_1C , T(LEFT), END ); - BABLM( BABL_GO_RIGHT_1C , T(RIGHT), END ); - BABLM( BABL_GO_LEFT_WORD , D(LCTL), T(LEFT), U(LCTL), END ); - BABLM( BABL_GO_RIGHT_WORD , D(LCTL), T(RIGHT), U(LCTL), END ); - BABLM( BABL_GO_START_LINE , T(HOME), END ); - BABLM( BABL_GO_END_LINE , T(END), END ); - BABLM( BABL_GO_START_DOC , D(LCTL),T(HOME), U(LCTL),END ); - BABLM( BABL_GO_END_DOC , D(LCTL),T(END), U(LCTL),END ); - BABLM( BABL_GO_NEXT_LINE , T(DOWN), END ); - BABLM( BABL_GO_PREV_LINE , T(UP), END ); - BABLM( BABL_PGDN , T(PGDN), END ); - BABLM( BABL_PGUP , T(PGUP), END ); - BABLM( BABL_DEL_RIGHT_1C , D(DEL), END ); - BABLM( BABL_DEL_LEFT_WORD , D(LCTL), T(BSPACE), U(LCTL), END ); - BABLM( BABL_DEL_RIGHT_WORD , D(LCTL), T(DEL), U(LCTL), END ); - BABLM( BABL_DEL_TO_LINE_END, D(RSFT), T(HOME), U(RSFT), T(DEL), END); - BABLM( BABL_DEL_TO_LINE_START, D(RSFT), T(END), U(RSFT), T(DEL), END ); -#ifndef BABL_MOVEMENTONLY - BABLM( BABL_UNDO , D(LCTL), T(Z), U(LCTL), END ); - BABLM( BABL_REDO , D(LCTL), T(Y), U(LCTL), END ); - BABLM( BABL_CUT , D(LCTL), T(X), U(LCTL), END ); - BABLM( BABL_COPY , D(LCTL), T(C), U(LCTL), END ); - BABLM( BABL_PASTE , D(LCTL), T(V), U(LCTL), END ); - BABLM( BABL_SELECT_ALL, D(LCTL), T(A), U(LCTL), END ); - BABLM( BABL_FIND, D(LCTL),T(F), U(LCTL),END ); - /* BABLM(BABL_FIND_NEXT , T(F3),END ); KDE */ - BABLM( BABL_FIND_NEXT, D(LCTL),T(G), U(LCTL),END ); // Gnome*/ - /* BABLM( , D(LCTL),T(R), U(LCTL),END ); KDE */ - BABLM( BABL_FIND_REPLACE, D(LCTL),T(H), U(LCTL),END ); // Gnome*/ - BABLM( BABL_RUNAPP, D(LALT),T(F2), U(LALT),END ); - BABLM( BABL_SWITCH_APP_NEXT, D(LCTL),T(TAB), U(LCTL),END ); - BABLM( BABL_SWITCH_APP_LAST, D(LSFT),D(LCTL),T(TAB), U(LCTL), U(LSFT),END ); - BABLM( BABL_CLOSE_APP, D(LALT),T(F4), U(LALT),END ); - //BABLM( BABL_HELP, END ); - -#ifndef BABL_NOBROWSER - BABLM( BABL_BROWSER_NEW_TAB, D(LCTL), T(T), U(LCTL),END ); - BABLM( BABL_BROWSER_CLOSE_TAB, D(LCTL), T(W), U(LCTL),END ); - BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LCTL), D(RSFT),T(T), U(RSFT),U(LCTL),END ); - BABLM( BABL_BROWSER_NEXT_TAB, D(LCTL), T(TAB), U(LCTL),END ); - BABLM( BABL_BROWSER_PREV_TAB, D(LCTL), D(RSFT), T(TAB), U(RSFT), U(LCTL),END ); - BABLM( BABL_BROWSER_URL_BAR, D(LCTL), T(L), U(LCTL),END ); - BABLM( BABL_BROWSER_FORWARD, D(LALT), T(RIGHT), U(LALT),END ); - BABLM( BABL_BROWSER_BACK, D(LALT), T(LEFT), U(LALT),END ); - BABLM( BABL_BROWSER_FIND, D(LCTL), T(F), U(LCTL),END ); - BABLM( BABL_BROWSER_BOOKMARK, D(LCTL), T(D), U(LCTL),END ); - BABLM( BABL_BROWSER_DEV_TOOLS, D(LCTL), T(T), U(LCTL),END ); // Chrome - BABLM( BABL_BROWSER_RELOAD, D(LCTL), T(F5), U(LCTL),END ); // hard reload w/o cache - BABLM( BABL_BROWSER_FULLSCREEN, T(F11),END ); //command shift F - BABLM( BABL_BROWSER_ZOOM_IN, D(LCTL), T(PLUS), U(LCTL),END ); - BABLM( BABL_BROWSER_ZOOM_OUT, D(LCTL), T(MINS), U(LCTL),END ); -#endif -#endif - return MACRO_NONE; - -#endif - -#ifdef MAC_MODE - - case MAC_MODE: - BABLM( BABL_GO_LEFT_1C , T(LEFT), END ); - BABLM( BABL_GO_RIGHT_1C, T(RIGHT), END ); - BABLM( BABL_GO_LEFT_WORD , D(LALT), T(LEFT), U(LALT), END ); - BABLM( BABL_GO_RIGHT_WORD , D(LALT), T(RIGHT), U(LALT), END ); - BABLM( BABL_GO_START_LINE , D(LGUI), T(LEFT), U(LGUI), END ); - BABLM( BABL_GO_END_LINE , D(LGUI), T(RIGHT), U(LGUI), END ); - BABLM( BABL_GO_START_DOC , D(LGUI),T(UP), U(LGUI),END ); - BABLM( BABL_GO_END_DOC , D(LGUI),T(DOWN), U(LGUI),END ); - BABLM( BABL_GO_NEXT_LINE , T(DOWN), END ); - BABLM( BABL_GO_PREV_LINE , T(UP), END ); - BABLM( BABL_PGDN , D(LALT),T(DOWN), U(LALT), END ); - BABLM( BABL_PGUP , D(LALT),T(UP), U(LALT), END ); - BABLM( BABL_DEL_RIGHT_1C , D(DEL), END ); - BABLM( BABL_DEL_LEFT_WORD , D(LALT), T(BSPACE), U(LALT), END ); - BABLM( BABL_DEL_RIGHT_WORD, D(LALT), T(DEL), U(LALT), END ); - BABLM( BABL_DEL_TO_LINE_END, D(LCTL), T(K), U(LCTL), END );// there must be another way - BABLM( BABL_DEL_TO_LINE_START, D(LGUI), T(BSPACE), U(LGUI), END ); -#ifndef BABL_MOVEMENTONLY - BABLM( BABL_UNDO , D(1), D(LGUI), T(Z), U(LGUI), END ); - BABLM( BABL_REDO , D(LSFT),D(LGUI), T(Z), U(LSFT),U(LGUI), END ); - BABLM( BABL_CUT , D(LGUI), T(X), U(LGUI), END ); - BABLM( BABL_COPY , D(LGUI), T(C), U(LGUI), END ); - BABLM( BABL_PASTE , D(LGUI), T(V), U(LGUI), END ); - BABLM( BABL_SELECT_ALL , D(LGUI), T(A), U(LGUI), END ); - BABLM( BABL_FIND , D(LGUI),T(F), U(LGUI),END ); - BABLM( BABL_FIND_NEXT, D(LGUI),T(G), U(LGUI),END ); - BABLM( BABL_FIND_REPLACE, D(LGUI),T(F), U(LGUI),END ); - BABLM( BABL_RUNAPP , D(LGUI),T(R), U(LGUI),END ); - BABLM( BABL_SWITCH_APP_NEXT , D(LGUI),T(TAB), U(LGUI),END ); - BABLM( BABL_SWITCH_APP_LAST , D(LSFT),D(LGUI),T(TAB), U(LGUI), U(LSFT),END ); - BABLM( BABL_CLOSE_APP , D(LGUI),T(Q), U(LGUI),END ); - BABLM( BABL_HELP , D(LSFT),D(LGUI),T(SLASH), U(LGUI), U(LSFT),END ); - -#ifndef BABL_NOBROWSER - BABLM( BABL_BROWSER_NEW_TAB, D(LGUI), T(T), U(LGUI),END ); - BABLM( BABL_BROWSER_CLOSE_TAB, D(LGUI), T(W), U(LGUI),END ); - BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LGUI), D(RSFT),T(T), U(RSFT),U(LGUI),END ); - BABLM( BABL_BROWSER_NEXT_TAB, D(LGUI),D(LALT), T(RIGHT),U(LALT), U(LGUI),END ); - BABLM( BABL_BROWSER_PREV_TAB, D(LGUI), D(RSFT), T(LEFT), U(RSFT), U(LGUI),END ); - BABLM( BABL_BROWSER_URL_BAR, D(LGUI), T(L), U(LGUI),END ); - BABLM( BABL_BROWSER_FORWARD, D(LGUI), T(RIGHT), U(LGUI),END ); - BABLM( BABL_BROWSER_BACK, D(LGUI), T(LEFT), U(LGUI),END ); - BABLM( BABL_BROWSER_FIND, D(LGUI), T(F), U(LGUI),END ); - BABLM( BABL_BROWSER_BOOKMARK, D(LGUI), T(D), U(LGUI),END ); - //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LGUI),END ); // EDGE - BABLM( BABL_BROWSER_DEV_TOOLS, D(LGUI), D(LALT), T(I), U(LALT),U(LGUI),END ); // Chrome - // Chrome - BABLM( BABL_BROWSER_RELOAD, D(LGUI), T(R), U(LGUI),END ); // add shift for reload w/o cache - BABLM( BABL_BROWSER_FULLSCREEN, D(LGUI), D(LCTL), T(P), U(LCTL), U(LGUI),END ); //command shift F - BABLM( BABL_BROWSER_ZOOM_IN, D(LGUI), D(RSFT), T(EQL), U(RSFT), U(LGUI),END ); // ctr+ + - BABLM( BABL_BROWSER_ZOOM_OUT, D(LGUI), T(MINS), U(LGUI),END ); -#endif -#endif - - return MACRO_NONE; -#endif - -#ifdef EMACS_MODE - - case EMACS_MODE: - switch(shortcut) { -//probably should allow meta to not be ALT - - BABLM( BABL_GO_LEFT_1C, T(LEFT), END ); - BABLM( BABL_GO_RIGHT_1C, T(RIGHT), END ); - BABLM( BABL_GO_LEFT_WORD, D(LALT), T(B), U(LALT), END ); - BABLM( BABL_GO_RIGHT_WORD , D(LALT), T(F), U(LALT), END ); - BABLM( BABL_GO_START_LINE , D(LCTL), T(A), U(LCTL), END ); - BABLM( BABL_GO_END_LINE , D(LCTL), T(E), U(LCTL), END ); - BABLM( BABL_GO_START_DOC , D(LALT), D(LSFT), T(COMM),U(LSFT), U(LALT) ,END ); - BABLM( BABL_GO_END_DOC , D(LALT), D(LSFT), T(DOT), U(LSFT), U(LALT) ,END ); - BABLM( BABL_GO_NEXT_LINE , D(LCTL), T(N), U(LCTL), END ); - BABLM( BABL_GO_PREV_LINE , D(LCTL), T(P), U(LCTL), END ); - BABLM( BABL_PGDN , D(LCTL), T(V), U(LCTL), END ); - BABLM( BABL_PGUP , D(LALT), T(V), U(LALT), END ); - BABLM( BABL_DEL_RIGHT_1C, D(LCTL), T(D), U(LCTL),END ); - BABLM( BABL_DEL_LEFT_WORD , D(LCTL), T(BSPACE), U(LCTL), END ); - BABLM( BABL_DEL_RIGHT_WORD , D(LALT), T(D), U(LALT), END ); - BABLM( BABL_DEL_TO_LINE_END, D(LCTL), T(K), U(LCTL), END ); - BABLM( BABL_DEL_TO_LINE_START, T(ESC), T(0), D(LCTL), T(K), U(LCTL), END ); -#ifndef BABL_MOVEMENTONLY - BABLM( BABL_UNDO , D(LCTL), T(X), U(LCTL),T(C), END ); - BABLM( BABL_REDO , D(LCTL), T(X), U(LCTL),T(C), END ); // arguably - BABLM( BABL_CUT , D(LCTL), T(W), U(LCTL), END ); - BABLM( BABL_COPY , D(LALT), T(W), U(LALT), END ); //really? - BABLM( BABL_PASTE , D(LCTL), T(Y), U(LCTL), END ); - BABLM( BABL_SELECT_ALL ,D(LCTL), T(X), U(LCTL),T(H), END ); - BABLM( BABL_FIND , D(LCTL), T(S), U(LCTL),END ); - BABLM( BABL_FIND_NEXT , D(LCTL), T(S), U(LCTL),END ); - BABLM( BABL_FIND_REPLACE , D(LALT),D(LSFT), T(5),U(LSFT), U(LALT), END ); - BABLM( BABL_RUNAPP , D(LALT), T(X), U(LALT),T(S),T(H),T(E),T(L),T(L),END );// arguably - BABLM( BABL_SWITCH_APP_NEXT , D(LCTL), T(X), U(LCTL),T(RIGHT), END ); // arguably - BABLM( BABL_SWITCH_APP_LAST , D(LCTL), T(X), U(LCTL),T(LEFT), END ); // arguably - BABLM( BABL_CLOSE_APP , D(LCTL), T(X), U(LCTL),T(C),END ); - BABLM( BABL_HELP , D(LCTL),T(H), U(LCTL),T(A),END); // start search in help -#ifndef BABL_NOBROWSER -/* you get to figure w3 out - BABLM( BABL_BROWSER_NEW_TAB, D(LGUI), T(T), U(LGUI),END ); - BABLM( BABL_BROWSER_CLOSE_TAB, D(LGUI), T(W), U(LGUI),END ); - BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LGUI), D(RSFT),T(T), U(RSFT),U(LGUI),END ); - BABLM( BABL_BROWSER_NEXT_TAB, D(LGUI),D(LALT), T(RIGHT),U(LALT), U(LGUI),END ); - BABLM( BABL_BROWSER_PREV_TAB, D(LGUI), D(RSFT), T(LEFT), U(RSFT), U(LGUI),END ); - BABLM( BABL_BROWSER_URL_BAR, D(LGUI), T(L), U(LGUI),END ); - BABLM( BABL_BROWSER_FORWARD, D(LGUI), T(RIGHT), U(LGUI),END ); - BABLM( BABL_BROWSER_BACK, D(LGUI), T(LEFT), U(LGUI),END ); - BABLM( BABL_BROWSER_FIND, D(LGUI), T(F), U(LGUI),END ); - BABLM( BABL_BROWSER_BOOKMARK, D(LGUI), T(D), U(LGUI),END ); - //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LGUI),END ); // EDGE - BABLM( BABL_BROWSER_DEV_TOOLS, D(LGUI), D(LALT), T(I), U(LALT),U(LGUI),END ); // Chrome - // Chrome - BABLM( BABL_BROWSER_RELOAD, D(LGUI), T(R), U(LGUI),END ); // add shift for reload w/o cache - BABLM( BABL_BROWSER_FULLSCREEN, D(LGUI), D(LCTL), T(P), U(LCTL), U(LGUI),END ); //command shift F - BABLM( BABL_BROWSER_ZOOM_IN, D(LGUI), D(RSFT), T(EQL), U(RSFT), U(LGUI),END ); // ctr+ + - BABLM( BABL_BROWSER_ZOOM_OUT, D(LGUI), T(MINS), U(LGUI),END ); -*/ -#endif -#endif - break; - - return MACRO_NONE; - } - -#endif - - -#ifdef VI_MODE - case VI_MODE: -// you have to track the modes yourself. Otherwise motion is awful (bell, bell, bell) - - - BABLM( BABL_GO_LEFT_1C , T(H), END ); - BABLM( BABL_GO_RIGHT_1C , T(L), END ); - BABLM( BABL_GO_LEFT_WORD , T(B),END ); - BABLM( BABL_GO_RIGHT_WORD , T(W), END ); - BABLM( BABL_GO_START_LINE , D(LSFT), T(6),U(LSFT), END ); //^ - BABLM( BABL_GO_END_LINE , D(LSFT), T(4),U(LSFT) , END ); //$ - BABLM( BABL_GO_START_DOC , T(G),T(G) ,END ); - BABLM( BABL_GO_END_DOC , D(LSFT), T(G),U(LSFT),END ); - BABLM( BABL_GO_NEXT_LINE , T(J), END ); - BABLM( BABL_GO_PREV_LINE, T(K), END ); - BABLM( BABL_PGDN ,D(LCTL), T(F), U(LCTL), END ); - BABLM( BABL_PGUP , D(LCTL), T(B), U(LCTL), END ); - BABLM( BABL_DEL_RIGHT_1C , T(X),END ); - BABLM( BABL_DEL_LEFT_WORD , T(D),T(G),T(E),END ); - BABLM( BABL_DEL_RIGHT_WORD , T(D),T(W),END ); - BABLM( BABL_DEL_TO_LINE_END, T(D),D(LSFT), T(4),U(LSFT) ,END ); // d$ - BABLM( BABL_DEL_TO_LINE_START, T(D),D(LSFT), T(6),U(LSFT) ,END ); -#ifndef BABL_MOVEMENTONLY - BABLM( BABL_UNDO , T(U), END ); - BABLM( BABL_REDO , D(LCTL), T(R), U(LCTL), END ); - BABLM( BABL_CUT , T(X), END ); - BABLM( BABL_COPY , T(Y),END ); - BABLM( BABL_PASTE , T(P), END ); - BABLM( BABL_SELECT_ALL , D(LSFT), T(SCLN),U(LSFT),D(LSFT), T(5),U(LSFT),T(Y), END ); // wrong but helpful? - BABLM( BABL_FIND , T(SLASH),END ); - BABLM( BABL_FIND_NEXT , T(N),END ); - BABLM( BABL_FIND_REPLACE , D(LALT),D(LSFT), T(5),U(LSFT), U(LALT), END ); - BABLM( BABL_RUNAPP,END ); - BABLM( BABL_SWITCH_APP_NEXT ,END ); - BABLM( BABL_SWITCH_APP_LAST ,END ); - BABLM(BABL_CLOSE_APP, D(LSFT), T(SCLN),U(LSFT), T(Q), D(RSFT), T(1),U(RSFT), END ); - BABLM(BABL_HELP, D(LSFT), T(SCLN),U(LSFT),T(H),END); // start search in help -#ifndef BABL_NOBROWSER -/* you get to figure this out - BABLM( BABL_BROWSER_NEW_TAB, D(LGUI), T(T), U(LGUI),END ); - BABLM( BABL_BROWSER_CLOSE_TAB, D(LGUI), T(W), U(LGUI),END ); - BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LGUI), D(RSFT),T(T), U(RSFT),U(LGUI),END ); - BABLM( BABL_BROWSER_NEXT_TAB, D(LGUI),D(LALT), T(RIGHT),U(LALT), U(LGUI),END ); - BABLM( BABL_BROWSER_PREV_TAB, D(LGUI), D(RSFT), T(LEFT), U(RSFT), U(LGUI),END ); - BABLM( BABL_BROWSER_URL_BAR, D(LGUI), T(L), U(LGUI),END ); - BABLM( BABL_BROWSER_FORWARD, D(LGUI), T(RIGHT), U(LGUI),END ); - BABLM( BABL_BROWSER_BACK, D(LGUI), T(LEFT), U(LGUI),END ); - BABLM( BABL_BROWSER_FIND, D(LGUI), T(F), U(LGUI),END ); - BABLM( BABL_BROWSER_BOOKMARK, D(LGUI), T(D), U(LGUI),END ); - //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LGUI),END ); // EDGE - BABLM( BABL_BROWSER_DEV_TOOLS, D(LGUI), D(LALT), T(I), U(LALT),U(LGUI),END ); // Chrome - // Chrome - BABLM( BABL_BROWSER_RELOAD, D(LGUI), T(R), U(LGUI),END ); // add shift for reload w/o cache - BABLM( BABL_BROWSER_FULLSCREEN, D(LGUI), D(LCTL), T(P), U(LCTL), U(LGUI),END ); //command shift F - BABLM( BABL_BROWSER_ZOOM_IN, D(LGUI), T(PLUS), U(LGUI),END ); - BABLM( BABL_BROWSER_ZOOM_OUT, D(LGUI), T(MINS), U(LGUI),END ); -*/ -#endif -#endif - return MACRO_NONE; -#endif - - - - -#ifdef READMUX_MODE -// Readline command line editing + tmux windowing -// I havent decided how much to do readline and how much tmux - - - case READMUX_MODE: - - BABLM( BABL_GO_LEFT_1C , T(LEFT), END ); - BABLM( BABL_GO_RIGHT_1C , T(RIGHT), END ); - BABLM( BABL_GO_LEFT_WORD , D(LALT), T(B), U(LALT), END ); - BABLM( BABL_GO_RIGHT_WORD , D(LALT), T(F), U(LALT), END ); - BABLM( BABL_GO_START_LINE , D(LCTL), T(A), U(LCTL), END ); - BABLM( BABL_GO_END_LINE , D(LCTL), T(E), U(LCTL), END ); - //BABLM( BABL_GO_START_DOC ,END );// tmux? - //BABLM( BABL_GO_END_DOC ,END ); // tmux? - BABLM( BABL_GO_NEXT_LINE , D(LCTL), T(N), U(LCTL), END ); - BABLM( BABL_GO_PREV_LINE , D(LCTL), T(P), U(LCTL), END ); - BABLM( BABL_PGDN , T(PGDN), END ); - BABLM( BABL_PGUP , T(PGUP), END ); - BABLM( BABL_DEL_RIGHT_1C , D(LCTL), T(D), U(LCTL),END ); - BABLM( BABL_DEL_LEFT_WORD , D(LCTL), T(W), U(LCTL), END ); - BABLM( BABL_DEL_RIGHT_WORD , D(LALT), T(D), U(LALT), END ); - BABLM( BABL_DEL_TO_LINE_END, D(LCTL), T(K), U(LCTL), END ); - BABLM( BABL_DEL_TO_LINE_START, D(LCTL), T(U), U(LCTL), END ); -#ifndef BABL_MOVEMENTONLY - BABLM( BABL_UNDO , D(LALT), T(R), U(LALT) , END ); - BABLM( BABL_REDO , D(LCTL), T(X), U(LCTL),T(C), END ); // arguably - BABLM( BABL_CUT , D(LCTL), T(K), U(LCTL), END ); // wrong half the time - //BABLM( BABL_COPY ,END ); - BABLM( BABL_PASTE , D(LCTL), T(Y), U(LCTL), END ); - BABLM( BABL_SELECT_ALL , D(LCTL), T(A), T(K), T(Y), U(LCTL) , END ); - BABLM( BABL_FIND , D(LCTL), T(R), U(LCTL), END ); // search history - BABLM(BABL_FIND_NEXT, D(LCTL), T(S), U(LCTL), END ); - //BABLM( BABL_FIND_REPLACE ,END ); - BABLM( BABL_RUNAPP , D(LCTL), T(B), U(LCTL), T(C),END ); //tmux - BABLM( BABL_SWITCH_APP_NEXT , D(LCTL), T(B), U(LCTL), T(N),END ); //tmux - BABLM( BABL_SWITCH_APP_LAST , D(LCTL), T(B), U(LCTL), T(P),END ); //tmux - BABLM( BABL_CLOSE_APP , D(LCTL), T(B), U(LCTL), T(D),END); // usually what I want - // BABLM( BABL_HELP ,END ); -#ifndef BABL_NOBROWSER -/* Add lynx shortcuts? - BABLM( BABL_BROWSER_NEW_TAB, D(LGUI), T(T), U(LGUI),END ); - BABLM( BABL_BROWSER_CLOSE_TAB, D(LGUI), T(W), U(LGUI),END ); - BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LGUI), D(RSFT),T(T), U(RSFT),U(LGUI),END ); - BABLM( BABL_BROWSER_NEXT_TAB, D(LGUI),D(LALT), T(RIGHT),U(LALT), U(LGUI),END ); - BABLM( BABL_BROWSER_PREV_TAB, D(LGUI), D(RSFT), T(LEFT), U(RSFT), U(LGUI),END ); - BABLM( BABL_BROWSER_URL_BAR, D(LGUI), T(L), U(LGUI),END ); - BABLM( BABL_BROWSER_FORWARD, D(LGUI), T(RIGHT), U(LGUI),END ); - BABLM( BABL_BROWSER_BACK, D(LGUI), T(LEFT), U(LGUI),END ); - BABLM( BABL_BROWSER_FIND, D(LGUI), T(F), U(LGUI),END ); - BABLM( BABL_BROWSER_BOOKMARK, D(LGUI), T(D), U(LGUI),END ); - //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LGUI),END ); // EDGE - BABLM( BABL_BROWSER_DEV_TOOLS, D(LGUI), D(LALT), T(I), U(LALT),U(LGUI),END ); // Chrome - // Chrome - BABLM( BABL_BROWSER_RELOAD, D(LGUI), T(R), U(LGUI),END ); // add shift for reload w/o cache - BABLM( BABL_BROWSER_FULLSCREEN, D(LGUI), D(LCTL), T(P), U(LCTL), U(LGUI),END ); //command shift F - BABLM( BABL_BROWSER_ZOOM_IN, D(LGUI), T(PLUS), U(LGUI),END ); - BABLM( BABL_BROWSER_ZOOM_OUT, D(LGUI), T(MINS), U(LGUI),END ); -*/ -#endif -#endif - - return MACRO_NONE; - -#endif - - default: - return MACRO_NONE; - } - -} - - -#endif diff --git a/keyboards/handwired/ms_sculpt_mobile/babblePaste.h b/keyboards/handwired/ms_sculpt_mobile/babblePaste.h deleted file mode 100644 index 1e8206212a..0000000000 --- a/keyboards/handwired/ms_sculpt_mobile/babblePaste.h +++ /dev/null @@ -1,238 +0,0 @@ -/* A library to output the right key shortcut in any common app. -Given a global variable babble_mode to show the environment and a -key that calls the paste macro, do the right type of paste. - -Setting the bable_mode is done by another macro, or TBD interaction with the host. - -Huge thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts -and jeebak & algernon's keymap -*/ -#ifndef _babblePaste_h_included__ -#define _babblePaste_h_included__ -#include "config.h" -#include "action_layer.h" -#include "quantum_keycodes.h" - -#ifdef USE_BABLPASTE - -/* *************************** - -// Uncomment any modes you want. Whatever mode = 0 will be the default on boot -// Expect to get errors if you comment a feature out and leave it in your keymap. - -#define USE_BABLPASTE - -//#define MS_MODE 0 // Windows. -//#define MAC_MODE 1 -//#define LINUX_MODE 2 //aka gnome+KDE -//#define EMACS_MODE 3 -//#define VI_MODE 4 -//#define WORDSTAR_MODE 5 -//#define READMUX 6 // Readline and tmux - -// This removes everything but cursor movement -//#define BABL_MOVEMENTONLY -// and this just removes browser shortcuts -//#define BABL_NOBROWSER -****************************/ - - -// Uncomment if you need more free flash space -// It removes everything but cursor movement -//#define BABL_MOVEMENTONLY - - -// Define starting number for BABL macros in the macro range. -// Probably can start the default even lower -#define BABL_START_NUM 50 - -/* Macros handled by babblepaste. Most should be available for all platforms. -Whatever isn't defined will NOP */ -enum { -// Movement macros - // left & right - BABL_GO_LEFT_1C= BABL_START_NUM, - BABL_GO_RIGHT_1C, - BABL_GO_LEFT_WORD, - BABL_GO_RIGHT_WORD, - BABL_GO_START_LINE, - BABL_GO_END_LINE, - // now up & down - BABL_GO_START_DOC, - BABL_GO_END_DOC, - BABL_GO_NEXT_LINE, - BABL_GO_PREV_LINE, - BABL_PGDN, - BABL_PGUP, - // And the delete options - //BABL_DEL_LEFT_1C == backspace, so why bother. - BABL_DEL_RIGHT_1C, // usually = Del - BABL_DEL_LEFT_WORD, - BABL_DEL_RIGHT_WORD, - BABL_DEL_TO_LINE_END, // delete from cursor to end of line - BABL_DEL_TO_LINE_START, // delete from cursor to begining line -#ifndef BABL_MOVEMENTONLY - // Cut & Paste - BABL_UNDO, - BABL_REDO, - BABL_CUT, - BABL_COPY, - BABL_PASTE, - BABL_SELECT_ALL, - /* not yet implemented - BABL_SWAP_LAST2C // swap last characters before the cursor - BABL_SWAP_LAST2W // Swap the last two words before the cursor - */ - // find & replace - BABL_FIND, - BABL_FIND_NEXT, - BABL_FIND_REPLACE, - // GUI or app - BABL_RUNAPP, - BABL_SWITCH_APP_NEXT, - BABL_SWITCH_APP_LAST, // previous - BABL_CLOSE_APP, - BABL_HELP, - -#ifndef BABL_NOBROWSER - BABL_BROWSER_NEW_TAB, - BABL_BROWSER_CLOSE_TAB, - BABL_BROWSER_REOPEN_LAST_TAB, - BABL_BROWSER_NEXT_TAB, - BABL_BROWSER_PREV_TAB, - BABL_BROWSER_URL_BAR, - BABL_BROWSER_FORWARD, - BABL_BROWSER_BACK, - BABL_BROWSER_FIND, - BABL_BROWSER_BOOKMARK, - BABL_BROWSER_DEV_TOOLS, // hard one to remember - BABL_BROWSER_RELOAD, - BABL_BROWSER_FULLSCREEN, - BABL_BROWSER_ZOOM_IN, - BABL_BROWSER_ZOOM_OUT, - -#endif - -#endif -// Macros for mode switching -#ifdef MS_MODE - BABL_WINDOWS, -#endif -#ifdef MAC_MODE - BABL_MAC, -#endif -#ifdef LINUX_MODE - BABL_LINUX, -#endif -#ifdef EMACS_MODE - BABL_EMACS, -#endif -#ifdef VI_MODE - BABL_VI, -#endif -#ifdef READMUX_MODE - BABL_READLINE, -#endif - - -}; - -// BUG, used to jump to babble functiion. Surely there is a way to calculate size of enum? -#define BABL_NUM_MACROS 48+4 // 48 + # of defined modes. - -/* And all the shorthand keymap ready versions */ -// First the mode switching macros -#ifdef MS_MODE -#define B_WIN M(BABL_WINDOWS) -#endif -#ifdef MAC_MODE -#define B_MAC M(BABL_MAC) -#endif -#ifdef LINUX_MODE -#define B_LNX M(BABL_LINUX) -#endif -#ifdef EMACS_MODE -#define B_EMAX M(BABL_EMACS) -#endif -#ifdef VI_MODE -#define B_VI M(BABL_VI) -#endif -#ifdef READMUX_MODE -#define B_READ M(BABL_READLINE) -#endif - -// and all the movement & action. - -#define B_L1C M(BABL_GO_LEFT_1C) -#define B_R1C M(BABL_GO_RIGHT_1C) -#define B_L1W M(BABL_GO_LEFT_WORD) -#define B_R1W M(BABL_GO_RIGHT_WORD) -#define B_GSOL M(BABL_GO_START_LINE) -#define B_GEOL M(BABL_GO_END_LINE) -#define B_GTOP M(BABL_GO_START_DOC) -#define B_GEND M(BABL_GO_END_DOC) -#define B_DOWN M(BABL_GO_NEXT_LINE) -#define B_UP M(BABL_GO_PREV_LINE) -#define B_PGDN M(BABL_PGDN) -#define B_PGUP M(BABL_PGUP) -//#define B_BKSP M(BABL_DEL_LEFT_1C) == backspace so why bother. -#define B_DEL M(BABL_DEL_RIGHT_1C) // usually = Del -#define B_DLW M(BABL_DEL_LEFT_WORD) -#define B_DRW M(BABL_DEL_RIGHT_WORD) -#define B_DEOL M(BABL_DEL_TO_LINE_END) // delete from cursor to end of line -#define B_DSOL M(BABL_DEL_TO_LINE_START) // delete from cursor to begining line -#define B_UNDO M(BABL_UNDO) -#define B_REDO M(BABL_REDO) -#define B_CUT M(BABL_CUT) -#define B_COPY M(BABL_COPY) -#define B_PAST M(BABL_PASTE) -#define B_SELA M(BABL_SELECT_ALL) -#define B_FIND M(BABL_FIND) -#define B_FINDN M(BABL_FIND_NEXT) -#define B_FINDR M(BABL_FIND_REPLACE) -#define B_RAPP M(BABL_RUNAPP) -#define B_NAPP M(BABL_SWITCH_APP_NEXT) -#define B_PAPP M(BABL_SWITCH_APP_LAST) // previous -#define B_CAPP M(BABL_CLOSE_APP) -#define B_HELP M(BABL_HELP) -#define B_NTAB M(BABL_BROWSER_NEW_TAB) -#define B_CTAB M(BABL_BROWSER_CLOSE_TAB) -#define B_ROTB M(BABL_BROWSER_REOPEN_LAST_TAB) -#define B_NXTB M(BABL_BROWSER_NEXT_TAB) -#define B_PTAB M(BABL_BROWSER_PREV_TAB) -#define B_NURL M(BABL_BROWSER_URL_BAR) -#define B_BFWD M(BABL_BROWSER_FORWARD) -#define B_BBAK M(BABL_BROWSER_BACK) -#define B_BFND M(BABL_BROWSER_FIND) -#define B_BOOK M(BABL_BROWSER_BOOKMARK) -#define B_BDEV M(BABL_BROWSER_DEV_TOOLS) // hard one to remember -#define B_BRLD M(BABL_BROWSER_RELOAD) -#define B_BFUlL M(BABL_BROWSER_FULLSCREEN) -#define B_ZMIN M(BABL_BROWSER_ZOOM_IN) -#define B_ZMOT M(BABL_BROWSER_ZOOM_OUT) - - - - - - - -/* from action_macro.h -typedef uint8_t macro_t; - -#define MACRO_NONE (macro_t*)0 -#define MACRO(...) ({ static const macro_t __m[] PROGMEM = { __VA_ARGS__ }; &__m[0]; }) -#define MACRO_GET(p) pgm_read_byte(p) - -#define BABL_MSTART (entry, os, macro...) ( const macro_t bablDict[entry][os] PROGMEM = { macro... }; ) - -*/ - -const macro_t *babblePaste(keyrecord_t *record, uint8_t shortcut); - -macro_t* switch_babble_mode( uint8_t id); - - -#endif -#endif - diff --git a/keyboards/handwired/ms_sculpt_mobile/babblePaste.txt b/keyboards/handwired/ms_sculpt_mobile/babblePaste.txt deleted file mode 100644 index cf75e153e8..0000000000 --- a/keyboards/handwired/ms_sculpt_mobile/babblePaste.txt +++ /dev/null @@ -1,123 +0,0 @@ - BabblePaste is a library of common macros used to make sure that -you can have one "paste" button on one layer, and it will do the -right thing on any OS or app. Windows=Ctrl-V. Mac = Command-V and so on. - -The babblepaste library looks for the current status in a babble_mode global variable. -To switch modes, run the switch_babble_mode() function, or a pre defined macro. -Currently supported are Windows, OS X, Gnome/kde, Emacs, VI and readline, -across 42+ common macro actions. - - -###To use the library -1) Paste the following into your config.h. - -//////Begin////// -#define USE_BABLPASTE 1 - -#ifdef USE_BABLPASTE -/* define BabblePaste maps. Whatever = 0 will be the default. */ -// MAC_MODE 0 -// MS_MODE 1 -// LINUX_MODE 2 -// EMACS_MODE 3 -// VI_MODE 3 -// Readline and tmux -// READMUX_MODE 2 -// WORDSTAR_MODE 5 -#endif - -// Uncomment these to remove options an free up flash space - -// This removes everything but cursor movement -// BABL_MOVEMENTONLY -// and this just removes browser shortcuts -// BABL_NOBROWSER -///////End/////// - -2) Add the following to your keymap in the action_get_macro - -//////Begin////// -#ifdef USE_BABLPASTE - - if( id >= BABL_START_NUM && id < (BABL_START_NUM + BABL_NUM_MACROS ) ) { - if (record->event.pressed) { // is there a case where this isn't desired? - - babblePaste ( record, id ); - return MACRO_NONE; - } - } -#endif -///////End/////// - -3) add Babbelpaste actions to your keymap. See the full list in babblePaste.h, or the -list below -B_L1C // go left 1 char -B_R1C // go Right 1 char - B_L1W //GO_LEFT_1 WORD - B_R1W //BABL_GO_RIGHT_1 WORD - B_GSOL // BABL_GOTO_START of _LINE - B_GEOL // BABL_GOTO_END_LINE - B_GTOP //BABL_GOTO_START_DOC - B_GEND //BABL_GO_END_DOC - B_DOWN //BABL_GO_NEXT_LINE - B_UP // BABL_GO_PREV_LINE - B_PGDN //PGDN - B_PGUP //PGUP -// B_BKSP //backspace so why bother. - B_DEL // DEL_RIGHT_1 Char // usually = Del - B_DLW // DEL_LEFT_ 1 WORD) - B_DRW //DEL_RIGHT_1 WORD - B_DEOL // delete from cursor to end of line - B_DSOL // delete from cursor to begining line - B_UNDO //UNDO - B_REDO // REDO - B_CUT // CUT) - B_COPY // COPY) - B_PAST // PASTE) - B_SELA // SELECT_ALL - B_FIND // FIND) - B_FINDN //FIND_NEXT) - B_FINDR // FIND_REPLACE) - B_RAPP // open application launcher - B_NAPP // switch to next app - B_PAPP // switch to previous app - B_CAPP // CLOSE_APP) - B_HELP // HELP) - B_NTAB // BROWSER_NEW_TAB) - B_CTAB //BROWSER_CLOSE_TAB) - B_ROTB //BROWSER_REOPEN_LAST_TAB) - B_NXTB //BROWSER_NEXT_TAB) - B_PTAB //BROWSER_PREV_TAB) - B_NURL //BROWSER_jump to URL_BAR) - B_BFWD // BROWSER_FORWARD (in history) - B_BBAK //BROWSER_BACK (in history) - B_BFND // BROWSER_FIND) - B_BOOK //BROWSER_New BOOKMARK) - B_BDEV //BROWSER_ Open DEV_TOOLS) // hard one to remember - B_BRLD // BROWSER_RELOAD Page - B_BFUlL // BROWSER_FULLSCREEN) - B_ZMIN // BROWSER_ZOOM_IN) - B_ZMOT //BROWSER_ZOOM_OUT) - - -#### Development notes --Why a new function? Because it would make the keymap too ugly to put it there. --Why not return the macro to action_get_macro? Because I kept running into scope problems -and pointers to the wrong type. --Why not an array of arrays as a lookup instead of a function? That would allow you -to store the lookup table in PROGMEM. True, but that takes more pre-processor skill -than I had. - --Have you tested this on every platform? No. Submit a patch. - - -### Next steps for someone. -Make it easier to pair macros with modifiers. So key foo will jump to start of line, and -Shift(foo) will jump to the first tab in a browser. - -## Thanks - -Thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts -and https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/jeebak/keymap.c -And of course QMK... - diff --git a/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/babblePaste.c b/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/babblePaste.c new file mode 100644 index 0000000000..e035648706 --- /dev/null +++ b/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/babblePaste.c @@ -0,0 +1,460 @@ +/* A library to output the right key shortcut in any common app. +Given a global variable babble_mode to show the environment and a +key that calls the paste macro, do the right type of paste. +Setting the context is done by another macro, or TBD interaction with the host. + +Huge thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts +and https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/jeebak/keymap.c +*/ + +#include "babblePaste.h" + +#include "action_macro.h" + +#ifdef USE_BABLPASTE + +// GLOBAL variable to determine mode. Sets startup default if no eeppom +uint8_t babble_mode =0 ; + +// small function that we might also want to call from a keymap. + +macro_t* switch_babble_mode( uint8_t id) { + babble_mode= id; + return MACRO_NONE; //less typing where called +} + + +// Today I learned that the preprocessor can not create a switch statement label from an argument +// And else statements have problems, see https://gcc.gnu.org/onlinedocs/gcc-3.0.1/cpp_3.html#SEC15 +#define BABLM(ent, macro...) \ + if ( ent == shortcut ) \ + { action_macro_play( MACRO(macro)); return MACRO_NONE; } + + +/* this function runs the appropriate babblepaste macro, given +the global babble_mode, and a shortcut from the ENUM in babblePaste.h +TODO, the pointers in this function should be stored in a PROGMEM array, not ram. +But that requires even more clever preprocessor foo. +*/ +const macro_t *babblePaste (keyrecord_t *record, uint8_t shortcut) { +/* + if ( shortcut < BABL_START_NUM || \ + shortcut >= (BABL_START_NUM + BABL_NUM_MACROS ) ) { + return MACRO_NONE; + } +*/ + + +#ifdef MS_MODE + if ( BABL_WINDOWS == shortcut ) { return switch_babble_mode(MS_MODE); } +#endif +#ifdef MAC_MODE + if ( BABL_MAC == shortcut) { return switch_babble_mode(MAC_MODE); } +#endif +#ifdef LINUX_MODE + if ( BABL_LINUX == shortcut ) { return switch_babble_mode(LINUX_MODE); } +#endif + #ifdef READMUX_MODE + if ( BABL_READLINE == shortcut ) { switch_babble_mode(READMUX_MODE); return MACRO_NONE; } +#endif +#ifdef VI_MODE + if ( BABL_VI == shortcut ) { return switch_babble_mode(VI_MODE); } +#endif +#ifdef EMACS_MODE + if ( BABL_EMACS == shortcut ) { return switch_babble_mode(EMACS_MODE); } +#endif + + + + switch(babble_mode) { + +#ifdef MS_MODE + + case MS_MODE: + BABLM( BABL_GO_LEFT_1C, T(LEFT), END ); + BABLM( BABL_GO_RIGHT_1C , T(RIGHT), END ); + BABLM( BABL_GO_LEFT_WORD, D(LCTL), T(LEFT), U(LCTL), END ); + BABLM( BABL_GO_RIGHT_WORD, D(LCTL), T(RIGHT), U(LCTL), END ); + BABLM( BABL_GO_START_LINE, T(HOME), END ); + BABLM( BABL_GO_END_LINE, T(END), END ); + BABLM( BABL_GO_START_DOC, D(LCTL),T(HOME), U(LCTL),END ); + BABLM( BABL_GO_END_DOC, D(LCTL),T(END), U(LCTL),END ); + BABLM( BABL_GO_NEXT_LINE, T(DOWN), END ); + BABLM( BABL_GO_PREV_LINE, T(UP), END ); + BABLM( BABL_PGDN, T(PGDN), END ); + BABLM( BABL_PGUP, T(PGUP), END ); + BABLM( BABL_DEL_RIGHT_1C, T(DEL), END ); + BABLM( BABL_DEL_LEFT_WORD, D(LCTL), T(BSPACE), U(LCTL), END ); + BABLM( BABL_DEL_RIGHT_WORD, D(LCTL), T(DEL), U(LCTL), END ); + BABLM( BABL_DEL_TO_LINE_END, D(RSFT), T(HOME), U(RSFT), T(DEL), END); + BABLM( BABL_DEL_TO_LINE_START, D(RSFT), T(END), U(RSFT), T(DEL), END ); +#ifndef BABL_MOVEMENTONLY + BABLM( BABL_UNDO, D(LCTL), T(Z), U(LCTL), END ); + BABLM( BABL_REDO, D(LCTL), T(Y), U(LCTL), END ); + BABLM( BABL_CUT, D(LCTL), T(X), U(LCTL), END ); + BABLM( BABL_COPY, D(LCTL), T(C), U(LCTL), END ); + BABLM( BABL_PASTE, D(LCTL), T(V), U(LCTL), END ); + BABLM( BABL_SELECT_ALL, D(LCTL), T(A), U(LCTL), END ); + BABLM( BABL_FIND, D(LCTL),T(F), U(LCTL),END ); + BABLM( BABL_FIND_NEXT, T(F3),END ); + BABLM( BABL_FIND_REPLACE, D(LCTL),T(H), U(LCTL),END ); + BABLM( BABL_RUNAPP, D(LGUI),T(R), U(LGUI),END ); + BABLM( BABL_SWITCH_APP_NEXT, D(LALT),T(TAB), U(LALT),END ); + BABLM( BABL_SWITCH_APP_LAST, D(LSFT),D(LALT),T(TAB), U(LALT), U(LSFT),END ); + BABLM( BABL_CLOSE_APP, D(LALT),T(F4), U(LALT),END ); + BABLM( BABL_HELP, T(F1),END ); +#ifndef BABL_NOBROWSER + BABLM( BABL_BROWSER_NEW_TAB, D(LCTL), T(T), U(LCTL),END ); + BABLM( BABL_BROWSER_CLOSE_TAB, D(LCTL), T(W), U(LCTL),END ); + BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LCTL), D(RSFT),T(T), U(RSFT),U(LCTL),END ); + BABLM( BABL_BROWSER_NEXT_TAB, D(LCTL), T(TAB), U(LCTL),END ); + BABLM( BABL_BROWSER_PREV_TAB, D(LCTL), D(RSFT), T(TAB), U(RSFT), U(LCTL),END ); + BABLM( BABL_BROWSER_URL_BAR, D(LCTL), T(L), U(LCTL),END ); + BABLM( BABL_BROWSER_FORWARD, D(LALT), T(RIGHT), U(LALT),END ); + BABLM( BABL_BROWSER_BACK, D(LALT), T(LEFT), U(LALT),END ); + BABLM( BABL_BROWSER_FIND, D(LCTL), T(F), U(LCTL),END ); + BABLM( BABL_BROWSER_BOOKMARK, D(LCTL), T(D), U(LCTL),END ); + //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LCTL),END ); // EDGE + BABLM( BABL_BROWSER_DEV_TOOLS, D(LCTL), T(T), U(LCTL),END ); // Chrome + // Chrome + BABLM( BABL_BROWSER_RELOAD, D(LCTL), T(F5), U(LCTL),END ); // hard reload w/o cache + BABLM( BABL_BROWSER_FULLSCREEN, T(F11),END ); //command shift F + BABLM( BABL_BROWSER_ZOOM_IN, D(LCTL), D(RSFT), T(EQL), U(RSFT), U(LCTL),END ); // ctr+ + + BABLM( BABL_BROWSER_ZOOM_OUT, D(LCTL), T(MINS), U(LCTL),END ); +#endif +#endif + + // Todo, ring bell, flash light, show user this isn't supported + return MACRO_NONE; + + +#endif /* MS_MODE*/ + + +#ifdef LINUX_MODE + + case LINUX_MODE: + BABLM( BABL_GO_LEFT_1C , T(LEFT), END ); + BABLM( BABL_GO_RIGHT_1C , T(RIGHT), END ); + BABLM( BABL_GO_LEFT_WORD , D(LCTL), T(LEFT), U(LCTL), END ); + BABLM( BABL_GO_RIGHT_WORD , D(LCTL), T(RIGHT), U(LCTL), END ); + BABLM( BABL_GO_START_LINE , T(HOME), END ); + BABLM( BABL_GO_END_LINE , T(END), END ); + BABLM( BABL_GO_START_DOC , D(LCTL),T(HOME), U(LCTL),END ); + BABLM( BABL_GO_END_DOC , D(LCTL),T(END), U(LCTL),END ); + BABLM( BABL_GO_NEXT_LINE , T(DOWN), END ); + BABLM( BABL_GO_PREV_LINE , T(UP), END ); + BABLM( BABL_PGDN , T(PGDN), END ); + BABLM( BABL_PGUP , T(PGUP), END ); + BABLM( BABL_DEL_RIGHT_1C , D(DEL), END ); + BABLM( BABL_DEL_LEFT_WORD , D(LCTL), T(BSPACE), U(LCTL), END ); + BABLM( BABL_DEL_RIGHT_WORD , D(LCTL), T(DEL), U(LCTL), END ); + BABLM( BABL_DEL_TO_LINE_END, D(RSFT), T(HOME), U(RSFT), T(DEL), END); + BABLM( BABL_DEL_TO_LINE_START, D(RSFT), T(END), U(RSFT), T(DEL), END ); +#ifndef BABL_MOVEMENTONLY + BABLM( BABL_UNDO , D(LCTL), T(Z), U(LCTL), END ); + BABLM( BABL_REDO , D(LCTL), T(Y), U(LCTL), END ); + BABLM( BABL_CUT , D(LCTL), T(X), U(LCTL), END ); + BABLM( BABL_COPY , D(LCTL), T(C), U(LCTL), END ); + BABLM( BABL_PASTE , D(LCTL), T(V), U(LCTL), END ); + BABLM( BABL_SELECT_ALL, D(LCTL), T(A), U(LCTL), END ); + BABLM( BABL_FIND, D(LCTL),T(F), U(LCTL),END ); + /* BABLM(BABL_FIND_NEXT , T(F3),END ); KDE */ + BABLM( BABL_FIND_NEXT, D(LCTL),T(G), U(LCTL),END ); // Gnome*/ + /* BABLM( , D(LCTL),T(R), U(LCTL),END ); KDE */ + BABLM( BABL_FIND_REPLACE, D(LCTL),T(H), U(LCTL),END ); // Gnome*/ + BABLM( BABL_RUNAPP, D(LALT),T(F2), U(LALT),END ); + BABLM( BABL_SWITCH_APP_NEXT, D(LCTL),T(TAB), U(LCTL),END ); + BABLM( BABL_SWITCH_APP_LAST, D(LSFT),D(LCTL),T(TAB), U(LCTL), U(LSFT),END ); + BABLM( BABL_CLOSE_APP, D(LALT),T(F4), U(LALT),END ); + //BABLM( BABL_HELP, END ); + +#ifndef BABL_NOBROWSER + BABLM( BABL_BROWSER_NEW_TAB, D(LCTL), T(T), U(LCTL),END ); + BABLM( BABL_BROWSER_CLOSE_TAB, D(LCTL), T(W), U(LCTL),END ); + BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LCTL), D(RSFT),T(T), U(RSFT),U(LCTL),END ); + BABLM( BABL_BROWSER_NEXT_TAB, D(LCTL), T(TAB), U(LCTL),END ); + BABLM( BABL_BROWSER_PREV_TAB, D(LCTL), D(RSFT), T(TAB), U(RSFT), U(LCTL),END ); + BABLM( BABL_BROWSER_URL_BAR, D(LCTL), T(L), U(LCTL),END ); + BABLM( BABL_BROWSER_FORWARD, D(LALT), T(RIGHT), U(LALT),END ); + BABLM( BABL_BROWSER_BACK, D(LALT), T(LEFT), U(LALT),END ); + BABLM( BABL_BROWSER_FIND, D(LCTL), T(F), U(LCTL),END ); + BABLM( BABL_BROWSER_BOOKMARK, D(LCTL), T(D), U(LCTL),END ); + BABLM( BABL_BROWSER_DEV_TOOLS, D(LCTL), T(T), U(LCTL),END ); // Chrome + BABLM( BABL_BROWSER_RELOAD, D(LCTL), T(F5), U(LCTL),END ); // hard reload w/o cache + BABLM( BABL_BROWSER_FULLSCREEN, T(F11),END ); //command shift F + BABLM( BABL_BROWSER_ZOOM_IN, D(LCTL), T(PLUS), U(LCTL),END ); + BABLM( BABL_BROWSER_ZOOM_OUT, D(LCTL), T(MINS), U(LCTL),END ); +#endif +#endif + return MACRO_NONE; + +#endif + +#ifdef MAC_MODE + + case MAC_MODE: + BABLM( BABL_GO_LEFT_1C , T(LEFT), END ); + BABLM( BABL_GO_RIGHT_1C, T(RIGHT), END ); + BABLM( BABL_GO_LEFT_WORD , D(LALT), T(LEFT), U(LALT), END ); + BABLM( BABL_GO_RIGHT_WORD , D(LALT), T(RIGHT), U(LALT), END ); + BABLM( BABL_GO_START_LINE , D(LGUI), T(LEFT), U(LGUI), END ); + BABLM( BABL_GO_END_LINE , D(LGUI), T(RIGHT), U(LGUI), END ); + BABLM( BABL_GO_START_DOC , D(LGUI),T(UP), U(LGUI),END ); + BABLM( BABL_GO_END_DOC , D(LGUI),T(DOWN), U(LGUI),END ); + BABLM( BABL_GO_NEXT_LINE , T(DOWN), END ); + BABLM( BABL_GO_PREV_LINE , T(UP), END ); + BABLM( BABL_PGDN , D(LALT),T(DOWN), U(LALT), END ); + BABLM( BABL_PGUP , D(LALT),T(UP), U(LALT), END ); + BABLM( BABL_DEL_RIGHT_1C , D(DEL), END ); + BABLM( BABL_DEL_LEFT_WORD , D(LALT), T(BSPACE), U(LALT), END ); + BABLM( BABL_DEL_RIGHT_WORD, D(LALT), T(DEL), U(LALT), END ); + BABLM( BABL_DEL_TO_LINE_END, D(LCTL), T(K), U(LCTL), END );// there must be another way + BABLM( BABL_DEL_TO_LINE_START, D(LGUI), T(BSPACE), U(LGUI), END ); +#ifndef BABL_MOVEMENTONLY + BABLM( BABL_UNDO , D(1), D(LGUI), T(Z), U(LGUI), END ); + BABLM( BABL_REDO , D(LSFT),D(LGUI), T(Z), U(LSFT),U(LGUI), END ); + BABLM( BABL_CUT , D(LGUI), T(X), U(LGUI), END ); + BABLM( BABL_COPY , D(LGUI), T(C), U(LGUI), END ); + BABLM( BABL_PASTE , D(LGUI), T(V), U(LGUI), END ); + BABLM( BABL_SELECT_ALL , D(LGUI), T(A), U(LGUI), END ); + BABLM( BABL_FIND , D(LGUI),T(F), U(LGUI),END ); + BABLM( BABL_FIND_NEXT, D(LGUI),T(G), U(LGUI),END ); + BABLM( BABL_FIND_REPLACE, D(LGUI),T(F), U(LGUI),END ); + BABLM( BABL_RUNAPP , D(LGUI),T(R), U(LGUI),END ); + BABLM( BABL_SWITCH_APP_NEXT , D(LGUI),T(TAB), U(LGUI),END ); + BABLM( BABL_SWITCH_APP_LAST , D(LSFT),D(LGUI),T(TAB), U(LGUI), U(LSFT),END ); + BABLM( BABL_CLOSE_APP , D(LGUI),T(Q), U(LGUI),END ); + BABLM( BABL_HELP , D(LSFT),D(LGUI),T(SLASH), U(LGUI), U(LSFT),END ); + +#ifndef BABL_NOBROWSER + BABLM( BABL_BROWSER_NEW_TAB, D(LGUI), T(T), U(LGUI),END ); + BABLM( BABL_BROWSER_CLOSE_TAB, D(LGUI), T(W), U(LGUI),END ); + BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LGUI), D(RSFT),T(T), U(RSFT),U(LGUI),END ); + BABLM( BABL_BROWSER_NEXT_TAB, D(LGUI),D(LALT), T(RIGHT),U(LALT), U(LGUI),END ); + BABLM( BABL_BROWSER_PREV_TAB, D(LGUI), D(RSFT), T(LEFT), U(RSFT), U(LGUI),END ); + BABLM( BABL_BROWSER_URL_BAR, D(LGUI), T(L), U(LGUI),END ); + BABLM( BABL_BROWSER_FORWARD, D(LGUI), T(RIGHT), U(LGUI),END ); + BABLM( BABL_BROWSER_BACK, D(LGUI), T(LEFT), U(LGUI),END ); + BABLM( BABL_BROWSER_FIND, D(LGUI), T(F), U(LGUI),END ); + BABLM( BABL_BROWSER_BOOKMARK, D(LGUI), T(D), U(LGUI),END ); + //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LGUI),END ); // EDGE + BABLM( BABL_BROWSER_DEV_TOOLS, D(LGUI), D(LALT), T(I), U(LALT),U(LGUI),END ); // Chrome + // Chrome + BABLM( BABL_BROWSER_RELOAD, D(LGUI), T(R), U(LGUI),END ); // add shift for reload w/o cache + BABLM( BABL_BROWSER_FULLSCREEN, D(LGUI), D(LCTL), T(P), U(LCTL), U(LGUI),END ); //command shift F + BABLM( BABL_BROWSER_ZOOM_IN, D(LGUI), D(RSFT), T(EQL), U(RSFT), U(LGUI),END ); // ctr+ + + BABLM( BABL_BROWSER_ZOOM_OUT, D(LGUI), T(MINS), U(LGUI),END ); +#endif +#endif + + return MACRO_NONE; +#endif + +#ifdef EMACS_MODE + + case EMACS_MODE: + switch(shortcut) { +//probably should allow meta to not be ALT + + BABLM( BABL_GO_LEFT_1C, T(LEFT), END ); + BABLM( BABL_GO_RIGHT_1C, T(RIGHT), END ); + BABLM( BABL_GO_LEFT_WORD, D(LALT), T(B), U(LALT), END ); + BABLM( BABL_GO_RIGHT_WORD , D(LALT), T(F), U(LALT), END ); + BABLM( BABL_GO_START_LINE , D(LCTL), T(A), U(LCTL), END ); + BABLM( BABL_GO_END_LINE , D(LCTL), T(E), U(LCTL), END ); + BABLM( BABL_GO_START_DOC , D(LALT), D(LSFT), T(COMM),U(LSFT), U(LALT) ,END ); + BABLM( BABL_GO_END_DOC , D(LALT), D(LSFT), T(DOT), U(LSFT), U(LALT) ,END ); + BABLM( BABL_GO_NEXT_LINE , D(LCTL), T(N), U(LCTL), END ); + BABLM( BABL_GO_PREV_LINE , D(LCTL), T(P), U(LCTL), END ); + BABLM( BABL_PGDN , D(LCTL), T(V), U(LCTL), END ); + BABLM( BABL_PGUP , D(LALT), T(V), U(LALT), END ); + BABLM( BABL_DEL_RIGHT_1C, D(LCTL), T(D), U(LCTL),END ); + BABLM( BABL_DEL_LEFT_WORD , D(LCTL), T(BSPACE), U(LCTL), END ); + BABLM( BABL_DEL_RIGHT_WORD , D(LALT), T(D), U(LALT), END ); + BABLM( BABL_DEL_TO_LINE_END, D(LCTL), T(K), U(LCTL), END ); + BABLM( BABL_DEL_TO_LINE_START, T(ESC), T(0), D(LCTL), T(K), U(LCTL), END ); +#ifndef BABL_MOVEMENTONLY + BABLM( BABL_UNDO , D(LCTL), T(X), U(LCTL),T(C), END ); + BABLM( BABL_REDO , D(LCTL), T(X), U(LCTL),T(C), END ); // arguably + BABLM( BABL_CUT , D(LCTL), T(W), U(LCTL), END ); + BABLM( BABL_COPY , D(LALT), T(W), U(LALT), END ); //really? + BABLM( BABL_PASTE , D(LCTL), T(Y), U(LCTL), END ); + BABLM( BABL_SELECT_ALL ,D(LCTL), T(X), U(LCTL),T(H), END ); + BABLM( BABL_FIND , D(LCTL), T(S), U(LCTL),END ); + BABLM( BABL_FIND_NEXT , D(LCTL), T(S), U(LCTL),END ); + BABLM( BABL_FIND_REPLACE , D(LALT),D(LSFT), T(5),U(LSFT), U(LALT), END ); + BABLM( BABL_RUNAPP , D(LALT), T(X), U(LALT),T(S),T(H),T(E),T(L),T(L),END );// arguably + BABLM( BABL_SWITCH_APP_NEXT , D(LCTL), T(X), U(LCTL),T(RIGHT), END ); // arguably + BABLM( BABL_SWITCH_APP_LAST , D(LCTL), T(X), U(LCTL),T(LEFT), END ); // arguably + BABLM( BABL_CLOSE_APP , D(LCTL), T(X), U(LCTL),T(C),END ); + BABLM( BABL_HELP , D(LCTL),T(H), U(LCTL),T(A),END); // start search in help +#ifndef BABL_NOBROWSER +/* you get to figure w3 out + BABLM( BABL_BROWSER_NEW_TAB, D(LGUI), T(T), U(LGUI),END ); + BABLM( BABL_BROWSER_CLOSE_TAB, D(LGUI), T(W), U(LGUI),END ); + BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LGUI), D(RSFT),T(T), U(RSFT),U(LGUI),END ); + BABLM( BABL_BROWSER_NEXT_TAB, D(LGUI),D(LALT), T(RIGHT),U(LALT), U(LGUI),END ); + BABLM( BABL_BROWSER_PREV_TAB, D(LGUI), D(RSFT), T(LEFT), U(RSFT), U(LGUI),END ); + BABLM( BABL_BROWSER_URL_BAR, D(LGUI), T(L), U(LGUI),END ); + BABLM( BABL_BROWSER_FORWARD, D(LGUI), T(RIGHT), U(LGUI),END ); + BABLM( BABL_BROWSER_BACK, D(LGUI), T(LEFT), U(LGUI),END ); + BABLM( BABL_BROWSER_FIND, D(LGUI), T(F), U(LGUI),END ); + BABLM( BABL_BROWSER_BOOKMARK, D(LGUI), T(D), U(LGUI),END ); + //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LGUI),END ); // EDGE + BABLM( BABL_BROWSER_DEV_TOOLS, D(LGUI), D(LALT), T(I), U(LALT),U(LGUI),END ); // Chrome + // Chrome + BABLM( BABL_BROWSER_RELOAD, D(LGUI), T(R), U(LGUI),END ); // add shift for reload w/o cache + BABLM( BABL_BROWSER_FULLSCREEN, D(LGUI), D(LCTL), T(P), U(LCTL), U(LGUI),END ); //command shift F + BABLM( BABL_BROWSER_ZOOM_IN, D(LGUI), D(RSFT), T(EQL), U(RSFT), U(LGUI),END ); // ctr+ + + BABLM( BABL_BROWSER_ZOOM_OUT, D(LGUI), T(MINS), U(LGUI),END ); +*/ +#endif +#endif + break; + + return MACRO_NONE; + } + +#endif + + +#ifdef VI_MODE + case VI_MODE: +// you have to track the modes yourself. Otherwise motion is awful (bell, bell, bell) + + + BABLM( BABL_GO_LEFT_1C , T(H), END ); + BABLM( BABL_GO_RIGHT_1C , T(L), END ); + BABLM( BABL_GO_LEFT_WORD , T(B),END ); + BABLM( BABL_GO_RIGHT_WORD , T(W), END ); + BABLM( BABL_GO_START_LINE , D(LSFT), T(6),U(LSFT), END ); //^ + BABLM( BABL_GO_END_LINE , D(LSFT), T(4),U(LSFT) , END ); //$ + BABLM( BABL_GO_START_DOC , T(G),T(G) ,END ); + BABLM( BABL_GO_END_DOC , D(LSFT), T(G),U(LSFT),END ); + BABLM( BABL_GO_NEXT_LINE , T(J), END ); + BABLM( BABL_GO_PREV_LINE, T(K), END ); + BABLM( BABL_PGDN ,D(LCTL), T(F), U(LCTL), END ); + BABLM( BABL_PGUP , D(LCTL), T(B), U(LCTL), END ); + BABLM( BABL_DEL_RIGHT_1C , T(X),END ); + BABLM( BABL_DEL_LEFT_WORD , T(D),T(G),T(E),END ); + BABLM( BABL_DEL_RIGHT_WORD , T(D),T(W),END ); + BABLM( BABL_DEL_TO_LINE_END, T(D),D(LSFT), T(4),U(LSFT) ,END ); // d$ + BABLM( BABL_DEL_TO_LINE_START, T(D),D(LSFT), T(6),U(LSFT) ,END ); +#ifndef BABL_MOVEMENTONLY + BABLM( BABL_UNDO , T(U), END ); + BABLM( BABL_REDO , D(LCTL), T(R), U(LCTL), END ); + BABLM( BABL_CUT , T(X), END ); + BABLM( BABL_COPY , T(Y),END ); + BABLM( BABL_PASTE , T(P), END ); + BABLM( BABL_SELECT_ALL , D(LSFT), T(SCLN),U(LSFT),D(LSFT), T(5),U(LSFT),T(Y), END ); // wrong but helpful? + BABLM( BABL_FIND , T(SLASH),END ); + BABLM( BABL_FIND_NEXT , T(N),END ); + BABLM( BABL_FIND_REPLACE , D(LALT),D(LSFT), T(5),U(LSFT), U(LALT), END ); + BABLM( BABL_RUNAPP,END ); + BABLM( BABL_SWITCH_APP_NEXT ,END ); + BABLM( BABL_SWITCH_APP_LAST ,END ); + BABLM(BABL_CLOSE_APP, D(LSFT), T(SCLN),U(LSFT), T(Q), D(RSFT), T(1),U(RSFT), END ); + BABLM(BABL_HELP, D(LSFT), T(SCLN),U(LSFT),T(H),END); // start search in help +#ifndef BABL_NOBROWSER +/* you get to figure this out + BABLM( BABL_BROWSER_NEW_TAB, D(LGUI), T(T), U(LGUI),END ); + BABLM( BABL_BROWSER_CLOSE_TAB, D(LGUI), T(W), U(LGUI),END ); + BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LGUI), D(RSFT),T(T), U(RSFT),U(LGUI),END ); + BABLM( BABL_BROWSER_NEXT_TAB, D(LGUI),D(LALT), T(RIGHT),U(LALT), U(LGUI),END ); + BABLM( BABL_BROWSER_PREV_TAB, D(LGUI), D(RSFT), T(LEFT), U(RSFT), U(LGUI),END ); + BABLM( BABL_BROWSER_URL_BAR, D(LGUI), T(L), U(LGUI),END ); + BABLM( BABL_BROWSER_FORWARD, D(LGUI), T(RIGHT), U(LGUI),END ); + BABLM( BABL_BROWSER_BACK, D(LGUI), T(LEFT), U(LGUI),END ); + BABLM( BABL_BROWSER_FIND, D(LGUI), T(F), U(LGUI),END ); + BABLM( BABL_BROWSER_BOOKMARK, D(LGUI), T(D), U(LGUI),END ); + //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LGUI),END ); // EDGE + BABLM( BABL_BROWSER_DEV_TOOLS, D(LGUI), D(LALT), T(I), U(LALT),U(LGUI),END ); // Chrome + // Chrome + BABLM( BABL_BROWSER_RELOAD, D(LGUI), T(R), U(LGUI),END ); // add shift for reload w/o cache + BABLM( BABL_BROWSER_FULLSCREEN, D(LGUI), D(LCTL), T(P), U(LCTL), U(LGUI),END ); //command shift F + BABLM( BABL_BROWSER_ZOOM_IN, D(LGUI), T(PLUS), U(LGUI),END ); + BABLM( BABL_BROWSER_ZOOM_OUT, D(LGUI), T(MINS), U(LGUI),END ); +*/ +#endif +#endif + return MACRO_NONE; +#endif + + + + +#ifdef READMUX_MODE +// Readline command line editing + tmux windowing +// I havent decided how much to do readline and how much tmux + + + case READMUX_MODE: + + BABLM( BABL_GO_LEFT_1C , T(LEFT), END ); + BABLM( BABL_GO_RIGHT_1C , T(RIGHT), END ); + BABLM( BABL_GO_LEFT_WORD , D(LALT), T(B), U(LALT), END ); + BABLM( BABL_GO_RIGHT_WORD , D(LALT), T(F), U(LALT), END ); + BABLM( BABL_GO_START_LINE , D(LCTL), T(A), U(LCTL), END ); + BABLM( BABL_GO_END_LINE , D(LCTL), T(E), U(LCTL), END ); + //BABLM( BABL_GO_START_DOC ,END );// tmux? + //BABLM( BABL_GO_END_DOC ,END ); // tmux? + BABLM( BABL_GO_NEXT_LINE , D(LCTL), T(N), U(LCTL), END ); + BABLM( BABL_GO_PREV_LINE , D(LCTL), T(P), U(LCTL), END ); + BABLM( BABL_PGDN , T(PGDN), END ); + BABLM( BABL_PGUP , T(PGUP), END ); + BABLM( BABL_DEL_RIGHT_1C , D(LCTL), T(D), U(LCTL),END ); + BABLM( BABL_DEL_LEFT_WORD , D(LCTL), T(W), U(LCTL), END ); + BABLM( BABL_DEL_RIGHT_WORD , D(LALT), T(D), U(LALT), END ); + BABLM( BABL_DEL_TO_LINE_END, D(LCTL), T(K), U(LCTL), END ); + BABLM( BABL_DEL_TO_LINE_START, D(LCTL), T(U), U(LCTL), END ); +#ifndef BABL_MOVEMENTONLY + BABLM( BABL_UNDO , D(LALT), T(R), U(LALT) , END ); + BABLM( BABL_REDO , D(LCTL), T(X), U(LCTL),T(C), END ); // arguably + BABLM( BABL_CUT , D(LCTL), T(K), U(LCTL), END ); // wrong half the time + //BABLM( BABL_COPY ,END ); + BABLM( BABL_PASTE , D(LCTL), T(Y), U(LCTL), END ); + BABLM( BABL_SELECT_ALL , D(LCTL), T(A), T(K), T(Y), U(LCTL) , END ); + BABLM( BABL_FIND , D(LCTL), T(R), U(LCTL), END ); // search history + BABLM(BABL_FIND_NEXT, D(LCTL), T(S), U(LCTL), END ); + //BABLM( BABL_FIND_REPLACE ,END ); + BABLM( BABL_RUNAPP , D(LCTL), T(B), U(LCTL), T(C),END ); //tmux + BABLM( BABL_SWITCH_APP_NEXT , D(LCTL), T(B), U(LCTL), T(N),END ); //tmux + BABLM( BABL_SWITCH_APP_LAST , D(LCTL), T(B), U(LCTL), T(P),END ); //tmux + BABLM( BABL_CLOSE_APP , D(LCTL), T(B), U(LCTL), T(D),END); // usually what I want + // BABLM( BABL_HELP ,END ); +#ifndef BABL_NOBROWSER +/* Add lynx shortcuts? + BABLM( BABL_BROWSER_NEW_TAB, D(LGUI), T(T), U(LGUI),END ); + BABLM( BABL_BROWSER_CLOSE_TAB, D(LGUI), T(W), U(LGUI),END ); + BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LGUI), D(RSFT),T(T), U(RSFT),U(LGUI),END ); + BABLM( BABL_BROWSER_NEXT_TAB, D(LGUI),D(LALT), T(RIGHT),U(LALT), U(LGUI),END ); + BABLM( BABL_BROWSER_PREV_TAB, D(LGUI), D(RSFT), T(LEFT), U(RSFT), U(LGUI),END ); + BABLM( BABL_BROWSER_URL_BAR, D(LGUI), T(L), U(LGUI),END ); + BABLM( BABL_BROWSER_FORWARD, D(LGUI), T(RIGHT), U(LGUI),END ); + BABLM( BABL_BROWSER_BACK, D(LGUI), T(LEFT), U(LGUI),END ); + BABLM( BABL_BROWSER_FIND, D(LGUI), T(F), U(LGUI),END ); + BABLM( BABL_BROWSER_BOOKMARK, D(LGUI), T(D), U(LGUI),END ); + //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LGUI),END ); // EDGE + BABLM( BABL_BROWSER_DEV_TOOLS, D(LGUI), D(LALT), T(I), U(LALT),U(LGUI),END ); // Chrome + // Chrome + BABLM( BABL_BROWSER_RELOAD, D(LGUI), T(R), U(LGUI),END ); // add shift for reload w/o cache + BABLM( BABL_BROWSER_FULLSCREEN, D(LGUI), D(LCTL), T(P), U(LCTL), U(LGUI),END ); //command shift F + BABLM( BABL_BROWSER_ZOOM_IN, D(LGUI), T(PLUS), U(LGUI),END ); + BABLM( BABL_BROWSER_ZOOM_OUT, D(LGUI), T(MINS), U(LGUI),END ); +*/ +#endif +#endif + + return MACRO_NONE; + +#endif + + default: + return MACRO_NONE; + } + +} + + +#endif diff --git a/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/babblePaste.h b/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/babblePaste.h new file mode 100644 index 0000000000..1e8206212a --- /dev/null +++ b/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/babblePaste.h @@ -0,0 +1,238 @@ +/* A library to output the right key shortcut in any common app. +Given a global variable babble_mode to show the environment and a +key that calls the paste macro, do the right type of paste. + +Setting the bable_mode is done by another macro, or TBD interaction with the host. + +Huge thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts +and jeebak & algernon's keymap +*/ +#ifndef _babblePaste_h_included__ +#define _babblePaste_h_included__ +#include "config.h" +#include "action_layer.h" +#include "quantum_keycodes.h" + +#ifdef USE_BABLPASTE + +/* *************************** + +// Uncomment any modes you want. Whatever mode = 0 will be the default on boot +// Expect to get errors if you comment a feature out and leave it in your keymap. + +#define USE_BABLPASTE + +//#define MS_MODE 0 // Windows. +//#define MAC_MODE 1 +//#define LINUX_MODE 2 //aka gnome+KDE +//#define EMACS_MODE 3 +//#define VI_MODE 4 +//#define WORDSTAR_MODE 5 +//#define READMUX 6 // Readline and tmux + +// This removes everything but cursor movement +//#define BABL_MOVEMENTONLY +// and this just removes browser shortcuts +//#define BABL_NOBROWSER +****************************/ + + +// Uncomment if you need more free flash space +// It removes everything but cursor movement +//#define BABL_MOVEMENTONLY + + +// Define starting number for BABL macros in the macro range. +// Probably can start the default even lower +#define BABL_START_NUM 50 + +/* Macros handled by babblepaste. Most should be available for all platforms. +Whatever isn't defined will NOP */ +enum { +// Movement macros + // left & right + BABL_GO_LEFT_1C= BABL_START_NUM, + BABL_GO_RIGHT_1C, + BABL_GO_LEFT_WORD, + BABL_GO_RIGHT_WORD, + BABL_GO_START_LINE, + BABL_GO_END_LINE, + // now up & down + BABL_GO_START_DOC, + BABL_GO_END_DOC, + BABL_GO_NEXT_LINE, + BABL_GO_PREV_LINE, + BABL_PGDN, + BABL_PGUP, + // And the delete options + //BABL_DEL_LEFT_1C == backspace, so why bother. + BABL_DEL_RIGHT_1C, // usually = Del + BABL_DEL_LEFT_WORD, + BABL_DEL_RIGHT_WORD, + BABL_DEL_TO_LINE_END, // delete from cursor to end of line + BABL_DEL_TO_LINE_START, // delete from cursor to begining line +#ifndef BABL_MOVEMENTONLY + // Cut & Paste + BABL_UNDO, + BABL_REDO, + BABL_CUT, + BABL_COPY, + BABL_PASTE, + BABL_SELECT_ALL, + /* not yet implemented + BABL_SWAP_LAST2C // swap last characters before the cursor + BABL_SWAP_LAST2W // Swap the last two words before the cursor + */ + // find & replace + BABL_FIND, + BABL_FIND_NEXT, + BABL_FIND_REPLACE, + // GUI or app + BABL_RUNAPP, + BABL_SWITCH_APP_NEXT, + BABL_SWITCH_APP_LAST, // previous + BABL_CLOSE_APP, + BABL_HELP, + +#ifndef BABL_NOBROWSER + BABL_BROWSER_NEW_TAB, + BABL_BROWSER_CLOSE_TAB, + BABL_BROWSER_REOPEN_LAST_TAB, + BABL_BROWSER_NEXT_TAB, + BABL_BROWSER_PREV_TAB, + BABL_BROWSER_URL_BAR, + BABL_BROWSER_FORWARD, + BABL_BROWSER_BACK, + BABL_BROWSER_FIND, + BABL_BROWSER_BOOKMARK, + BABL_BROWSER_DEV_TOOLS, // hard one to remember + BABL_BROWSER_RELOAD, + BABL_BROWSER_FULLSCREEN, + BABL_BROWSER_ZOOM_IN, + BABL_BROWSER_ZOOM_OUT, + +#endif + +#endif +// Macros for mode switching +#ifdef MS_MODE + BABL_WINDOWS, +#endif +#ifdef MAC_MODE + BABL_MAC, +#endif +#ifdef LINUX_MODE + BABL_LINUX, +#endif +#ifdef EMACS_MODE + BABL_EMACS, +#endif +#ifdef VI_MODE + BABL_VI, +#endif +#ifdef READMUX_MODE + BABL_READLINE, +#endif + + +}; + +// BUG, used to jump to babble functiion. Surely there is a way to calculate size of enum? +#define BABL_NUM_MACROS 48+4 // 48 + # of defined modes. + +/* And all the shorthand keymap ready versions */ +// First the mode switching macros +#ifdef MS_MODE +#define B_WIN M(BABL_WINDOWS) +#endif +#ifdef MAC_MODE +#define B_MAC M(BABL_MAC) +#endif +#ifdef LINUX_MODE +#define B_LNX M(BABL_LINUX) +#endif +#ifdef EMACS_MODE +#define B_EMAX M(BABL_EMACS) +#endif +#ifdef VI_MODE +#define B_VI M(BABL_VI) +#endif +#ifdef READMUX_MODE +#define B_READ M(BABL_READLINE) +#endif + +// and all the movement & action. + +#define B_L1C M(BABL_GO_LEFT_1C) +#define B_R1C M(BABL_GO_RIGHT_1C) +#define B_L1W M(BABL_GO_LEFT_WORD) +#define B_R1W M(BABL_GO_RIGHT_WORD) +#define B_GSOL M(BABL_GO_START_LINE) +#define B_GEOL M(BABL_GO_END_LINE) +#define B_GTOP M(BABL_GO_START_DOC) +#define B_GEND M(BABL_GO_END_DOC) +#define B_DOWN M(BABL_GO_NEXT_LINE) +#define B_UP M(BABL_GO_PREV_LINE) +#define B_PGDN M(BABL_PGDN) +#define B_PGUP M(BABL_PGUP) +//#define B_BKSP M(BABL_DEL_LEFT_1C) == backspace so why bother. +#define B_DEL M(BABL_DEL_RIGHT_1C) // usually = Del +#define B_DLW M(BABL_DEL_LEFT_WORD) +#define B_DRW M(BABL_DEL_RIGHT_WORD) +#define B_DEOL M(BABL_DEL_TO_LINE_END) // delete from cursor to end of line +#define B_DSOL M(BABL_DEL_TO_LINE_START) // delete from cursor to begining line +#define B_UNDO M(BABL_UNDO) +#define B_REDO M(BABL_REDO) +#define B_CUT M(BABL_CUT) +#define B_COPY M(BABL_COPY) +#define B_PAST M(BABL_PASTE) +#define B_SELA M(BABL_SELECT_ALL) +#define B_FIND M(BABL_FIND) +#define B_FINDN M(BABL_FIND_NEXT) +#define B_FINDR M(BABL_FIND_REPLACE) +#define B_RAPP M(BABL_RUNAPP) +#define B_NAPP M(BABL_SWITCH_APP_NEXT) +#define B_PAPP M(BABL_SWITCH_APP_LAST) // previous +#define B_CAPP M(BABL_CLOSE_APP) +#define B_HELP M(BABL_HELP) +#define B_NTAB M(BABL_BROWSER_NEW_TAB) +#define B_CTAB M(BABL_BROWSER_CLOSE_TAB) +#define B_ROTB M(BABL_BROWSER_REOPEN_LAST_TAB) +#define B_NXTB M(BABL_BROWSER_NEXT_TAB) +#define B_PTAB M(BABL_BROWSER_PREV_TAB) +#define B_NURL M(BABL_BROWSER_URL_BAR) +#define B_BFWD M(BABL_BROWSER_FORWARD) +#define B_BBAK M(BABL_BROWSER_BACK) +#define B_BFND M(BABL_BROWSER_FIND) +#define B_BOOK M(BABL_BROWSER_BOOKMARK) +#define B_BDEV M(BABL_BROWSER_DEV_TOOLS) // hard one to remember +#define B_BRLD M(BABL_BROWSER_RELOAD) +#define B_BFUlL M(BABL_BROWSER_FULLSCREEN) +#define B_ZMIN M(BABL_BROWSER_ZOOM_IN) +#define B_ZMOT M(BABL_BROWSER_ZOOM_OUT) + + + + + + + +/* from action_macro.h +typedef uint8_t macro_t; + +#define MACRO_NONE (macro_t*)0 +#define MACRO(...) ({ static const macro_t __m[] PROGMEM = { __VA_ARGS__ }; &__m[0]; }) +#define MACRO_GET(p) pgm_read_byte(p) + +#define BABL_MSTART (entry, os, macro...) ( const macro_t bablDict[entry][os] PROGMEM = { macro... }; ) + +*/ + +const macro_t *babblePaste(keyrecord_t *record, uint8_t shortcut); + +macro_t* switch_babble_mode( uint8_t id); + + +#endif +#endif + diff --git a/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/babblePaste.txt b/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/babblePaste.txt new file mode 100644 index 0000000000..cf75e153e8 --- /dev/null +++ b/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/babblePaste.txt @@ -0,0 +1,123 @@ + BabblePaste is a library of common macros used to make sure that +you can have one "paste" button on one layer, and it will do the +right thing on any OS or app. Windows=Ctrl-V. Mac = Command-V and so on. + +The babblepaste library looks for the current status in a babble_mode global variable. +To switch modes, run the switch_babble_mode() function, or a pre defined macro. +Currently supported are Windows, OS X, Gnome/kde, Emacs, VI and readline, +across 42+ common macro actions. + + +###To use the library +1) Paste the following into your config.h. + +//////Begin////// +#define USE_BABLPASTE 1 + +#ifdef USE_BABLPASTE +/* define BabblePaste maps. Whatever = 0 will be the default. */ +// MAC_MODE 0 +// MS_MODE 1 +// LINUX_MODE 2 +// EMACS_MODE 3 +// VI_MODE 3 +// Readline and tmux +// READMUX_MODE 2 +// WORDSTAR_MODE 5 +#endif + +// Uncomment these to remove options an free up flash space + +// This removes everything but cursor movement +// BABL_MOVEMENTONLY +// and this just removes browser shortcuts +// BABL_NOBROWSER +///////End/////// + +2) Add the following to your keymap in the action_get_macro + +//////Begin////// +#ifdef USE_BABLPASTE + + if( id >= BABL_START_NUM && id < (BABL_START_NUM + BABL_NUM_MACROS ) ) { + if (record->event.pressed) { // is there a case where this isn't desired? + + babblePaste ( record, id ); + return MACRO_NONE; + } + } +#endif +///////End/////// + +3) add Babbelpaste actions to your keymap. See the full list in babblePaste.h, or the +list below +B_L1C // go left 1 char +B_R1C // go Right 1 char + B_L1W //GO_LEFT_1 WORD + B_R1W //BABL_GO_RIGHT_1 WORD + B_GSOL // BABL_GOTO_START of _LINE + B_GEOL // BABL_GOTO_END_LINE + B_GTOP //BABL_GOTO_START_DOC + B_GEND //BABL_GO_END_DOC + B_DOWN //BABL_GO_NEXT_LINE + B_UP // BABL_GO_PREV_LINE + B_PGDN //PGDN + B_PGUP //PGUP +// B_BKSP //backspace so why bother. + B_DEL // DEL_RIGHT_1 Char // usually = Del + B_DLW // DEL_LEFT_ 1 WORD) + B_DRW //DEL_RIGHT_1 WORD + B_DEOL // delete from cursor to end of line + B_DSOL // delete from cursor to begining line + B_UNDO //UNDO + B_REDO // REDO + B_CUT // CUT) + B_COPY // COPY) + B_PAST // PASTE) + B_SELA // SELECT_ALL + B_FIND // FIND) + B_FINDN //FIND_NEXT) + B_FINDR // FIND_REPLACE) + B_RAPP // open application launcher + B_NAPP // switch to next app + B_PAPP // switch to previous app + B_CAPP // CLOSE_APP) + B_HELP // HELP) + B_NTAB // BROWSER_NEW_TAB) + B_CTAB //BROWSER_CLOSE_TAB) + B_ROTB //BROWSER_REOPEN_LAST_TAB) + B_NXTB //BROWSER_NEXT_TAB) + B_PTAB //BROWSER_PREV_TAB) + B_NURL //BROWSER_jump to URL_BAR) + B_BFWD // BROWSER_FORWARD (in history) + B_BBAK //BROWSER_BACK (in history) + B_BFND // BROWSER_FIND) + B_BOOK //BROWSER_New BOOKMARK) + B_BDEV //BROWSER_ Open DEV_TOOLS) // hard one to remember + B_BRLD // BROWSER_RELOAD Page + B_BFUlL // BROWSER_FULLSCREEN) + B_ZMIN // BROWSER_ZOOM_IN) + B_ZMOT //BROWSER_ZOOM_OUT) + + +#### Development notes +-Why a new function? Because it would make the keymap too ugly to put it there. +-Why not return the macro to action_get_macro? Because I kept running into scope problems +and pointers to the wrong type. +-Why not an array of arrays as a lookup instead of a function? That would allow you +to store the lookup table in PROGMEM. True, but that takes more pre-processor skill +than I had. + +-Have you tested this on every platform? No. Submit a patch. + + +### Next steps for someone. +Make it easier to pair macros with modifiers. So key foo will jump to start of line, and +Shift(foo) will jump to the first tab in a browser. + +## Thanks + +Thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts +and https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/jeebak/keymap.c +And of course QMK... + diff --git a/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/rules.mk b/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/rules.mk index 6d1eae2bf9..5b45f586b5 100644 --- a/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/rules.mk +++ b/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/rules.mk @@ -15,3 +15,6 @@ UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# Keymap specific files +SRC = babblePaste.c diff --git a/keyboards/handwired/ms_sculpt_mobile/rules.mk b/keyboards/handwired/ms_sculpt_mobile/rules.mk index 72015d93d8..6498fa6c76 100644 --- a/keyboards/handwired/ms_sculpt_mobile/rules.mk +++ b/keyboards/handwired/ms_sculpt_mobile/rules.mk @@ -24,6 +24,3 @@ COMMAND_ENABLE = yes # Commands for debug and configuration NKRO_ENABLE = no # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality AUDIO_ENABLE = no # Audio output - -# Project specific files -SRC = babblePaste.c -- cgit v1.2.3 From 4f6c0d0ea5eb922d98413f30c1710b7800aa2bd3 Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 26 Jan 2022 07:21:08 +1100 Subject: More keyboard rules.mk cleanups (#16044) * More keyboard rules.mk cleanups * Found a couple more --- keyboards/handwired/carpolly/rules.mk | 1 - keyboards/handwired/croxsplit44/rules.mk | 7 ++----- keyboards/handwired/dygma/raise/rules.mk | 2 +- keyboards/handwired/ortho_brass/rules.mk | 7 ++----- 4 files changed, 5 insertions(+), 12 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/carpolly/rules.mk b/keyboards/handwired/carpolly/rules.mk index a7f3367d86..0cc90c1160 100644 --- a/keyboards/handwired/carpolly/rules.mk +++ b/keyboards/handwired/carpolly/rules.mk @@ -15,7 +15,6 @@ COMMAND_ENABLE = yes # Commands for debug and configuration NKRO_ENABLE = yes # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow -BLUETOOTH_ENABLE = no # Enable Bluetooth AUDIO_ENABLE = no # Audio output # generated by KBFirmware JSON to QMK Parser diff --git a/keyboards/handwired/croxsplit44/rules.mk b/keyboards/handwired/croxsplit44/rules.mk index 0b2170c456..87f77b103a 100644 --- a/keyboards/handwired/croxsplit44/rules.mk +++ b/keyboards/handwired/croxsplit44/rules.mk @@ -12,10 +12,7 @@ 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 = no # USB Nkey Rollover +NKRO_ENABLE = no # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow -AUDIO_ENABLE = no # Audio output \ No newline at end of file +AUDIO_ENABLE = no # Audio output diff --git a/keyboards/handwired/dygma/raise/rules.mk b/keyboards/handwired/dygma/raise/rules.mk index 0fd9955715..a0120c8159 100644 --- a/keyboards/handwired/dygma/raise/rules.mk +++ b/keyboards/handwired/dygma/raise/rules.mk @@ -12,7 +12,7 @@ MOUSEKEY_ENABLE = yes # Mouse keys EXTRAKEY_ENABLE = no # Audio control and System control CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = no # USB Nkey Rollover +NKRO_ENABLE = no # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output diff --git a/keyboards/handwired/ortho_brass/rules.mk b/keyboards/handwired/ortho_brass/rules.mk index 19154c58f9..4e3b0d925a 100644 --- a/keyboards/handwired/ortho_brass/rules.mk +++ b/keyboards/handwired/ortho_brass/rules.mk @@ -1,7 +1,7 @@ # MCU name MCU = atmega32u4 -# Bootloader +# Bootloader selection BOOTLOADER = qmk-dfu # Build Options @@ -10,13 +10,10 @@ MOUSEKEY_ENABLE = no # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = yes # N-key Rollover +NKRO_ENABLE = yes # Enable N-key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable RGB underlight. -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - LAYOUTS = ortho_4x12 RGBLIGHT_SUPPORTED = no -- cgit v1.2.3 From 7d685956cc616a8d76aa7866f42bf569a9ca3fca Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 31 Jan 2022 04:29:42 +1100 Subject: Rename `AdafruitBLE` to `BluefruitLE` (#16127) --- keyboards/handwired/42/rules.mk | 2 +- keyboards/handwired/bdn9_ble/rules.mk | 2 +- keyboards/handwired/fruity60/rules.mk | 2 +- keyboards/handwired/prkl30/feather/rules.mk | 2 +- keyboards/handwired/promethium/keymaps/default/keymap.c | 6 +++--- keyboards/handwired/promethium/keymaps/priyadi/keymap.c | 6 +++--- keyboards/handwired/promethium/promethium.c | 4 ++-- keyboards/handwired/promethium/rules.mk | 2 +- keyboards/handwired/pterodactyl/rules.mk | 2 +- keyboards/handwired/slash/rules.mk | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/42/rules.mk b/keyboards/handwired/42/rules.mk index 5742e84bf5..655ce00bef 100644 --- a/keyboards/handwired/42/rules.mk +++ b/keyboards/handwired/42/rules.mk @@ -21,4 +21,4 @@ RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE diff --git a/keyboards/handwired/bdn9_ble/rules.mk b/keyboards/handwired/bdn9_ble/rules.mk index e5abbcfb88..a3082cf364 100644 --- a/keyboards/handwired/bdn9_ble/rules.mk +++ b/keyboards/handwired/bdn9_ble/rules.mk @@ -21,4 +21,4 @@ RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output ENCODER_ENABLE = no BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE diff --git a/keyboards/handwired/fruity60/rules.mk b/keyboards/handwired/fruity60/rules.mk index 74628e3e6f..c84f68f0bf 100644 --- a/keyboards/handwired/fruity60/rules.mk +++ b/keyboards/handwired/fruity60/rules.mk @@ -20,6 +20,6 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE LAYOUTS = 60_tsangan_hhkb diff --git a/keyboards/handwired/prkl30/feather/rules.mk b/keyboards/handwired/prkl30/feather/rules.mk index f83173fa0b..7578dcef74 100644 --- a/keyboards/handwired/prkl30/feather/rules.mk +++ b/keyboards/handwired/prkl30/feather/rules.mk @@ -22,4 +22,4 @@ AUDIO_ENABLE = no # This can be enabled if a speaker is connected to t RGBLIGHT_ENABLE = no # This can be enabled if a ws2812 strip is connected to the expansion port. BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE diff --git a/keyboards/handwired/promethium/keymaps/default/keymap.c b/keyboards/handwired/promethium/keymaps/default/keymap.c index 14a293bb39..e12142c50b 100644 --- a/keyboards/handwired/promethium/keymaps/default/keymap.c +++ b/keyboards/handwired/promethium/keymaps/default/keymap.c @@ -137,7 +137,7 @@ enum planck_keycodes { #ifndef FAUXCLICKY_ENABLE FC_TOG, #endif -#ifndef MODULE_ADAFRUIT_BLE +#ifndef BLUETOOTH_BLUEFRUIT_LE OUT_BT, #endif RGBDEMO, @@ -1261,7 +1261,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } void set_output_user(uint8_t output) { -#ifdef MODULE_ADAFRUIT_BLE +#ifdef BLUETOOTH_BLUEFRUIT_LE switch(output) { case OUTPUT_USB: led_set_output_usb(); @@ -1285,7 +1285,7 @@ void matrix_init_user() { #endif // auto detect output on init -#ifdef MODULE_ADAFRUIT_BLE +#ifdef BLUETOOTH_BLUEFRUIT_LE uint8_t output = auto_detect_output(); if (output == OUTPUT_USB) { set_output(OUTPUT_USB); diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 094eb15762..94b505aa2c 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -140,7 +140,7 @@ enum planck_keycodes { #ifndef FAUXCLICKY_ENABLE FC_TOG, #endif -#ifndef MODULE_ADAFRUIT_BLE +#ifndef BLUETOOTH_BLUEFRUIT_LE OUT_BT, #endif RGBDEMO, @@ -1264,7 +1264,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } void set_output_user(uint8_t output) { -#ifdef MODULE_ADAFRUIT_BLE +#ifdef BLUETOOTH_BLUEFRUIT_LE switch(output) { case OUTPUT_USB: led_set_output_usb(); @@ -1288,7 +1288,7 @@ void matrix_init_user() { #endif // auto detect output on init -#ifdef MODULE_ADAFRUIT_BLE +#ifdef BLUETOOTH_BLUEFRUIT_LE uint8_t output = auto_detect_output(); if (output == OUTPUT_USB) { set_output(OUTPUT_USB); diff --git a/keyboards/handwired/promethium/promethium.c b/keyboards/handwired/promethium/promethium.c index 8eb1680d84..0df6c28e9b 100644 --- a/keyboards/handwired/promethium/promethium.c +++ b/keyboards/handwired/promethium/promethium.c @@ -3,7 +3,7 @@ #include "timer.h" #include "matrix.h" #include "musical_notes.h" -#include "adafruit_ble.h" +#include "bluefruit_le.h" float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_A4, 0.0625); float fauxclicky_released_note[2] = MUSICAL_NOTE(_A4, 0.0625); @@ -12,7 +12,7 @@ float fauxclicky_beep_note[2] = MUSICAL_NOTE(_C6, 0.25); // cubic fit {3.3, 0}, {3.5, 2.9}, {3.6, 5}, {3.7, 8.6}, {3.8, 36}, {3.9, 62}, {4.0, 73}, {4.05, 83}, {4.1, 89}, {4.15, 94}, {4.2, 100} uint8_t battery_level(void) { - float voltage = adafruit_ble_read_battery_voltage() * 2 * 3.3 / 1024; + float voltage = bluefruit_le_read_battery_voltage() * 2 * 3.3 / 1024; if (voltage < MIN_VOLTAGE) return 0; if (voltage > MAX_VOLTAGE) return 255; return (voltage - MIN_VOLTAGE) / (MAX_VOLTAGE - MIN_VOLTAGE) * 255; diff --git a/keyboards/handwired/promethium/rules.mk b/keyboards/handwired/promethium/rules.mk index f41e88b0c4..383800ee01 100644 --- a/keyboards/handwired/promethium/rules.mk +++ b/keyboards/handwired/promethium/rules.mk @@ -23,7 +23,7 @@ PS2_MOUSE_ENABLE = yes PS2_USE_INT = yes CUSTOM_MATRIX = yes BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE SRC += ws2812.c SRC += rgbsps.c diff --git a/keyboards/handwired/pterodactyl/rules.mk b/keyboards/handwired/pterodactyl/rules.mk index 629b30e385..fd63e2ad48 100644 --- a/keyboards/handwired/pterodactyl/rules.mk +++ b/keyboards/handwired/pterodactyl/rules.mk @@ -22,7 +22,7 @@ AUDIO_ENABLE = no # Audio output UNICODE_ENABLE = yes CUSTOM_MATRIX = yes BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE SRC += matrix.c QUANTUM_LIB_SRC += i2c_master.c diff --git a/keyboards/handwired/slash/rules.mk b/keyboards/handwired/slash/rules.mk index 275a2eb7eb..53d114978f 100644 --- a/keyboards/handwired/slash/rules.mk +++ b/keyboards/handwired/slash/rules.mk @@ -20,4 +20,4 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE -- cgit v1.2.3 From cffc3fcce532a02fae8a128e1d5ffeaf6df79520 Mon Sep 17 00:00:00 2001 From: mmccoyd Date: Sun, 30 Jan 2022 10:53:01 -0800 Subject: [Keyboard] Re-org Hillside folders and fix default keymap (#16128) Co-authored-by: mmccoyd --- keyboards/handwired/hillside/0_1/info.json | 96 +++++++++ .../hillside/0_1/keymaps/default/keymap.json | 101 ++++++++++ .../hillside/0_1/keymaps/default/readme.md | 212 ++++++++++++++++++++ .../handwired/hillside/0_1/keymaps/json2hill.py | 136 +++++++++++++ .../handwired/hillside/0_1/keymaps/via/keymap.json | 61 ++++++ keyboards/handwired/hillside/0_1/readme.md | 29 +++ keyboards/handwired/hillside/info.json | 93 +-------- .../handwired/hillside/keymaps/default/keymap.json | 102 ---------- .../handwired/hillside/keymaps/default/readme.md | 216 --------------------- keyboards/handwired/hillside/keymaps/json2hill.py | 136 ------------- .../handwired/hillside/keymaps/via/keymap.json | 101 ---------- keyboards/handwired/hillside/readme.md | 26 +-- 12 files changed, 640 insertions(+), 669 deletions(-) create mode 100644 keyboards/handwired/hillside/0_1/keymaps/default/keymap.json create mode 100644 keyboards/handwired/hillside/0_1/keymaps/default/readme.md create mode 100755 keyboards/handwired/hillside/0_1/keymaps/json2hill.py create mode 100644 keyboards/handwired/hillside/0_1/keymaps/via/keymap.json create mode 100644 keyboards/handwired/hillside/0_1/readme.md delete mode 100644 keyboards/handwired/hillside/keymaps/default/keymap.json delete mode 100644 keyboards/handwired/hillside/keymaps/default/readme.md delete mode 100755 keyboards/handwired/hillside/keymaps/json2hill.py delete mode 100644 keyboards/handwired/hillside/keymaps/via/keymap.json (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/hillside/0_1/info.json b/keyboards/handwired/hillside/0_1/info.json index 4505bf3e35..8c00f70366 100644 --- a/keyboards/handwired/hillside/0_1/info.json +++ b/keyboards/handwired/hillside/0_1/info.json @@ -1,4 +1,14 @@ { + "manufacturer": "mmccoyd", + "maintainer": "mmccoyd", + + "keyboard_name": "Hillside", + "url": "http://github.com/mmccoyd/hillside/", + + "tags": ["split", "column stagger", "choc v1", "choc spaced" ], + + "processor": "atmega32u4", + "matrix_pins": { "rows": ["D7", "E6", "B4", "B5"], "cols": ["F6", "F7", "B1", "B3", "B2", "B6"] @@ -9,5 +19,91 @@ "vid": "0xFEED", "pid": "0x67C0", "device_ver": "0x0001" + }, + + "features": { + "encoder": true, + "extrakey": true, + "rgblight": true + }, + "split": { + "soft_serial_pin": "D2", + "main": "left" + }, + + "rgblight": { + "led_count": 5, + "pin": "D3", + "split": true, + "hue_steps": 8, + "saturation_steps": 8, + "brightness_steps": 8 + }, + + "layouts": { + "LAYOUT": { + "layout": [ + + {"label": "Tab", "x": 0, "y": 0.93}, + {"label": "Q", "x": 1, "y": 0.93}, + {"label": "W", "x": 2, "y": 0.31}, + {"label": "E", "x": 3, "y": 0}, + {"label": "R", "x": 4, "y": 0.28}, + {"label": "T", "x": 5, "y": 0.42}, + + {"label": "Y", "x": 9.5, "y": 0.42}, + {"label": "U", "x": 10.5, "y": 0.28}, + {"label": "I", "x": 11.5, "y": 0}, + {"label": "O", "x": 12.5, "y": 0.31}, + {"label": "P", "x": 13.5, "y": 0.93}, + {"label": "Backspace", "x": 14.5, "y": 0.93}, + + + {"label": "Ctrl", "x": 0, "y": 1.93}, + {"label": "A", "x": 1, "y": 1.93}, + {"label": "S", "x": 2, "y": 1.31}, + {"label": "D", "x": 3, "y": 1}, + {"label": "F", "x": 4, "y": 1.28}, + {"label": "G", "x": 5, "y": 1.42}, + + {"label": "H", "x": 9.5, "y": 1.42}, + {"label": "J", "x": 10.5, "y": 1.28}, + {"label": "K", "x": 11.5, "y": 1}, + {"label": "L", "x": 12.5, "y": 1.31}, + {"label": ";", "x": 13.5, "y": 1.93}, + {"label": "'", "x": 14.5, "y": 1.93}, + + + {"label": "Shift", "x": 0, "y": 2.93}, + {"label": "Z", "x": 1, "y": 2.93}, + {"label": "X", "x": 2, "y": 2.31}, + {"label": "C", "x": 3, "y": 2}, + {"label": "V", "x": 4, "y": 2.28}, + {"label": "B", "x": 5, "y": 2.42}, + {"label": "`", "x": 6, "y": 2.78}, + + {"label": "Esc", "x": 8.5, "y": 2.78}, + {"label": "N", "x": 9.5, "y": 2.42}, + {"label": "M", "x": 10.5, "y": 2.28}, + {"label": ",", "x": 11.5, "y": 2}, + {"label": ".", "x": 12.5, "y": 2.31}, + {"label": "/", "x": 13.5, "y": 2.93}, + {"label": "Shift", "x": 14.5, "y": 2.93}, + + + {"label": "Enter", "x": 2, "y": 3.31}, + {"label": "Gui", "x": 3.5, "y": 3.28}, + {"label": "Alt", "x": 4.5, "y": 3.42}, + {"label": "Num", "x": 5.5, "y": 3.78}, + {"label": "Nav", "x": 6.5, "y": 4.14}, + + + {"label": "Sym", "x": 8, "y": 4.14}, + {"label": "Space", "x": 9, "y": 3.78}, + {"label": "Alt", "x": 10, "y": 3.42}, + {"label": "Gui", "x": 11, "y": 3.28}, + {"label": "App", "x": 12.5, "y": 3.31} + ] + } } } diff --git a/keyboards/handwired/hillside/0_1/keymaps/default/keymap.json b/keyboards/handwired/hillside/0_1/keymaps/default/keymap.json new file mode 100644 index 0000000000..c5837a16fb --- /dev/null +++ b/keyboards/handwired/hillside/0_1/keymaps/default/keymap.json @@ -0,0 +1,101 @@ +{ "version": 1, + "notes": "", + "documentation": "\"This file is a QMK Configurator export. You can import this at . It can also be used directly with QMK's source code.\n\nTo setup your QMK environment check out the tutorial: \n\nYou can convert this file to a keymap.c using this command: `qmk json2c {keymap}`\n\nYou can compile this keymap using this command: `qmk compile {keymap}`\"\n", + "keyboard": "handwired/hillside/0_1", + "keymap": "default", + "layout": "LAYOUT", + "layers": [ + ["KC_TAB" , "KC_Q" , "KC_W" , "KC_E" , "KC_R" , "KC_T", + "KC_Y" , "KC_U" , "KC_I" , "KC_O" , "KC_P" , "KC_BSPC", + + "KC_CAPS", "KC_A" , "KC_S" , "KC_D" , "KC_F" , "KC_G", + "KC_H" , "KC_J" , "KC_K" , "KC_L" , "KC_SCLN" , "KC_ENT", + + "KC_LSFT", "KC_Z" , "KC_X" , "KC_C" , "KC_V" , "KC_B" , "KC_GRV", + "KC_ESC" , "KC_N" , "KC_M" , "KC_COMM" , "KC_DOT" , "KC_SLSH" , "KC_RSFT", + + "KC_LCTL", "KC_LGUI" , "KC_LALT" , "MO(5)" , "MO(3)", + "MO(4)" , "KC_SPC" , "KC_LALT" , "KC_RGUI" , "KC_QUOT" + + ], + ["KC_TAB" , "KC_QUOT" , "KC_COMM" , "KC_DOT" , "KC_P" , "KC_Y", + "KC_F" , "KC_G" , "KC_C" , "KC_R" , "KC_L" , "KC_BSPC", + + "KC_CAPS", "KC_A" , "KC_O" , "KC_E" , "KC_U" , "KC_I", + "KC_D" , "KC_H" , "KC_T" , "KC_N" , "KC_S" , "KC_ENT", + + "KC_LSFT", "KC_SCLN" , "KC_Q" , "KC_J" , "KC_K" , "KC_X" , "KC_GRV", + "KC_ESC" , "KC_B" , "KC_M" , "KC_W" , "KC_V" , "KC_Z" , "KC_RSFT", + + "KC_LCTL", "KC_LGUI" , "KC_LALT" , "MO(5)" , "MO(3)", + "MO(4)" , "KC_SPC" , "KC_LALT" , "KC_RGUI" , "KC_SLSH" + + ], + ["KC_TAB" , "KC_Q" , "KC_W" , "KC_F" , "KC_P" , "KC_B", + "KC_J" , "KC_L" , "KC_U" , "KC_Y" , "KC_SCLN" , "KC_BSPC", + + "KC_CAPS", "KC_A" , "KC_R" , "KC_S" , "KC_T" , "KC_G", + "KC_M" , "KC_N" , "KC_E" , "KC_I" , "KC_O" , "KC_ENT", + + "KC_LSFT", "KC_Z" , "KC_X" , "KC_C" , "KC_D" , "KC_V" , "KC_GRV", + "KC_ESC" , "KC_K" , "KC_H" , "KC_COMM" , "KC_DOT" , "KC_SLSH" , "KC_RSFT", + + "KC_LCTL", "KC_LGUI" , "KC_LALT" , "MO(5)" , "MO(3)", + "MO(4)" , "KC_SPC" , "KC_LALT" , "KC_RGUI" , "KC_QUOT" + + ], + ["KC_NO" , "KC_INS" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_VOLU", + "KC_PGUP", "KC_HOME" , "KC_NO" , "KC_END" , "KC_NO" , "KC_DEL", + + "KC_NO" , "KC_LGUI" , "KC_LALT" , "KC_LCTL" , "KC_LSFT" , "KC_VOLD", + "KC_PGDN", "KC_LEFT" , "KC_UP" , "KC_RGHT" , "KC_NO" , "KC_TRNS", + + "KC_LSFT", "LCTL(KC_Z)" , "LCTL(KC_X)" , "LCTL(KC_C)", "LCTL(KC_V)" , "LCTL(KC_Y)", "KC_MUTE", + "KC_ESC" , "OSM(MOD_RALT)", "LCTL(KC_LEFT)", "KC_DOWN" , "LCTL(KC_RGHT)", "KC_APP" , "KC_TRNS", + + "KC_TRNS", "KC_TRNS" , "KC_TRNS" , "KC_TRNS" , "KC_TRNS", + "MO(6)" , "KC_BSPC" , "KC_TRNS" , "KC_TRNS" , "KC_RCTL" + + ], + ["KC_F11" , "KC_EXLM" , "KC_AT" , "KC_HASH" , "KC_DLR" , "KC_PERC", + "KC_CIRC", "KC_AMPR" , "KC_ASTR" , "KC_LPRN" , "KC_RPRN" , "KC_TRNS", + + "KC_F12" , "KC_F1" , "KC_F2" , "KC_F3" , "KC_F4" , "KC_F5", + "KC_PIPE", "KC_LSFT" , "KC_LCTL" , "KC_LALT" , "KC_LGUI" , "KC_TRNS", + + "KC_LSFT", "KC_F6" , "KC_F7" , "KC_F8" , "KC_F9" , "KC_F10" , "KC_PSCR", + "KC_ESC" , "KC_BSLS" , "KC_LBRC" , "KC_RBRC" , "KC_LCBR" , "KC_RCBR" , "KC_TRNS", + + "KC_TRNS", "KC_TRNS" , "KC_TRNS" , "KC_TRNS" , "MO(6)", + "KC_TRNS", "KC_TRNS" , "KC_TRNS" , "KC_TRNS" , "KC_RCTL" + + ], + ["KC_TAB" , "KC_MINS" , "KC_PLUS" , "KC_EQL" , "KC_SLSH" , "KC_ASTR", + "KC_COMM", "KC_7" , "KC_8" , "KC_9" , "KC_NO" , "KC_TRNS", + + "KC_NO" , "KC_LGUI" , "KC_LALT" , "KC_LCTL" , "KC_LSFT" , "KC_NO", + "KC_0" , "KC_1" , "KC_2" , "KC_3" , "KC_UNDS" , "KC_TRNS", + + "KC_TRNS", "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO", + "KC_NO" , "KC_DOT" , "KC_4" , "KC_5" , "KC_6" , "KC_NO" , "KC_TRNS", + + "KC_TRNS", "KC_TRNS" , "KC_TRNS" , "KC_TRNS" , "KC_NO", + "KC_NO" , "KC_BSPC" , "KC_TRNS" , "KC_TRNS" , "KC_RCTL" + + ], + ["KC_NO" , "DF(0)" , "DF(1)" , "DF(2)" , "AG_SWAP" , "AG_NORM", + "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO", + + "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "CL_SWAP" , "CL_NORM", + "RGB_MOD", "RGB_VAI" , "RGB_HUI" , "RGB_SAI" , "KC_NO" , "KC_NO", + + "RESET" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO", + "RGB_TOG", "RGB_RMOD" , "RGB_VAD" , "RGB_HUD" , "RGB_SAD" , "KC_NO" , "KC_NO", + + "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_TRNS", + "KC_TRNS", "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" + + ] + ], + "author": "@mmccoyd" +} diff --git a/keyboards/handwired/hillside/0_1/keymaps/default/readme.md b/keyboards/handwired/hillside/0_1/keymaps/default/readme.md new file mode 100644 index 0000000000..ae4a5c5648 --- /dev/null +++ b/keyboards/handwired/hillside/0_1/keymaps/default/readme.md @@ -0,0 +1,212 @@ +# Default Keymap + +This default keymap follows many of the norms seen in non-programmable keyboards + to ease initial use of the Hillside keyboard. +It is a starting point for you to tweak over time to better suit _your_ preferences. +You can easily customize it with the + [QMK configurator](https://config.qmk.fm/#/hillside/0_1/LAYOUT) + or with the [via firmware](https://caniusevia.com). + +Some of its key features are: +- A mostly standard base layer with letters, some symbols, shift, modifier and delete keys + in the expected places for non-programmable keyboards. +- QWERTY, Colemak-DH and Dvorak options for the letter and symbol layout. +- Comfortable modifier and function or symbol combinations on the non-base layers + using modifiers on the home row of the navigation/edit, symbol/function and number-pad layers. +- Word navigation and cut/copy/paste keys on the navigation layer. +- A slightly optimized number pad with the more frequently used numbers on the home row. + +We've deliberately omitted some features: +- Combos: because the online configuration tools do not handle them + and because they would add to the initial learning curve, + as helpful to a keymap as a light sprinkling of combos can be. +- Multi-function mod-tap keys, auto shift capitalization and auto-exit modes such as CAPWORD or NUMWORD: + as they may be too large a step for someone new to programmable keyboards. + +## Base Layer + +``` +| TAB | Q | W | E | R | T |---------------------------| Y | U | I | O | P | BKSPC | +| CAPS | A | S | D | F | G |---------------------------| H | J | K | L | ; | ENTER | +| SHIFT | Z | X | C | V | B | ~ |---------------| ESC | N | M | , | . | / | SHIFT | +--------------|CTRL |-----| GUI | ALT | Num | Nav |---| Sym |SPACE| ALT | GUI |-----| ' |-------------- +``` + +The base layer provides a very standard key layout: + +- Return, Tab, backspace and shift keys in the outer columns. +- Alt/option and win/command keys on both thumbs, with the location swappable for windows or mac. +- A space key on the right thumb. + +The differences from a standard layout are: + +- There are three additional "shift" keys + to access the navigation/editing, symbol/function, and number layers. +- Esc and `~ are above the thumbs. +- The Menu and AltGr keys are on a layer. + +The default layout is QWERTY with alternatives of Dvorak and Colemak-DH +and the alt/option and win/command key locations are swappable for windows or mac. + +
+Details of Dvorak and Colemak-DH +The Dvorak and Colemak-DH base layers + have identical non-alpha and non-symbol keys as the QWERTY base layer. +In the Dvorak layout, the symbol key in the bottom row is the "/?" symbols + so that the same 12 symbols are taken care of on the base layer. + +``` +Dvorak +| TAB | ' | , | . | P | Y |---------------------------| F | G | C | R | L | BKSPC | +| CAPS | A | O | E | U | I |---------------------------| D | H | T | N | S | ENTER | +| SHIFT | ; | Q | J | K | X | ~ |---------------| ESC | B | M | W | V | Z | SHIFT | +--------------|CTRL |-----| GUI | ALT | Num | Nav |---| Sym |SPACE| ALT | GUI |-----| / |-------------- + +Colemak-DH +| TAB | Q | W | F | P | B |---------------------------| J | L | U | Y | ; | BKSPC | +| CAPS | A | R | S | T | G |---------------------------| M | N | E | I | O | ENTER | +| SHIFT | Z | X | C | D | V | ~ |---------------| ESC | K | H | , | . | / | SHIFT | +--------------|CTRL |-----| GUI | ALT | Num | Nav |---| Sym |SPACE| ALT | GUI |-----| ' |-------------- +``` +
+ +## Navigation, Editing and Media Layer + +``` +| | INS | | | |VOL+ |---------------------------|PG_UP|HOME | | END| | DEL | +| | GUI | ALT |CTRL |SHIFT|VOL- |---------------------------|PG_DN|LEFT | UP |RIGHT| | ENTER | +| SHIFT |UNDO | CUT |COPY |PASTE|REDO |MUTE |---------------| ESC |RALT |WORDL|DOWN |WORDR|MENU | SHIFT | +--------------|CTRL |-----| GUI | ALT | Num | *** |---| Adj |BSPC | ALT | GUI |-----|CTRL |-------------- +``` +Holding down the Nav key accesses a navigation and editing layer: + +- Navigation arrows are on and below the right home row in a cross pattern. + This feels more natural for a column stagger keyboard than an inverted T. + The keys below that move left or right by a word. + Home, end, and page up/down are beside them. +- Modifiers in the left home row make it easier to use the arrows + to select text with the shift key or move between desktops or tabs. +- Editing keys appear on the lower left. + The edit keys, modifiers and arrows make it easy to move text around without leaving the layer. +- Delete is in the upper right, and a backspace key is on the thumb. +- The base layer modifiers and escape are in the same spots as on the base layer, + and a right-hand control key is added. +- Media volume and play keys are on the left, accessible with one hand. +- Menu and AltGr keys fill out the layer. +- A few keys do nothing and are available for more user-specific needs. + +## Symbol and Function Layer + +``` +| F11 | ! | @ | # | $ | % |---------------------------| ^ | & | * | ( | ) | BSPC | +| F12 | F1 | F2 | F3 | F4 | F5 |---------------------------| | |SHIFT|CTRL | ALT | GUI | ENTER | +| SHIFT | F6 | F7 | F8 | F9 | F10 |PRTSC|---------------| ESC | \ | [ | ] | { | } | SHIFT | +--------------|CTRL |-----| GUI | ALT | Num | Adj |---| *** |SPACE| ALT | GUI |-----|CTRL |-------------- +``` +Holding down the Sym key accesses a layer of symbol and function keys: + +- The symbols usually found on the number keys are in the top row. + If desired, you can use these positions for other things, + as the symbols are also accessible from the number pad layer with the shift key. +- Several more symbols appear on the right. +- The function keys are on the left, beginning with two rows of five. +- A row of modifiers in the home row allows the comfortable creation of any modifier and function key combination. +- The base layer modifier and escape keys are still available, as is a right-hand control key. + +## Number Pad and Algebraic Layer +``` +| TAB | - | + | = | / | * |---------------------------| . | 7 | 8 | 9 | | BSPC | +| | GUI | ALT |CTRL |SHIFT| |---------------------------| 0 | 1 | 2 | 3 | _ | ENTER | +| SHIFT | | | | | | |---------------| ESC | , | 4 | 5 | 6 | | SHIFT | +--------------|CTRL |-----| GUI | ALT | *** | |---| |BSPC | ALT | GUI |-----|CTRL |-------------- +``` +Holding down the Num key accesses a number pad and arithmetic symbols: + +- The number pad has the lowest numbers swapped into the home row as these are the most commonly used. +- A row of modifiers in the home row allows the comfortable creation of any modifier and number combination. +- Symbols commonly used with numbers fill out the layer + and can be combined with the home row mods or the existing base layer modifiers on the right hand. +- Several keys remain unused and await more user-specific needs. + + +## Adjust Layer +``` +| |QWERT|DVORK|COLMK|AG_SWAP|AG_NORM|-----------------------| | | | | | | +| | | | |CTR_S|CTR_N|---------------------------|MOD+ |BRI+ |HUE+ |SAT+ | | | +| RESET | | | | | | |--------------|RGBTOG|MOD- |BRI- |HUE- |SAT- | | | +--------------| |-----| | | | *** |---| *** | | | |-----| |-------------- +``` +Simultaneously holding down the Nav and Sym keys enables keys to adjust various keyboard settings: + +- The base layer can be set to QWERTY, Colemak-DH or Dvorak, + but the keyboard reverts to QWERTY each time it is plugged in. +- Alt/option and GUI/command can be swapped for mac users or restored to the windows norm. + This setting persists over power loss. +- The backlight LEDs can be enabled, disabled, and controlled. + These settings also persist over power loss. + + +## Make it Yours + +If you are coming from a traditional keyboard, + with a row-staggered layout and a large set of physical keys, + learning to use a column staggered (ergo) and layer-based keyboard, + which uses layers instead of finger reaches to access numbers, symbols and functions, + will be an adjustment for your muscle memory and your mental keyboard map. +This default layout tries to simplify that adjustment by keeping things in the expected spots when possible. + +Yet this layout is only a decent compromise and is not optimal for each user. + +The online configurator makes it easy to tweak this layout to your needs. +You can add additional layers or completely switch around what these do. + +Some changes you might consider making: +- Put some of your most-used key combinations on the unused keys on the navigation layer. +- If you are on a mac, switch the editing and word navigation keys from ctrl-x to cmd-x. +- Change the shift keys to one-shot shift keys, + where pressing and releasing them shifts the next key pressed. + That is much easier on your hands than holding them down. + Yet, they can still be held as usual if desired. +- Instead of holding down the thumb key to keep the symbol layer active, + you could use a one-shot layer key. + One-shot modifiers are likely less stress on your hands and may even be faster. + You would still be able to hold it down instead. +- Instead of holding down the key for the number pad layer, + you could make it a layer toggle, like caps lock is a capitalization toggle key. + +Here are some other keymaps for inspiration and ideas: +- The [Ferris default](https://github.com/qmk/qmk_firmware/tree/master/keyboards/ferris/keymaps/default) uses more advanced features as it has far fewer keys to work with. +- The [Miryoku](https://github.com/manna-harbour/miryoku/tree/master/docs/reference) keymap ensures that all modifiers are comfortably available with each character key. +- The [Kyria default](https://github.com/qmk/qmk_firmware/tree/master/keyboards/splitkb/kyria/keymaps/default) has different keymap choices and a couple more keys. + +A good metaphor is to think of your keymap as a bonsai tree that you tweak slightly over time + in response to ideas of how it might serve you better. + + +## Why no keymap.c + +Via and the online configurator provide straightforward visual ways to work with a simple layout, + and both use a .json keymap format. +So this default ```keymap.json``` was created with the online configurator + and formatted for easier reading and editing. + +If you wish, you can edit the ```keymap.json``` directly in a text editor, optionally use the below ```json2hill.py``` to restore the spacing, and then compile and flash it. + +Or, you can use the graphical configurator to edit the keymap. To do that: + +- Open the [QMK configurator](https://config.qmk.fm/#/handwired/hillside/LAYOUT) +- Using the green up arrow button, load the keymap from ```qmk_firmware/keyboards/handwired/hillside/keymaps/default/keymap.json``` +- Make the changes you wish to the layout +- Save the keymap using the green down arrow button. +- Copy those changes back into your QMK repository and reformat for easy reading using the format script: +``` +./keyboards/handwired/hillside/0_1/keymaps/json2hill.py --input /default.json > ./keyboards/handwired/hillside/0_1/keymaps/default/keymap.json +``` + You may need to make that script executable with ```chmod +x```. After your keymap is safely copied and formated, you may want to remove the keymap from your download directory so later downloads will automatically receive the same file name. + +After either method of editing, compile and flash the keymap as usual. + +You can combine a .json based keymap with more advanced features specified in .c files + with a bit more complexity. +For example, see +[pierrec83's Kyria map](https://github.com/qmk/qmk_firmware/tree/master/keyboards/splitkb/kyria/keymaps/pierrec83). diff --git a/keyboards/handwired/hillside/0_1/keymaps/json2hill.py b/keyboards/handwired/hillside/0_1/keymaps/json2hill.py new file mode 100755 index 0000000000..a9971c0d78 --- /dev/null +++ b/keyboards/handwired/hillside/0_1/keymaps/json2hill.py @@ -0,0 +1,136 @@ +#!/usr/bin/env python3 + +# Copyright 2020-2021 Pierre Viseu Chevalier, Michael McCoyd (@pierrechevalier83, @mmccoyd) +# SPDX-License-Identifier: GPL-2.0-or-later + +"""Pretty print keymap json in more readable row/side organized format.""" + +import argparse +import json +import sys +from typing import NamedTuple + +"""Print keymap json in row and side format, though as still re-readable json. + +For example, for one layer: + + ["KC_TAB" , "KC_Q" , "KC_W" , "KC_E" , "KC_R" , "KC_T", + "KC_Y" , "KC_U" , "KC_I" , "KC_O" , "KC_P" , "KC_BSPC", + + "KC_LCTL", "KC_A" , "KC_S" , "KC_D" , "KC_F" , "KC_G", + "KC_H" , "KC_J" , "KC_K" , "KC_L" , "KC_SCLN", "KC_QUOT", + + "KC_LSFT", "KC_Z" , "KC_X" , "KC_C" , "KC_V" , "KC_B" , "KC_GRV", + "KC_ESC" , "KC_N" , "KC_M" , "KC_COMM", "KC_DOT" , "KC_SLSH", "KC_RSFT", + + "KC_ENT" , "KC_LGUI", "KC_LALT", "MO(5)" , "MO(3)", + "MO(4)" , "KC_SPC" , "KC_LALT", "KC_RGUI", "KC_APP" + ], +""" + +indent_level=4 # number of spaces of initial indent per output line + +# The structure of the keymap +# [[Endpoint of sides with identical widths, side width, mapping to column],...] +KEYS_TO_COL = [[24, 6, lambda n: n % 6], + [38, 7, lambda n: (n - 24) % 7], + [48, 5, lambda n: (n - 38) % 5]] +LAST_KEY = KEYS_TO_COL[-1][0] - 1 + +def parse_cli(): + parser = argparse.ArgumentParser(description='Hillside keymap formatter') + parser.add_argument("--input", type=argparse.FileType('r'), + default=sys.stdin, help="Input keymap " + "(json file produced by qmk configurator)") + return parser.parse_args() + +class Column(NamedTuple): + """Column number within keymap side, if it ends side, and ends row. + + Position within a keyboard row runs from 0 to n and again 0 to n""" + num: int + ends_side: bool + ends_row: bool + +def get_col(key_index): + """Return Column for key_index.""" + for keys, num_cols, col_fn in KEYS_TO_COL: + if key_index < keys: + col_num = col_fn(key_index) + return Column(col_num, + ends_side=col_num == num_cols - 1, + ends_row=(keys - 1 - key_index) % (2 * num_cols) == 0) + +def format_layers(layers): + formatted = indent_level * " " + "\"layers\": [\n" + + # Find max key length per column + max_key_length = {} + for layer in layers: + for (index, keycode) in enumerate(layer): + col = get_col(index) + max_length = max_key_length.get(col.num) + if (not max_length) or len(keycode) > max_length: + max_key_length.update({col.num: len(keycode)}) + # Format each layer + for (layer_index, layer) in enumerate(layers): + # Opening [ + formatted += 2 * indent_level * " " + formatted += "[" + + # Split keys into pairs of left and right rows by key row length + for (index, keycode) in enumerate(layer): + col = get_col(index) + + # Indent for rows past first + if col.num == 0 and index != 0: + formatted += (1 + 2 * indent_level) * " " + + # Print key + formatted += json.dumps(keycode) + + # End layer, or end side, or space to next key + if index == LAST_KEY: + formatted += "\n" + elif col.ends_side: + formatted += ",\n" + else: + n_spaces = max_key_length[get_col(index).num] - len(keycode) + formatted += n_spaces * " " + formatted += ", " + + # Split groups of row sides + if col.ends_row: + formatted += "\n" + + # Closing ] with , or without + formatted += 2 * indent_level * " " + if layer_index < len(layers) - 1: + formatted += "],\n" + else: + formatted += "]\n" + + formatted += indent_level * " " + formatted += "]" + + return formatted + +def format_keymap(keymap_json): + formatted = "{" + for (index, k) in enumerate(keymap_json): + if k == "layers": + formatted += format_layers(keymap_json[k]) + else: + formatted += f"{indent_level * ' '}{json.dumps(k)}: {json.dumps(keymap_json[k])}" + if index < len(keymap_json) - 1: + formatted += "," + formatted += "\n" + formatted += "}" + return formatted + +def main(): + args=parse_cli() + keymap_json = json.loads(args.input.read()) + print(format_keymap(keymap_json)) + +main() diff --git a/keyboards/handwired/hillside/0_1/keymaps/via/keymap.json b/keyboards/handwired/hillside/0_1/keymaps/via/keymap.json new file mode 100644 index 0000000000..a015f0241c --- /dev/null +++ b/keyboards/handwired/hillside/0_1/keymaps/via/keymap.json @@ -0,0 +1,61 @@ +{ "version": 1, + "notes": "", + "keyboard": "handwired/hillside/0_1", + "keymap": "via", + "layout": "LAYOUT", + "layers": [ + ["KC_TAB" , "KC_Q" , "KC_W" , "KC_E" , "KC_R" , "KC_T", + "KC_Y" , "KC_U" , "KC_I" , "KC_O" , "KC_P" , "KC_BSPC", + + "KC_CAPS" , "KC_A" , "KC_S" , "KC_D" , "KC_F" , "KC_G", + "KC_H" , "KC_J" , "KC_K" , "KC_L" , "KC_SCLN", "KC_ENT", + + "KC_LSFT" , "KC_Z" , "KC_X" , "KC_C" , "KC_V" , "KC_B" , "KC_GRV", + "KC_ESC" , "KC_N" , "KC_M" , "KC_COMM", "KC_DOT" , "KC_SLSH", "KC_RSFT", + + "KC_LCTL" , "KC_LGUI", "KC_LALT", "MO(3)" , "MO(1)", + "MO(2)" , "KC_SPC" , "KC_LALT", "KC_RGUI", "KC_QUOT" + + ], + ["KC_NO" , "KC_INS" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_VOLU", + "KC_PGUP" , "KC_HOME", "KC_NO" , "KC_END" , "KC_NO" , "KC_DEL", + + "KC_NO" , "KC_LGUI", "KC_LALT", "KC_LCTL", "KC_LSFT", "KC_VOLD", + "KC_PGDN" , "KC_LEFT", "KC_UP" , "KC_RGHT", "KC_NO" , "KC_TRNS", + + "KC_LSFT" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_MUTE", + "KC_ESC" , "KC_CAPS", "KC_NO" , "KC_DOWN", "KC_NO" , "KC_APP" , "KC_TRNS", + + "KC_TRNS" , "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", + "KC_TRNS" , "KC_BSPC", "KC_TRNS", "KC_TRNS", "KC_RCTL" + + ], + ["KC_F11" , "KC_EXLM", "KC_AT" , "KC_HASH", "KC_DLR" , "KC_PERC", + "KC_CIRC" , "KC_AMPR", "KC_ASTR", "KC_LPRN", "KC_RPRN", "KC_TRNS", + + "KC_F12" , "KC_F1" , "KC_F2" , "KC_F3" , "KC_F4" , "KC_F5", + "KC_PIPE" , "KC_LSFT", "KC_LCTL", "KC_LALT", "KC_LGUI", "KC_TRNS", + + "KC_LSFT" , "KC_F6" , "KC_F7" , "KC_F8" , "KC_F9" , "KC_F10" , "KC_PSCR", + "KC_ESC" , "KC_BSLS", "KC_LBRC", "KC_RBRC", "KC_LCBR", "KC_RCBR", "KC_TRNS", + + "KC_TRNS" , "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", + "KC_TRNS" , "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_RCTL" + + ], + ["KC_TAB" , "KC_MINS", "KC_PLUS", "KC_EQL" , "KC_SLSH", "KC_ASTR", + "KC_COMM" , "KC_7" , "KC_8" , "KC_9" , "KC_NO" , "KC_TRNS", + + "ANY(RGB_TOG)", "KC_LGUI", "KC_LALT", "KC_LCTL", "KC_LSFT", "KC_NO", + "KC_0" , "KC_1" , "KC_2" , "KC_3" , "KC_UNDS", "KC_TRNS", + + "KC_TRNS" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO", + "KC_NO" , "KC_DOT" , "KC_4" , "KC_5" , "KC_6" , "KC_NO" , "KC_TRNS", + + "KC_TRNS" , "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_NO", + "KC_NO" , "KC_BSPC", "KC_TRNS", "KC_TRNS", "KC_RCTL" + + ] + ], + "author": "@mmccoyd" +} diff --git a/keyboards/handwired/hillside/0_1/readme.md b/keyboards/handwired/hillside/0_1/readme.md new file mode 100644 index 0000000000..f1ff0f8506 --- /dev/null +++ b/keyboards/handwired/hillside/0_1/readme.md @@ -0,0 +1,29 @@ +# Hillside + +![hillside](https://imgur.com/XW0rX13.png) + +[Hillside](https://github.com/mmccoyd/hillside) + is a split ergonomic keyboard + with 3x6+4+2 choc-spaced keys with aggressive column stagger, + a longer thumb arc and a breakoff outer-pinky column. + +* Keyboard Maintainer: [Michael McCoyd](https://github.com/mmccoyd) +* Hardware Supported: ProMicro/Elite-C and compatible +* Hardware Availability: https://github.com/mmccoyd/hillside + +Make example for this keyboard (after setting up your build environment): + + make handwired/hillside/0_1:default + +Flashing example for this keyboard: + + make handwired/hillside/0_1:default:flash + +## Bootloader + +Enter the bootloader by either: + +* **Physical reset button**: Briefly press the button on the front of the PCB. +* **Keycode in layout**: Press the key mapped to `RESET` if it is available + +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). diff --git a/keyboards/handwired/hillside/info.json b/keyboards/handwired/hillside/info.json index 7a29df1c64..781b43c0ff 100644 --- a/keyboards/handwired/hillside/info.json +++ b/keyboards/handwired/hillside/info.json @@ -2,96 +2,5 @@ "manufacturer": "mmccoyd", "maintainer": "mmccoyd", - "keyboard_name": "Hillside", - "url": "http://github.com/mmccoyd/hillside/", - - "tags": ["split", "column stagger", "choc v1", "choc spaced" ], - - "processor": "atmega32u4", - - "features": { - "encoder": true, - "extrakey": true, - "rgblight": true - }, - "split": { - "soft_serial_pin": "D2", - "main": "left" - }, - - "rgblight": { - "led_count": 5, - "pin": "D3", - "split": true, - "hue_steps": 8, - "saturation_steps": 8, - "brightness_steps": 8 - }, - - "layouts": { - "LAYOUT": { - "layout": [ - - {"label": "Tab", "x": 0, "y": 0.93}, - {"label": "Q", "x": 1, "y": 0.93}, - {"label": "W", "x": 2, "y": 0.31}, - {"label": "E", "x": 3, "y": 0}, - {"label": "R", "x": 4, "y": 0.28}, - {"label": "T", "x": 5, "y": 0.42}, - - {"label": "Y", "x": 9.5, "y": 0.42}, - {"label": "U", "x": 10.5, "y": 0.28}, - {"label": "I", "x": 11.5, "y": 0}, - {"label": "O", "x": 12.5, "y": 0.31}, - {"label": "P", "x": 13.5, "y": 0.93}, - {"label": "Backspace", "x": 14.5, "y": 0.93}, - - - {"label": "Ctrl", "x": 0, "y": 1.93}, - {"label": "A", "x": 1, "y": 1.93}, - {"label": "S", "x": 2, "y": 1.31}, - {"label": "D", "x": 3, "y": 1}, - {"label": "F", "x": 4, "y": 1.28}, - {"label": "G", "x": 5, "y": 1.42}, - - {"label": "H", "x": 9.5, "y": 1.42}, - {"label": "J", "x": 10.5, "y": 1.28}, - {"label": "K", "x": 11.5, "y": 1}, - {"label": "L", "x": 12.5, "y": 1.31}, - {"label": ";", "x": 13.5, "y": 1.93}, - {"label": "'", "x": 14.5, "y": 1.93}, - - - {"label": "Shift", "x": 0, "y": 2.93}, - {"label": "Z", "x": 1, "y": 2.93}, - {"label": "X", "x": 2, "y": 2.31}, - {"label": "C", "x": 3, "y": 2}, - {"label": "V", "x": 4, "y": 2.28}, - {"label": "B", "x": 5, "y": 2.42}, - {"label": "`", "x": 6, "y": 2.78}, - - {"label": "Esc", "x": 8.5, "y": 2.78}, - {"label": "N", "x": 9.5, "y": 2.42}, - {"label": "M", "x": 10.5, "y": 2.28}, - {"label": ",", "x": 11.5, "y": 2}, - {"label": ".", "x": 12.5, "y": 2.31}, - {"label": "/", "x": 13.5, "y": 2.93}, - {"label": "Shift", "x": 14.5, "y": 2.93}, - - - {"label": "Enter", "x": 2, "y": 3.31}, - {"label": "Gui", "x": 3.5, "y": 3.28}, - {"label": "Alt", "x": 4.5, "y": 3.42}, - {"label": "Num", "x": 5.5, "y": 3.78}, - {"label": "Nav", "x": 6.5, "y": 4.14}, - - - {"label": "Sym", "x": 8, "y": 4.14}, - {"label": "Space", "x": 9, "y": 3.78}, - {"label": "Alt", "x": 10, "y": 3.42}, - {"label": "Gui", "x": 11, "y": 3.28}, - {"label": "App", "x": 12.5, "y": 3.31} - ] - } - } + "url": "http://github.com/mmccoyd/hillside/" } diff --git a/keyboards/handwired/hillside/keymaps/default/keymap.json b/keyboards/handwired/hillside/keymaps/default/keymap.json deleted file mode 100644 index f5871b073f..0000000000 --- a/keyboards/handwired/hillside/keymaps/default/keymap.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "version": 1, - "notes": "", - "documentation": "\"This file is a QMK Configurator export. You can import this at . It can also be used directly with QMK's source code.\n\nTo setup your QMK environment check out the tutorial: \n\nYou can convert this file to a keymap.c using this command: `qmk json2c {keymap}`\n\nYou can compile this keymap using this command: `qmk compile {keymap}`\"\n", - "keyboard": "handwired/hillside/0_1", - "author": "@mmccoyd", - "keymap": "default", - "layout": "LAYOUT", - "layers": [ - ["KC_TAB" , "KC_Q" , "KC_W" , "KC_E" , "KC_R" , "KC_T", - "KC_Y" , "KC_U" , "KC_I" , "KC_O" , "KC_P" , "KC_BSPC", - - "KC_LCTL", "KC_A" , "KC_S" , "KC_D" , "KC_F" , "KC_G", - "KC_H" , "KC_J" , "KC_K" , "KC_L" , "KC_SCLN" , "KC_QUOT", - - "KC_LSFT", "KC_Z" , "KC_X" , "KC_C" , "KC_V" , "KC_B" , "KC_GRV", - "KC_ESC" , "KC_N" , "KC_M" , "KC_COMM" , "KC_DOT" , "KC_SLSH" , "KC_RSFT", - - "KC_ENT" , "KC_LGUI" , "KC_LALT" , "MO(5)" , "MO(3)", - "MO(4)" , "KC_SPC" , "KC_LALT" , "KC_RGUI" , "KC_APP" - - ], - ["KC_TAB" , "KC_QUOT" , "KC_COMM" , "KC_DOT" , "KC_P" , "KC_Y", - "KC_F" , "KC_G" , "KC_C" , "KC_R" , "KC_L" , "KC_BSPC", - - "KC_LCTL", "KC_A" , "KC_O" , "KC_E" , "KC_U" , "KC_I", - "KC_D" , "KC_H" , "KC_T" , "KC_N" , "KC_S" , "KC_SLSH", - - "KC_LSFT", "KC_SCLN" , "KC_Q" , "KC_J" , "KC_K" , "KC_X" , "KC_GRV", - "KC_ESC" , "KC_B" , "KC_M" , "KC_W" , "KC_V" , "KC_Z" , "KC_RSFT", - - "KC_ENT" , "KC_LGUI" , "KC_LALT" , "MO(5)" , "MO(3)", - "MO(4)" , "KC_SPC" , "KC_LALT" , "KC_RGUI" , "KC_APP" - - ], - ["KC_TAB" , "KC_Q" , "KC_W" , "KC_F" , "KC_P" , "KC_B", - "KC_J" , "KC_L" , "KC_U" , "KC_Y" , "KC_SCLN" , "KC_BSPC", - - "KC_LCTL", "KC_A" , "KC_R" , "KC_S" , "KC_T" , "KC_G", - "KC_M" , "KC_N" , "KC_E" , "KC_I" , "KC_O" , "KC_QUOT", - - "KC_LSFT", "KC_Z" , "KC_X" , "KC_C" , "KC_D" , "KC_V" , "KC_GRV", - "KC_ESC" , "KC_K" , "KC_H" , "KC_COMM" , "KC_DOT" , "KC_SLSH" , "KC_RSFT", - - "KC_ENT" , "KC_LGUI" , "KC_LALT" , "MO(5)" , "MO(3)", - "MO(4)" , "KC_SPC" , "KC_LALT" , "KC_RGUI" , "KC_APP" - - ], - ["KC_CAPS", "KC_INS" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_VOLU", - "KC_PGUP", "KC_HOME" , "KC_NO" , "KC_END" , "KC_NO" , "KC_DEL", - - "KC_LCTL", "KC_LGUI" , "KC_LALT" , "KC_LCTL" , "KC_LSFT" , "KC_VOLD", - "KC_PGDN", "KC_LEFT" , "KC_UP" , "KC_RGHT" , "KC_NO" , "KC_RCTL", - - "KC_LSFT", "LCTL(KC_Z)", "LCTL(KC_X)" , "LCTL(KC_C)", "LCTL(KC_V)" , "LCTL(KC_Y)", "KC_MUTE", - "KC_ESC" , "KC_NO" , "LCTL(KC_LEFT)", "KC_DOWN" , "LCTL(KC_RGHT)", "KC_RALT" , "KC_RSFT", - - "KC_TRNS", "KC_TRNS" , "KC_TRNS" , "KC_TRNS" , "KC_TRNS", - "MO(6)" , "KC_BSPC" , "KC_TRNS" , "KC_TRNS" , "KC_TRNS" - - ], - ["KC_F12" , "KC_EXLM" , "KC_AT" , "KC_HASH" , "KC_DLR" , "KC_PERC", - "KC_CIRC", "KC_AMPR" , "KC_ASTR" , "KC_LPRN" , "KC_RPRN" , "KC_BSPC", - - "KC_LCTL", "KC_F1" , "KC_F2" , "KC_F3" , "KC_F4" , "KC_F5", - "KC_PIPE", "KC_LSFT" , "KC_LCTL" , "KC_LALT" , "KC_LGUI" , "KC_RCTL", - - "KC_LSFT", "KC_F6" , "KC_F7" , "KC_F8" , "KC_F9" , "KC_F10" , "KC_F11", - "KC_ESC" , "KC_BSLS" , "KC_LBRC" , "KC_RBRC" , "KC_LCBR" , "KC_RCBR" , "KC_RSFT", - - "KC_TRNS", "KC_TRNS" , "KC_TRNS" , "KC_TRNS" , "MO(6)", - "KC_TRNS", "KC_TRNS" , "KC_TRNS" , "KC_TRNS" , "KC_TRNS" - - ], - ["KC_NO" , "KC_MINS" , "KC_PLUS" , "KC_EQL" , "KC_SLSH" , "KC_ASTR", - "KC_COMM", "KC_7" , "KC_8" , "KC_9" , "KC_NO" , "KC_TRNS", - - "KC_TRNS", "KC_LGUI" , "KC_LALT" , "KC_LCTL" , "KC_LSFT" , "KC_NO", - "KC_0" , "KC_1" , "KC_2" , "KC_3" , "KC_UNDS" , "KC_RCTL", - - "KC_TRNS", "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO", - "KC_NO" , "KC_DOT" , "KC_4" , "KC_5" , "KC_6" , "KC_NO" , "KC_TRNS", - - "KC_TRNS", "KC_TRNS" , "KC_TRNS" , "KC_TRNS" , "KC_NO", - "KC_NO" , "KC_BSPC" , "KC_TRNS" , "KC_TRNS" , "KC_TRNS" - - ], - ["KC_NO" , "DF(0)" , "DF(1)" , "DF(2)" , "AG_SWAP" , "AG_NORM", - "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO", - - "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO", - "RGB_MOD", "RGB_VAI" , "RGB_HUI" , "RGB_SAI" , "KC_NO" , "KC_NO", - - "RESET" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO", - "RGB_TOG", "RGB_RMOD" , "RGB_VAD" , "RGB_HUD" , "RGB_SAD" , "KC_NO" , "KC_NO", - - "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_TRNS", - "KC_TRNS", "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" - - ] - ] -} diff --git a/keyboards/handwired/hillside/keymaps/default/readme.md b/keyboards/handwired/hillside/keymaps/default/readme.md deleted file mode 100644 index a982c0c380..0000000000 --- a/keyboards/handwired/hillside/keymaps/default/readme.md +++ /dev/null @@ -1,216 +0,0 @@ -# Default Keymap - -This default keymap follows many of the norms seen in non-programmable keyboards - to ease initial use of the Hillside keyboard. -It is a starting point for you to tweak over time to better suit _your_ preferences. -You can easily customize it with the - [QMK configurator](https://config.qmk.fm/#/hillside/0_1/LAYOUT) - or with the [via firmware](https://caniusevia.com). - -Some of its key features are: -- A mostly standard base layer with letters, some symbols, shift, modifier and delete keys - in the expected places for non-programmable keyboards. -- QWERTY, Colemak-DH and Dvorak options for the letter and symbol layout. -- Comfortable modifier and function or symbol combinations on the non-base layers - using modifiers on the home row of the navigation/edit, symbol/function and number-pad layers. -- Word navigation and cut/copy/paste keys on the navigation layer. -- A slightly optimized number pad with the more frequently used numbers on the home row. - -We've deliberately omitted some features: -- Combos: because the online configuration tools do not handle them - and because they would add to the initial learning curve, - as helpful to a keymap as a light sprinkling of combos can be. -- Multi-function mod-tap keys, auto shift capitalization and auto-exit modes such as CAPWORD or NUMWORD: - as they may be too large a step for someone new to programmable keyboards. - -## Base Layer - -``` -| TAB | Q | W | E | R | T |---------------------------| Y | U | I | O | P | BKSPC | -| CTRL | A | S | D | F | G |---------------------------| H | J | K | L | ; | ' | -| SHIFT | Z | X | C | V | B | ~ |---------------| ESC | N | M | , | . | / | SHIFT | ---------------|ENTER|-----| GUI | ALT | Num | Nav |---| Sym |SPACE| ALT | GUI |-----| APP |-------------- -``` - -The base layer can be either of QWERTY, Colemak-DH or Dvorak, - with identical non-alpha and non-symbol keys. -QWERTY is the default. - -A standard keyboard layout is used for: - -- Tab, backspace and shift keys in the outer columns. -- Alt/option and GUI/command keys on both thumbs, with the location swappable for windows or mac. -- A space key on the right thumb. - -The differences from a standard layout are: - -- There are three additional "shift" keys - to access the navigation/editing, symbol/function, and number layers. -- Enter is on the left thumb or ring finger. - This location allowed preserving the more common right-hand keys. - Feel free to swap it with the quote key or have it share the right shift key - as a mod-tap key. -- Control is in the caps lock spot. -- Esc and `~ are above the thumbs. -- The rarer AltGr key is in a layer. - -
-Details of Dvorak and Colemak-DH -In the Dvorak layout, the outer home row key is the "/?" symbols - so that the same 12 symbols are taken care of on the base layer. - -``` -Dvorak -| TAB | ' | , | . | P | Y |---------------------------| F | G | C | R | L | BKSPC | -| CTRL | A | O | E | U | I |---------------------------| D | H | T | N | S | / | -| SHIFT | ; | Q | J | K | X | ~ |---------------| ESC | B | M | W | V | Z | SHIFT | ---------------|ENTER|-----| GUI | ALT | Num | Nav |---| Sym |SPACE| ALT | GUI |-----| APP |-------------- - -Colemak-DH -| TAB | Q | W | F | P | B |---------------------------| J | L | U | Y | ; | BKSPC | -| CTRL | A | R | S | T | G |---------------------------| M | N | E | I | O | ' | -| SHIFT | Z | X | C | D | V | ~ |---------------| ESC | K | H | , | . | / | SHIFT | ---------------|ENTER|-----| GUI | ALT | Num | Nav |---| Sym |SPACE| ALT | GUI |-----| APP |-------------- -``` -
- -## Navigation, Editing and Media Layer - -``` -| CAPS | INS | | | |VOL+ |---------------------------|PG_UP|HOME | | END| | DEL | -| CTRL | GUI | ALT |CTRL |SHIFT|VOL- |---------------------------|PG_DN|LEFT | UP |RIGHT| | CTRL | -| SHIFT |UNDO | CUT |COPY |PASTE|REDO |MUTE |---------------| ESC | |WORDL|DOWN |WORDR|RALT | SHIFT | ---------------|ENTER|-----| GUI | ALT | Num | *** |---| Adj |BSPC | ALT | GUI |-----| APP |-------------- -``` -Holding down the Nav key accesses a navigation and editing layer: - -- Navigation arrows are on and below the right home row in a cross pattern. - This feels more natural for a column stagger keyboard than an inverted T. - The keys below that move left or right by a word. - Home, end, and page up/down are beside them. -- Modifiers in the left home row make it easier to use the arrows - to select text with the shift key or move between desktops or tabs. -- Editing keys appear on the lower left. - The edit keys, modifiers and arrows make it easy to move text around without leaving the layer. -- Delete is in the upper right, and a backspace key is on the thumb. -- The base layer modifiers and escape are in the same spots as on the base layer, - and a right-hand control key is added. -- Media volume and play keys are on the left, accessible with one hand. -- AltGr and caps lock fill out the layer. -- A few keys do nothing and are available for more user-specific needs. - -## Symbol and Function Layer - -``` -| F12 | ! | @ | # | $ | % |---------------------------| ^ | & | * | ( | ) | BSPC | -| CTRL | F1 | F2 | F3 | F4 | F5 |---------------------------| | |SHIFT|CTRL | ALT | GUI | CTRL | -| SHIFT | F6 | F7 | F8 | F9 | F10 | F11 |---------------| ESC | \ | [ | ] | { | } | SHIFT | ---------------|ENTER|-----| GUI | ALT | Num | Adj |---| *** |SPACE| ALT | GUI |-----| APP |-------------- -``` -Holding down the Sym key accesses a layer of symbol and function keys: - -- The symbols usually found on the number keys are in the top row. - If desired, you can use these positions for other things, - as the symbols are also accessible from the number pad layer with the shift key. -- The remaining symbols appear on the right. -- The function keys are on the left, beginning with two rows of five. -- A row of modifiers in the home row allows the comfortable creation of any modifier and function key combination. -- The base layer modifier and escape keys are still available, as is a right-hand control key. - -## Number Pad and Algebraic Layer -``` -| | - | + | = | / | * |---------------------------| . | 7 | 8 | 9 | | BSPC | -| CTRL | GUI | ALT |CTRL |SHIFT| |---------------------------| 0 | 1 | 2 | 3 | _ | CTRL | -| SHIFT | | | | | | |---------------| ESC | , | 4 | 5 | 6 | | SHIFT | ---------------|ENTER|-----| GUI | ALT | *** | |---| |BSPC | ALT | GUI |-----| APP |-------------- -``` -Holding down the Num key accesses a number pad and arithmetic symbols: - -- The number pad has the lowest numbers swapped into the home row as these are the most commonly used. -- A row of modifiers in the home row allows the comfortable creation of any modifier and number combination. -- Symbols commonly used with numbers fill out the layer - and can be combined with the home row mods or the existing base layer modifiers on the right hand. -- Several keys remain unused and await more user-specific needs. - - -## Adjust Layer -``` -| |QWERT|DVORK|COLMK|AG_SWAP|AG_NORM|-----------------------| | | | | | | -| | | | | | |---------------------------|MOD+ |BRI+ |HUE+ |SAT+ | | | -| RESET | | | | | | |--------------|RGBTOG|MOD- |BRI- |HUE- |SAT- | | | ---------------| |-----| | | | *** |---| *** | | | |-----| |-------------- -``` -Simultaneously holding down the Nav and Sym keys enables keys to adjust various keyboard settings: - -- The base layer can be set to QWERTY, Colemak-DH or Dvorak, - but the keyboard reverts to QWERTY each time it is plugged in. -- Alt/option and GUI/command can be swapped for mac users or restored to the windows norm. - This setting persists over power loss. -- The backlight LEDs can be enabled, disabled, and controlled. - These settings also persist over power loss. - - -## Make it Yours - -If you are coming from a traditional keyboard, - with a row-staggered layout and a large set of physical keys, - learning to use a column staggered (ergo) and layer-based keyboard, - which uses layers instead of finger reaches to access numbers, symbols and functions, - will be an adjustment for your muscle memory and your mental keyboard map. -This default layout tries to simplify that adjustment by keeping things in the expected spots when possible. - -Yet this layout is only a decent compromise and is not optimal for each user. - -The online configurator makes it easy to tweak this layout to your needs. -You can add additional layers or completely switch around what these do. - -Some changes you might consider making: -- Put some of your most-used key combinations on the unused keys on the navigation layer. -- If you are on a mac, switch the editing and word navigation keys from ctrl-x to cmd-x. -- Change the shift keys to one-shot shift keys, - where pressing and releasing them shifts the next key pressed. - That is much easier on your hands than holding them down. - Yet, they can still be held as usual if desired. -- Instead of holding down the thumb key to keep the symbol layer active, - you could use a one-shot layer key. - One-shot modifiers are likely less stress on your hands and may even be faster. - You would still be able to hold it down instead. -- Instead of holding down the key for the number pad layer, - you could make it a layer toggle, like caps lock is a capitalization toggle key. - -Here are some other keymaps for inspiration and ideas: -- The [Ferris default](https://github.com/qmk/qmk_firmware/tree/master/keyboards/ferris/keymaps/default) uses more advanced features as it has far fewer keys to work with. -- The [Miryoku](https://github.com/manna-harbour/miryoku/tree/master/docs/reference) keymap ensures that all modifiers are comfortably available with each character key. -- The [Kyria default](https://github.com/qmk/qmk_firmware/tree/master/keyboards/splitkb/kyria/keymaps/default) has different keymap choices and a couple more keys. - -A good metaphor is to think of your keymap as a bonsai tree that you tweak slightly over time - in response to ideas of how it might serve you better. - - -## Why no keymap.c - -Via and the online configurator provide straightforward visual ways to work with a simple layout, - and both use a .json keymap format. -So this default ```keymap.json``` was created with the online configurator - and formatted for easier reading and editing. - -If you wish, you can edit the ```keymap.json``` directly in a text editor, optionally use the below ```json2hill.py``` to restore the spacing, and then compile and flash it. - -Or, you can use the graphical configurator to edit the keymap. To do that: - -- Open the [QMK configurator](https://config.qmk.fm/#/handwired/hillside/LAYOUT) -- Using the green up arrow button, load the keymap from ```qmk_firmware/keyboards/handwired/hillside/keymaps/default/keymap.json``` -- Make the changes you wish to the layout -- Save the keymap using the green down arrow button. -- Copy those changes back into your QMK repository and reformat for easy reading using the format script: -``` -./keyboards/handwired/hillside/keymaps/json2hill.py --input /default.json > ./keyboards/handwired/hillside/keymaps/default/keymap.json -``` - You may need to make that script executable with ```chmod +x```. After your keymap is safely copied and formated, you may want to remove the keymap from your download directory so later downloads will automatically receive the same file name. - -After either method of editing, compile and flash the keymap as usual. - -You can combine a .json based keymap with more advanced features specified in .c files - with a bit more complexity. -For example, see -[pierrec83's Kyria map](https://github.com/qmk/qmk_firmware/tree/master/keyboards/splitkb/kyria/keymaps/pierrec83). diff --git a/keyboards/handwired/hillside/keymaps/json2hill.py b/keyboards/handwired/hillside/keymaps/json2hill.py deleted file mode 100755 index a9971c0d78..0000000000 --- a/keyboards/handwired/hillside/keymaps/json2hill.py +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright 2020-2021 Pierre Viseu Chevalier, Michael McCoyd (@pierrechevalier83, @mmccoyd) -# SPDX-License-Identifier: GPL-2.0-or-later - -"""Pretty print keymap json in more readable row/side organized format.""" - -import argparse -import json -import sys -from typing import NamedTuple - -"""Print keymap json in row and side format, though as still re-readable json. - -For example, for one layer: - - ["KC_TAB" , "KC_Q" , "KC_W" , "KC_E" , "KC_R" , "KC_T", - "KC_Y" , "KC_U" , "KC_I" , "KC_O" , "KC_P" , "KC_BSPC", - - "KC_LCTL", "KC_A" , "KC_S" , "KC_D" , "KC_F" , "KC_G", - "KC_H" , "KC_J" , "KC_K" , "KC_L" , "KC_SCLN", "KC_QUOT", - - "KC_LSFT", "KC_Z" , "KC_X" , "KC_C" , "KC_V" , "KC_B" , "KC_GRV", - "KC_ESC" , "KC_N" , "KC_M" , "KC_COMM", "KC_DOT" , "KC_SLSH", "KC_RSFT", - - "KC_ENT" , "KC_LGUI", "KC_LALT", "MO(5)" , "MO(3)", - "MO(4)" , "KC_SPC" , "KC_LALT", "KC_RGUI", "KC_APP" - ], -""" - -indent_level=4 # number of spaces of initial indent per output line - -# The structure of the keymap -# [[Endpoint of sides with identical widths, side width, mapping to column],...] -KEYS_TO_COL = [[24, 6, lambda n: n % 6], - [38, 7, lambda n: (n - 24) % 7], - [48, 5, lambda n: (n - 38) % 5]] -LAST_KEY = KEYS_TO_COL[-1][0] - 1 - -def parse_cli(): - parser = argparse.ArgumentParser(description='Hillside keymap formatter') - parser.add_argument("--input", type=argparse.FileType('r'), - default=sys.stdin, help="Input keymap " - "(json file produced by qmk configurator)") - return parser.parse_args() - -class Column(NamedTuple): - """Column number within keymap side, if it ends side, and ends row. - - Position within a keyboard row runs from 0 to n and again 0 to n""" - num: int - ends_side: bool - ends_row: bool - -def get_col(key_index): - """Return Column for key_index.""" - for keys, num_cols, col_fn in KEYS_TO_COL: - if key_index < keys: - col_num = col_fn(key_index) - return Column(col_num, - ends_side=col_num == num_cols - 1, - ends_row=(keys - 1 - key_index) % (2 * num_cols) == 0) - -def format_layers(layers): - formatted = indent_level * " " + "\"layers\": [\n" - - # Find max key length per column - max_key_length = {} - for layer in layers: - for (index, keycode) in enumerate(layer): - col = get_col(index) - max_length = max_key_length.get(col.num) - if (not max_length) or len(keycode) > max_length: - max_key_length.update({col.num: len(keycode)}) - # Format each layer - for (layer_index, layer) in enumerate(layers): - # Opening [ - formatted += 2 * indent_level * " " - formatted += "[" - - # Split keys into pairs of left and right rows by key row length - for (index, keycode) in enumerate(layer): - col = get_col(index) - - # Indent for rows past first - if col.num == 0 and index != 0: - formatted += (1 + 2 * indent_level) * " " - - # Print key - formatted += json.dumps(keycode) - - # End layer, or end side, or space to next key - if index == LAST_KEY: - formatted += "\n" - elif col.ends_side: - formatted += ",\n" - else: - n_spaces = max_key_length[get_col(index).num] - len(keycode) - formatted += n_spaces * " " - formatted += ", " - - # Split groups of row sides - if col.ends_row: - formatted += "\n" - - # Closing ] with , or without - formatted += 2 * indent_level * " " - if layer_index < len(layers) - 1: - formatted += "],\n" - else: - formatted += "]\n" - - formatted += indent_level * " " - formatted += "]" - - return formatted - -def format_keymap(keymap_json): - formatted = "{" - for (index, k) in enumerate(keymap_json): - if k == "layers": - formatted += format_layers(keymap_json[k]) - else: - formatted += f"{indent_level * ' '}{json.dumps(k)}: {json.dumps(keymap_json[k])}" - if index < len(keymap_json) - 1: - formatted += "," - formatted += "\n" - formatted += "}" - return formatted - -def main(): - args=parse_cli() - keymap_json = json.loads(args.input.read()) - print(format_keymap(keymap_json)) - -main() diff --git a/keyboards/handwired/hillside/keymaps/via/keymap.json b/keyboards/handwired/hillside/keymaps/via/keymap.json deleted file mode 100644 index 8b4810c309..0000000000 --- a/keyboards/handwired/hillside/keymaps/via/keymap.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "version": 1, - "notes": "", - "keyboard": "handwired/hillside/0_1", - "author": "@mmccoyd", - "keymap": "via", - "layout": "LAYOUT", - "layers": [ - ["KC_TAB" , "KC_Q" , "KC_W" , "KC_E" , "KC_R" , "KC_T", - "KC_Y" , "KC_U" , "KC_I" , "KC_O" , "KC_P" , "KC_BSPC", - - "KC_LCTL", "KC_A" , "KC_S" , "KC_D" , "KC_F" , "KC_G", - "KC_H" , "KC_J" , "KC_K" , "KC_L" , "KC_SCLN" , "KC_QUOT", - - "KC_LSFT", "KC_Z" , "KC_X" , "KC_C" , "KC_V" , "KC_B" , "KC_GRV", - "KC_ESC" , "KC_N" , "KC_M" , "KC_COMM" , "KC_DOT" , "KC_SLSH" , "KC_RSFT", - - "KC_ENT" , "KC_LGUI" , "KC_LALT" , "MO(5)" , "MO(3)", - "MO(4)" , "KC_SPC" , "KC_LALT" , "KC_RGUI" , "KC_APP" - - ], - ["KC_TAB" , "KC_QUOT" , "KC_COMM" , "KC_DOT" , "KC_P" , "KC_Y", - "KC_F" , "KC_G" , "KC_C" , "KC_R" , "KC_L" , "KC_BSPC", - - "KC_LCTL", "KC_A" , "KC_O" , "KC_E" , "KC_U" , "KC_I", - "KC_D" , "KC_H" , "KC_T" , "KC_N" , "KC_S" , "KC_SLSH", - - "KC_LSFT", "KC_SCLN" , "KC_Q" , "KC_J" , "KC_K" , "KC_X" , "KC_GRV", - "KC_ESC" , "KC_B" , "KC_M" , "KC_W" , "KC_V" , "KC_Z" , "KC_RSFT", - - "KC_ENT" , "KC_LGUI" , "KC_LALT" , "MO(5)" , "MO(3)", - "MO(4)" , "KC_SPC" , "KC_LALT" , "KC_RGUI" , "KC_APP" - - ], - ["KC_TAB" , "KC_Q" , "KC_W" , "KC_F" , "KC_P" , "KC_B", - "KC_J" , "KC_L" , "KC_U" , "KC_Y" , "KC_SCLN" , "KC_BSPC", - - "KC_LCTL", "KC_A" , "KC_R" , "KC_S" , "KC_T" , "KC_G", - "KC_M" , "KC_N" , "KC_E" , "KC_I" , "KC_O" , "KC_QUOT", - - "KC_LSFT", "KC_Z" , "KC_X" , "KC_C" , "KC_D" , "KC_V" , "KC_GRV", - "KC_ESC" , "KC_K" , "KC_H" , "KC_COMM" , "KC_DOT" , "KC_SLSH" , "KC_RSFT", - - "KC_ENT" , "KC_LGUI" , "KC_LALT" , "MO(5)" , "MO(3)", - "MO(4)" , "KC_SPC" , "KC_LALT" , "KC_RGUI" , "KC_APP" - - ], - ["KC_CAPS", "KC_INS" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_VOLU", - "KC_PGUP", "KC_HOME" , "KC_NO" , "KC_END" , "KC_NO" , "KC_DEL", - - "KC_LCTL", "KC_LGUI" , "KC_LALT" , "KC_LCTL" , "KC_LSFT" , "KC_VOLD", - "KC_PGDN", "KC_LEFT" , "KC_UP" , "KC_RGHT" , "KC_NO" , "KC_RCTL", - - "KC_LSFT", "LCTL(KC_Z)", "LCTL(KC_X)" , "LCTL(KC_C)", "LCTL(KC_V)" , "LCTL(KC_Y)", "KC_MUTE", - "KC_ESC" , "KC_NO" , "LCTL(KC_LEFT)", "KC_DOWN" , "LCTL(KC_RGHT)", "KC_RALT" , "KC_RSFT", - - "KC_TRNS", "KC_TRNS" , "KC_TRNS" , "KC_TRNS" , "KC_TRNS", - "MO(6)" , "KC_BSPC" , "KC_TRNS" , "KC_TRNS" , "KC_TRNS" - - ], - ["KC_F12" , "KC_EXLM" , "KC_AT" , "KC_HASH" , "KC_DLR" , "KC_PERC", - "KC_CIRC", "KC_AMPR" , "KC_ASTR" , "KC_LPRN" , "KC_RPRN" , "KC_BSPC", - - "KC_LCTL", "KC_F1" , "KC_F2" , "KC_F3" , "KC_F4" , "KC_F5", - "KC_PIPE", "KC_LSFT" , "KC_LCTL" , "KC_LALT" , "KC_LGUI" , "KC_RCTL", - - "KC_LSFT", "KC_F6" , "KC_F7" , "KC_F8" , "KC_F9" , "KC_F10" , "KC_F11", - "KC_ESC" , "KC_BSLS" , "KC_LBRC" , "KC_RBRC" , "KC_LCBR" , "KC_RCBR" , "KC_RSFT", - - "KC_TRNS", "KC_TRNS" , "KC_TRNS" , "KC_TRNS" , "MO(6)", - "KC_TRNS", "KC_TRNS" , "KC_TRNS" , "KC_TRNS" , "KC_TRNS" - - ], - ["KC_NO" , "KC_MINS" , "KC_PLUS" , "KC_EQL" , "KC_SLSH" , "KC_ASTR", - "KC_COMM", "KC_7" , "KC_8" , "KC_9" , "KC_NO" , "KC_TRNS", - - "KC_TRNS", "KC_LGUI" , "KC_LALT" , "KC_LCTL" , "KC_LSFT" , "KC_NO", - "KC_0" , "KC_1" , "KC_2" , "KC_3" , "KC_UNDS" , "KC_RCTL", - - "KC_TRNS", "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO", - "KC_NO" , "KC_DOT" , "KC_4" , "KC_5" , "KC_6" , "KC_NO" , "KC_TRNS", - - "KC_TRNS", "KC_TRNS" , "KC_TRNS" , "KC_TRNS" , "KC_NO", - "KC_NO" , "KC_BSPC" , "KC_TRNS" , "KC_TRNS" , "KC_TRNS" - - ], - ["KC_NO" , "DF(0)" , "DF(1)" , "DF(2)" , "AG_SWAP" , "AG_NORM", - "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO", - - "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO", - "RGB_MOD", "RGB_VAI" , "RGB_HUI" , "RGB_SAI" , "KC_NO" , "KC_NO", - - "RESET" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO", - "RGB_TOG", "RGB_RMOD" , "RGB_VAD" , "RGB_HUD" , "RGB_SAD" , "KC_NO" , "KC_NO", - - "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" , "KC_TRNS", - "KC_TRNS", "KC_NO" , "KC_NO" , "KC_NO" , "KC_NO" - - ] - ] -} diff --git a/keyboards/handwired/hillside/readme.md b/keyboards/handwired/hillside/readme.md index f1ff0f8506..cffb3875aa 100644 --- a/keyboards/handwired/hillside/readme.md +++ b/keyboards/handwired/hillside/readme.md @@ -2,28 +2,10 @@ ![hillside](https://imgur.com/XW0rX13.png) -[Hillside](https://github.com/mmccoyd/hillside) - is a split ergonomic keyboard - with 3x6+4+2 choc-spaced keys with aggressive column stagger, - a longer thumb arc and a breakoff outer-pinky column. +Hillside is a small family of split ergonomic keyboards, currently of one. +Inside this directory is support for each model. * Keyboard Maintainer: [Michael McCoyd](https://github.com/mmccoyd) -* Hardware Supported: ProMicro/Elite-C and compatible +* Hardware Supported: + * [Hillside 0_1](https://github.com/qmk/qmk_firmware/blob/master/keyboards/handwired/hillside/0_1): ProMicro/Elite-C and compatible * Hardware Availability: https://github.com/mmccoyd/hillside - -Make example for this keyboard (after setting up your build environment): - - make handwired/hillside/0_1:default - -Flashing example for this keyboard: - - make handwired/hillside/0_1:default:flash - -## Bootloader - -Enter the bootloader by either: - -* **Physical reset button**: Briefly press the button on the front of the PCB. -* **Keycode in layout**: Press the key mapped to `RESET` if it is available - -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). -- cgit v1.2.3 From d1cf218b9dad0d35413349e7b78ff21612958579 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sun, 30 Jan 2022 13:29:43 -0800 Subject: [Keyboard] Overhaul Tractyl Manuform (#16134) --- .../handwired/tractyl_manuform/5x6_right/config.h | 1 - .../tractyl_manuform/5x6_right/f411/config.h | 3 +- .../5x6_right/keymaps/drashna/keymap.c | 4 +- keyboards/handwired/tractyl_manuform/config.h | 2 - .../handwired/tractyl_manuform/tractyl_manuform.c | 419 ++++++++++++++++----- .../handwired/tractyl_manuform/tractyl_manuform.h | 118 ++++-- 6 files changed, 414 insertions(+), 133 deletions(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/config.h b/keyboards/handwired/tractyl_manuform/5x6_right/config.h index 59cd098fdb..b4f09e5e87 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/config.h +++ b/keyboards/handwired/tractyl_manuform/5x6_right/config.h @@ -50,5 +50,4 @@ along with this program. If not, see . #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION -#define POINTING_DEVICE_TASK_THROTTLE #define POINTING_DEVICE_RIGHT diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/f411/config.h b/keyboards/handwired/tractyl_manuform/5x6_right/f411/config.h index 6ae51ca6f0..87c3239057 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/f411/config.h +++ b/keyboards/handwired/tractyl_manuform/5x6_right/f411/config.h @@ -79,7 +79,8 @@ along with this program. If not, see . #define I2C1_SDA_PIN B9 #define I2C1_SCL_PAL_MODE 4 #define I2C1_SDA_PAL_MODE 4 -// #define I2C1_CLOCK_SPEED 400000 +#define I2C1_CLOCK_SPEED 400000 +#define I2C1_DUTY_CYCLE FAST_DUTY_CYCLE_2 /* encoder config */ #define ENCODERS_PAD_A \ diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c index fa1e8897ee..570760cf66 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c +++ b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c @@ -61,8 +61,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_MOUSE] = LAYOUT_5x6_right( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, KC_WH_U, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, KC_WH_D, KC_BTN1, KC_BTN3, KC_BTN2, KC_BTN6, DPI_CONFIG, + _______, _______, _______, _______, _______, _______, KC_WH_U, DPI_MOD, DPI_RMOD,S_D_MOD, S_D_RMOD,DRGSCRL, + _______, _______, _______, _______, _______, _______, KC_WH_D, KC_BTN1, KC_BTN3, KC_BTN2, KC_BTN6, SNIPING, _______, _______, _______, _______, _______, _______, KC_BTN7, KC_BTN4, KC_BTN5, KC_BTN8, _______, _______, _______, _______, _______, _______, _______, _______, KC_BTN3, diff --git a/keyboards/handwired/tractyl_manuform/config.h b/keyboards/handwired/tractyl_manuform/config.h index 15c8102b8f..f9160ea148 100644 --- a/keyboards/handwired/tractyl_manuform/config.h +++ b/keyboards/handwired/tractyl_manuform/config.h @@ -24,8 +24,6 @@ along with this program. If not, see . #define VENDOR_ID 0x44DD #define MANUFACTURER Drashna -#define USB_POLLING_INTERVAL_MS 1 - /* disable debug print */ // #define NO_DEBUG diff --git a/keyboards/handwired/tractyl_manuform/tractyl_manuform.c b/keyboards/handwired/tractyl_manuform/tractyl_manuform.c index 5bdc57ca09..033146134d 100644 --- a/keyboards/handwired/tractyl_manuform/tractyl_manuform.c +++ b/keyboards/handwired/tractyl_manuform/tractyl_manuform.c @@ -18,135 +18,345 @@ #include "transactions.h" #include -#ifndef TRACKBALL_DPI_OPTIONS -# define TRACKBALL_DPI_OPTIONS \ - { 1200, 1600, 2400 } -# ifndef TRACKBALL_DPI_DEFAULT -# define TRACKBALL_DPI_DEFAULT 1 -# endif -#endif -#ifndef TRACKBALL_DPI_DEFAULT -# define TRACKBALL_DPI_DEFAULT 0 -#endif - -keyboard_config_t keyboard_config; -kb_config_data_t kb_config_data; -uint16_t dpi_array[] = TRACKBALL_DPI_OPTIONS; -#define DPI_OPTION_SIZE (sizeof(dpi_array) / sizeof(uint16_t)) - -bool process_record_kb(uint16_t keycode, keyrecord_t* record) { - if (!process_record_user(keycode, record)) { - return false; - } +#ifdef CONSOLE_ENABLE +# include "print.h" +#endif // CONSOLE_ENABLE #ifdef POINTING_DEVICE_ENABLE - if (keycode == DPI_CONFIG && record->event.pressed) { - if ((get_mods() | get_oneshot_mods()) & MOD_MASK_SHIFT) { - keyboard_config.dpi_config = (keyboard_config.dpi_config - 1) % DPI_OPTION_SIZE; - } else { - keyboard_config.dpi_config = (keyboard_config.dpi_config + 1) % DPI_OPTION_SIZE; - } - eeconfig_update_kb(keyboard_config.raw); - kb_config_data.device_cpi = dpi_array[keyboard_config.dpi_config]; - pointing_device_set_cpi(kb_config_data.device_cpi); - } -#endif +# ifndef CHARYBDIS_MINIMUM_DEFAULT_DPI +# define CHARYBDIS_MINIMUM_DEFAULT_DPI 400 +# endif // CHARYBDIS_MINIMUM_DEFAULT_DPI + +# ifndef CHARYBDIS_DEFAULT_DPI_CONFIG_STEP +# define CHARYBDIS_DEFAULT_DPI_CONFIG_STEP 200 +# endif // CHARYBDIS_DEFAULT_DPI_CONFIG_STEP + +# ifndef CHARYBDIS_MINIMUM_SNIPING_DPI +# define CHARYBDIS_MINIMUM_SNIPING_DPI 200 +# endif // CHARYBDIS_MINIMUM_SNIPER_MODE_DPI + +# ifndef CHARYBDIS_SNIPING_DPI_CONFIG_STEP +# define CHARYBDIS_SNIPING_DPI_CONFIG_STEP 100 +# endif // CHARYBDIS_SNIPING_DPI_CONFIG_STEP + +// Fixed DPI for drag-scroll. +# ifndef CHARYBDIS_DRAGSCROLL_DPI +# define CHARYBDIS_DRAGSCROLL_DPI 100 +# endif // CHARYBDIS_DRAGSCROLL_DPI + +# ifndef CHARYBDIS_DRAGSCROLL_BUFFER_SIZE +# define CHARYBDIS_DRAGSCROLL_BUFFER_SIZE 6 +# endif // !CHARYBDIS_DRAGSCROLL_BUFFER_SIZE + +# ifndef CHARYBDIS_POINTER_ACCELERATION_FACTOR +# define CHARYBDIS_POINTER_ACCELERATION_FACTOR 24 +# endif // !CHARYBDIS_POINTER_ACCELERATION_FACTOR + +typedef union { + uint8_t raw; + struct { + uint8_t pointer_default_dpi : 4; // 16 steps available. + uint8_t pointer_sniping_dpi : 2; // 4 steps available. + bool is_dragscroll_enabled : 1; + bool is_sniping_enabled : 1; + } __attribute__((packed)); +} charybdis_config_t; -/* If Mousekeys is disabled, then use handle the mouse button - * keycodes. This makes things simpler, and allows usage of - * the keycodes in a consistent manner. But only do this if - * Mousekeys is not enable, so it's not handled twice. +static charybdis_config_t g_charybdis_config = {0}; + +/** + * \brief Set the value of `config` from EEPROM. + * + * Note that `is_dragscroll_enabled` and `is_sniping_enabled` are purposefully + * ignored since we do not want to persist this state to memory. In practice, + * this state is always written to maximize write-performances. Therefore, we + * explicitly set them to `false` in this function. */ -#ifndef MOUSEKEY_ENABLE - if (IS_MOUSEKEY_BUTTON(keycode)) { - report_mouse_t currentReport = pointing_device_get_report(); - currentReport.buttons = pointing_device_handle_buttons(currentReport.buttons, record->event.pressed, keycode - KC_MS_BTN1); - pointing_device_set_report(currentReport); - pointing_device_send(); +static void read_charybdis_config_from_eeprom(charybdis_config_t* config) { + config->raw = eeconfig_read_kb() & 0xff; + config->is_dragscroll_enabled = false; + config->is_sniping_enabled = false; +} + +/** + * \brief Save the value of `config` to eeprom. + * + * Note that all values are written verbatim, including whether drag-scroll + * and/or sniper mode are enabled. `read_charybdis_config_from_eeprom(…)` + * resets these 2 values to `false` since it does not make sense to persist + * these across reboots of the board. + */ +static void write_charybdis_config_to_eeprom(charybdis_config_t* config) { eeconfig_update_kb(config->raw); } + +/** \brief Return the current value of the pointer's default DPI. */ +static uint16_t get_pointer_default_dpi(charybdis_config_t* config) { return (uint16_t)config->pointer_default_dpi * CHARYBDIS_DEFAULT_DPI_CONFIG_STEP + CHARYBDIS_MINIMUM_DEFAULT_DPI; } + +/** \brief Return the current value of the pointer's sniper-mode DPI. */ +static uint16_t get_pointer_sniping_dpi(charybdis_config_t* config) { return (uint16_t)config->pointer_sniping_dpi * CHARYBDIS_SNIPING_DPI_CONFIG_STEP + CHARYBDIS_MINIMUM_SNIPING_DPI; } + +/** \brief Set the appropriate DPI for the input config. */ +static void maybe_update_pointing_device_cpi(charybdis_config_t* config) { + if (config->is_dragscroll_enabled) { + pointing_device_set_cpi(CHARYBDIS_DRAGSCROLL_DPI); + } else if (config->is_sniping_enabled) { + pointing_device_set_cpi(get_pointer_sniping_dpi(config)); + } else { + pointing_device_set_cpi(get_pointer_default_dpi(config)); } -#endif +} - return true; +/** + * \brief Update the pointer's default DPI to the next or previous step. + * + * Increases the DPI value if `forward` is `true`, decreases it otherwise. + * The increment/decrement steps are equal to CHARYBDIS_DEFAULT_DPI_CONFIG_STEP. + */ +static void step_pointer_default_dpi(charybdis_config_t* config, bool forward) { + config->pointer_default_dpi += forward ? 1 : -1; + maybe_update_pointing_device_cpi(config); } -__attribute__((weak)) void keyboard_pre_init_sub(void) {} -void keyboard_pre_init_kb(void) { - // debug_enable = true; - // debug_matrix = true; - // debug_mouse = true; - // debug_encoder = true; - // This is the debug LED. -#if defined(DEBUG_LED_PIN) - setPinOutput(DEBUG_LED_PIN); - writePin(DEBUG_LED_PIN, !debug_enable); -#endif +/** + * \brief Update the pointer's sniper-mode DPI to the next or previous step. + * + * Increases the DPI value if `forward` is `true`, decreases it otherwise. + * The increment/decrement steps are equal to CHARYBDIS_SNIPING_DPI_CONFIG_STEP. + */ +static void step_pointer_sniping_dpi(charybdis_config_t* config, bool forward) { + config->pointer_sniping_dpi += forward ? 1 : -1; + maybe_update_pointing_device_cpi(config); +} + +uint16_t charybdis_get_pointer_default_dpi(void) { return get_pointer_default_dpi(&g_charybdis_config); } + +uint16_t charybdis_get_pointer_sniping_dpi(void) { return get_pointer_sniping_dpi(&g_charybdis_config); } - memset(&kb_config_data, 0, sizeof(kb_config_data)); +void charybdis_cycle_pointer_default_dpi_noeeprom(bool forward) { step_pointer_default_dpi(&g_charybdis_config, forward); } - keyboard_pre_init_sub(); - keyboard_pre_init_user(); +void charybdis_cycle_pointer_default_dpi(bool forward) { + step_pointer_default_dpi(&g_charybdis_config, forward); + write_charybdis_config_to_eeprom(&g_charybdis_config); } -void keyboard_post_init_kb(void) { - transaction_register_rpc(RPC_ID_KB_CONFIG_SYNC, kb_config_sync_handler); +void charybdis_cycle_pointer_sniping_dpi_noeeprom(bool forward) { step_pointer_sniping_dpi(&g_charybdis_config, forward); } - keyboard_post_init_user(); +void charybdis_cycle_pointer_sniping_dpi(bool forward) { + step_pointer_sniping_dpi(&g_charybdis_config, forward); + write_charybdis_config_to_eeprom(&g_charybdis_config); } -#ifdef POINTING_DEVICE_ENABLE -void pointing_device_init_kb(void) { - kb_config_data.device_cpi = dpi_array[keyboard_config.dpi_config]; - pointing_device_set_cpi(kb_config_data.device_cpi); - pointing_device_init_user(); +bool charybdis_get_pointer_sniping_enabled(void) { return g_charybdis_config.is_sniping_enabled; } + +void charybdis_set_pointer_sniping_enabled(bool enable) { + g_charybdis_config.is_sniping_enabled = enable; + maybe_update_pointing_device_cpi(&g_charybdis_config); } -report_mouse_t pointing_device_task_kb(report_mouse_t mouse_report) { - if (is_keyboard_master()) { - mouse_report = pointing_device_task_user(mouse_report); +bool charybdis_get_pointer_dragscroll_enabled(void) { return g_charybdis_config.is_dragscroll_enabled; } + +void charybdis_set_pointer_dragscroll_enabled(bool enable) { + g_charybdis_config.is_dragscroll_enabled = enable; + maybe_update_pointing_device_cpi(&g_charybdis_config); +} + +void pointing_device_init_kb(void) { maybe_update_pointing_device_cpi(&g_charybdis_config); } + +# ifndef CONSTRAIN_HID +# define CONSTRAIN_HID(value) ((value) < -127 ? -127 : ((value) > 127 ? 127 : (value))) +# endif // !CONSTRAIN_HID + +/** + * \brief Add optional acceleration effect. + * + * If `CHARYBDIS_ENABLE_POINTER_ACCELERATION` is defined, add a simple and naive + * acceleration effect to the provided value. Return the value unchanged + * otherwise. + */ +# ifndef DISPLACEMENT_WITH_ACCELERATION +# ifdef CHARYBDIS_POINTER_ACCELERATION_ENABLE +# define DISPLACEMENT_WITH_ACCELERATION(d) (CONSTRAIN_HID(d > 0 ? d * d / CHARYBDIS_POINTER_ACCELERATION_FACTOR + d : -d * d / CHARYBDIS_POINTER_ACCELERATION_FACTOR + d)) +# else // !CHARYBDIS_POINTER_ACCELERATION_ENABLE +# define DISPLACEMENT_WITH_ACCELERATION(d) (d) +# endif // CHARYBDIS_POINTER_ACCELERATION_ENABLE +# endif // !DISPLACEMENT_WITH_ACCELERATION + +/** + * \brief Augment the pointing device behavior. + * + * Implement the Charybdis-specific features for pointing devices: + * - Drag-scroll + * - Sniping + * - Acceleration + */ +static void pointing_device_task_charybdis(report_mouse_t* mouse_report) { + static int16_t scroll_buffer_x = 0; + static int16_t scroll_buffer_y = 0; + if (g_charybdis_config.is_dragscroll_enabled) { +# ifdef CHARYBDIS_DRAGSCROLL_REVERSE_X + scroll_buffer_x -= mouse_report->x; +# else + scroll_buffer_x += mouse_report->x; +# endif // CHARYBDIS_DRAGSCROLL_REVERSE_X +# ifdef CHARYBDIS_DRAGSCROLL_REVERSE_Y + scroll_buffer_y -= mouse_report->y; +# else + scroll_buffer_y += mouse_report->y; +# endif // CHARYBDIS_DRAGSCROLL_REVERSE_Y + mouse_report->x = 0; + mouse_report->y = 0; + if (abs(scroll_buffer_x) > CHARYBDIS_DRAGSCROLL_BUFFER_SIZE) { + mouse_report->h = scroll_buffer_x > 0 ? 1 : -1; + scroll_buffer_x = 0; + } + if (abs(scroll_buffer_y) > CHARYBDIS_DRAGSCROLL_BUFFER_SIZE) { + mouse_report->v = scroll_buffer_y > 0 ? 1 : -1; + scroll_buffer_y = 0; + } + } else if (!g_charybdis_config.is_sniping_enabled) { + mouse_report->x = DISPLACEMENT_WITH_ACCELERATION(mouse_report->x); + mouse_report->y = DISPLACEMENT_WITH_ACCELERATION(mouse_report->y); } +} + +report_mouse_t pointing_device_task_kb(report_mouse_t mouse_report) { + pointing_device_task_charybdis(&mouse_report); + mouse_report = pointing_device_task_user(mouse_report); + return mouse_report; } -#endif + +# if defined(POINTING_DEVICE_ENABLE) && !defined(NO_CHARYBDIS_KEYCODES) +/** \brief Whether SHIFT mod is enabled. */ +static bool has_shift_mod(void) { +# ifdef NO_ACTION_ONESHOT + return mod_config(get_mods()) & MOD_MASK_SHIFT; +# else + return mod_config(get_mods() | get_oneshot_mods()) & MOD_MASK_SHIFT; +# endif // NO_ACTION_ONESHOT +} +# endif // POINTING_DEVICE_ENABLE && !NO_CHARYBDIS_KEYCODES + +/** + * \brief Outputs the Charybdis configuration to console. + * + * Prints the in-memory configuration structure to console, for debugging. + * Includes: + * - raw value + * - drag-scroll: on/off + * - sniping: on/off + * - default DPI: internal table index/actual DPI + * - sniping DPI: internal table index/actual DPI + */ +static void debug_charybdis_config_to_console(charybdis_config_t* config) { +# ifdef CONSOLE_ENABLE + dprintf("(charybdis) process_record_kb: config = {\n" + "\traw = 0x%04X,\n" + "\t{\n" + "\t\tis_dragscroll_enabled=%b\n" + "\t\tis_sniping_enabled=%b\n" + "\t\tdefault_dpi=0x%02X (%ld)\n" + "\t\tsniping_dpi=0x%01X (%ld)\n" + "\t}\n" + "}\n", + config->raw, config->is_dragscroll_enabled, config->is_sniping_enabled, config->pointer_default_dpi, get_pointer_default_dpi(config), config->pointer_sniping_dpi, get_pointer_sniping_dpi(config)); +# endif // CONSOLE_ENABLE +} + +bool process_record_kb(uint16_t keycode, keyrecord_t* record) { + if (!process_record_user(keycode, record)) { + debug_charybdis_config_to_console(&g_charybdis_config); + return false; + } +# ifndef NO_CHARYBDIS_KEYCODES + switch (keycode) { + case POINTER_DEFAULT_DPI_FORWARD: + if (record->event.pressed) { + // Step backward if shifted, forward otherwise. + charybdis_cycle_pointer_default_dpi(/* forward= */ !has_shift_mod()); + } + break; + case POINTER_DEFAULT_DPI_REVERSE: + if (record->event.pressed) { + // Step forward if shifted, backward otherwise. + charybdis_cycle_pointer_default_dpi(/* forward= */ has_shift_mod()); + } + break; + case POINTER_SNIPING_DPI_FORWARD: + if (record->event.pressed) { + // Step backward if shifted, forward otherwise. + charybdis_cycle_pointer_sniping_dpi(/* forward= */ !has_shift_mod()); + } + break; + case POINTER_SNIPING_DPI_REVERSE: + if (record->event.pressed) { + // Step forward if shifted, backward otherwise. + charybdis_cycle_pointer_sniping_dpi(/* forward= */ has_shift_mod()); + } + break; + case SNIPING_MODE: + charybdis_set_pointer_sniping_enabled(record->event.pressed); + break; + case SNIPING_MODE_TOGGLE: + if (record->event.pressed) { + charybdis_set_pointer_sniping_enabled(!charybdis_get_pointer_sniping_enabled()); + } + break; + case DRAGSCROLL_MODE: + charybdis_set_pointer_dragscroll_enabled(record->event.pressed); + break; + case DRAGSCROLL_MODE_TOGGLE: + if (record->event.pressed) { + charybdis_set_pointer_dragscroll_enabled(!charybdis_get_pointer_dragscroll_enabled()); + } + break; + } +# endif // !NO_CHARYBDIS_KEYCODES +# ifndef MOUSEKEY_ENABLE + // Simulate mouse keys if full support is not enabled (reduces firmware size + // while maintaining support for mouse keys). + if (IS_MOUSEKEY_BUTTON(keycode)) { + report_mouse_t mouse_report = pointing_device_get_report(); + mouse_report.buttons = pointing_device_handle_buttons(mouse_report.buttons, record->event.pressed, keycode - KC_MS_BTN1); + pointing_device_set_report(mouse_report); + pointing_device_send(); + } +# endif // !MOUSEKEY_ENABLE + debug_charybdis_config_to_console(&g_charybdis_config); + return true; +} void eeconfig_init_kb(void) { - keyboard_config.dpi_config = TRACKBALL_DPI_DEFAULT; -#ifdef POINTING_DEVICE_ENABLE - kb_config_data.device_cpi = dpi_array[keyboard_config.dpi_config]; - pointing_device_set_cpi(kb_config_data.device_cpi); -#endif - eeconfig_update_kb(keyboard_config.raw); + g_charybdis_config.raw = 0; + write_charybdis_config_to_eeprom(&g_charybdis_config); + maybe_update_pointing_device_cpi(&g_charybdis_config); eeconfig_init_user(); } -__attribute__((weak)) void matrix_init_sub_kb(void) {} -void matrix_init_kb(void) { - // is safe to just read DPI setting since matrix init - // comes before pointing device init. - keyboard_config.raw = eeconfig_read_kb(); - if (keyboard_config.dpi_config > DPI_OPTION_SIZE) { - eeconfig_init_kb(); +void matrix_power_up(void) { pointing_device_task(); } + +void charybdis_config_sync_handler(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) { + if (initiator2target_buffer_size == sizeof(g_charybdis_config)) { + memcpy(&g_charybdis_config, initiator2target_buffer, sizeof(g_charybdis_config)); } - matrix_init_sub_kb(); - matrix_init_user(); } -__attribute__((weak)) void matrix_scan_sub_kb(void) {} -void matrix_scan_kb(void) { - matrix_scan_sub_kb(); - matrix_scan_user(); +void keyboard_post_init_kb(void) { + transaction_register_rpc(RPC_ID_KB_CONFIG_SYNC, charybdis_config_sync_handler); + + keyboard_post_init_user(); } void housekeeping_task_kb(void) { if (is_keyboard_master()) { // Keep track of the last state, so that we can tell if we need to propagate to slave - static kb_config_data_t last_kb_config; - static uint32_t last_sync = 0; - bool needs_sync = false; + static charybdis_config_t last_charybdis_config = {0}; + static uint32_t last_sync = 0; + bool needs_sync = false; // Check if the state values are different - if (memcmp(&kb_config_data, &last_kb_config, sizeof(kb_config_data))) { + if (memcmp(&g_charybdis_config, &last_charybdis_config, sizeof(g_charybdis_config))) { needs_sync = true; - memcpy(&last_kb_config, &kb_config_data, sizeof(kb_config_data)); + memcpy(&last_charybdis_config, &g_charybdis_config, sizeof(g_charybdis_config)); } // Send to slave every 500ms regardless of state change if (timer_elapsed32(last_sync) > 500) { @@ -155,7 +365,7 @@ void housekeeping_task_kb(void) { // Perform the sync if requested if (needs_sync) { - if (transaction_rpc_send(RPC_ID_KB_CONFIG_SYNC, sizeof(kb_config_data), &kb_config_data)) { + if (transaction_rpc_send(RPC_ID_KB_CONFIG_SYNC, sizeof(g_charybdis_config), &g_charybdis_config)) { last_sync = timer_read32(); } } @@ -163,12 +373,19 @@ void housekeeping_task_kb(void) { // no need for user function, is called already } -void kb_config_sync_handler(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) { - if (initiator2target_buffer_size == sizeof(kb_config_data)) { - memcpy(&kb_config_data, initiator2target_buffer, sizeof(kb_config_data)); - } -} +#endif // POINTING_DEVICE_ENABLE +__attribute__((weak)) void matrix_init_sub_kb(void) {} +void matrix_init_kb(void) { #ifdef POINTING_DEVICE_ENABLE -void matrix_power_up(void) { pointing_device_task(); } -#endif + read_charybdis_config_from_eeprom(&g_charybdis_config); +#endif // POINTING_DEVICE_ENABLE + matrix_init_sub_kb(); + matrix_init_user(); +} + +__attribute__((weak)) void matrix_scan_sub_kb(void) {} +void matrix_scan_kb(void) { + matrix_scan_sub_kb(); + matrix_scan_user(); +} diff --git a/keyboards/handwired/tractyl_manuform/tractyl_manuform.h b/keyboards/handwired/tractyl_manuform/tractyl_manuform.h index 3f8aca4551..197aee985e 100644 --- a/keyboards/handwired/tractyl_manuform/tractyl_manuform.h +++ b/keyboards/handwired/tractyl_manuform/tractyl_manuform.h @@ -17,7 +17,6 @@ #pragma once #include "quantum.h" -#include "pointing_device.h" #if defined(KEYBOARD_handwired_tractyl_manuform_5x6_right) # include "5x6_right.h" @@ -25,33 +24,100 @@ # include "4x6_right.h" #endif -typedef union { - uint32_t raw; - struct { - uint8_t dpi_config; - }; -} keyboard_config_t; - -typedef union { - uint32_t raw; - struct { - uint16_t device_cpi; - }; -} kb_config_data_t; - -extern keyboard_config_t keyboard_config; -extern kb_config_data_t kb_config_data; - -enum ploopy_keycodes { - DPI_CONFIG = SAFE_RANGE, +#ifdef POINTING_DEVICE_ENABLE +# ifndef NO_CHARYBDIS_KEYCODES +enum charybdis_keycodes { +# ifdef VIA_ENABLE + POINTER_DEFAULT_DPI_FORWARD = USER00, +# else + POINTER_DEFAULT_DPI_FORWARD = SAFE_RANGE, +# endif // VIA_ENABLE + POINTER_DEFAULT_DPI_REVERSE, + POINTER_SNIPING_DPI_FORWARD, + POINTER_SNIPING_DPI_REVERSE, + SNIPING_MODE, + SNIPING_MODE_TOGGLE, + DRAGSCROLL_MODE, + DRAGSCROLL_MODE_TOGGLE, KEYMAP_SAFE_RANGE, }; +# define CHARYBDIS_SAFE_RANGE KEYMAP_SAFE_RANGE +# define DPI_MOD POINTER_DEFAULT_DPI_FORWARD +# define DPI_RMOD POINTER_DEFAULT_DPI_REVERSE +# define S_D_MOD POINTER_SNIPING_DPI_FORWARD +# define S_D_RMOD POINTER_SNIPING_DPI_REVERSE +# define SNIPING SNIPING_MODE +# define SNP_TOG SNIPING_MODE_TOGGLE +# define DRGSCRL DRAGSCROLL_MODE +# define DRG_TOG DRAGSCROLL_MODE_TOGGLE +# endif // !NO_CHARYBDIS_KEYCODES -void matrix_init_sub_kb(void); -void matrix_scan_sub_kb(void); +/** \brief Return the current DPI value for the pointer's default mode. */ +uint16_t charybdis_get_pointer_default_dpi(void); + +/** + * \brief Update the pointer's default DPI to the next or previous step. + * + * Increases the DPI value if `forward` is `true`, decreases it otherwise. + * The increment/decrement steps are equal to CHARYBDIS_DEFAULT_DPI_CONFIG_STEP. + * + * The new value is persisted in EEPROM. + */ +void charybdis_cycle_pointer_default_dpi(bool forward); + +/** + * \brief Same as `charybdis_cycle_pointer_default_dpi`, but do not write to + * EEPROM. + * + * This means that reseting the board will revert the value to the last + * persisted one. + */ +void charybdis_cycle_pointer_default_dpi_noeeprom(bool forward); + +/** \brief Return the current DPI value for the pointer's sniper-mode. */ +uint16_t charybdis_get_pointer_sniping_dpi(void); + +/** + * \brief Update the pointer's sniper-mode DPI to the next or previous step. + * + * Increases the DPI value if `forward` is `true`, decreases it otherwise. + * The increment/decrement steps are equal to CHARYBDIS_SNIPING_DPI_CONFIG_STEP. + * + * The new value is persisted in EEPROM. + */ +void charybdis_cycle_pointer_sniping_dpi(bool forward); + +/** + * \brief Same as `charybdis_cycle_pointer_sniping_dpi`, but do not write to + * EEPROM. + * + * This means that reseting the board will revert the value to the last + * persisted one. + */ +void charybdis_cycle_pointer_sniping_dpi_noeeprom(bool forward); -void keyboard_pre_init_sync(void); -void keyboard_post_init_sync(void); -void housekeeping_task_sync(void); +/** \brief Whether sniper-mode is enabled. */ +bool charybdis_get_pointer_sniping_enabled(void); + +/** + * \brief Enable/disable sniper mode. + * + * When sniper mode is enabled the dpi is reduced to slow down the pointer for + * more accurate movements. + */ +void charybdis_set_pointer_sniping_enabled(bool enable); -void kb_config_sync_handler(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer); +/** \brief Whether drag-scroll is enabled. */ +bool charybdis_get_pointer_dragscroll_enabled(void); + +/** + * \brief Enable/disable drag-scroll mode. + * + * When drag-scroll mode is enabled, horizontal and vertical pointer movements + * are translated into horizontal and vertical scroll movements. + */ +void charybdis_set_pointer_dragscroll_enabled(bool enable); +#endif // POINTING_DEVICE_ENABLE + +void matrix_init_sub_kb(void); +void matrix_scan_sub_kb(void); -- cgit v1.2.3 From f4f3bf81c79516b3ad1a0e8c05ef8986f8b546eb Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 5 Feb 2022 16:55:24 +1100 Subject: Add missing `BOOTLOADER` for a handful of boards (#16225) --- keyboards/handwired/twadlee/tp69/rules.mk | 3 +++ 1 file changed, 3 insertions(+) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/twadlee/tp69/rules.mk b/keyboards/handwired/twadlee/tp69/rules.mk index 216e797c4b..a1c290cf15 100644 --- a/keyboards/handwired/twadlee/tp69/rules.mk +++ b/keyboards/handwired/twadlee/tp69/rules.mk @@ -1,6 +1,9 @@ # MCU name MCU = MKL26Z64 +# Bootloader selection +BOOTLOADER = halfkay + # Build Options # change yes to no to disable # -- cgit v1.2.3 From e04f6c5d38d503140de3632e8850159e0ef362a6 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Thu, 10 Feb 2022 17:52:39 +0000 Subject: Remove manual enable of LTO within user keymaps (#15378) --- keyboards/handwired/dactyl_manuform/5x6/keymaps/333fred/rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'keyboards/handwired') diff --git a/keyboards/handwired/dactyl_manuform/5x6/keymaps/333fred/rules.mk b/keyboards/handwired/dactyl_manuform/5x6/keymaps/333fred/rules.mk index 6d2e27cb41..5ad63b02b7 100644 --- a/keyboards/handwired/dactyl_manuform/5x6/keymaps/333fred/rules.mk +++ b/keyboards/handwired/dactyl_manuform/5x6/keymaps/333fred/rules.mk @@ -1,3 +1,3 @@ KEY_LOCK_ENABLE = yes CONSOLE_ENABLE = no -EXTRAFLAGS += -flto +LTO_ENABLE = yes -- cgit v1.2.3