Skip to content

Commit

Permalink
Apply cpi changes to keyboards
Browse files Browse the repository at this point in the history
  • Loading branch information
drashna committed Sep 9, 2021
1 parent f2b37d9 commit 9ebbf9b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion keyboards/handwired/tractyl_manuform/tm_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,6 @@ void housekeeping_task_sync(void) {
void trackball_set_cpi(uint16_t cpi) {
kb_config.device_cpi = cpi;
if (!is_keyboard_left()) {
pmw3360_set_cpi(cpi);
pointing_device_set_cpi(cpi);
}
}
8 changes: 4 additions & 4 deletions keyboards/ploopyco/mouse/mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) {
if (keycode == DPI_CONFIG && record->event.pressed) {
keyboard_config.dpi_config = (keyboard_config.dpi_config + 1) % DPI_OPTION_SIZE;
eeconfig_update_kb(keyboard_config.raw);
pmw3360_set_cpi(dpi_array[keyboard_config.dpi_config]);
pointing_device_set_cpi(dpi_array[keyboard_config.dpi_config]);
}

if (keycode == DRAG_SCROLL) {
Expand All @@ -156,9 +156,9 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) {
is_drag_scroll ^= 1;
}
#ifdef PLOOPY_DRAGSCROLL_FIXED
pmw3360_set_cpi(is_drag_scroll ? PLOOPY_DRAGSCROLL_DPI : dpi_array[keyboard_config.dpi_config]);
pointing_device_set_cpi(is_drag_scroll ? PLOOPY_DRAGSCROLL_DPI : dpi_array[keyboard_config.dpi_config]);
#else
pmw3360_set_cpi(is_drag_scroll ? (dpi_array[keyboard_config.dpi_config] * PLOOPY_DRAGSCROLL_MULTIPLIER) : dpi_array[keyboard_config.dpi_config]);
pointing_device_set_cpi(is_drag_scroll ? (dpi_array[keyboard_config.dpi_config] * PLOOPY_DRAGSCROLL_MULTIPLIER) : dpi_array[keyboard_config.dpi_config]);
#endif
}

Expand Down Expand Up @@ -217,7 +217,7 @@ void keyboard_pre_init_kb(void) {
}

void pointing_device_init_kb(void) {
pmw3360_set_cpi(dpi_array[keyboard_config.dpi_config]);
pointing_device_set_cpi(dpi_array[keyboard_config.dpi_config]);
// initialize the scroll wheel's optical encoder
opt_encoder_init();
}
Expand Down
8 changes: 4 additions & 4 deletions keyboards/ploopyco/trackball/trackball.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) {
if (keycode == DPI_CONFIG && record->event.pressed) {
keyboard_config.dpi_config = (keyboard_config.dpi_config + 1) % DPI_OPTION_SIZE;
eeconfig_update_kb(keyboard_config.raw);
pmw3360_set_cpi(dpi_array[keyboard_config.dpi_config]);
pointing_device_set_cpi(dpi_array[keyboard_config.dpi_config]);
}

if (keycode == DRAG_SCROLL) {
Expand All @@ -155,9 +155,9 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) {
is_drag_scroll ^= 1;
}
#ifdef PLOOPY_DRAGSCROLL_FIXED
pmw3360_set_cpi(is_drag_scroll ? PLOOPY_DRAGSCROLL_DPI : dpi_array[keyboard_config.dpi_config]);
pointing_device_set_cpi(is_drag_scroll ? PLOOPY_DRAGSCROLL_DPI : dpi_array[keyboard_config.dpi_config]);
#else
pmw3360_set_cpi(is_drag_scroll ? (dpi_array[keyboard_config.dpi_config] * PLOOPY_DRAGSCROLL_MULTIPLIER) : dpi_array[keyboard_config.dpi_config]);
pointing_device_set_cpi(is_drag_scroll ? (dpi_array[keyboard_config.dpi_config] * PLOOPY_DRAGSCROLL_MULTIPLIER) : dpi_array[keyboard_config.dpi_config]);
#endif
}

Expand Down Expand Up @@ -237,7 +237,7 @@ void matrix_init_kb(void) {
}

void keyboard_post_init_kb(void) {
pmw3360_set_cpi(dpi_array[keyboard_config.dpi_config]);
pointing_device_set_cpi(dpi_array[keyboard_config.dpi_config]);

keyboard_post_init_user();
}
6 changes: 3 additions & 3 deletions keyboards/ploopyco/trackball_mini/trackball_mini.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void pointing_device_init_kb(void) {
opt_encoder_init();

// set the DPI.
adns5050_set_cpi(dpi_array[keyboard_config.dpi_config]);
pointing_device_set_cpi(dpi_array[keyboard_config.dpi_config]);
}

report_mouse_t pointing_device_task_kb(report_mouse_t mouse_report) {
Expand Down Expand Up @@ -161,7 +161,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) {
if (keycode == DPI_CONFIG && record->event.pressed) {
keyboard_config.dpi_config = (keyboard_config.dpi_config + 1) % DPI_OPTION_SIZE;
eeconfig_update_kb(keyboard_config.raw);
adns5050_set_cpi(dpi_array[keyboard_config.dpi_config]);
pointing_device_set_cpi(dpi_array[keyboard_config.dpi_config]);
}

if (keycode == DRAG_SCROLL) {
Expand All @@ -171,7 +171,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) {
{
is_drag_scroll ^= 1;
}
adns5050_set_cpi(is_drag_scroll ? PLOOPY_DRAGSCROLL_DPI : dpi_array[keyboard_config.dpi_config]);
pointing_device_set_cpi(is_drag_scroll ? PLOOPY_DRAGSCROLL_DPI : dpi_array[keyboard_config.dpi_config]);
}

/* If Mousekeys is disabled, then use handle the mouse button
Expand Down
4 changes: 2 additions & 2 deletions keyboards/ploopyco/trackball_nano/trackball_nano.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void pointing_device_init_kb(void) {
opt_encoder_init();

// set the DPI.
adns5050_set_cpi(dpi_array[keyboard_config.dpi_config]);
pointing_device_set_cpi(dpi_array[keyboard_config.dpi_config]);
}

report_mouse_t pointing_device_task_kb(report_mouse_t mouse_report) {
Expand Down Expand Up @@ -113,7 +113,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) {
if (keycode == DPI_CONFIG && record->event.pressed) {
keyboard_config.dpi_config = (keyboard_config.dpi_config + 1) % DPI_OPTION_SIZE;
eeconfig_update_kb(keyboard_config.raw);
adns5050_set_cpi(dpi_array[keyboard_config.dpi_config]);
pointing_device_set_cpi(dpi_array[keyboard_config.dpi_config]);
}

/* If Mousekeys is disabled, then use handle the mouse button
Expand Down

0 comments on commit 9ebbf9b

Please sign in to comment.