mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-07-27 03:21:15 +00:00
one_handed_keyboard
This commit is contained in:
parent
e6ea61000b
commit
71d6c9eafd
5
keyboards/htx_studio/.vscode/settings.json
vendored
Normal file
5
keyboards/htx_studio/.vscode/settings.json
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"files.associations": {
|
||||||
|
"one_handed_keyboard.h": "c"
|
||||||
|
}
|
||||||
|
}
|
@ -30,7 +30,6 @@
|
|||||||
|
|
||||||
#ifdef RGB_MATRIX_ENABLE
|
#ifdef RGB_MATRIX_ENABLE
|
||||||
|
|
||||||
#define WS2812_BITBANG_NOP_FUDGE 0
|
|
||||||
#define WS2812_PWM_DRIVER PWMD3
|
#define WS2812_PWM_DRIVER PWMD3
|
||||||
#define WS2812_PWM_CHANNEL 1
|
#define WS2812_PWM_CHANNEL 1
|
||||||
#define WS2812_DMA_STREAM STM32_DMA1_STREAM1
|
#define WS2812_DMA_STREAM STM32_DMA1_STREAM1
|
||||||
@ -38,4 +37,3 @@
|
|||||||
#define WS2812_DMAMUX_ID STM32_DMAMUX1_TIM3_UP
|
#define WS2812_DMAMUX_ID STM32_DMAMUX1_TIM3_UP
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
25
keyboards/htx_studio/one_handed_keyboard/info.json
Normal file
25
keyboards/htx_studio/one_handed_keyboard/info.json
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"manufacturer": "HTXStudio",
|
||||||
|
"maintainer": "HTXStudio",
|
||||||
|
"bootloader": "stm32-dfu",
|
||||||
|
"diode_direction": "ROW2COL",
|
||||||
|
"encoder": {
|
||||||
|
"rotary": [
|
||||||
|
{"pin_a": "A9", "pin_b": "A10"}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"features": {
|
||||||
|
"bootmagic": true,
|
||||||
|
"encoder": true,
|
||||||
|
"extrakey": true,
|
||||||
|
"mousekey": true,
|
||||||
|
"nkro": true,
|
||||||
|
"pointing_device": true
|
||||||
|
},
|
||||||
|
"matrix_pins": {
|
||||||
|
"cols": ["A0", "A1", "A2", "C4", "B0", "B1", "B2", "B7", "B5", "B3", "B10", "C11", "C10", "A15"],
|
||||||
|
"rows": ["B12", "B15", "C6", "B13", "B14", "A8"]
|
||||||
|
},
|
||||||
|
"processor": "STM32G431",
|
||||||
|
"url": "https://github.com/htx-studio"
|
||||||
|
}
|
@ -1,32 +1,8 @@
|
|||||||
{
|
{
|
||||||
"manufacturer": "HTXStudio",
|
|
||||||
"keyboard_name": "One-Handed_Keyboard_ML",
|
"keyboard_name": "One-Handed_Keyboard_ML",
|
||||||
"maintainer": "HTXStudio",
|
|
||||||
"bootloader": "stm32-dfu",
|
|
||||||
"diode_direction": "ROW2COL",
|
|
||||||
"encoder": {
|
|
||||||
"rotary": [
|
|
||||||
{"pin_a": "A9", "pin_b": "A10"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"features": {
|
"features": {
|
||||||
"bootmagic": true,
|
|
||||||
"encoder": true,
|
|
||||||
"extrakey": true,
|
|
||||||
"mousekey": true,
|
|
||||||
"nkro": true,
|
|
||||||
"pointing_device": true,
|
|
||||||
"rgb_matrix": true
|
"rgb_matrix": true
|
||||||
},
|
},
|
||||||
"matrix": {
|
|
||||||
"cols": 14,
|
|
||||||
"rows": 6
|
|
||||||
},
|
|
||||||
"matrix_pins": {
|
|
||||||
"cols": ["A0", "A1", "A2", "C4", "B0", "B1", "B2", "B7", "B5", "B3", "B10", "C11", "C10", "A15"],
|
|
||||||
"rows": ["B12", "B15", "C6", "B13", "B14", "A8"]
|
|
||||||
},
|
|
||||||
"processor": "STM32G431",
|
|
||||||
"rgb_matrix": {
|
"rgb_matrix": {
|
||||||
"animations": {
|
"animations": {
|
||||||
"alphas_mods": true,
|
"alphas_mods": true,
|
||||||
@ -138,7 +114,6 @@
|
|||||||
"max_brightness": 110,
|
"max_brightness": 110,
|
||||||
"sleep": true
|
"sleep": true
|
||||||
},
|
},
|
||||||
"url": "https://github.com/htx-studio",
|
|
||||||
"usb": {
|
"usb": {
|
||||||
"device_version": "3.1.0",
|
"device_version": "3.1.0",
|
||||||
"pid": "0x03AF",
|
"pid": "0x03AF",
|
@ -15,23 +15,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include QMK_KEYBOARD_H
|
#include QMK_KEYBOARD_H
|
||||||
|
#include "one_handed_keyboard.h"
|
||||||
#define TRACKBALL_DPI_MIN 1000
|
|
||||||
#define TRACKBALL_DPI_MAX 8000
|
|
||||||
#define TRACKBALL_DPI_DEFAULT 3000
|
|
||||||
#define TRACKBALL_DPI_STEP 1000
|
|
||||||
|
|
||||||
enum my_keycodes {
|
enum my_keycodes {
|
||||||
DPI_UP = SAFE_RANGE,
|
DPI_UP = SAFE_RANGE,
|
||||||
DPI_DOWN
|
DPI_DOWN
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef union {
|
|
||||||
uint16_t TrackballDPI;
|
|
||||||
} user_config_t;
|
|
||||||
user_config_t user_config;
|
|
||||||
|
|
||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
// ┏━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┓
|
// ┏━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┓
|
||||||
@ -93,58 +83,26 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void pointing_device_init_kb(void) {
|
|
||||||
wait_ms(10);
|
|
||||||
user_config.TrackballDPI = eeconfig_read_user();
|
|
||||||
wait_ms(10);
|
|
||||||
adns9800_init();
|
|
||||||
wait_ms(10);
|
|
||||||
pointing_device_set_cpi(user_config.TrackballDPI);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ADNS9800. The CPI range is 800-8200, in increments of 200.
|
// ADNS9800. The CPI range is 800-8200, in increments of 200.
|
||||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
switch (keycode) {
|
switch (keycode) {
|
||||||
case DPI_UP: {
|
case DPI_UP: {
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
user_config.TrackballDPI += TRACKBALL_DPI_STEP;
|
pointing_adns9800_cpi_up();
|
||||||
if(user_config.TrackballDPI > TRACKBALL_DPI_MAX) {
|
|
||||||
user_config.TrackballDPI = TRACKBALL_DPI_MAX;
|
|
||||||
}
|
|
||||||
eeconfig_update_user(user_config.TrackballDPI);
|
|
||||||
pointing_device_set_cpi(user_config.TrackballDPI);
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case DPI_DOWN: {
|
case DPI_DOWN: {
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
user_config.TrackballDPI -= TRACKBALL_DPI_STEP;
|
pointing_adns9800_cpi_down();
|
||||||
if(user_config.TrackballDPI < TRACKBALL_DPI_MIN) {
|
|
||||||
user_config.TrackballDPI = TRACKBALL_DPI_MIN;
|
|
||||||
}
|
}
|
||||||
eeconfig_update_user(user_config.TrackballDPI);
|
break;
|
||||||
pointing_device_set_cpi(user_config.TrackballDPI);
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
default: break;
|
||||||
}
|
}
|
||||||
default:
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void eeconfig_init_user(void) {
|
void eeconfig_init_user(void) {
|
||||||
user_config.TrackballDPI = TRACKBALL_DPI_DEFAULT;
|
pointing_adns9800_reset();
|
||||||
wait_ms(10);
|
|
||||||
pointing_device_set_cpi(user_config.TrackballDPI);
|
|
||||||
eeconfig_update_user(user_config.TrackballDPI);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
|
|
||||||
if (host_keyboard_led_state().caps_lock) {
|
|
||||||
RGB_MATRIX_INDICATOR_SET_COLOR(28, 255, 255, 255); // assuming caps lock is at led #5
|
|
||||||
} else {
|
|
||||||
RGB_MATRIX_INDICATOR_SET_COLOR(28, 0, 0, 0);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright 2020 QMK
|
/* Copyright 2025 htx-studio (@https://github.com/htx-studio)
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -14,12 +14,14 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#include "rgb_matrix.h"
|
||||||
|
#include "host.h"
|
||||||
#define HAL_USE_PWM TRUE
|
|
||||||
#define HAL_USE_SPI TRUE
|
|
||||||
#define SPI_USE_WAIT TRUE
|
|
||||||
#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD
|
|
||||||
|
|
||||||
#include_next <halconf.h>
|
|
||||||
|
|
||||||
|
bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
|
||||||
|
if (host_keyboard_led_state().caps_lock) {
|
||||||
|
RGB_MATRIX_INDICATOR_SET_COLOR(28, 255, 255, 255); // assuming caps lock is at led #5
|
||||||
|
} else {
|
||||||
|
RGB_MATRIX_INDICATOR_SET_COLOR(28, 0, 0, 0);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
@ -12,11 +12,11 @@ This is a keyboard with a fan-shaped layout and 59 keys.The commonly used button
|
|||||||
|
|
||||||
Make example for this keyboard (after setting up your build environment):
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
`make htx_studio/one_handed_keyboard_ml:default`
|
`make htx_studio/one_handed_keyboard/ml:default`
|
||||||
|
|
||||||
Flashing example for this keyboard:
|
Flashing example for this keyboard:
|
||||||
|
|
||||||
`make htx_studio/one_handed_keyboard_ml:default:flash`
|
`make htx_studio/one_handed_keyboard/ml:default:flash`
|
||||||
|
|
||||||
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).
|
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).
|
||||||
|
|
@ -1,32 +1,8 @@
|
|||||||
{
|
{
|
||||||
"manufacturer": "HTXStudio",
|
|
||||||
"keyboard_name": "One-Handed_Keyboard_MR",
|
"keyboard_name": "One-Handed_Keyboard_MR",
|
||||||
"maintainer": "HTXStudio",
|
|
||||||
"bootloader": "stm32-dfu",
|
|
||||||
"diode_direction": "ROW2COL",
|
|
||||||
"encoder": {
|
|
||||||
"rotary": [
|
|
||||||
{"pin_a": "A9", "pin_b": "A10"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"features": {
|
"features": {
|
||||||
"bootmagic": true,
|
|
||||||
"encoder": true,
|
|
||||||
"extrakey": true,
|
|
||||||
"mousekey": true,
|
|
||||||
"nkro": true,
|
|
||||||
"pointing_device": true,
|
|
||||||
"rgb_matrix": true
|
"rgb_matrix": true
|
||||||
},
|
},
|
||||||
"matrix": {
|
|
||||||
"cols": 14,
|
|
||||||
"rows": 6
|
|
||||||
},
|
|
||||||
"matrix_pins": {
|
|
||||||
"cols": ["A0", "A1", "A2", "C4", "B0", "B1", "B2", "B7", "B5", "B3", "B10", "C11", "C10", "A15"],
|
|
||||||
"rows": ["B12", "B15", "C6", "B13", "B14", "A8"]
|
|
||||||
},
|
|
||||||
"processor": "STM32G431",
|
|
||||||
"rgb_matrix": {
|
"rgb_matrix": {
|
||||||
"animations": {
|
"animations": {
|
||||||
"alphas_mods": true,
|
"alphas_mods": true,
|
||||||
@ -138,7 +114,6 @@
|
|||||||
"max_brightness": 110,
|
"max_brightness": 110,
|
||||||
"sleep": true
|
"sleep": true
|
||||||
},
|
},
|
||||||
"url": "https://github.com/htx-studio",
|
|
||||||
"usb": {
|
"usb": {
|
||||||
"device_version": "3.1.0",
|
"device_version": "3.1.0",
|
||||||
"pid": "0x03BF",
|
"pid": "0x03BF",
|
@ -15,22 +15,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include QMK_KEYBOARD_H
|
#include QMK_KEYBOARD_H
|
||||||
|
#include "one_handed_keyboard.h"
|
||||||
#define TRACKBALL_DPI_MIN 1000
|
|
||||||
#define TRACKBALL_DPI_MAX 8000
|
|
||||||
#define TRACKBALL_DPI_DEFAULT 3000
|
|
||||||
#define TRACKBALL_DPI_STEP 1000
|
|
||||||
|
|
||||||
enum my_keycodes {
|
enum my_keycodes {
|
||||||
DPI_UP = SAFE_RANGE,
|
DPI_UP = SAFE_RANGE,
|
||||||
DPI_DOWN
|
DPI_DOWN
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef union {
|
|
||||||
uint16_t TrackballDPI;
|
|
||||||
} user_config_t;
|
|
||||||
user_config_t user_config;
|
|
||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
// ┏━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┓
|
// ┏━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┓
|
||||||
@ -89,59 +80,26 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void pointing_device_init_kb(void) {
|
|
||||||
wait_ms(10);
|
|
||||||
user_config.TrackballDPI = eeconfig_read_user();
|
|
||||||
wait_ms(10);
|
|
||||||
adns9800_init();
|
|
||||||
wait_ms(10);
|
|
||||||
pointing_device_set_cpi(user_config.TrackballDPI);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ADNS9800. The CPI range is 800-8200, in increments of 200.
|
// ADNS9800. The CPI range is 800-8200, in increments of 200.
|
||||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
switch (keycode) {
|
switch (keycode) {
|
||||||
case DPI_UP: {
|
case DPI_UP: {
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
user_config.TrackballDPI += TRACKBALL_DPI_STEP;
|
pointing_adns9800_cpi_up();
|
||||||
if(user_config.TrackballDPI > TRACKBALL_DPI_MAX) {
|
|
||||||
user_config.TrackballDPI = TRACKBALL_DPI_MAX;
|
|
||||||
}
|
|
||||||
eeconfig_update_user(user_config.TrackballDPI);
|
|
||||||
pointing_device_set_cpi(user_config.TrackballDPI);
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case DPI_DOWN: {
|
case DPI_DOWN: {
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
user_config.TrackballDPI -= TRACKBALL_DPI_STEP;
|
pointing_adns9800_cpi_down();
|
||||||
if(user_config.TrackballDPI < TRACKBALL_DPI_MIN) {
|
|
||||||
user_config.TrackballDPI = TRACKBALL_DPI_MIN;
|
|
||||||
}
|
}
|
||||||
eeconfig_update_user(user_config.TrackballDPI);
|
break;
|
||||||
pointing_device_set_cpi(user_config.TrackballDPI);
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
default: break;
|
||||||
}
|
}
|
||||||
default:
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void eeconfig_init_user(void) {
|
void eeconfig_init_user(void) {
|
||||||
user_config.TrackballDPI = TRACKBALL_DPI_DEFAULT;
|
pointing_adns9800_reset();
|
||||||
wait_ms(10);
|
|
||||||
pointing_device_set_cpi(user_config.TrackballDPI);
|
|
||||||
eeconfig_update_user(user_config.TrackballDPI);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
|
|
||||||
if (host_keyboard_led_state().caps_lock) {
|
|
||||||
RGB_MATRIX_INDICATOR_SET_COLOR(28, 255, 255, 255); // assuming caps lock is at led #5
|
|
||||||
} else {
|
|
||||||
RGB_MATRIX_INDICATOR_SET_COLOR(28, 0, 0, 0);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
27
keyboards/htx_studio/one_handed_keyboard/mr/mr.c
Normal file
27
keyboards/htx_studio/one_handed_keyboard/mr/mr.c
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
/* Copyright 2025 htx-studio (@https://github.com/htx-studio)
|
||||||
|
*
|
||||||
|
* 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 "rgb_matrix.h"
|
||||||
|
#include "host.h"
|
||||||
|
|
||||||
|
bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
|
||||||
|
if (host_keyboard_led_state().caps_lock) {
|
||||||
|
RGB_MATRIX_INDICATOR_SET_COLOR(28, 255, 255, 255); // assuming caps lock is at led #5
|
||||||
|
} else {
|
||||||
|
RGB_MATRIX_INDICATOR_SET_COLOR(28, 0, 0, 0);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
@ -12,11 +12,11 @@ This is a keyboard with a fan-shaped layout and 59 keys.The commonly used button
|
|||||||
|
|
||||||
Make example for this keyboard (after setting up your build environment):
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
`make htx_studio/one_handed_keyboard_mr:default`
|
`make htx_studio/one_handed_keyboard/mr:default`
|
||||||
|
|
||||||
Flashing example for this keyboard:
|
Flashing example for this keyboard:
|
||||||
|
|
||||||
`make htx_studio/one_handed_keyboard_mr:default:flash`
|
`make htx_studio/one_handed_keyboard/mr:default:flash`
|
||||||
|
|
||||||
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).
|
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).
|
||||||
|
|
@ -0,0 +1,61 @@
|
|||||||
|
/* Copyright 2025 htx-studio (@https://github.com/htx-studio)
|
||||||
|
*
|
||||||
|
* 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 "wait.h"
|
||||||
|
#include "eeconfig.h"
|
||||||
|
#include "pointing_device.h"
|
||||||
|
#include "one_handed_keyboard.h"
|
||||||
|
|
||||||
|
#define TRACKBALL_DPI_MIN 1000
|
||||||
|
#define TRACKBALL_DPI_MAX 8000
|
||||||
|
#define TRACKBALL_DPI_DEFAULT 3000
|
||||||
|
#define TRACKBALL_DPI_STEP 1000
|
||||||
|
|
||||||
|
user_config_t user_config;
|
||||||
|
|
||||||
|
void pointing_device_init_kb(void) {
|
||||||
|
wait_ms(10);
|
||||||
|
user_config.TrackballDPI = eeconfig_read_user();
|
||||||
|
wait_ms(10);
|
||||||
|
adns9800_init();
|
||||||
|
wait_ms(10);
|
||||||
|
pointing_device_set_cpi(user_config.TrackballDPI);
|
||||||
|
}
|
||||||
|
|
||||||
|
void pointing_adns9800_cpi_up(void) {
|
||||||
|
user_config.TrackballDPI += TRACKBALL_DPI_STEP;
|
||||||
|
if(user_config.TrackballDPI > TRACKBALL_DPI_MAX) {
|
||||||
|
user_config.TrackballDPI = TRACKBALL_DPI_MAX;
|
||||||
|
}
|
||||||
|
eeconfig_update_user(user_config.TrackballDPI);
|
||||||
|
pointing_device_set_cpi(user_config.TrackballDPI);
|
||||||
|
}
|
||||||
|
|
||||||
|
void pointing_adns9800_cpi_down(void) {
|
||||||
|
user_config.TrackballDPI -= TRACKBALL_DPI_STEP;
|
||||||
|
if(user_config.TrackballDPI < TRACKBALL_DPI_MIN) {
|
||||||
|
user_config.TrackballDPI = TRACKBALL_DPI_MIN;
|
||||||
|
}
|
||||||
|
eeconfig_update_user(user_config.TrackballDPI);
|
||||||
|
pointing_device_set_cpi(user_config.TrackballDPI);
|
||||||
|
}
|
||||||
|
|
||||||
|
void pointing_adns9800_reset(void) {
|
||||||
|
user_config.TrackballDPI = TRACKBALL_DPI_DEFAULT;
|
||||||
|
wait_ms(10);
|
||||||
|
eeconfig_update_user(user_config.TrackballDPI);
|
||||||
|
pointing_device_set_cpi(user_config.TrackballDPI);
|
||||||
|
}
|
@ -14,17 +14,17 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#ifndef ONE_HANDED_KEYBOARD_H
|
||||||
|
#define ONE_HANDED_KEYBOARD_H
|
||||||
|
|
||||||
#define SPI_DRIVER SPID1
|
#include "quantum.h"
|
||||||
#define SPI_SCK_PIN A5
|
|
||||||
#define SPI_MISO_PIN A6
|
|
||||||
#define SPI_MOSI_PIN A7
|
|
||||||
|
|
||||||
#define POINTING_DEVICE_CS_PIN A4
|
typedef union {
|
||||||
#define POINTING_DEVICE_MOTION_PIN A3
|
uint16_t TrackballDPI;
|
||||||
#define POINTING_DEVICE_TASK_THROTTLE_MS 1
|
} user_config_t;
|
||||||
#define POINTING_DEVICE_INVERT_X 1
|
|
||||||
|
|
||||||
#define ENCODER_RESOLUTION 2
|
void pointing_adns9800_cpi_up(void);
|
||||||
|
void pointing_adns9800_cpi_down(void);
|
||||||
|
void pointing_adns9800_reset(void);
|
||||||
|
|
||||||
|
#endif // ONE_HANDED_KEYBOARD_H
|
@ -1,32 +1,5 @@
|
|||||||
{
|
{
|
||||||
"manufacturer": "HTXStudio",
|
|
||||||
"keyboard_name": "One-Handed_Keyboard_SL",
|
"keyboard_name": "One-Handed_Keyboard_SL",
|
||||||
"maintainer": "HTXStudio",
|
|
||||||
"bootloader": "stm32-dfu",
|
|
||||||
"diode_direction": "ROW2COL",
|
|
||||||
"encoder": {
|
|
||||||
"rotary": [
|
|
||||||
{"pin_a": "A9", "pin_b": "A10"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"features": {
|
|
||||||
"bootmagic": true,
|
|
||||||
"encoder": true,
|
|
||||||
"extrakey": true,
|
|
||||||
"mousekey": true,
|
|
||||||
"nkro": true,
|
|
||||||
"pointing_device": true
|
|
||||||
},
|
|
||||||
"matrix": {
|
|
||||||
"cols": 14,
|
|
||||||
"rows": 6
|
|
||||||
},
|
|
||||||
"matrix_pins": {
|
|
||||||
"cols": ["A0", "A1", "A2", "C4", "B0", "B1", "B2", "B7", "B5", "B3", "B10", "C11", "C10", "A15"],
|
|
||||||
"rows": ["B12", "B15", "C6", "B13", "B14", "A8"]
|
|
||||||
},
|
|
||||||
"processor": "STM32G431",
|
|
||||||
"url": "https://github.com/htx-studio",
|
|
||||||
"usb": {
|
"usb": {
|
||||||
"device_version": "3.1.0",
|
"device_version": "3.1.0",
|
||||||
"pid": "0x03BE",
|
"pid": "0x03BE",
|
@ -15,22 +15,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include QMK_KEYBOARD_H
|
#include QMK_KEYBOARD_H
|
||||||
|
#include "one_handed_keyboard.h"
|
||||||
#define TRACKBALL_DPI_MIN 1000
|
|
||||||
#define TRACKBALL_DPI_MAX 8000
|
|
||||||
#define TRACKBALL_DPI_DEFAULT 3000
|
|
||||||
#define TRACKBALL_DPI_STEP 1000
|
|
||||||
|
|
||||||
enum my_keycodes {
|
enum my_keycodes {
|
||||||
DPI_UP = SAFE_RANGE,
|
DPI_UP = SAFE_RANGE,
|
||||||
DPI_DOWN
|
DPI_DOWN
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef union {
|
|
||||||
uint16_t TrackballDPI;
|
|
||||||
} user_config_t;
|
|
||||||
user_config_t user_config;
|
|
||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
|
||||||
@ -72,49 +63,26 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void pointing_device_init_kb(void) {
|
|
||||||
wait_ms(10);
|
|
||||||
user_config.TrackballDPI = eeconfig_read_user();
|
|
||||||
wait_ms(10);
|
|
||||||
adns9800_init();
|
|
||||||
wait_ms(10);
|
|
||||||
pointing_device_set_cpi(user_config.TrackballDPI);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ADNS9800. The CPI range is 800-8200, in increments of 200.
|
// ADNS9800. The CPI range is 800-8200, in increments of 200.
|
||||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
switch (keycode) {
|
switch (keycode) {
|
||||||
case DPI_UP: {
|
case DPI_UP: {
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
user_config.TrackballDPI += TRACKBALL_DPI_STEP;
|
pointing_adns9800_cpi_up();
|
||||||
if(user_config.TrackballDPI > TRACKBALL_DPI_MAX) {
|
|
||||||
user_config.TrackballDPI = TRACKBALL_DPI_MAX;
|
|
||||||
}
|
|
||||||
eeconfig_update_user(user_config.TrackballDPI);
|
|
||||||
pointing_device_set_cpi(user_config.TrackballDPI);
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case DPI_DOWN: {
|
case DPI_DOWN: {
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
user_config.TrackballDPI -= TRACKBALL_DPI_STEP;
|
pointing_adns9800_cpi_down();
|
||||||
if(user_config.TrackballDPI < TRACKBALL_DPI_MIN) {
|
|
||||||
user_config.TrackballDPI = TRACKBALL_DPI_MIN;
|
|
||||||
}
|
}
|
||||||
eeconfig_update_user(user_config.TrackballDPI);
|
break;
|
||||||
pointing_device_set_cpi(user_config.TrackballDPI);
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
default: break;
|
||||||
}
|
}
|
||||||
default:
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void eeconfig_init_user(void) {
|
void eeconfig_init_user(void) {
|
||||||
user_config.TrackballDPI = TRACKBALL_DPI_DEFAULT;
|
pointing_adns9800_reset();
|
||||||
wait_ms(10);
|
|
||||||
pointing_device_set_cpi(user_config.TrackballDPI);
|
|
||||||
eeconfig_update_user(user_config.TrackballDPI);
|
|
||||||
}
|
}
|
@ -12,11 +12,11 @@ This is a keyboard with a fan-shaped layout and 59 keys.The commonly used button
|
|||||||
|
|
||||||
Make example for this keyboard (after setting up your build environment):
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
`make htx_studio/one_handed_keyboard_sl:default`
|
`make htx_studio/one_handed_keyboard/sl:default`
|
||||||
|
|
||||||
Flashing example for this keyboard:
|
Flashing example for this keyboard:
|
||||||
|
|
||||||
`make htx_studio/one_handed_keyboard_sl:default:flash`
|
`make htx_studio/one_handed_keyboard/sl:default:flash`
|
||||||
|
|
||||||
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).
|
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).
|
||||||
|
|
@ -1,42 +0,0 @@
|
|||||||
/* Copyright 2025 htx-studio (@https://github.com/htx-studio)
|
|
||||||
*
|
|
||||||
* 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 SPI_DRIVER SPID1
|
|
||||||
#define SPI_SCK_PIN A5
|
|
||||||
#define SPI_MISO_PIN A6
|
|
||||||
#define SPI_MOSI_PIN A7
|
|
||||||
|
|
||||||
#define POINTING_DEVICE_CS_PIN A4
|
|
||||||
#define POINTING_DEVICE_MOTION_PIN A3
|
|
||||||
#define POINTING_DEVICE_TASK_THROTTLE_MS 1
|
|
||||||
#define POINTING_DEVICE_INVERT_X 1
|
|
||||||
|
|
||||||
#define ENCODER_RESOLUTION 2
|
|
||||||
|
|
||||||
#ifdef RGB_MATRIX_ENABLE
|
|
||||||
|
|
||||||
#define WS2812_BITBANG_NOP_FUDGE 0
|
|
||||||
#define WS2812_PWM_DRIVER PWMD3
|
|
||||||
#define WS2812_PWM_CHANNEL 1
|
|
||||||
#define WS2812_DMA_STREAM STM32_DMA1_STREAM1
|
|
||||||
#define WS2812_DMA_CHANNEL 1
|
|
||||||
#define WS2812_DMAMUX_ID STM32_DMAMUX1_TIM3_UP
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
|||||||
/* Copyright 2020 QMK
|
|
||||||
*
|
|
||||||
* 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_next <mcuconf.h>
|
|
||||||
|
|
||||||
#undef STM32_SPI_USE_SPI1
|
|
||||||
#define STM32_SPI_USE_SPI1 TRUE
|
|
||||||
|
|
||||||
/* enable TIM3, used for RGB LED PWM driver */
|
|
||||||
#undef STM32_PWM_USE_TIM3
|
|
||||||
#define STM32_PWM_USE_TIM3 TRUE
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
|||||||
/* Copyright 2020 QMK
|
|
||||||
*
|
|
||||||
* 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 HAL_USE_SPI TRUE
|
|
||||||
#define SPI_USE_WAIT TRUE
|
|
||||||
#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD
|
|
||||||
|
|
||||||
#include_next <halconf.h>
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
|||||||
/* Copyright 2020 QMK
|
|
||||||
*
|
|
||||||
* 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_next <mcuconf.h>
|
|
||||||
|
|
||||||
#undef STM32_SPI_USE_SPI1
|
|
||||||
#define STM32_SPI_USE_SPI1 TRUE
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user