summaryrefslogtreecommitdiffstats
path: root/input/keycodes.c
Commit message (Collapse)AuthorAgeFilesLines
* input: add missing forward media keynanahi2023-12-061-1/+2
| | | | | | | | | XF86Back and XF86Forward are mostly used to navigate file and web browsers to go back/forward in history. XF86Forward isn't recognized right now, so add it. Because XF86AudioForward already takes the "FORWARD" name, rename the browse keys to GO_BACK and GO_FORWARD instead.
* input: add missing keypad key definesChristoph Heinrich2023-08-251-0/+8
| | | | | | | | So far all the keypad keys except for `0` and `,` mapped to the same MP_KEY_* independent of numlock state, even though different key codes are received. Now all the alternative functions map to appropriate MP_KEY_* defines, with missing ones added.
* input: add new keys: Back, Tools, ZoomIn, ZoomOutJames Cuzella2023-08-231-0/+4
| | | | | | | | | | | | | | | | | These were the only keys missing to support mapping all keycodes on a [popular RF Remote][1] used with Linux HTPC apps. Note that X11/XWayland + xkbcomp still warns about keycodes > 255, due to the 8-bit limit in Xorg but `mpv` on Wayland is able to handle these. For X11 users, there are [a couple options][2]: - [Gianni Ceccarelli's patched `xf86-input-evdev`][3] - [Use udev hwdb to map scancodes to keycodes][4] [1]: https://www.mythtv.org/wiki/Air_mouse_rf_remote [2]: https://unix.stackexchange.com/a/436233/7688 [3]: https://www.thenautilus.net/SW/xf86-input-evdev/ [4]: https://wiki.archlinux.org/title/Map_scancodes_to_keycodes
* input: add function keys F13-F24Thomas Weißschuh2022-09-021-0/+12
|
* command: add input-key-list propertywm42020-05-141-0/+10
| | | | Fixes: #7698
* input: add new PLAYONLY and PAUSEONLY MP_KEY key codesder richter2020-01-261-0/+2
| | | | | since the old PLAY and PAUSE key codes cycle through the pause property, the new key codes only explicitly set the pause property.
* mac: remove Apple Remote supportder richter2019-12-151-15/+0
| | | | | | the Apple Remote has long been deprecated and abandoned by Apple. current macs don't come with support for it anymore. support might be re-added with the next commit.
* input: introduce a pseudo key name that grabs all text inputwm42019-11-221-2/+2
| | | | | | | | | The intended target for this is the mpv.repl script, which manually added every single ASCII key as a separate key binding. This provides a simpler mechanism, that will catch any kind of text input. Due to its special nature, explicitly do not give a guarantee for compatibility; thus the warning in input.rst.
* input: add gamepad support through SDL2Stefano Pigozzi2019-10-231-0/+26
| | | | | | | | | | | | | | | The code is very basic: - only handles gamepads, could be extended for generic joysticks in the future. - only has button mappings for controllers natively supported by SDL2. I heard more can be added through env vars, there's also ways to load mappings from text files, but I'd rather not go there yet. Common ones like Dualshock are supported natively. - analog buttons (TRIGGER and AXIS) are mapped to discrete buttons using an activation threshold. - only supports one gamepad at a time. the feature is intented to use gamepads as evolved remote controls, not play multiplayer games in mpv :)
* input: merge mouse wheel and axis keycodesJames Ross-Gowan2017-09-031-5/+4
| | | | | | | | | | | | | | | | | | | | | | Mouse wheel bindings have always been a cause of user confusion. Previously, on Wayland and macOS, precise touchpads would generate AXIS keycodes and notched mouse wheels would generate mouse button keycodes. On Windows, both types of device would generate AXIS keycodes and on X11, both types of device would generate mouse button keycodes. This made it pretty difficult for users to modify their mouse-wheel bindings, since it differed between platforms and in some cases, between devices. To make it more confusing, the keycodes used on Windows were changed in 18a45a42d524 without a deprecation period or adequate communication to users. This change aims to make mouse wheel binds less confusing. Both the mouse button and AXIS keycodes are now deprecated aliases of the new WHEEL keycodes. This will technically break input configs on Wayland and macOS that assign different commands to precise and non-precise scroll events, but this is probably uncommon (if anyone does it at all) and I think it's a fair tradeoff for finally fixing mouse wheel-related confusion on other platforms.
* input: use mnemonic names for mouse buttonsJames Ross-Gowan2017-09-031-40/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | mpv's mouse button numbering is based on X11 button numbering, which allows for an arbitrary number of buttons and includes mouse wheel input as buttons 3-6. This button numbering was used throughout the codebase and exposed in input.conf, and it was difficult to remember which physical button each number actually referred to and which referred to the scroll wheel. In practice, PC mice only have between two and five buttons and one or two scroll wheel axes, which are more or less in the same location and have more or less the same function. This allows us to use names to refer to the buttons instead of numbers, which makes input.conf syntax a lot easier to remember. It also makes the syntax robust to changes in mpv's underlying numbering. The old MOUSE_BTNx names are still understood as deprecated aliases of the named buttons. This changes both the input.conf syntax and the MP_MOUSE_BTNx symbols in the codebase, since I think both would benefit from using names over numbers, especially since some platforms don't use X11 button numbering and handle different mouse buttons in different windowing system events. This also makes the names shorter, since otherwise they would be pretty long, and it removes the high-numbered MOUSE_BTNx_DBL names, since they weren't used. Names are the same as used in Qt: https://doc.qt.io/qt-5/qt.html#MouseButton-enum
* w32_common: handle media keysJames Ross-Gowan2017-08-051-0/+3
| | | | | | | | | | | | | | | | | This was attempted before in fc9695e63b5b, but it was reverted in 1b7ce759b1f4 because it caused conflicts with other software watching the same keys (See #2041.) It seems like some PCs ship with OEM software that watches the volume keys without consuming key events and this causes them to be handled twice, once by mpv and once by the other software. In order to prevent conflicts like this, use the WM_APPCOMMAND message to handle media keys. Returning TRUE from the WM_APPCOMMAND handler should indicate to the operating system that we consumed the key event and it should not be propogated to the shell. Also, we now only listen for keys that are directly related to multimedia playback (eg. the APPCOMMAND_MEDIA_* keys.) Keys like APPCOMMAND_VOLUME_* are ignored, so they can be handled by the shell, or by other mixer software.
* input/keycodes: change license to LGPLwm42017-06-201-7/+7
| | | | | All relevant authors have agreed. See 2e84934be7 (the mentioned person has replied and agreed now).
* input: add a catch-all "unmapped" commandwm42015-12-231-0/+2
| | | | | | This can be used to grab all unmapped keys. Fixes #2612.
* input: rename recently added HALF_SPACEwm42015-10-211-1/+1
| | | | | | There was a complaint that the naming is inaccurate. That's probably right. Just use the official name instead, which is a bit clunky, but surely correct.
* input: add key name for U+3000 IDEOGRAPHIC SPACEwm42015-10-211-0/+1
| | | | | | | Deserves its own name, because just like SPACE it's a printable character, but invisible. Fixes #2349... I think.
* Update license headersMarcin Kurczewski2015-04-131-5/+4
| | | | Signed-off-by: wm4 <wm4@nowhere>
* input: remove Linux joystick supportwm42015-03-241-36/+0
| | | | | | | | | | | Why did this exist in the first place? Other than being completely useless, this even caused some regressions in the past. For example, there was the case of a laptop exposing its accelerometer as joystick device, which led to extremely fun things due to the default mappings of axis movement being mapped to seeking. I suppose those who really want to use their joystick to control a media player (???) can configure it as mouse device or so.
* input: add MOUSE_ENTER keybinding.torque2015-02-181-0/+1
| | | | Signed-off-by: wm4 <wm4@nowhere>
* x11: add XK_Cancel to the list of special keysMartin Herkt2015-02-141-0/+1
| | | | | Some IR receivers emit this key by default for remote control buttons. Make it mappable.
* Remove some unneeded NULL checkswm42014-11-211-1/+1
| | | | Found by Coverity; also see commit 85fb2af3.
* input: don't add weird padding when formatting keycodewm42014-10-171-1/+1
| | | | No idea what this was for. It has no purpose and looks weird.
* Move compat/ and bstr/ directory contents somewhere elsewm42014-08-291-1/+1
| | | | | | | | | bstr.c doesn't really deserve its own directory, and compat had just a few files, most of which may as well be in osdep. There isn't really any justification for these extra directories, so get rid of them. The compat/libav.h was empty - just delete it. We changed our approach to API compatibility, and will likely not need it anymore.
* input: make key bindings like "Shift+X" work (for ASCII)wm42014-08-261-3/+25
| | | | | | | | | | | | | | "Shift+X" didn't actually map any key, as opposed to "Shift+x". This is because shift usually changes the case of a character, so a plain printable character like "X" simply can never be combined with shift. But this is not very intuitive. Always remove the shift code from printable characters. Also, for ASCII, actually apply the case mapping to uppercase characters if combined with shift. Doing this for unicode in general would be nice, but that would require lookup tables. In general, we don't know anyway what character a key produces when combined with shift - it could be anything, and depends on the keyboard layout.
* build: include <strings.h> for strcasecmp()wm42014-07-101-0/+1
| | | | | | | It happens to work without strings.h on glibc or with _GNU_SOURCE, but the POSIX standard requires including <strings.h>. Hopefully fixes OSX build.
* keycodes: add const to a function argumentwm42014-02-171-1/+1
|
* input: use bstr_xappend()wm42013-12-301-12/+22
| | | | To get rid of mp_append_utf8_buffer().
* input: split off some code from input.c to separate fileswm42013-12-261-0/+321
This is mostly just moving code around.