Closed retrotails closed 2 years ago
This is the simpler fix:
diff --git a/src/main.c b/src/main.c
index 9f4d207..d621e9b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -461,14 +461,14 @@ void on_pointer_event(struct pointer_collection* collection,
if (vertical_steps < 0) {
vertical_steps *= -1;
scroll_mask |= POINTER_SCROLL_UP;
- } else {
+ } else if (vertical_steps > 0) {
scroll_mask |= POINTER_SCROLL_DOWN;
}
if (horizontal_steps < 0) {
horizontal_steps *= -1;
scroll_mask |= POINTER_SCROLL_LEFT;
- } else {
+ } else if (horizontal_steps > 0) {
scroll_mask |= POINTER_SCROLL_RIGHT;
}
I just added horizontal scrolling to neatvnc & wayvnc. Thanks for bringing it to my attention that it was missing!
This just needs a squash now.
Btw, have you read the contributing guide? ;)
Err, I actually don't have a contributing guide for this project. Got confused. There's one for wayvnc, but not this.
I think this is correct? idk I don't really use git and I've never squashed a commit.
scrolling horizontally left or right would both also contribute to scrolling downward, probably due to a bitwise math bug. there's likely a much simpler change to the existing code to fix it, but I tried to understand what it did and rewrite it because it was easier.
personally, I do not use/want horizontal scrolling, but my trackball/trackpoint devices make it difficult to scroll directly up/down without also having some sideways movement.
purely to test if horizontal scrolling worked, I hacked in support for it in wayvnc using the following, and it does function when used along with this PR.