}
}
+static VOID EnableExtraHardware(HANDLE ConsoleInput)
+{
+ DWORD ConInMode;
+
+ if (GetConsoleMode(ConsoleInput, &ConInMode))
+ {
+#if 0
+ // GetNumberOfConsoleMouseButtons();
+ // GetSystemMetrics(SM_CMOUSEBUTTONS);
+ // GetSystemMetrics(SM_MOUSEPRESENT);
+ if (MousePresent)
+ {
+#endif
+ /* Support mouse input events if there is a mouse on the system */
+ ConInMode |= ENABLE_MOUSE_INPUT;
+#if 0
+ }
+ else
+ {
+ /* Do not support mouse input events if there is no mouse on the system */
+ ConInMode &= ~ENABLE_MOUSE_INPUT;
+ }
+#endif
+
+ SetConsoleMode(ConsoleInput, ConInMode);
+ }
+}
+
/* PUBLIC FUNCTIONS ***********************************************************/
VOID
{
switch (ControlType)
{
- case CTRL_C_EVENT:
- case CTRL_BREAK_EVENT:
- {
- /* HACK: Stop the VDM */
- DPRINT1("Ctrl-C/Break: Stop the VDM\n");
- EmulatorTerminate();
- break;
- }
case CTRL_LAST_CLOSE_EVENT:
{
if (WaitForSingleObject(VdmTaskEvent, 0) == WAIT_TIMEOUT)
break;
}
+
default:
{
/* Stop the VDM if the user logs out or closes the console */
DestroyVdmMenu();
}
-static BOOL
+BOOL
ConsoleAttach(VOID)
{
/* Save the original input and output console modes */
// return FALSE;
}
+ /* Set the console input mode */
+ // FIXME: Activate ENABLE_WINDOW_INPUT when we will want to perform actions
+ // upon console window events (screen buffer resize, ...).
+ SetConsoleMode(ConsoleInput, 0 /* | ENABLE_WINDOW_INPUT */);
+ EnableExtraHardware(ConsoleInput);
+
+ /* Set the console output mode */
+ // SetConsoleMode(ConsoleOutput, ENABLE_PROCESSED_OUTPUT | ENABLE_WRAP_AT_EOL_OUTPUT);
+
/* Initialize the UI */
ConsoleInitUI();
return TRUE;
}
-static VOID
+VOID
ConsoleDetach(VOID)
{
/* Restore the original input and output console modes */