mirror of
https://github.com/Zaarrg/stremio-community-v5.git
synced 2026-05-10 12:10:54 +00:00
Fix Play/Pause media key not working out of focus
- Fix media key out of focus not working [86](https://github.com/Zaarrg/stremio-community-v5/issues/86)
This commit is contained in:
parent
d6c485de17
commit
917dd8d52a
3 changed files with 16 additions and 0 deletions
|
|
@ -122,6 +122,11 @@ int main(int argc, char* argv[])
|
|||
return 1;
|
||||
}
|
||||
|
||||
//Add PlayPause Hotkey
|
||||
if (!RegisterHotKey(g_hWnd, 1, 0, VK_MEDIA_PLAY_PAUSE)) {
|
||||
AppendToCrashLog(L"[BOOT]: Failed to register hotkey!");
|
||||
}
|
||||
|
||||
// Scale Values with DPI
|
||||
ScaleWithDPI();
|
||||
LoadCustomMenuFont();
|
||||
|
|
|
|||
|
|
@ -391,6 +391,15 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
}
|
||||
break;
|
||||
}
|
||||
case WM_HOTKEY:
|
||||
{
|
||||
// PlayPause Hotkey
|
||||
if (wParam == 1) {
|
||||
std::vector<std::string> args = {"cycle", "pause"};
|
||||
HandleMpvCommand(args);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case WM_SETTINGCHANGE:
|
||||
{
|
||||
UpdateTheme(hWnd);
|
||||
|
|
|
|||
|
|
@ -67,4 +67,6 @@ void Cleanup()
|
|||
}
|
||||
|
||||
Discord_Shutdown();
|
||||
|
||||
UnregisterHotKey(g_hWnd, 1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue