Skip to content
Extraits de code Groupes Projets
Valider 5a7282d1 rédigé par Elliu's avatar Elliu
Parcourir les fichiers

Add various keybinds

parent daf1f2e4
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Pipeline #2638 réussi
......@@ -317,8 +317,15 @@ MpvWidget::keyPressEvent(QKeyEvent* event)
case Qt::ShiftModifier:
switch(event->key()){
case Qt::Key_J:
MPV_SEND_COMMAND_ASYNC("cycle", "sub", NULL);
MPV_SEND_COMMAND_ASYNC("osd-msg", "cycle", "sub", nullptr);
case Qt::Key_Period:
MPV_SEND_COMMAND_ASYNC("osd-msg","frame-step", nullptr);
case Qt::Key_Z:
MPV_SEND_COMMAND_ASYNC("osd-msg", "add", "sub-delay", "+0.1", nullptr);
case Qt::Key_G:
MPV_SEND_COMMAND_ASYNC("osd-msg", "add", "sub-scale", "+0.1", nullptr);
case Qt::Key_F:
MPV_SEND_COMMAND_ASYNC("osd-msg", "add", "sub-scale", "-0.1", nullptr);
}
break;
......@@ -332,6 +339,7 @@ MpvWidget::keyPressEvent(QKeyEvent* event)
//lkt_queue_send(m_queue, LKT_EVENT_PLAY_TOGGLE, LKT_PLAY_TOGGLE);
break;
case Qt::Key_Return:
case Qt::Key_Greater:
LOG_DEBUG("WINDOW", "RETURN PRESSED");
lkt_queue_send(m_queue, LKT_EVENT_PLAY_NEXT, nullptr);
break;
......@@ -340,31 +348,49 @@ MpvWidget::keyPressEvent(QKeyEvent* event)
lkt_queue_send(m_queue, LKT_EVENT_PLAY_PREV, nullptr);
break;
case Qt::Key_Left:
MPV_SEND_COMMAND_ASYNC("osd-msg-bar", "seek", "-5", "relative", NULL);
MPV_SEND_COMMAND_ASYNC("osd-msg-bar", "seek", "-5", "relative", nullptr);
case Qt::Key_Right:
MPV_SEND_COMMAND_ASYNC("osd-msg-bar", "seek", "+5", "relative", NULL);
MPV_SEND_COMMAND_ASYNC("osd-msg-bar", "seek", "+5", "relative", nullptr);
case Qt::Key_Down:
MPV_SEND_COMMAND_ASYNC("osd-msg-bar", "seek", "-60", "relative", NULL);
MPV_SEND_COMMAND_ASYNC("osd-msg-bar", "seek", "-60", "relative", nullptr);
case Qt::Key_Up:
MPV_SEND_COMMAND_ASYNC("osd-msg-bar", "seek", "+60", "relative", NULL);
case Qt::Key_O:
MPV_SEND_COMMAND_ASYNC("osd-msg-bar", "show-progress", NULL);
MPV_SEND_COMMAND_ASYNC("osd-msg-bar", "seek", "+60", "relative", nullptr);
case Qt::Key_L:
MPV_SEND_COMMAND_ASYNC("ab-loop", NULL);
MPV_SEND_COMMAND_ASYNC("osd-msg", "ab-loop", nullptr);
case Qt::Key_O:
MPV_SEND_COMMAND_ASYNC("osd-msg-bar", "show-progress", nullptr);
case Qt::Key_BracketLeft:
MPV_SEND_COMMAND_ASYNC("osd-msg", "multiply", "speed", "1/1.1", nullptr);
case Qt::Key_BracketRight:
MPV_SEND_COMMAND_ASYNC("osd-msg", "multiply", "speed", "1.1", nullptr);
case Qt::Key_BraceLeft:
MPV_SEND_COMMAND_ASYNC("osd-msg", "multiply", "speed", "0.5", nullptr);
case Qt::Key_BraceRight:
MPV_SEND_COMMAND_ASYNC("osd-msg", "multiply", "speed", "2", nullptr);
case Qt::Key_Backspace:
MPV_SEND_COMMAND_ASYNC("osd-msg", "set", "speed", "1.0", nullptr);
case Qt::Key_Semicolon:
MPV_SEND_COMMAND_ASYNC("osd-msg","frame-step", nullptr);
case Qt::Key_Comma:
MPV_SEND_COMMAND_ASYNC("osd-msg","frame-back-step", nullptr);
/* Track management */
case Qt::Key_NumberSign:
MPV_SEND_COMMAND_ASYNC("cycle", "audio", NULL);
MPV_SEND_COMMAND_ASYNC("osd-msg", "cycle", "audio", nullptr);
case Qt::Key_J:
MPV_SEND_COMMAND_ASYNC("cycle", "sub", "down", NULL);
MPV_SEND_COMMAND_ASYNC("osd-msg", "cycle", "sub", "down", nullptr);
case Qt::Key_Underscore:
MPV_SEND_COMMAND_ASYNC("cycle", "video", NULL);
MPV_SEND_COMMAND_ASYNC("osd-msg", "cycle", "video", nullptr);
/* Misc */
case Qt::Key_I:
MPV_SEND_COMMAND_ASYNC("script-binding", "stats/display-stats", NULL);
MPV_SEND_COMMAND_ASYNC("script-binding", "stats/display-stats", nullptr);
case Qt::Key_Delete:
MPV_SEND_COMMAND_ASYNC("script-message", "osc-visibility", (m_oscVisible = !m_oscVisible) ? "always" : "never", NULL);
MPV_SEND_COMMAND_ASYNC("script-message", "osc-visibility", (m_oscVisible = !m_oscVisible) ? "always" : "never", nullptr);
case Qt::Key_Z:
MPV_SEND_COMMAND_ASYNC("osd-msg", "add", "sub-delay", "-0.1", nullptr);
case Qt::Key_M:
MPV_SEND_COMMAND_ASYNC("osd-msg", "cycle", "mute", nullptr);
default:
break;
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter