summaryrefslogtreecommitdiffstats
path: root/mpvcore/input
Commit message (Collapse)AuthorAgeFilesLines
* input: unlock playloop thread during selectStefano Pigozzi2013-09-011-0/+2
| | | | | | This allows other threads to use mp_input_put_key without blocking if the playloop is doing the 500ms select call (i.e.: during pause). Makes Cocoa GUI responsive again (regression since 2d363c3).
* osx: use MP_KEY_* instead of MK_* for media keysStefano Pigozzi2013-09-012-10/+0
| | | | | In 213ad5d6c I added `MK_*` key bindings overlooking the fact that mpv already has `MP_KEY_*` for media keys.
* input: allow window dragging even if mouse is in a mouse areawm42013-09-012-4/+13
| | | | | | 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.
* input: deal with spurious X11 LeaveNotify eventswm42013-09-011-6/+0
| | | | | | | | | | | | | | | | | | | | | If the mpv window is unfocus, clicking on the OSC should focus the window (done by the window manager) and allow interaction with the OSC. But somehow X sends a spurious LeaveNotify event, immediately followed by an EnterNotify event. This happens at least with IceWM. The result is that the OSC will disappear (due to receiving MOUSE_LEAVE). The OSC will stay invisible, because EnterNotify isn't handled, and there's nothing that could make the OSC appear again. Solve this by handling EnterNotify. We cause a redundant MOUSE_MOVE event to be sent, which triggers the code to make the OSC visible. We have to remove the code from input.c, which ignores redundant mouse move events. Since the code ignoring redundant mouse move events is still needed on Windows, move that code to w32_common.c. The need for this is documented in the code, also see commit 03fd2fe. (The original idea was to save some code by having this code in the core, but now it turns out that this didn't quite work out.)
* input: print more debug infos, raise loglevelwm42013-09-011-2/+20
|
* input: stay in current input section if mouse button is downwm42013-09-011-28/+63
| | | | | | | | | | | | | | | | | Normally, moving the mouse outside of the mouse area of an input section will send mouse events somewhere else (because input section mouse areas are similar to windows/widgets in real GUI toolkits). This was done even if a mouse button was held down. This is quite different from how GUI toolkits behave. Change the code so that if a mouse button is down, the mouse area of the current input section can't be left. Releasing the mouse button (while the mouse pointer is outside of the mouse area) will actually leave the mouse area. As a side-effect, this commit also tests more often whether the current mouse input section is valid. This is needed to make releasing a mouse button trigger the mouse input section change.
* input: add some more X11 multimedia/internet keyswm42013-09-012-1/+13
| | | | | | | | These keys can be found on various "multimedia" and "internet" keyboard. X defines many keycodes, so I'm not adding all, just what I found on my own keyboard. Other key codes can be added on request.
* keycodes: cosmetics: align indentationwm42013-09-011-113/+113
|
* input: comment all default bindings in input.confwm42013-09-011-1/+9
| | | | | | | | | | | | | | I suspect most users will just copy etc/input.conf when they want to remap some default bindings. But usually this means the user even copies bindings he doesn't care about, and it's better if the user maps only the bindings in his input.conf the user intends to remap. Comment all bindings in etc/input.conf. Since this file also defines the builtin defaults and is baked into the mpv binary, we have to do something to get them anyway, even though they are commented. Do this by having input.c "uncomment" the bindings in the baked in input.conf. (Of course this is done only for the builtin config, not configs loaded from disk.)
* input: lock for accessing struct input_ctxStefano Pigozzi2013-09-011-67/+114
| | | | | | | | | | | | | | The previous code was locking only the input queue. That was too weak since it didn't protect the input_ctx data structure. So remove the locking on the queue and lock all the public functions that interact with the input_ctx. The private functions and public functions that do not act on the input_ctx (there are quite some functions doing mp_cmd manipulations for instance) are not locked. Some changes by wm4. Use a recursive mutex, and restructure some code to be less annoying with locks, such as converting code to single return, or making use of the recursive mutex.
* input: fix --no-input-default-bindingswm42013-08-291-0/+2
| | | | The option did nothing. This was probably broken with 5b38a52.
* input: fix build if HAVE_PTHREADS is undefinedGiuliano Schneider2013-08-151-1/+1
|
* macosx: remove platform specific input queueStefano Pigozzi2013-08-131-3/+0
| | | | | Since last commit the input queue in the core is thread safe, so there is no need for all this platform specific stuff anymore.
* input: make input queue thread safeStefano Pigozzi2013-08-131-6/+35
| | | | | | | If pthreads are enabled the input queue accesses are regulated by acquiring a mutex. This is useful for platforms like OS X, where the events are created in the cocoa thread and added to the queue to then be dequeued in the playloop thread.
* input: add support for precise scroll axesAlexander Preisinger2013-08-073-0/+30
| | | | | | | | | | | | | | | 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.
* core: move contents to mpvcore (2/2)Stefano Pigozzi2013-08-064-12/+12
| | | | Followup commit. Fixes all the files references.
* core: move contents to mpvcore (1/2)Stefano Pigozzi2013-08-067-0/+3145
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.