summaryrefslogtreecommitdiffstats
path: root/mpvcore/input/input.h
diff options
context:
space:
mode:
authorAlexander Preisinger <alexander.preisinger@gmail.com>2013-07-25 18:08:57 +0200
committerAlexander Preisinger <alexander.preisinger@gmail.com>2013-08-07 22:15:39 +0200
commit023e5ccd02609c8a2fdcf63ee0a87025beeb79f0 (patch)
tree4846330cd6d36a8d353f2c287fb061e0de3e05bb /mpvcore/input/input.h
parent406241005e3d897b30a5b168a16ad61f0996c43c (diff)
downloadmpv-023e5ccd02609c8a2fdcf63ee0a87025beeb79f0.tar.bz2
mpv-023e5ccd02609c8a2fdcf63ee0a87025beeb79f0.tar.xz
input: add support for precise scroll axes
Support horizontal and vertical axes of input devices. If the input device support precise scrolling with an input value then it should first be scaled to a standard multiplier, where 1.0 is the default. The multiplier will then applied to the following commands if possible: * MP_CMD_SEEK * MP_CMD_SPEED_MULT * MP_CMD_ADD All other commands will triggered on every axis event, without change the values specified in the config file.
Diffstat (limited to 'mpvcore/input/input.h')
-rw-r--r--mpvcore/input/input.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/mpvcore/input/input.h b/mpvcore/input/input.h
index 2c8441c7c0..022ebb3881 100644
--- a/mpvcore/input/input.h
+++ b/mpvcore/input/input.h
@@ -146,6 +146,7 @@ typedef struct mp_cmd {
bool mouse_move;
int mouse_x, mouse_y;
struct mp_cmd *queue_next;
+ double scale; // for scaling numeric arguments
} mp_cmd_t;
@@ -181,6 +182,10 @@ void mp_input_put_key(struct input_ctx *ictx, int code);
// string as key events.
void mp_input_put_key_utf8(struct input_ctx *ictx, int mods, struct bstr t);
+// Process scrolling input. Support for precise scrolling. Scales the given
+// scroll amount add multiplies it with the command (seeking, sub-delay, etc)
+void mp_input_put_axis(struct input_ctx *ictx, int direction, double value);
+
// Update mouse position (in window coordinates).
void mp_input_set_mouse_pos(struct input_ctx *ictx, int x, int y);