Commit Graph

12 Commits

Author SHA1 Message Date
wm4 5e9c226229 command: disable autorepeat for some commands (actually properties)
Disable autorepeat for the "add"/"cycle" commands when changing
properties that are choices (such as fullscreen, pause, and more).
In these cases, autorepeat is not very useful, and can rather harmful
effects (like triggering too many repeated commands if command
execution is slow).

(Actually, the commands are just dropped _after_ being repeated, since
input.c itself does not know enough about the commands to decide whether
or not they should be repeated.)
2013-10-28 00:33:52 +01:00
wm4 ae9a3e33aa command: add commands for displaying overlays
Requested by github issue #255.

Does not work where mmap is not available (i.e. Windows).
2013-10-05 22:46:55 +02:00
wm4 93b712fa8a command: add sub_seek input command
Essentially reuses the sub_step command, and is subject to the same
restrictions.

Seems to behave a bit strange sometimes, but generally works.
2013-10-02 21:05:04 +02:00
wm4 df5706f156 input: remove strange offset from commands enum
A leftover from 10 years of refactoring.
2013-10-02 20:48:50 +02:00
wm4 0d90dd07ff input: more mp_msg conversion
It appears the last run missed all mp_tmsg().

Since the command parser also prints messages, it needs a new parameter
to pass a log context. We go the easy way and just require the input_ctx
to be passed, and use its mp_log.
2013-09-27 15:30:59 +02:00
wm4 6048f87e3c Add initial Lua scripting support
This is preliminary. There are still tons of issues, and any aspect
of scripting may change in the future. I decided to merge this
(preliminary) work now because it makes it easier to develop it, not
because it's done. lua.rst is clear enough about it (plus some
sarcasm).

This requires linking to Lua. Lua has no official pkg-config file, but
there are distribution specific .pc files, all with different names.
Adding a non-pkg-config based configure test was considered, but we'd
rather not.

One major complication is that libquvi links against Lua too, and if
the Lua version is different from mpv's, you will get a crash as soon
as libquvi uses Lua. (libquvi by design always runs when a file is
opened.) I would consider this the problem of distros and whoever
builds mpv, but to make things easier for users, we add a terrible
runtime test to the configure script, which probes whether libquvi
will crash. This is disabled when cross-compiling, but in that case
we hope the user knows what he is doing.
2013-09-26 01:28:58 +02:00
Stefano Pigozzi 763f33424e input: convert to new msg API 2013-09-10 21:31:02 +02:00
wm4 ac927e39bf input: don't deliver mouse events if mouse area is not set
This caused the OSC to be always visible at startup on X11:
- EnterNotify event send a mouse event to input.c
- OSC has not completely initialized yet, and no mouse area is set
- mouse event is dispatched to "showhide" OSC section
- OSC becomes visible, regardless of mouse position

Fix this by treating the mouse area as empty if it's not set, instead of
infinite as it was before this commit. This means an input section must
set a mouse area to receive mouse events at all. We also have to change
the default section to receive mouse events with the new behavior.

Also, if MOUSE_MOVE is unmapped (or mapped to something that doesn't
parse), and produces no command, the mouse position wouldn't be updated
(because the mouse position is bound to input commands), so we have to
generate a dummy command in this case.

(This matters only for the OSC, On Screen Controller, which isn't merged
yet, so these changes shouldn't have much effect right now.)
2013-09-08 01:50:14 +02:00
wm4 6a55fa6793 input: allow window dragging even if mouse is in a mouse area
If the input section is enabled with MP_INPUT_ALLOW_VO_DRAGGING, then
the  VO will be allowed to drag the window with mouse button down +
mouse move even if the mouse is inside the section's mouse area.
2013-09-01 20:17:51 +02:00
Alexander Preisinger 023e5ccd02 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.
2013-08-07 22:15:39 +02:00
Stefano Pigozzi 406241005e core: move contents to mpvcore (2/2)
Followup commit. Fixes all the files references.
2013-08-06 22:52:31 +02:00
Stefano Pigozzi bc27f946c2 core: move contents to mpvcore (1/2)
core is used in many unix systems for core dumps. For that reason some tools
work under the assumption that the file is indeed a core dump (for example
autoconf does this).

This commit just renames the files. The following one will change all the
includes to fix compilation. This is done this way because git has a easier
time tracing file changes if there is a pure rename commit.
2013-08-06 22:48:47 +02:00