summaryrefslogtreecommitdiffstats
path: root/input/keycodes.h
Commit message (Collapse)AuthorAgeFilesLines
* input: add missing forward media keynanahi2023-12-061-4/+5
| | | | | | | | | 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
* command: add input-key-list propertywm42020-05-141-0/+1
| | | | 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-17/+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: make MP_INPUT_RELEASE_ALL a pseudo-keywm42019-11-221-0/+2
| | | | | | | Should be without consequences. I think this is less trouble, because code frequently wants to add/remove bits for modifiers and key state from key codes, and with this change you can't accidentally break it by testing or removing bits from the old -1 value.
* input: introduce a pseudo key name that grabs all text inputwm42019-11-221-1/+6
| | | | | | | | | 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/+28
| | | | | | | | | | | | | | | 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: add a define for the number of mouse buttons and use itwm42018-05-251-0/+2
| | | | (Why the fuck are there up to 20 mouse buttons?)
* input: fix error in MP_KEY_IS_WHEELJames Ross-Gowan2017-09-031-1/+1
| | | | Whoops.
* input: merge mouse wheel and axis keycodesJames Ross-Gowan2017-09-031-44/+33
| | | | | | | | | | | | | | | | | | | | | | 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-47/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-9/+7
| | | | | All relevant authors have agreed. See 2e84934be7 (the mentioned person has replied and agreed now).
* input: add MP_KEY_IS_AXIS and treat MP_AXIS_* as mouse eventsJames Ross-Gowan2017-05-121-2/+8
| | | | | MP_AXIS_* events are semantically equivalent to scroll button events (eg. MP_MOUSE_BTN{3,4,5,6}). They depend on the mouse position.
* input: add a catch-all "unmapped" commandwm42015-12-231-0/+3
| | | | | | This can be used to grab all unmapped keys. Fixes #2612.
* Update license headersMarcin Kurczewski2015-04-131-5/+4
| | | | Signed-off-by: wm4 <wm4@nowhere>
* input: remove Linux joystick supportwm42015-03-241-37/+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: minor cleanupwm42015-02-181-3/+9
| | | | | | | Add MP_KEY_MOUSE_ENTER to the ignored input if the user has disabled mouse input. Remove one instance of code duplication, and add a MP_KEY_IS_MOUSE_MOVE macro to summarize events that are caused by moving the mouse.
* 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.
* x11: make all XF86 special keys mappablewm42015-02-131-1/+6
| | | | | | | | Makes all keys documented in XF86keysym.h mappable. This requires the user to deal with numeric keycodes; no names are queried or exported. This is an easy way to avoid adding all the hundreds of XF86 keys to our X11 lookup table and mpv's keycode/name list.
* input: make key bindings like "Shift+X" work (for ASCII)wm42014-08-261-0/+3
| | | | | | | | | | | | | | "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.
* input: make all modifier flags unsignedwm42014-08-261-8/+8
|
* input: be stricter about rejecting mouse input with --no-input-cursorwm42014-07-271-0/+3
| | | | | | | Apparently this switch means all mouse input should be strictly rejected. Some VO backends (such as X11) explicitly disable all mouse events if this option is set, but others don't. So check them in input.c, which increases consistency.
* input: fix typos, cosmeticswm42014-05-101-10/+10
|
* input: keycodes: reorder flagswm42014-04-181-16/+16
| | | | | | | MP_KEY_EMIT_ON_UP and MP_NO_REPEAT_KEY are not modifiers, just static flags that some keycodes set. This is just a cosmetic change.
* keycodes: add const to a function argumentwm42014-02-171-1/+1
|
* input: use bstr_xappend()wm42013-12-301-2/+2
| | | | To get rid of mp_append_utf8_buffer().
* input: split off some code from input.c to separate fileswm42013-12-261-0/+18
| | | | This is mostly just moving code around.
* Move mpvcore/input/ to input/wm42013-12-171-0/+254
|
* Rename directories, move files (step 1 of 2) (does not compile)wm42012-11-121-214/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tis drops the silly lib prefixes, and attempts to organize the tree in a more logical way. Make the top-level directory less cluttered as well. Renames the following directories: libaf -> audio/filter libao2 -> audio/out libvo -> video/out libmpdemux -> demux Split libmpcodecs: vf* -> video/filter vd*, dec_video.* -> video/decode mp_image*, img_format*, ... -> video/ ad*, dec_audio.* -> audio/decode libaf/format.* is moved to audio/ - this is similar to how mp_image.* is located in video/. Move most top-level .c/.h files to core. (talloc.c/.h is left on top- level, because it's external.) Park some of the more annoying files in compat/. Some of these are relicts from the time mplayer used ffmpeg internals. sub/ is not split, because it's too much of a mess (subtitle code is mixed with OSD display and rendering). Maybe the organization of core is not ideal: it mixes playback core (like mplayer.c) and utility helpers (like bstr.c/h). Should the need arise, the playback core will be moved somewhere else, while core contains all helper and common code.
* win32: support key modifiers (shift, ctrl, alt)wm42012-04-061-10/+9
| | | | | | | | | | Support for this is rather simple, and some combinations of modifiers and keys don't work. For example, Ctrl+Alt+character is not supported, because Windows doesn't emit a WM_CHAR in this case. Also add support for the pause and print screen keys. Remove the pointless KEY_CTRL translation. Remove KEY_CTRL altogether, because it was not clear what it was actually supposed to mean.
* x11: add print and menu keyswm42012-01-181-0/+1
|
* input: allow unicode keys and reassign internal key codeswm42012-01-181-19/+19
| | | | | | | | | | This moves all key codes above the highest valid unicode code point (which is 0x10FFFF). All key codes below MP_KEY_BASE now directly map to unicode. Configuration files (input.conf) can contain unicode characters in UTF-8 to map non-ASCII characters/keys. This shouldn't change anything user visible, except that "direct key codes" (as used in input.conf) will change their meaning.
* input: support up to 20 mouse buttonsreimar2011-06-291-2/+22
| | | | | | | Increase the number of supported mouse buttons from 10 to 20. There really seem to be input devices with at least 12. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33391 b3059339-0415-0410-9bf9-f77b7e298cf2
* input: move all key code lists to input/keycodes.hUoti Urpala2011-05-021-0/+194
Move the definitions of all special key codes (those not passed by ASCII value) to input/keycodes.h. Before they were spread between osdep/keycodes.h, input/joystick.h, input/mouse.h and input/ar.h, plus some special values in input.h. This was especially inconvenient as the codes had to be coordinated to not conflict between the files. The change requires a bit of ugliness as appleir.c includes <linux/input.h> which contains various conflicting KEY_* definitions. Work around this by adding a special preprocessor variable which can be used to avoid defining these in keycodes.h.