[FR] Support general keydown/keyup listener (wildcard binding) without specify key

Open
#18,619 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
15/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
c, javascript
Domain
desktop-dev

Research direction

The issue asks for a wildcard key listener alongside mp.add_key_binding and mp.register_event, which the payload names as the scripting entry points. Before writing code, settle the design: how a catch-all binding interacts with existing bindings, and which key identifier it passes to the script. The payload names no files, so locate the key dispatch and scripting bindings yourself. Done means a maintainer agrees on the API shape and a script receives keys it did not bind.

Written by the indexing model from the issue text.

Description

meta:feature-request
Expected behavior of the wanted feature

mp.add_key_binding(key, name|fn [,fn [,flags]]) requires an explicit key name, so a script can only react to keys it already knows about.

There is currently no way for a script to be notified of any key the user presses.

mp.register_event() has no keypress event.

// browser js general keydown listener
window.addEventListener('keydown', (e) => console.log(e.code));
Alternative behavior of the wanted feature

No response

Log File

No response

Sample Files

No response

Dominant language
C
Stars
38.2k
Forks
3.7k
Avg merge
1d 13h
Merged PRs (30d)
76

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mpv-player/mpv

All issues in mpv-player/mpv

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.