diff options
author | James Ross-Gowan <rossymiles@gmail.com> | 2017-04-24 22:10:03 +1000 |
---|---|---|
committer | James Ross-Gowan <rossymiles@gmail.com> | 2017-05-12 22:58:58 +1000 |
commit | 937128697fbbef6b21e2d23a4785f1334f62b9e3 (patch) | |
tree | c1c6d3a09f423340b306a4605b4d81b80f2150f5 /player | |
parent | 6ccb7b5fa520497461b282cf6a32dfac276f43d7 (diff) | |
download | mpv-937128697fbbef6b21e2d23a4785f1334f62b9e3.tar.bz2 mpv-937128697fbbef6b21e2d23a4785f1334f62b9e3.tar.xz |
input: pre-process MP_AXIS_* input
This adds some logic for pre-processing MP_AXIS_* events before the
corresponding input command is generated.
Firstly, the events are filtered. A lot of touchpad drivers and
operating systems don't seem to filter axis events, which makes it
difficult to use the verical axis (MP_AXIS_UP/MP_AXIS_DOWN) without
accidentally triggering commands bound to the horizontal axis
(MP_AXIS_LEFT/MP_AXIS_RIGHT) and vice-versa. To fix this, a small
deadzone is used. When one axis breaks out of the deadzone, events on
the other axis are ignored until the user stops scrolling (determined by
a timer.)
Secondly, the scale_units value is determined, which is the integer
number of "units" the user has scrolled, as opposed to scale, which is
the fractional number of units. It's determed by accumulating the
fractional scale values. If an axis is bound to a "non-scalable" command
that doesn't understand fractional units, interpret_key() will queue
that many commands, each with scale = 1.0.
Diffstat (limited to 'player')
0 files changed, 0 insertions, 0 deletions