Skip to content

Commit

Permalink
some optimizations and adaptions to own usage
Browse files Browse the repository at this point in the history
  • Loading branch information
FearlessSpiff committed Nov 13, 2023
1 parent 873cf09 commit 02c44a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10
status = "okay";
label = "TRACKPAD";
reg = <0x2A>;
rotate-90;
sleep;
/* rotate-90; */
/* sleep; /*
/* no-taps; */
};

Expand Down
8 changes: 4 additions & 4 deletions app/boards/shields/splitkb_aurora_corne/trackpad.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ static void handle_trackpad(const struct device *dev, const struct sensor_trigge
uint8_t button;
static uint8_t last_button = 0;
static int8_t scroll_ver_rem = 0, scroll_hor_rem = 0;
if (layer == 3) { // raise
const int16_t total_hor = dx.val1 + scroll_hor_rem, total_ver = -dy.val1 + scroll_ver_rem;
if (layer == 3 || layer == 9 || layer == 15) { // "num" layers
const int16_t total_hor = dx.val1 + scroll_hor_rem, total_ver = dy.val1 + scroll_ver_rem;
scroll_hor_rem = total_hor % SCROLL_DIV_FACTOR;
scroll_ver_rem = total_ver % SCROLL_DIV_FACTOR;
zmk_hid_mouse_scroll_update(total_hor / SCROLL_DIV_FACTOR, total_ver / SCROLL_DIV_FACTOR);
button = RCLK;
} else {
zmk_hid_mouse_movement_update(CLAMP(-dx.val1, INT8_MIN, INT8_MAX),
CLAMP(dy.val1, INT8_MIN, INT8_MAX));
zmk_hid_mouse_movement_update(CLAMP(dx.val1, INT8_MIN, INT8_MAX),
CLAMP(-dy.val1, INT8_MIN, INT8_MAX));
button = LCLK;
}
if (!last_pressed && btn.val1) {
Expand Down

0 comments on commit 02c44a3

Please sign in to comment.