Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

input_default_bindings not working on macOS #63

Closed
kpj opened this issue Jan 28, 2018 · 4 comments
Closed

input_default_bindings not working on macOS #63

kpj opened this issue Jan 28, 2018 · 4 comments

Comments

@kpj
Copy link

kpj commented Jan 28, 2018

Hello,

Time for another macOS related issue ( :-[ ). As explained in #61, an extra QT-Window needs to be created for python-mpv to work on macOS.

If I now take the PyQT embedding example from the README and add input_default_bindings=True, input_vo_keyboard=True to the MPV instantiation, I would expect mpv-commands such as space (for pausing) or o (for time-display) to work.
On linux, it does indeed work.
On macOS however, nothing happens.

Do you have a suggestion why this might be happening? (PyQT not forwarding keypress-events, ...)

@jaseg
Copy link
Owner

jaseg commented Feb 1, 2018

Sorry, I have no idea. Maybe focus order, in that on mac your window is not in focus?

@kpj
Copy link
Author

kpj commented Feb 6, 2018

I investigated this using a custom keyPressEvent method in the QMainWindow and it does receive the key-events.
I also added custom @player.on_key_press bindings to my MPV class, but they were never triggered.

Is there a way of simulating keypresses using python-mpv? That way I could catch key-events in PyQT's keyPressEvent method and propagate them manually.
This is of course a very dirty solution, but the best I could think of so far.

@Frechdachs
Copy link
Contributor

Is there a way of simulating keypresses using python-mpv?

For example: mpvobject.command('keypress', 'ctrl+a')

@kpj
Copy link
Author

kpj commented Feb 25, 2018

That works nicely, thanks a lot!
For now I'll stick to this workaround.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants