diff options
author | Drashna Jaelre <drashna@live.com> | 2021-07-01 00:42:32 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-01 00:42:32 -0700 |
commit | b7cf9a888a607dc024d74ee72c0ebbd8e0ddfdbe (patch) | |
tree | 3510846d4d53682e5ec9b964d093ef97c0b33bc7 /keyboards/handwired/dactyl_manuform | |
parent | bbe45185e30eb8d0e974f02b0ea809ed773221be (diff) |
Drashna's split updates (#13350)
Co-authored-by: Ryan <fauxpark@gmail.com>
Diffstat (limited to 'keyboards/handwired/dactyl_manuform')
15 files changed, 0 insertions, 1491 deletions
diff --git a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/5x6_right_trackball.c b/keyboards/handwired/dactyl_manuform/5x6_right_trackball/5x6_right_trackball.c deleted file mode 100644 index 4048fb233c..0000000000 --- a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/5x6_right_trackball.c +++ /dev/null @@ -1,228 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#include "5x6_right_trackball.h" - -#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; -uint16_t dpi_array[] = TRACKBALL_DPI_OPTIONS; -#define DPI_OPTION_SIZE (sizeof(dpi_array) / sizeof(uint16_t)) - -bool BurstState = false; // init burst state for Trackball module -uint16_t MotionStart = 0; // Timer for accel, 0 is resting state - -__attribute__((weak)) void process_mouse_user(report_mouse_t* mouse_report, int16_t x, int16_t y) { - mouse_report->x = x; - mouse_report->y = y; -} - -__attribute__((weak)) void process_mouse(report_mouse_t* mouse_report) { - report_pmw_t data = pmw_read_burst(); - if (data.isOnSurface && data.isMotion) { - // Reset timer if stopped moving - if (!data.isMotion) { - if (MotionStart != 0) MotionStart = 0; - return; - } - - // Set timer if new motion - if ((MotionStart == 0) && data.isMotion) { - if (debug_mouse) dprintf("Starting motion.\n"); - MotionStart = timer_read(); - } - - if (debug_mouse) { - dprintf("Delt] d: %d t: %u\n", abs(data.dx) + abs(data.dy), MotionStart); - } - if (debug_mouse) { - dprintf("Pre ] X: %d, Y: %d\n", data.dx, data.dy); - } -#if defined(PROFILE_LINEAR) - float scale = float(timer_elaspsed(MotionStart)) / 1000.0; - data.dx *= scale; - data.dy *= scale; -#elif defined(PROFILE_INVERSE) - // TODO -#else - // no post processing -#endif - - // Wrap to HID size - data.dx = constrain(data.dx, -127, 127); - data.dy = constrain(data.dy, -127, 127); - if (debug_mouse) dprintf("Cons] X: %d, Y: %d\n", data.dx, data.dy); - // dprintf("Elapsed:%u, X: %f Y: %\n", i, pgm_read_byte(firmware_data+i)); - - mouse_report->x = -data.dx; - mouse_report->y = data.dy; - } -} - -bool process_record_kb(uint16_t keycode, keyrecord_t* record) { - if (!process_record_user(keycode, record)) { return false; } - -#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); - trackball_set_cpi(dpi_array[keyboard_config.dpi_config]); - } -#endif - -/* 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. - */ -#ifndef MOUSEKEY_ENABLE - if (IS_MOUSEKEY_BUTTON(keycode)) { - report_mouse_t currentReport = pointing_device_get_report(); - if (record->event.pressed) { - currentReport.buttons |= 1 << (keycode - KC_MS_BTN1); - } else { - currentReport.buttons &= ~(1 << (keycode - KC_MS_BTN1)); - } - pointing_device_set_report(currentReport); - pointing_device_send(); - } -#endif - - return true; -} - -// Hardware Setup -void keyboard_pre_init_kb(void) { - // debug_enable = true; - // debug_matrix = true; - // debug_mouse = true; - // debug_encoder = true; - - /* Ground all output pins connected to ground. This provides additional - * pathways to ground. If you're messing with this, know this: driving ANY - * of these pins high will cause a short. On the MCU. Ka-blooey. - */ - - // This is the debug LED. -#if defined(DEBUG_LED_PIN) - setPinOutput(DEBUG_LED_PIN); - writePin(DEBUG_LED_PIN, debug_enable); -#endif - - keyboard_pre_init_user(); -} - -#ifdef POINTING_DEVICE_ENABLE -void pointing_device_init(void) { - if (!is_keyboard_left()) { - // initialize ball sensor - pmw_spi_init(); - } - trackball_set_cpi(dpi_array[keyboard_config.dpi_config]); -} - -static bool has_report_changed(report_mouse_t new, report_mouse_t old) { - return (new.buttons != old.buttons) || - (new.x && new.x != old.x) || - (new.y && new.y != old.y) || - (new.h && new.h != old.h) || - (new.v && new.v != old.v); -} - -void pointing_device_task(void) { - report_mouse_t mouse_report = pointing_device_get_report(); - if (!is_keyboard_left()) { - process_mouse(&mouse_report); - } - - pointing_device_set_report(mouse_report); - pointing_device_send(); -} -#endif - -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]); -#endif - eeconfig_update_kb(keyboard_config.raw); - eeconfig_init_user(); -} - -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(); - } - matrix_init_user(); -} - -#ifdef POINTING_DEVICE_ENABLE -void pointing_device_send(void) { - static report_mouse_t old_report = {}; - report_mouse_t mouseReport = pointing_device_get_report(); - if (is_keyboard_master()) { - int8_t x = mouseReport.x, y = mouseReport.y; - mouseReport.x = 0; - mouseReport.y = 0; - process_mouse_user(&mouseReport, x, y); - if (has_report_changed(mouseReport, old_report)) { - host_mouse_send(&mouseReport); - } - } else { - master_mouse_send(mouseReport.x, mouseReport.y); - } - mouseReport.x = 0; - mouseReport.y = 0; - mouseReport.v = 0; - mouseReport.h = 0; - old_report = mouseReport; - pointing_device_set_report(mouseReport); -} -#endif - -#ifdef SWAP_HANDS_ENABLE -const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { - /* Left hand, matrix positions */ - {{5, 6}, {4, 6}, {3, 6}, {2, 6}, {1, 6}, {0, 6}}, - {{5, 7}, {4, 7}, {3, 7}, {2, 7}, {1, 7}, {0, 7}}, - {{5, 8}, {4, 8}, {3, 8}, {2, 8}, {1, 8}, {0, 8}}, - {{5, 9}, {4, 9}, {3, 9}, {2, 9}, {1, 9}, {0, 9}}, - {{5, 10}, {4, 10}, {3, 10}, {2, 10}, {1, 10}, {0, 10}}, - {{5, 11}, {4, 11}, {3, 11}, {2, 11}, {1, 11}, {0, 11}}, - /* Right hand, matrix positions */ - {{5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}}, - {{5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}}, - {{5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}}, - {{5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}}, - {{5, 4}, {4, 4}, {3, 4}, {2, 4}, {1, 4}, {0, 4}}, - {{5, 5}, {4, 5}, {3, 5}, {2, 5}, {1, 5}, {0, 5}} -}; -#endif diff --git a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/5x6_right_trackball.h b/keyboards/handwired/dactyl_manuform/5x6_right_trackball/5x6_right_trackball.h deleted file mode 100644 index ed408563f7..0000000000 --- a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/5x6_right_trackball.h +++ /dev/null @@ -1,73 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#pragma once - -#include "dactyl_manuform.h" -#include "quantum.h" -#include "spi_master.h" -#include "drivers/sensors/pmw3360.h" -#include "pointing_device.h" - - -#define ___ KC_NO - -#define LAYOUT_5x6_right_trackball(\ - L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ - L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ - L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ - L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ - L42, L43, R42, R43, \ - L44, L45, R41, \ - L54, L55, R51, \ - L52, L53, R52, R53 \ - ) \ - { \ - { L00, L01, L02, L03, L04, L05 }, \ - { L10, L11, L12, L13, L14, L15 }, \ - { L20, L21, L22, L23, L24, L25 }, \ - { L30, L31, L32, L33, L34, L35 }, \ - { ___, ___, L42, L43, L44, L45 }, \ - { ___, ___, L52, L53, L54, L55 }, \ - \ - { R00, R01, R02, R03, R04, R05 }, \ - { R10, R11, R12, R13, R14, R15 }, \ - { R20, R21, R22, R23, R24, R25 }, \ - { R30, R31, R32, R33, R34, R35 }, \ - { ___, R41, R42, R43, ___, ___ }, \ - { ___, R51, R52, R53, ___, ___ } \ -} - - -void process_wheel(report_mouse_t* mouse_report); -void process_wheel_user(report_mouse_t* mouse_report, int16_t h, int16_t v); - -typedef union { - uint32_t raw; - struct { - uint8_t dpi_config; - }; -} keyboard_config_t; - -extern keyboard_config_t keyboard_config; - -enum ploopy_keycodes { - DPI_CONFIG = SAFE_RANGE, - KEYMAP_SAFE_RANGE, -}; - -void master_mouse_send(int8_t x, int8_t y); -void trackball_set_cpi(uint16_t cpi); diff --git a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/config.h b/keyboards/handwired/dactyl_manuform/5x6_right_trackball/config.h deleted file mode 100644 index bc6d66bb9d..0000000000 --- a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/config.h +++ /dev/null @@ -1,72 +0,0 @@ -/* -Copyright 2012 Jun Wako <wakojun@gmail.com> -Copyright 2015 Jack Humbert - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. -*/ - -#pragma once - -#include "config_common.h" - -#define PRODUCT_ID 0x3536 -#define DEVICE_VER 0x0001 -#define PRODUCT Tractyl-Manuform (5x6 with right side Trackball) - -/* key matrix size */ -// Rows are doubled-up -#define MATRIX_ROWS 12 -#define MATRIX_COLS 6 - -// wiring of each half -#define MATRIX_COL_PINS { C0, C1, C2, C3, C4, C5 } -#define MATRIX_ROW_PINS { F7, F6, F5, F4, F3, F2 } - -#define DIODE_DIRECTION COL2ROW - -// WS2812 RGB LED strip input and number of LEDs -#define RGB_DI_PIN E7 -#define RGBLED_NUM 58 -#define RGBLIGHT_SPLIT -#define RGBLED_SPLIT { 30 , 28 } -#define RGBLIGHT_SLEEP -// #define RGBW -#define RGBLIGHT_LIMIT_VAL 100 -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ -// #define BACKLIGHT_LEVELS 3 - -#define DEBUG_LED_PIN D6 - -#define USB_POLLING_INTERVAL_MS 1 - -#define ROTATIONAL_TRANSFORM_ANGLE -25 - -/* Bootmagic Lite key configuration */ -#define BOOTMAGIC_LITE_ROW 0 -#define BOOTMAGIC_LITE_COLUMN 0 -#define BOOTMAGIC_LITE_ROW_RIGHT 6 -#define BOOTMAGIC_LITE_COLUMN_RIGHT 5 - -#define AUDIO_PIN C6 -#define AUDIO_PIN_ALT B7 - -#define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 4095 -#define DYNAMIC_KEYMAP_LAYER_COUNT 16 - -/* serial.c configuration for split keyboard */ -#undef SOFT_SERIAL_PIN -#define SOFT_SERIAL_PIN D2 diff --git a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/info.json b/keyboards/handwired/dactyl_manuform/5x6_right_trackball/info.json deleted file mode 100644 index 8a413ec44f..0000000000 --- a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/info.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "keyboard_name": "Dactyl Manuform 5x6", - "url": "", - "maintainer": "qmk", - "width": 17, - "height": 8, - "layouts": { - "LAYOUT_5x6_right_trackball": { - "layout": [ - {"label":"L00", "x":0, "y":0}, - {"label":"L01", "x":1, "y":0}, - {"label":"L02", "x":2, "y":0}, - {"label":"L03", "x":3, "y":0}, - {"label":"L04", "x":4, "y":0}, - {"label":"L05", "x":5, "y":0}, - {"label":"R00", "x":11, "y":0}, - {"label":"R01", "x":12, "y":0}, - {"label":"R02", "x":13, "y":0}, - {"label":"R03", "x":14, "y":0}, - {"label":"R04", "x":15, "y":0}, - {"label":"R05", "x":16, "y":0}, - {"label":"L10", "x":0, "y":1}, - {"label":"L11", "x":1, "y":1}, - {"label":"L12", "x":2, "y":1}, - {"label":"L13", "x":3, "y":1}, - {"label":"L14", "x":4, "y":1}, - {"label":"L15", "x":5, "y":1}, - {"label":"R10", "x":11, "y":1}, - {"label":"R11", "x":12, "y":1}, - {"label":"R12", "x":13, "y":1}, - {"label":"R13", "x":14, "y":1}, - {"label":"R14", "x":15, "y":1}, - {"label":"R15", "x":16, "y":1}, - {"label":"L20", "x":0, "y":2}, - {"label":"L21", "x":1, "y":2}, - {"label":"L22", "x":2, "y":2}, - {"label":"L23", "x":3, "y":2}, - {"label":"L24", "x":4, "y":2}, - {"label":"L25", "x":5, "y":2}, - {"label":"R20", "x":11, "y":2}, - {"label":"R21", "x":12, "y":2}, - {"label":"R22", "x":13, "y":2}, - {"label":"R23", "x":14, "y":2}, - {"label":"R24", "x":15, "y":2}, - {"label":"R25", "x":16, "y":2}, - {"label":"L30", "x":0, "y":3}, - {"label":"L31", "x":1, "y":3}, - {"label":"L32", "x":2, "y":3}, - {"label":"L33", "x":3, "y":3}, - {"label":"L34", "x":4, "y":3}, - {"label":"L35", "x":5, "y":3}, - {"label":"R30", "x":11, "y":3}, - {"label":"R31", "x":12, "y":3}, - {"label":"R32", "x":13, "y":3}, - {"label":"R33", "x":14, "y":3}, - {"label":"R34", "x":15, "y":3}, - {"label":"R35", "x":16, "y":3}, - {"label":"L42", "x":2, "y":4}, - {"label":"L43", "x":3, "y":4}, - {"label":"R42", "x":13, "y":4}, - {"label":"R43", "x":14, "y":4}, - {"label":"L44", "x":4, "y":5}, - {"label":"L45", "x":5, "y":5}, - {"label":"R41", "x":12, "y":5}, - {"label":"L54", "x":6, "y":6}, - {"label":"L55", "x":7, "y":6}, - {"label":"R51", "x":10, "y":6}, - {"label":"L52", "x":6, "y":7}, - {"label":"L53", "x":7, "y":7}, - {"label":"R52", "x":9, "y":7}, - {"label":"R53", "x":10, "y":7} - ] - } - } -} diff --git a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/default/config.h b/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/default/config.h deleted file mode 100644 index 5bad6bcab3..0000000000 --- a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/default/config.h +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - - - -#pragma once - - -#include "../drashna/config.h" diff --git a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/default/keymap.c b/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/default/keymap.c deleted file mode 100644 index 037f59af85..0000000000 --- a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/default/keymap.c +++ /dev/null @@ -1,17 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -// placeholder diff --git a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/default/rules.mk b/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/default/rules.mk deleted file mode 100644 index 457cda5b0a..0000000000 --- a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/default/rules.mk +++ /dev/null @@ -1,4 +0,0 @@ -USER_NAME := drashna -SRC += ../drashna/keymap.c - -include $(KEYBOARD_PATH_1)/keymaps/drashna/rules.mk diff --git a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/drashna/config.h b/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/drashna/config.h deleted file mode 100644 index dedd1f5fe2..0000000000 --- a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/drashna/config.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#pragma once - -// #define USE_I2C -#define SELECT_SOFT_SERIAL_SPEED 0 -// #define SERIAL_USE_MULTI_TRANSACTION -#define SPLIT_MODS_ENABLE -#define EE_HANDS - -#define TRACKBALL_DPI_OPTIONS \ - { 1200, 1800, 2600, 3400 } - -#define RGBLIGHT_MAX_BRIGHTNESS 60 - -#undef DEBOUNCE -#define DEBOUNCE 10 - -#define SOLENOID_PIN F1 -#define SOLENOID_DEFAULT_DWELL 8 - -#define OLED_DISPLAY_128X64 -#define OLED_BRIGHTNESS 50 - -#define MK_KINETIC_SPEED diff --git a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/drashna/keymap.c b/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/drashna/keymap.c deleted file mode 100644 index b3300daa9c..0000000000 --- a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/drashna/keymap.c +++ /dev/null @@ -1,250 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#include "drashna.h" - -// clang-format off -#define LAYOUT_5x6_right_trackball_wrapper(...) LAYOUT_5x6_right_trackball(__VA_ARGS__) -#define LAYOUT_5x6_right_trackball_base( \ - K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ - K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ - K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ - ) \ - LAYOUT_5x6_right_trackball_wrapper( \ - KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS, \ - SH_TT, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, SH_TT, \ - LALT_T(KC_TAB), K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(K1B), \ - OS_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \ - OS_LALT, OS_LGUI, TG_GAME, TG_DBLO, \ - OS_LGUI, KC_GRV, OS_RGUI, \ - KC_SPC, OS_LGUI, KC_ENT, \ - BK_LWER, TT(_MOUSE), TT(_MOUSE), DL_RAIS \ - ) -#define LAYOUT_5x6_right_trackball_base_wrapper(...) LAYOUT_5x6_right_trackball_base(__VA_ARGS__) - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT_5x6_right_trackball_base_wrapper( - _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, - _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, - _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ - ), - - [_COLEMAK] = LAYOUT_5x6_right_trackball_base_wrapper( - _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, - _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, - _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ - ), - - [_DVORAK] = LAYOUT_5x6_right_trackball_base_wrapper( - _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, - _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, - _________________DVORAK_L3_________________, _________________DVORAK_R3_________________ - ), - - [_WORKMAN] = LAYOUT_5x6_right_trackball_base_wrapper( - _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, - _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, - _________________WORKMAN_L3________________, _________________WORKMAN_R3________________ - ), - - [_NORMAN] = LAYOUT_5x6_right_trackball_base_wrapper( - _________________NORMAN_L1_________________, _________________NORMAN_L1_________________, - _________________NORMAN_L2_________________, _________________NORMAN_R2_________________, - _________________NORMAN_L3_________________, _________________NORMAN_R3_________________ - ), - - [_MALTRON] = LAYOUT_5x6_right_trackball_base_wrapper( - _________________MALTRON_L1________________, _________________MALTRON_R1________________, - _________________MALTRON_L2________________, _________________MALTRON_R2________________, - _________________MALTRON_L3________________, _________________MALTRON_R3________________ - ), - - [_EUCALYN] = LAYOUT_5x6_right_trackball_base_wrapper( - _________________EUCALYN_L1________________, _________________EUCALYN_R1________________, - _________________EUCALYN_L2________________, _________________EUCALYN_R2________________, - _________________EUCALYN_L3________________, _________________EUCALYN_R3________________ - ), - - [_CARPLAX] = LAYOUT_5x6_right_trackball_base_wrapper( - _____________CARPLAX_QFMLWY_L1_____________, _____________CARPLAX_QFMLWY_R1_____________, - _____________CARPLAX_QFMLWY_L2_____________, _____________CARPLAX_QFMLWY_R2_____________, - _____________CARPLAX_QFMLWY_L3_____________, _____________CARPLAX_QFMLWY_R3_____________ - ), - - [_MOUSE] = LAYOUT_5x6_right_trackball( - _______, _______, _______, _______, _______, _______, DPI_CONFIG, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, KC_WH_U, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, KC_WH_D, KC_BTN1, KC_BTN3, KC_BTN2, KC_BTN6, _______, - _______, _______, _______, _______, _______, _______, KC_BTN7, KC_BTN4, KC_BTN5, KC_BTN8, _______, _______, - _______, _______, _______, _______, - _______, _______, _______, - _______, _______, _______, - _______, _______, _______, _______ - ), - [_GAMEPAD] = LAYOUT_5x6_right_trackball( - KC_ESC, KC_NO, KC_1, KC_2, KC_3, KC_4, DPI_CONFIG, _______, _______, _______, _______, _______, - KC_F1, KC_K, KC_Q, KC_W, KC_E, KC_R, _______, _______, _______, _______, _______, _______, - KC_TAB, KC_G, KC_A, KC_S, KC_D, KC_F, _______, _______, _______, _______, _______, _______, - KC_LCTL, KC_LSFT, KC_Z, KC_X, KC_C, KC_H, _______, _______, _______, _______, _______, _______, - KC_I, KC_T, TG_GAME, KC_NO, - KC_V, KC_O, _______, - KC_SPC, KC_P, _______, - KC_H, KC_LGUI, _______, _______ - ), - [_DIABLO] = LAYOUT_5x6_right_trackball( - KC_ESC, KC_V, KC_D, KC_LALT, KC_NO, KC_NO, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, - KC_TAB, KC_S, KC_I, KC_F, KC_M, KC_T, _______, _______, _______, _______, _______, _______, - KC_Q, KC_1, KC_2, KC_3, KC_4, KC_G, _______, _______, _______, _______, _______, _______, - KC_LCTL, KC_D3_1, KC_D3_2, KC_D3_3, KC_D3_4, KC_Z, _______, _______, _______, _______, _______, _______, - KC_F, KC_L, KC_NO, TG_DBLO, - KC_DIABLO_CLEAR, KC_F, _______, - SFT_T(KC_SPC), KC_J, _______, - ALT_T(KC_Q), KC_LGUI, _______, _______ - ), - [_LOWER] = LAYOUT_5x6_right_trackball_wrapper( - KC_F12, _________________FUNC_LEFT_________________, _________________FUNC_RIGHT________________, KC_F11, - _______, _________________LOWER_L1__________________, _________________LOWER_R1__________________, _______, - _______, _________________LOWER_L2__________________, _________________LOWER_R2__________________, KC_PIPE, - _______, _________________LOWER_L3__________________, _________________LOWER_R3__________________, _______, - _______, _______, _______, _______, - _______, _______, _______, - _______, _______, _______, - _______, _______, _______, _______ - ), - [_RAISE] = LAYOUT_5x6_right_trackball_wrapper( - KC_F12, _________________FUNC_LEFT_________________, _________________FUNC_RIGHT________________, KC_F11, - KC_GRV, _________________RAISE_L1__________________, _________________RAISE_R1__________________, _______, - _______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS, - _______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______, - _______, _______, _______, _______, - _______, _______, _______, - _______, _______, _______, - _______, _______, _______, _______ - ), - [_ADJUST] = LAYOUT_5x6_right_trackball_wrapper( - KC_MAKE, ___________________BLANK___________________, _________________ADJUST_R1_________________, KC_RST, - VRSN, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, EEP_RST, - _______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, TG_MODS, - _______, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, KC_MPLY, - HPT_DWLI, HPT_DWLD, _______, _______, - HPT_TOG, HPT_BUZ, KC_NUKE, - _______, _______, _______, - _______, _______, KC_NUKE, _______ - ), -}; -// clang-format on - -#ifdef POINTING_DEVICE_ENABLE -static uint16_t mouse_timer = 0; -static uint16_t mouse_debounce_timer = 0; -static uint8_t mouse_keycode_tracker = 0; -bool tap_toggling = false; - -void process_mouse_user(report_mouse_t* mouse_report, int16_t x, int16_t y) { - if ((x || y) && timer_elapsed(mouse_timer) > 125) { - mouse_timer = timer_read(); - if (!layer_state_is(_MOUSE) && !(layer_state_is(_GAMEPAD) || layer_state_is(_DIABLO)) && timer_elapsed(mouse_debounce_timer) > 125) { - layer_on(_MOUSE); - } - } - -# ifdef TAPPING_TERM_PER_KEY |