- now the win32 gui updates bx_options.Omouse_enabled whenever it

goes in/out of mouse capture mode.  This is critical because
  bx_options.Omouse_enabled is used to control whether the mouse
  events are sent into the hardware queue or not (keyboard.cc).
  This is only a partial fix though, because changing the mouse
  enabled setting in the control panel has no effect on the gui.
This commit is contained in:
Bryce Denney 2001-06-23 01:47:26 +00:00
parent f5a90eb9c6
commit 0bc41bc8ba
2 changed files with 4 additions and 0 deletions

View File

@ -200,6 +200,7 @@ bx_gui_c::mouse_enabled_changed (Boolean val)
replace_bitmap(BX_GUI_THIS mouse_hbar_id, BX_GUI_THIS mouse_bmap_id);
else
replace_bitmap(BX_GUI_THIS mouse_hbar_id, BX_GUI_THIS nomouse_bmap_id);
// ideally, this should update the gui too.
}
void

View File

@ -405,6 +405,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam) {
switch (iMsg) {
case WM_CREATE:
SetTimer (hwnd, 1, 330, NULL);
bx_options.Omouse_enabled->set (mouseCaptureMode);
if (mouseCaptureMode)
SetWindowText(hwnd, "Bochs for Windows [Press F12 to release mouse capture]");
else
@ -425,6 +426,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam) {
cursorWarped();
}
}
bx_options.Omouse_enabled->set (mouseCaptureMode);
return 0;
@ -484,6 +486,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam) {
case WM_SYSKEYDOWN:
if (wParam == VK_F12) {
mouseCaptureMode = !mouseCaptureMode;
bx_options.Omouse_enabled->set (mouseCaptureMode);
ShowCursor(!mouseCaptureMode);
ShowCursor(!mouseCaptureMode); // somehow one didn't do the trick (win98)
GetWindowRect(hwnd, &wndRect);