diff options
Diffstat (limited to 'DOCS/client_api_examples')
-rw-r--r-- | DOCS/client_api_examples/qtexample.cpp | 4 | ||||
-rw-r--r-- | DOCS/client_api_examples/simple.c | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/DOCS/client_api_examples/qtexample.cpp b/DOCS/client_api_examples/qtexample.cpp index 39dc1fd1d4..84b1102055 100644 --- a/DOCS/client_api_examples/qtexample.cpp +++ b/DOCS/client_api_examples/qtexample.cpp @@ -53,6 +53,10 @@ MainWindow::MainWindow(QWidget *parent) : // mpv as backend would implement its own key bindings. mpv_set_option_string(mpv, "input-default-bindings", "yes"); + // Enable keyboard input on the X11 window. For the messy details, see + // --input-x11-keyboard on the manpage. + mpv_set_option_string(mpv, "input-x11-keyboard", "yes"); + // Let us receive property change events with MPV_EVENT_PROPERTY_CHANGE if // this property changes. mpv_observe_property(mpv, 0, "time-pos", MPV_FORMAT_DOUBLE); diff --git a/DOCS/client_api_examples/simple.c b/DOCS/client_api_examples/simple.c index d3a4c78c26..6dbc40506a 100644 --- a/DOCS/client_api_examples/simple.c +++ b/DOCS/client_api_examples/simple.c @@ -21,6 +21,7 @@ int main(int argc, char *argv[]) // Enable default key bindings, so the user can actually interact with // the player (and e.g. close the window). check_error(mpv_set_option_string(ctx, "input-default-bindings", "yes")); + mpv_set_option_string(ctx, "input-x11-keyboard", "yes"); int val = 1; check_error(mpv_set_option(ctx, "osc", MPV_FORMAT_FLAG, &val)); |