mirror of
https://github.com/mpv-player/mpv
synced 2025-04-11 04:01:31 +00:00
terminal-win: implement terminal_set_mouse_input
This commit is contained in:
parent
c2ed2e7bc8
commit
eff18a8a11
@ -558,6 +558,13 @@ bool terminal_try_attach(void)
|
|||||||
|
|
||||||
void terminal_set_mouse_input(bool enable)
|
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)
|
void terminal_init(void)
|
||||||
|
Loading…
Reference in New Issue
Block a user