summaryrefslogtreecommitdiffstats
path: root/src/osd/modules/input/input_common.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/osd/modules/input/input_common.cpp')
-rw-r--r--src/osd/modules/input/input_common.cpp45
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();
+}