Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dosbox-staging/dosbox-staging.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/hardware/mouse/mouse_manymouse.cpp')
-rw-r--r--src/hardware/mouse/mouse_manymouse.cpp27
1 files changed, 2 insertions, 25 deletions
diff --git a/src/hardware/mouse/mouse_manymouse.cpp b/src/hardware/mouse/mouse_manymouse.cpp
index 46f9c03a2..4f50fb4ee 100644
--- a/src/hardware/mouse/mouse_manymouse.cpp
+++ b/src/hardware/mouse/mouse_manymouse.cpp
@@ -254,15 +254,10 @@ bool ManyMouseGlue::ProbeForMapping(uint8_t &physical_device_idx)
HandleEvent(event, true); // handle critical events
bool success = false;
- while (!shutdown_requested) {
- if (IsCancelRequested())
- break; // user cancelled using a keyboard
-
+ while (!DOS_IsCancelRequest()) {
// Poll mouse events, handle critical ones
- if (!ManyMouse_PollEvent(&event)) {
- CALLBACK_Idle();
+ if (!ManyMouse_PollEvent(&event))
continue;
- }
if (event.device >= max_mice)
continue;
HandleEvent(event, true);
@@ -297,24 +292,6 @@ bool ManyMouseGlue::ProbeForMapping(uint8_t &physical_device_idx)
return success;
}
-bool ManyMouseGlue::IsCancelRequested()
-{
- constexpr uint8_t code_ctrl_c = 0x03;
- constexpr uint8_t code_esc = 0x1b;
-
- while (!(Files[STDIN]->GetInformation() & (1 << 6))) {
- // A key is waiting, read it
- uint16_t count = 1;
- uint8_t code = 0;
- DOS_ReadFile(STDIN, &code, &count);
- // Check if requested to cancel
- if (code == code_ctrl_c || code == code_esc || code == 'q' || code == 'Q')
- return true;
- }
-
- return false;
-}
-
uint8_t ManyMouseGlue::GetIdx(const std::regex &regex)
{
assert(max_mice < UINT8_MAX);