summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/input/input_common.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Initial support for SDL3. [R. Belmont, Vas Crabb] arbee2026-02-071-0/+15
| | | | | | | | | * SDL3 is the default for macOS targets. Linux/Windows can build with OSD=sdl3 while we wait for better distro support for SDL3. Both X11 and Wayland sessions are fully supported on Linux. * SDL3 -sound=sdl supports both input and output. All other video, sound, and input functionality should otherwise be the same for now. SDL 3.4+ multiple keyboard/mouse support is planned.
* input/input_common.cpp: Fixed "Application" key with SDL keyboard provider. Vas Crabb2025-08-291-4/+11
| | | | | Also improved support for rare higher F-keys with SDL and Win32 providers.
* osd/modules/input: Various cleanup and minor enhancements. Vas Crabb2024-03-041-143/+148
| | | | | | | | | | | | | | | | | | | input_common.h: Got rid of the DirectInput key code macros. DirectInput headers are always available on Windows - it's just an opportunity for bygs. input_common.cpp: Added default names for keys mapped to MAME's "other switch" type. input_rawinput.cpp: Simulate Pause key being held for 30ms, similarly to what's done for Caps Lock on macOS with SDL. Also added a gross hack to give "correct" names for Pause and Num Lock. input_sdl.cpp: Get default key names from SDL. Not really that useful as it isn't aware of the current keyboard layout. Key map files are still needed for anything other than a US ANSI layout. Also added some comments.
* Update accumulating relative inputs exactly once per frame. Vas Crabb2023-02-241-3/+3
| | | | | | | | | | | | | This fixes "amplification" effects that would happen if the frame rate rose above 100 Hz (whether by unthrottling or otherwise). Synchronise with wall clock any time inputs are read. Not doing this has weird effects on relative inputs with frame skipping and contributes to unresponsiveness of menus. Reduce visual latency for mouse movement on menus when paused or skipping frames. The rest of the code changes to menus won't provide benefits until draw can happen after event handling.
* Various input and OSD refactoring: Vas Crabb2023-01-291-198/+175
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | osd: Supply OSD object to modules on initialisation. Encapsulated some event handling in the OSD objects rather than leaving it in free functions. Put various stuff in namespaces. osd/modules/input: Enabled dinput, xinput and winhybrid modules for Windows SDL builds, and enabled background input for dinput and xinput (and by extension winhybrid) modules. Also fixed some COM and X11 resource leaks. osd/modules/input/input_sdl.cpp: Flipped SDL mouse button order to match Windows, and exposed vertical and horizontal scroll as Z and rZ axes. Moved SDL UI event handling out of input devices into OSD object. osd/modules/input_rawinput.cpp: Changed lightgun Z axis token so it's correctly identified as a relative axis (it maps to the scroll wheel equivalent). osd: Added an option to choose the network provider module. Mostly useful if you build with both TUN/TAP and pcap support included, or if you want to disable emulated networking completely. emu/input.cpp: Use a better strategy for assembling input code names that uses fewer temporary strings and doesn't require use of the non-Unicode-aware space trimming function (fixes MT08552). osd/modules/input_dinput.cpp: Improved polling logic. osd: Made various parts of the input code less dependent on concrete emu objects, and reduced inappropriately passing around the machine object. Made input modules less dependent on OSD implementation. Encapsulated some stuff and got rid of some vestigial newui and SDL1 support code. Cleaned up some interfaces. Moved OSD options classes to their own files. Prepare to remove main.h from emu.h - it's mostly used to get the application name, which the vast majority of emulated devices don't need to do.
* Optimisation, and baby steps towards untangling stuff: Vas Crabb2022-06-161-0/+45
| | | | | | | | | | Optimised the scheduler's handling of unscheduled timers - gives a 50% performance improvement in some timer-heavy drivers. Added better endianness swizzling helpers. Got rid of some of the OSD input modules' dependence on concrete input classes from emu.
* remove uwp column Miodrag Milanovic2021-10-261-134/+134
|
* Remove OSD_UWP from rest of code Miodrag Milanovic2021-10-261-25/+2
|
* Slightly cleaned up OSD input modules. Vas Crabb2021-07-291-5/+1
| | | | | | | | | | Removed support for DirectInput 7 and earlier. It hasn't been tested in years, and it's not relevant on any supported OS. DirectInput is effectively finalised at version 8, and is unlikely to get an API update in the future. Use more string[_view] and fewer C strings, and tightened up scope of a few things.
* Eliminate ARRAY_LENGTH template in favor of C++17's std::size AJR2021-02-141-1/+1
| | | | | | | | | | * osdcomm.h: Move definition of EQUIVALENT_ARRAY to coretmpl.h * sharc.cpp, gt64xxx.cpp, ym2413.cpp, gb_lcd.cpp, snes_ppu.cpp: Use STRUCT_MEMBER for save state registration * gio/newport.cpp, megadrive/svp.cpp, nes_ctrl/bcbattle.cpp, arm7.cpp, tms9995.cpp, pckeybrd.cpp, sa1110.cpp, sa1111.cpp, jangou_blitter.cpp, vic4567.cpp: Use std::fill(_n) instead of memset * emucore.h: Remove obsolete typedef
* (nw) Clean up the mess on master Vas Crabb2019-03-261-2/+4
| | | | | | | | | | | | | This effectively reverts b380514764cf857469bae61c11143a19f79a74c5 and c24473ddff715ecec2e258a6eb38960cf8c8e98e, restoring the state at 598cd5227223c3b04ca31f0dbc1981256d9ea3ff. Before pushing, please check that what you're about to push is sane. Check your local commit log and ensure there isn't anything out-of-place before pushing to mainline. When things like this happen, it wastes everyone's time. I really don't need this in a week when real work™ is busting my balls and I'm behind where I want to be with preparing for MAME release.
* Revert "conflict resolution (nw)" andreasnaive2019-03-251-4/+2
| | | | | This reverts commit c24473ddff715ecec2e258a6eb38960cf8c8e98e, reversing changes made to 009cba4fb8102102168ef32870892438327f3705.
* Fixed sdl2 keymap processing. [Couriersud] couriersud2019-02-161-2/+4
| | | | | | | | | | Keymaps must have been broken for ages: - It is now possible to map every scancode SDL2 defines. - Removed keycode field. This was a leftover from SDL1.x - Fixed bug preventing keymaps from working. - Fixed the DE keymap. - Converted other keymaps to new format and added a comment that they have to be reviewed and fixed.
* Make "Keypad ," and "Keypad =" standard keys AJR2018-05-111-0/+2
|
* UWP: Better keyboard key names (nw) Brad Hughes2016-11-151-8/+6
|
* UWP: Enable gamepad support and update keyboard support (nw) Brad Hughes2016-11-141-4/+10
|
* Add basic keyboard input to UWP (nw) Brad Hughes2016-11-111-133/+151
|
* Misc. keyboard input improvements AJR2016-10-081-1/+5
| | | | | | | | - Add BS, Tab, 00, 000 keys common on add-on keypads as input items; SDL may recognize these, but DirectInput does not - Assign Keypad 00 and Keypad 000 in several drivers' input lists - Add SDL keycode for "cancel" key - Add keypad keys as alternates to natural keyboard - Move has_keyboard() out of the core; enabled() test is unnecessary now that all optional keyboards are slot devices (nw)
* Cleanups and version bump Miodrag Milanovic2016-07-271-1/+1
|
* Apollo changes: [Hans Ostermeyer] arbee2016-07-121-1/+3
| | | | | | | | | | - Keyboard mapping adjusted to fit current MAME - Fixed screen raw parameters - Fixed disp.dex Test 20 (Video SYNC Gen. Add. Test) for color displays 3c505: The Ethernet frame check sequence is now appended to transmit data [Hans Ostermeyer] input_common: fixed 0.172 regression for non-US keyboards [Hans Ostermeyer]
* RIP sdlinc.h couriersud2016-05-061-1/+1
|
* Fix BACKSLASH2 SDL key mapping Brad Hughes2016-04-111-1/+1
|
* Cleanups and version bump Miodrag Milanovic2016-03-301-1/+1
|
* General code cleanup in input modules. Using ComPtr to manage DirectInput ↵ Brad Hughes2016-03-181-6/+4
| | | | resources.
* compile fix (nw) Miodrag Milanovic2016-03-081-1/+1
|
* Fixed osdmini building for android and pnacl (nw) Miodrag Milanovic2016-03-081-1/+11
|
* Refactor OSD input into modules Brad Hughes2016-02-281-0/+266