#ifdef WITH_PPC
uae_ppc_pause(1);
#endif
- inputdevice_unacquire ();
+ inputdevice_unacquire();
pause_sound ();
setmouseactive(0, 0);
+ target_inputdevice_unacquire(true);
activate_console ();
trace_mode = 0;
exception_debugging = 0;
extern void inputdevice_settest (int);
extern int inputdevice_testread_count (void);
-extern bool target_can_autoswitchdevice(void);
+bool target_can_autoswitchdevice(void);
+void target_inputdevice_acquire(void);
+void target_inputdevice_unacquire(bool);
bool key_specialpressed(void);
bool key_shiftpressed(void);
}
}
-void target_inputdevice_acquire(void);
-void target_inputdevice_unacquire(void);
-
void inputdevice_acquire (int allmode)
{
int i;
if (!input_acquired)
return;
- target_inputdevice_unacquire();
+ target_inputdevice_unacquire(false);
input_acquired = 0;
if (!(inputmask & 4))
debuggerinitializing = FALSE;
if (!hDbgWnd)
return 0;
+ rawinput_release();
InitPages();
ShowPage(0, TRUE);
if (!regqueryint (NULL, _T("DebuggerMaximized"), &maximized))
void close_debug_window(void)
{
DestroyWindow(hDbgWnd);
+ rawinput_alloc();
}
int console_get_gui (TCHAR *out, int maxlen)
void rawinput_alloc(void)
{
- doregister_rawinput(true);
+ if (!rawinput_registered) {
+ doregister_rawinput(true);
+ }
+ //write_log("rawinput_alloc\n");
}
void rawinput_release(void)
{
+ UINT num = 0;
+ int v = GetRegisteredRawInputDevices(NULL, &num, sizeof(RAWINPUTDEVICE));
+ if (num) {
+ PRAWINPUTDEVICE devs = xcalloc(RAWINPUTDEVICE, num);
+ if (devs) {
+ int v = GetRegisteredRawInputDevices(devs, &num, sizeof(RAWINPUTDEVICE));
+ if (v >= 0) {
+ for (int i = 0; i < num; i++) {
+ PRAWINPUTDEVICE dev = devs + i;
+ dev->dwFlags = RIDEV_REMOVE;
+ dev->hwndTarget = NULL;
+
+ }
+ RegisterRawInputDevices(devs, num, sizeof(RAWINPUTDEVICE));
+ }
+ xfree(devs);
+ }
+ }
+ rawinput_registered = false;
+ //write_log("rawinput_free\n");
}
static void cleardid (struct didata *did)
for (int i = 0; i < num_joystick; i++)
sortobjects (&di_joystick[i]);
- rawinput_alloc();
return 1;
error2:
return mouseactive > 0;
}
-void target_inputdevice_unacquire(void)
+void target_inputdevice_unacquire(bool full)
{
close_tablet(tablet);
tablet = NULL;
+ if (full) {
+ rawinput_release();
+ }
}
void target_inputdevice_acquire(void)
{
struct AmigaMonitor *mon = &AMonitors[0];
- target_inputdevice_unacquire();
+ target_inputdevice_unacquire(false);
tablet = open_tablet(mon->hAmigaWnd);
+ rawinput_alloc();
}
int getfocusedmonitor(void)
flipgui(1);
if (setpaused (7)) {
- inputdevice_unacquire ();
+ inputdevice_unacquire();
+ rawinput_release();
wait_keyrelease();
- clearallkeys ();
+ clearallkeys();
setmouseactive(0, 0);
}
}
}
mon->manual_painting_needed--; /* So that WM_PAINT doesn't need to use custom refreshing */
- reset_sound ();
- inputdevice_copyconfig (&changed_prefs, &currprefs);
- inputdevice_config_change_test ();
- clearallkeys ();
+ reset_sound();
+ inputdevice_copyconfig(&changed_prefs, &currprefs);
+ inputdevice_config_change_test();
+ clearallkeys();
flipgui(0);
if (resumepaused (7)) {
- inputdevice_acquire (TRUE);
+ inputdevice_acquire(TRUE);
setmouseactive(0, 1);
}
- fpscounter_reset ();
- screenshot_free ();
- write_disk_history ();
+ rawinput_alloc();
+ fpscounter_reset();
+ screenshot_free();
+ write_disk_history();
gui_active--;
here--;
}
ShowCursor (TRUE);
wait_keyrelease ();
inputdevice_unacquire ();
+ rawinput_release();
inputmap_disable (hDlg, false);
inputdevice_settest (FALSE);
SetWindowText (mainDlg, tmp);
pause_sound ();
if (flipflop)
ShowWindow(mon->hAmigaWnd, SW_MINIMIZE);
+ rawinput_release();
}
if (hwnd == NULL)
flags |= MB_TASKMODAL;
reset_sound ();
resume_sound ();
setmouseactive(0, focuso > 0 ? 1 : 0);
+ rawinput_alloc();
}
}