From: Hermès Bélusca-Maïto Date: Sat, 1 Mar 2014 20:52:46 +0000 (+0000) Subject: [NTVDM]: Rework the code template to be used when we will support mice in ntvdm. X-Git-Tag: backups/0.3.17@66124~1365^2~50 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=129e5d0305dc7a5e3a03788a84b7ba882958744a [NTVDM]: Rework the code template to be used when we will support mice in ntvdm. svn path=/branches/ntvdm/; revision=62370 --- diff --git a/subsystems/ntvdm/hardware/ps2.c b/subsystems/ntvdm/hardware/ps2.c index 1aa2ab7d086..9599a51bdc9 100644 --- a/subsystems/ntvdm/hardware/ps2.c +++ b/subsystems/ntvdm/hardware/ps2.c @@ -337,17 +337,20 @@ BOOLEAN PS2Initialize(HANDLE ConsoleInput) RegisterIoPort(PS2_DATA_PORT , PS2ReadPort, PS2WritePort); #if 0 - if (MousePresent) + if (GetConsoleMode(ConsoleInput, &ConInMode)) { - /* Support mouse input events if there is a mouse on the system */ - if (GetConsoleMode(ConsoleInput, &ConInMode)) - SetConsoleMode(ConsoleInput, ConInMode | ENABLE_MOUSE_INPUT); - } - else - { - /* Do not support mouse input events if there is no mouse on the system */ - if (GetConsoleMode(ConsoleInput, &ConInMode)) - SetConsoleMode(ConsoleInput, ConInMode & ~ENABLE_MOUSE_INPUT); + if (MousePresent) + { + /* Support mouse input events if there is a mouse on the system */ + ConInMode |= ENABLE_MOUSE_INPUT; + } + else + { + /* Do not support mouse input events if there is no mouse on the system */ + ConInMode &= ~ENABLE_MOUSE_INPUT; + } + + SetConsoleMode(ConsoleInput, ConInMode); } #endif