summaryrefslogtreecommitdiff
path: root/keyboards/ploopyco/trackball_nano/trackball_nano.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/ploopyco/trackball_nano/trackball_nano.c')
-rw-r--r--keyboards/ploopyco/trackball_nano/trackball_nano.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/keyboards/ploopyco/trackball_nano/trackball_nano.c b/keyboards/ploopyco/trackball_nano/trackball_nano.c
index e208a728cb..0f2fbe2f72 100644
--- a/keyboards/ploopyco/trackball_nano/trackball_nano.c
+++ b/keyboards/ploopyco/trackball_nano/trackball_nano.c
@@ -52,6 +52,14 @@ keyboard_config_t keyboard_config;
uint16_t dpi_array[] = PLOOPY_DPI_OPTIONS;
#define DPI_OPTION_SIZE (sizeof(dpi_array) / sizeof(uint16_t))
+void cycle_dpi(void) {
+ keyboard_config.dpi_config = (keyboard_config.dpi_config + 1) % DPI_OPTION_SIZE;
+ pointing_device_set_cpi(dpi_array[keyboard_config.dpi_config]);
+#ifdef CONSOLE_ENABLE
+ uprintf("DPI is now %d\n", dpi_array[keyboard_config.dpi_config]);
+#endif
+}
+
// TODO: Implement libinput profiles
// https://wayland.freedesktop.org/libinput/doc/latest/pointer-acceleration.html
// Compile time accel selection