diff options
author | lokher <lokher@gmail.com> | 2023-04-26 16:32:15 +0800 |
---|---|---|
committer | lokher <lokher@gmail.com> | 2023-04-26 16:32:15 +0800 |
commit | e4f4ceaf3f2e3d25fb282273a81f9b58790fc427 (patch) | |
tree | c0a257eab0ffe5238fdf2c04882e8ee1fe8fc46e /users/drashna/pointing | |
parent | 103badc87cb50db1ff3851c84331e86ba78fb681 (diff) |
merge upstream 713427c
Diffstat (limited to 'users/drashna/pointing')
-rw-r--r-- | users/drashna/pointing/pointing.c | 13 | ||||
-rw-r--r-- | users/drashna/pointing/pointing_config.h | 6 |
2 files changed, 13 insertions, 6 deletions
diff --git a/users/drashna/pointing/pointing.c b/users/drashna/pointing/pointing.c index 1b64502ed3..18dad0da81 100644 --- a/users/drashna/pointing/pointing.c +++ b/users/drashna/pointing/pointing.c @@ -2,6 +2,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include "pointing.h" +#include "math.h" static uint16_t mouse_debounce_timer = 0; bool enable_acceleration = false; @@ -38,8 +39,10 @@ report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) { oled_timer_reset(); #endif if (enable_acceleration) { - x = (mouse_xy_report_t)(x > 0 ? x * x / 16 + x : -x * x / 16 + x); - y = (mouse_xy_report_t)(y > 0 ? y * y / 16 + y : -y * y / 16 + y); + x = (mouse_xy_report_t)(x > 0 ? pow(4, x) / 2 + x : -pow(4, abs(x)) / 2 + x); + y = (mouse_xy_report_t)(y > 0 ? pow(5, y) / 2 + y : -pow(5, abs(y)) / 2 + y); +// x = (mouse_xy_report_t)(x > 0 ? x * x / 16 + x : -x * x / 16 + x); +// y = (mouse_xy_report_t)(y > 0 ? y * y / 16 + y : -y * y / 16 + y); } mouse_report.x = x; mouse_report.y = y; @@ -81,10 +84,8 @@ bool is_mouse_record_user(uint16_t keycode, keyrecord_t* record) { switch (keycode) { # if defined(KEYBOARD_ploopy) case DPI_CONFIG: -# elif (defined(KEYBOARD_bastardkb_charybdis) || defined(KEYBOARD_handwired_tractyl_manuform)) && !defined(NO_CHARYBDIS_KEYCODES) - case SAFE_RANGE ...(CHARYBDIS_SAFE_RANGE - 1): -# elif (defined(KEYBOARD_bastardkb_dilemma) && !defined(NO_DILEMMA_KEYCODES)) - case SAFE_RANGE ...(DILEMMA_SAFE_RANGE - 1): +# elif (defined(KEYBOARD_bastardkb_charybdis) || defined(KEYBOARD_handwired_tractyl_manuform)) && !defined(NO_CHARYBDIS_KEYCODES) || (defined(KEYBOARD_bastardkb_dilemma) && !defined(NO_DILEMMA_KEYCODES)) + case QK_KB ... QK_KB_MAX: # endif case KC_ACCEL: return true; diff --git a/users/drashna/pointing/pointing_config.h b/users/drashna/pointing/pointing_config.h new file mode 100644 index 0000000000..50c29ede85 --- /dev/null +++ b/users/drashna/pointing/pointing_config.h @@ -0,0 +1,6 @@ +// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#define POINTING_DEVICE_MODES_ENABLE |