Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add maccel #4

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions keyboards/bastardkb/charybdis/3x5/keymaps/vendor/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
#ifdef CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_ENABLE
# include "timer.h"
#endif // CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_ENABLE
#ifdef MACCEL_ENABLE
#include "features/maccel/maccel.h"
#endif

enum charybdis_keymap_layers {
LAYER_BASE = 0,
Expand Down Expand Up @@ -216,8 +219,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// clang-format on

#ifdef POINTING_DEVICE_ENABLE
# ifdef CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_ENABLE
report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) {
# ifdef CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_ENABLE
if (abs(mouse_report.x) > CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_THRESHOLD || abs(mouse_report.y) > CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_THRESHOLD) {
if (auto_pointer_layer_timer == 0) {
layer_on(LAYER_POINTER);
Expand All @@ -228,19 +231,24 @@ report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) {
}
auto_pointer_layer_timer = timer_read();
}
# endif // CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_ENABLE
#ifdef MACCEL_ENABLE
mouse_report = pointing_device_task_maccel(mouse_report);
#endif
return mouse_report;
}

void matrix_scan_user(void) {
# ifdef CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_ENABLE
if (auto_pointer_layer_timer != 0 && TIMER_DIFF_16(timer_read(), auto_pointer_layer_timer) >= CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_TIMEOUT_MS) {
auto_pointer_layer_timer = 0;
layer_off(LAYER_POINTER);
# ifdef RGB_MATRIX_ENABLE
rgb_matrix_mode_noeeprom(RGB_MATRIX_DEFAULT_MODE);
# endif // RGB_MATRIX_ENABLE
}
}
# endif // CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_ENABLE
}

# ifdef CHARYBDIS_AUTO_SNIPING_ON_LAYER
layer_state_t layer_state_set_user(layer_state_t state) {
Expand Down
4 changes: 4 additions & 0 deletions keyboards/bastardkb/charybdis/3x5/keymaps/vendor/rules.mk
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
VIA_ENABLE = yes

USER_NAME := bastardkb

MACCEL_ENABLE = yes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
187 changes: 187 additions & 0 deletions users/bastardkb/features/maccel/assets/charybdis_3x5.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
{
"name": "Charybdis Nano",
"vendorId": "0xA8F8",
"productId": "0x1832",
"menus": [
"qmk_rgb_matrix",
{
"label": "Mouse acceleration",
"content": [
{
"label": "Acceleration",
"content": [
{
"label": "Enabled",
"type": "toggle",
"content": [
"id_maccel_enabled",
24,
5
]
},
{
"label": "Takeoff",
"type": "range",
"options": [
0,
60000
],
"content": [
"id_maccel_takeoff",
24,
1
]
},
{
"label": "Growth Rate",
"type": "range",
"options": [
0,
60000
],
"content": [
"id_maccel_growth_rate",
24,
2
]
},
{
"label": "Offset",
"type": "range",
"options": [
0,
60000
],
"content": [
"id_maccel_offset",
24,
3
]
},
{
"label": "Limit",
"type": "range",
"options": [
0,
60000
],
"content": [
"id_maccel_limit",
24,
4
]
}
]
}
]
}
],
"matrix": {
"rows": 8,
"cols": 5
},
"customKeycodes": [
{
"title": "Default DPI Increase",
"name": "Default DPI Inc",
"shortName": "DPI+"
},
{
"title": "Default DPI Decrease",
"name": "Default DPI Dec",
"shortName": "DPI-"
},
{
"title": "Sniping DPI Increase",
"name": "Sniping DPI Inc",
"shortName": "Snp+"
},
{
"title": "Sniping DPI Decrease",
"name": "Sniping DPI Dec",
"shortName": "Snp-"
},
{
"title": "Sniping Momentary",
"name": "Sniping MO",
"shortName": "Snp"
},
{
"title": "Sniping Toggle",
"name": "Sniping TO",
"shortName": "SnpT"
},
{
"title": "Drag-scroll Momentary",
"name": "Drag-scroll MO",
"shortName": "Drg"
},
{
"title": "Drag-scroll Toggle",
"name": "Drag-scroll TG",
"shortName": "DrgT"
}
],
"layouts": {
"keymap": [
[
"0,0",
"0,1",
"0,2",
"0,3",
"0,4",
{
"x": 4
},
"4,4",
"4,3",
"4,2",
"4,1",
"4,0"
],
[
"1,0",
"1,1",
"1,2",
"1,3",
"1,4",
{
"x": 4
},
"5,4",
"5,3",
"5,2",
"5,1",
"5,0"
],
[
"2,0",
"2,1",
"2,2",
"2,3",
"2,4",
{
"x": 4
},
"6,4",
"6,3",
"6,2",
"6,1",
"6,0"
],
[
{
"x": 3
},
"3,2",
"3,3",
"3,0",
{
"x": 2
},
"7,0",
"7,2"
]
]
}
}
Loading