Closed Senkai350 closed 1 year ago
I've made a test in Linux with PyQt6, this works. In PyQt6 you must use app.exec() not app.exec()_
import os
#os.add_dll_directory(os.getcwd())
import mpv
from PyQt6.QtWidgets import *
from PyQt6.QtCore import *
mpvfolderpath = f"mpv.net/portable_config/"
import sys
class Test(QMainWindow):
def __init__(self, parent=None):
super().__init__(parent)
self.setGeometry(100, 100, 400, 260)
self.container = QWidget(self)
self.setCentralWidget(self.container)
self.player = mpv.MPV(wid=str(int(self.container.winId())),
log_handler=print,
loglevel='debug',
input_default_bindings=True,
input_vo_keyboard=True)
@self.player.on_key_press('f')
def my_f_binding():
print("f работает!")
self.player.play('test.mp4')
app = QApplication(sys.argv)
import locale
locale.setlocale(locale.LC_NUMERIC, 'C')
win = Test()
win.show()
sys.exit(app.exec())
When i try to use keybindings with Pyside they just don't work, but without pyside all works perfect, why? My code: