diff options
author | 2022-06-16 12:37:26 +1000 | |
---|---|---|
committer | 2022-06-16 12:37:26 +1000 | |
commit | 731a6bbe8ac51a5ff006a0bca574a96f8f498051 (patch) | |
tree | 546c8b0812269188490334548bdf159d2843bfa7 /src/osd/modules/input/input_common.cpp | |
parent | 4e2121d8aa3a982288849c08500712f0cb2d96bc (diff) | |
parent | e7fe75fd5c901a2b62456dcfa2fbd6144bebf233 (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/osd/modules/input/input_common.cpp')
-rw-r--r-- | src/osd/modules/input/input_common.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/osd/modules/input/input_common.cpp b/src/osd/modules/input/input_common.cpp index bb596295ea9..7127a7878fa 100644 --- a/src/osd/modules/input/input_common.cpp +++ b/src/osd/modules/input/input_common.cpp @@ -14,6 +14,8 @@ #include "emu.h" #include "input_common.h" +#include "inputdev.h" // FIXME: still using concrete input device class in input_module_base::poll + // winnt.h defines this #ifdef DELETE #undef DELETE @@ -277,3 +279,46 @@ int input_module_base::init(const osd_options &options) return 0; } + +void input_module_base::poll(running_machine &machine) +{ + // ignore if not enabled + if (m_input_enabled) + { + // grab the current time + m_last_poll = m_clock.now(); + + before_poll(machine); + + // track if mouse/lightgun is enabled, for mouse hiding purposes + m_mouse_enabled = machine.input().device_class(DEVICE_CLASS_MOUSE).enabled(); + m_lightgun_enabled = machine.input().device_class(DEVICE_CLASS_LIGHTGUN).enabled(); + } + + // poll all of the devices + if (should_poll_devices(machine)) + { + m_devicelist.poll_devices(); + } + else + { + m_devicelist.reset_devices(); + } +} + +void input_module_base::pause() +{ + // keep track of the paused state + m_input_paused = true; +} + +void input_module_base::resume() +{ + // keep track of the paused state + m_input_paused = false; +} + +void input_module_base::exit() +{ + devicelist().free_all_devices(); +} |