Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to handle MouseWheel when both pixel and line deltas are available ? #22

Open
elinorbgr opened this issue Oct 16, 2016 · 3 comments
Labels
C - needs discussion Direction must be ironed out D - easy Likely easier than most tasks here P - low Nice to have S - api Design and usability S - enhancement Wouldn't this be the coolest?

Comments

@elinorbgr
Copy link
Contributor

In some cases (if the compositor supports it), the wayland backend can have access to both LineDelta and PixelDelta values for a given scroll event.

In this case, what should be done ?

  • generate only the PixelDelta event ?
  • generate only the LineDelta event ?
  • generate both ?
  • modify the MouseWheel event so that it may provide both values ?
@tomaka tomaka added the S - enhancement Wouldn't this be the coolest? label Oct 16, 2016
@tomaka tomaka added S - api Design and usability and removed S - api Design and usability labels Nov 3, 2016
@francesca64 francesca64 added C - needs discussion Direction must be ironed out D - easy Likely easier than most tasks here P - low Nice to have labels May 6, 2018
@nixpulvis
Copy link
Contributor

Two questions.

  1. Why even have two kinds of events? Couldn't everything be a normalized PixelDelta? Alacritty already converts to pixels (and then to proper lines) internally. What devices should I expect to see PixelDelta on exactly? Even my continuous trackpad, and trackpoint return fractional LineDeltas.

  2. Assuming we don't want to merge these two events, or that there's value in exposing the resolution of a single mouse scroll "click". Wouldn't a better name for this be something like ClickDelta, since as far as I understand this, there's nothing related to "lines" of text needed here. I could for example have a single "click" be used to fire a gun in an FPS for example (ah the best cheat code, sorry I digress), which has nothing to do with a "line" of any kind.

@kchibisov
Copy link
Member

What devices should I expect to see PixelDelta on exactly?

Mostly touchpads and I guess drawing tablets? For example my mouse is sending LineDelta, but touchpad is sending PixelDelta. However it depends on device most of the time.

@akhilman
Copy link

Post explaining why there are two (actually three) different delta types: http://who-t.blogspot.com/2015/01/providing-physical-movement-of-wheel.html
So basically yes, touchpads and tablets use pixels, but the mouse counts the number of clicks and degrees.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C - needs discussion Direction must be ironed out D - easy Likely easier than most tasks here P - low Nice to have S - api Design and usability S - enhancement Wouldn't this be the coolest?
Development

No branches or pull requests

7 participants