summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/input
Commit message (Collapse)AuthorAgeFilesLines
* input_sdl: fix deadlock issue with joystick (remove reset() call during ↵ hap2024-09-281-34/+47
| | | | process_event)
* input_sdl: empty event queue on resets hap2024-08-281-0/+4
|
* osd/input_common: increase event queue size, hap2024-08-243-9/+15
| | | | | input_rawinput/win32: empty event queue on resets, input_raw: set RIDEV_INPUTSINK flag because of missed keyup events, causing stuck inputs (MT8789)
* input_sdl.cpp: Add missing #include <cmath> for std::lround(). [Thomas Klausner] arbee2024-06-081-0/+1
|
* input/input_sdl.cpp: Added an SDL lightgun provider. Vas Crabb2024-04-265-54/+329
| | | | | | | | | | This does essentially the same thing as the Win32 lightgun provider, mapping the absolute pointer position over the window to gun axes. Also added a bunch of const in the windows input handling code. docs: Bumped version, as features that are not in a releaesd version of MAME are now documented.
* Initial touch input support: Vas Crabb2024-04-125-105/+233
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Feed mouse/pen/touch pointer events through UI input manager with Win32 and SDL. * Started migrating UI code to use new API and reworking mouse/touch interaction. * emu/render.cpp: Support pressing multiple clickable layout items simultaneously. * emu/render.cpp: Allow UI elements to be drawn in any window. * emu/rendlay.cpp, luaengine_render.cpp: Added layout view events for pointer input. * ui/ui.cpp: Allow the UI handler to control pointer display. * ui/analogipt.cpp: Added mouse/touch and more keys for navigating field state list. * ui/menu.cpp: Use vertical swipe to scroll and horizontal swipe to adjust. * ui/menu.cpp: Draw after processing input - greatly improves responsiveness. * ui/menu.cpp: Ignore keyboard/gamepad input during pointer actions. * ui/selmenu.cpp: Made left/right info pane arrows repeat when held. * ui/selmenu.cpp: Use middle click to move keyboard focus. * ui/selmenu.cpp: Let filter list scroll if it's too tall, and use a bit of horizontal padding. * ui/selmenu.cpp: Improved divider sizing. * ui/state.cpp: Don't allow clicks to pass through the confirm deletion prompt to the menu. * ui/simpleselgame.cpp: Fixed error message display and graphics/sound status not showing. * ui/simpleselgame.cpp: Allow tap/click to dismiss error message. * ui/utils.cpp: Show UI for choice filters when there are no choices - it's less confusing. * modules/input/input_sdl.cpp: Made scaling for mouse scroll better match RawInput and DirectInput. * modules/input/input_rawinput.cpp: Added support for horizontal scroll axis. * modules/input/input_win32.cpp: Added support for scroll axes and more buttons to mouse/lightgun. * modules/debugger/debugimgui.cpp: Don't fight over events with the UI manager - it breaks menus. * osd/windows/window.cpp: Translate mouse position to window cooridinates for scroll wheel events. * osd/sdl/window.cpp: Supply last mouse position for scroll wheel events if possible. * scripts/build/complay.py: Made zero input mask an error - it was only being used to block clicks.
* Drop support for GCC < 10.3, clang 6, SDL < 2.0.14 and Qt 5.10. Vas Crabb2024-03-281-53/+12
|
* -input/input_rawinput.cpp: Properly align buffers for RAWINPUT header Vas Crabb2024-03-071-7/+7
| | | | -jaleco/megasys1.cpp: Clarified comment about MCU program used for chimerab.
* osd/modules/input: Various cleanup and minor enhancements. Vas Crabb2024-03-046-326/+243
| | | | | | | | | | | | | | | | | | | 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.
* input_windows: remove doubled key hap2024-02-161-1/+1
|
* - osd sdl default keys: remove ctrl-blocks on f3 and f4, move opengl filter ↵ hap2024-02-161-7/+8
| | | | | | | from lctrl+f5 to lalt+f10, - osd windows default keys: move post processing key from lctrl+lalt+f5 to lalt+f10, - mame default keys: move rewind step from shit+tilde to shift+f4, move cheat from shift+f6 to shift+f8, move quick save/load from (none) to shift+f6/f7
* Fixed OSD interaction with updated default keys. [R. Belmont] arbee2024-02-131-0/+5
|
* osd/windows: Create single-threaded COM apartment on main thread. Vas Crabb2023-04-081-23/+0
|
* Bump version to 0.253mame0253 Vas Crabb2023-03-301-2/+2
|
* osd/modules/input/input_dinput.cpp: Adjusted heuristics to work better with ↵ Vas Crabb2023-03-292-25/+25
| | | | newer DualShock/DualSense controllers.
* input/input_dinput.h: Work around inability to have stdcall non-capturing ↵ Vas Crabb2023-03-261-4/+8
| | | | lambdas (fixes 32-bit MinGW build).
* osd/modules/input: Always use DirectInput with desktop window in background ↵ Vas Crabb2023-02-281-4/+11
| | | | | | | | | | | | | | | | | | | mode. There are multiple issues with what MAME was doing, but the most glaring is that it violates the DirectInput interface contract that requires the window associated with an open device must not be destroyed. See documentation for IDirectInputDevice8::SetCooperativeLevel: "This parameter must be a valid top-level window handle that belongs to the process. The window associated with the device must not be destroyed while it is still active in a DirectInput device." The previous code also prevented DirectInput controllers from working when using multiple windows if any window other than the first window had focus. Also fixed SDL builds not correctly recognising when all windows lose focus, and save state menu not appearing.
* osd/modules/input: Modernised interface for enumerating DirectInput devices. Vas Crabb2023-02-283-86/+73
| | | | | Gets rid of some state in the winhybrid joystick module that's only used during initialisation.
* osd: Fixed a corner case in XInput DJ Hero turntable handling. Vas Crabb2023-02-251-20/+14
|
* Update accumulating relative inputs exactly once per frame. Vas Crabb2023-02-2410-79/+103
| | | | | | | | | | | | | 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.
* osd: Cleaner way of dealing with input updates. Vas Crabb2023-02-231-1/+1
|
* osd: Don't pump events when reading inputs. Vas Crabb2023-02-235-28/+2
| | | | | | This was a drain on performance. If anything is trying to poll inputs in a loop, it needs to call input_update() to ensure it gets up-to-date state.
* Input refactoring: Vas Crabb2023-02-1810-345/+3360
| | | | | | | | | | | | | | | | | | | | | | | | | | osd/modules/input, emu/inpttype.cpp: Made most default joystick assignments supplied by input modules. Input modules take available controls into consideration when generating default assignments. emu/inpttype.ipp: Added a separate "Back" UI input separate from Cancel. You may want an easier to hit combination for moving to the previous menu than for exiting or cancelling input. They both default to Escape. emu/inpttype.ipp: Added a UI Help control. Currently only used by analog inputs menu emu/inpttype.h: Moved I/O port field type enum to its own header and sorted UI controls so they appear in a more logical order. ui: Don't use UI Select to restore defaults - people should be getting used to the UI Clear input by now. UI Select cycles multi-value items instead. ui/inputmap.cpp: Don't use immediate cancel to cycle between clearing and restoring default assignment (use UI Clear instead). osd: Reduced the number of files needing to include the dreaded emu.h. Got some implementation out of headers.
* -osd/windows/winutil.cpp: Better way to get module handle. Vas Crabb2023-02-121-1/+1
| | | | | | | * This was leftover support for Windows 2000 and earlier that hadn't been cleaned up. -atari: Don't forget your #include guards!
* Small batch of input refactoring: Vas Crabb2023-02-058-36/+104
| | | | | | | | | | | | | | | | | | | | | emu/input.cpp: Fixed regression in display of some joystick inputs. osd/interface: Split up interface classes into a few more files to reduce where the input device interface class needs to be included. Made OSD independent of concrete input_device class. osd/modules/input, emu/inputdev.cpp, emu/ioport.cpp: Allow input devices to provide tokens for controls without standard item types and additional default input assignments. Fixes issues assigning Yen and Backslash on Japanese keyboards. ui/textbox.cpp: Added a fixed-content text box menu class for future use. Got main.h out of emu.h as it’s only used in a very small number of places, mostly for getting the application name. Added eminline.h to attotime.h as it's used without emu.h. Cleaned up forward declarations in emufwd.h a little.
* osd: Don't swallow text input with -keyboardprovider win32 (addresses GitHub ↵ Vas Crabb2023-02-031-1/+1
| | | | #7911).
* Use EQUIVALENT_ARRAY to avoid issues with std::size on member arrays, enable ↵ Vas Crabb2023-02-011-6/+3
| | | | warnings for VLAs in C++.
* osd/tools: msvc fixes Patrick Mackinlay2023-02-011-0/+1
| | | | | * xinput.h depends on windows.h * avoid use of non-standard variable-length arrays
* osd: Turned video modules into actual modules, fixed various issues. Vas Crabb2023-02-013-12/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't ignore the return status of OSD module initialisation. Attempt to fall back to an alternate module if the selected module fails to initialise. Log more useful diagnostic information at verbose level. Fixed BGFX crash on exit after toggling fullscreen. Also persist more settings than just the selected chains across toggling fullscreen. Turned video modules into OSD modules in the same sense as all the other OSD modules. They now use the same selection/fallback mechanism as all the other modules without special extra code in the OSD implementations. Untangled some object ownership mess. Windows own renderers, OSD objects own windows. Fixed a refrence loop that caused the first window object to always leak. Don't create renderer object until after underlying window has been created. Fixed issues with order of creation/destruction when toggling fullscreen or changing prescale in fullscreen with -switchres in SDL builds. Use more smart pointers in BGFX and Direct3D render modules. Most of the code now reutrns a smart pointer when handing over ownership or a naked pointer when retaining ownership. Fixed a few leaks and simplified cleanup code. Encapsulated various OSD modules better.
* osd/modules/input: Fixed Linux build. Vas Crabb2023-01-292-3/+1
|
* Various input and OSD refactoring: Vas Crabb2023-01-2919-2761/+2415
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Miscellaneous fixes and refactoring: Vas Crabb2023-01-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ui/analogipt.cpp: Fixed bar graph display for fields with ranges that wrap through zero. emu/inputdev.cpp: Separateed analog axis deadzone and switch threshold settings, reduced default deadzone, and fixed a potential division by zero if the deadzone and saturation settings are equal. emu/ioport.cpp: Fixed behaviour of absolute analog fields where range passes through zero - it previously only worked for specific combinations of mask, minimum and default. Removed a workaround from universal/getaway.cpp that is no longer necessary. emu/input.cpp: Fixed unintuitive behaviour when an absolute field is assigned an OR combination of a relative control folled by an absolute control (e.g. Mouse X or Joy 1 LSX). Also fixed reading axis input sequences where an axis code is followed by a switch code (these can only be produced by manually editing configuration files, not through MAME's UI), and fixed the returned type when multiple relative axes sum to zero. osd/modules/input_dinput.cpp: Fixed hat switches being stuck in up position when input is suspended in the background taito/taitoio_yoke.cpp: Give throttle control a distinct type, and don't auto-centre. osd: Added option to select MIDI provider module (currently only PortMidi and the dummy module are available). Also put various things in namespaces, and fixed builds including SDL sound module with native Windows OSD. emu/validity.cpp: Added check to catch I/O port fields using UI input types. emu/inpttype.ipp: Renamed inputs that were causing confusion. "Bill" and "Track" were causing confusion for translators and hence likely causing confusion for many users, especially those who are not native English speakers. "Track" as an abbreviation for "Trackball" was frequently being mistranslated, e.g. in the sense of a CD track selection button or even in the sense of a railway track. There's no reason to abbreviate it. "Bill" in the US English sense as a banknote is too ambiguous and was causing confusion for translators. It's better to use the less ambiguous "Banknote". Corrected Greek translations of "Trackball". Don't run GitHub Actions on issue template changes.
* osd: Better scaling factors for XInput DJ Hero turntable dials. [DarkMoS] Vas Crabb2023-01-191-2/+2
|
* osd: Still more XInput rhythm game controller support for Windows: Vas Crabb2023-01-183-64/+317
| | | | | | * Added support for DJ Hero turntable controller. * Added support for Rock Band keyboard controller pedal. * Fixed pickup selector switch on guitar controllers.
* osd: Better XInput rhythm game controller support on Windows: Vas Crabb2023-01-181-54/+335
| | | | | | * Better support for extended controller type information. * Support for velocity sensitive six-drum controller. * Don't ignore button capabilites for keyboard controller.
* osd: Improved XInput guitar support and added XInput Rock Band keyboard support. Vas Crabb2023-01-181-217/+780
|
* osd: Added support for guitar and drum kit controllers via XInput. Vas Crabb2023-01-172-28/+102
|
* osd: Work around another observed invalid XInput capabilities report. Vas Crabb2023-01-151-2/+14
|
* -debugger/win: Cascade positions of new debugger windows. Vas Crabb2023-01-151-1/+29
| | | | | -osd: Better button names for NVIDIA Shield and Xbox One controllers with SDL game controller module.
* osd: I am officially incapable of keeping track of which OSD I'm working ↵ Vas Crabb2023-01-141-2/+2
| | | | with on each change (fix SDL build).
* osd: Added option to accept SDL game controller/joystick input when losing ↵ Vas Crabb2023-01-142-6/+11
| | | | UI focus.
* Hopefully fix SDL version detection macros for controller types. Vas Crabb2023-01-141-1/+5
|
* osd: Fixed constant name (helps to build the right OSD). Vas Crabb2023-01-141-3/+3
|
* osd: Recognise Joy-Con pairs with sdlgame input module. Vas Crabb2023-01-141-11/+16
|
* osd: Work around bad XInput capabilities report from Retro-Bit Saturn pad. Vas Crabb2023-01-141-7/+34
|
* osd: Added support for mapping files to sdlgame joystick provider and made ↵ Vas Crabb2023-01-142-8/+58
| | | | | | | | | | | | | | | | | it default with SDL. This changes behaviour, however I think it's a net positive: * Most games using Steam Input or SDL2 to read game controllers have this behaviour, so users have come to expect it. * This module is better at giving meaningful names to buttons on common controller, and assigning axes consistently. * Button/axis mapping files using a widely-used format are supported. * The old behaviour is still available with `-joystickprovider sdljoy` if anyone wants it. The new option for controller mapping files is in the general OSD options rather than SDL options as it can be extended to DirectInput in the future.
* -osd: Improved SDL Game Controller joystick provider: Vas Crabb2023-01-131-177/+374
| | | | | | | | | * Allow fallback to joystick API for devices without game controller mappings. * Detect controller reconnection. * Force Switch Pro Controller ZL/ZR to act like buttons. * Added button names for Google Stadia controller. * Also fixed dumb copy/paste error on my part in Windows clipboard code.
* osd: Fixed names of DualSense controller buttons with SDL Game Controller ↵ Vas Crabb2023-01-131-3/+30
| | | | provider.
* osd: Fixed names of face buttons on Switch Pro Controller with SDL Game ↵ Vas Crabb2023-01-131-2/+2
| | | | Controller provider.
* osd: Include mapping string in verbose output when enumerating SDL game ↵ Vas Crabb2023-01-131-1/+11
| | | | controllers.