1
0
mirror of https://github.com/mpv-player/mpv synced 2025-04-01 23:00:41 +00:00

terminal-win: implement terminal_set_mouse_input

This commit is contained in:
nanahi 2024-03-31 16:51:33 -04:00 committed by Kacper Michajłow
parent c2ed2e7bc8
commit eff18a8a11

View File

@ -558,6 +558,13 @@ bool terminal_try_attach(void)
void terminal_set_mouse_input(bool enable)
{
DWORD cmode;
HANDLE in = hSTDIN;
if (GetConsoleMode(in, &cmode)) {
cmode = enable ? cmode | ENABLE_MOUSE_INPUT
: cmode & (~ENABLE_MOUSE_INPUT);
SetConsoleMode(in, cmode);
}
}
void terminal_init(void)