summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/input.cpp
Commit message (Collapse)AuthorAgeFilesLines
* input.cpp, inputdev.cpp: Misc. fixes AJR2021-01-241-1/+3
| | | | | - Fix a recent regression with processing XInput DPAD input item tokens - Prevent code_to_token from blowing up in strange cases
* Much more core std::string_view modernization AJR2021-01-201-9/+10
| | | | | | | | | | | | | | | - Remove corestr.h from emu.h; update a few source files to not use it at all - Change strtrimspace, strtrimrightspace and core_filename_extract_* to be pure functions taking a std::string_view by value and returning the same type - Change strmakeupper and strmakelower to be pure functions taking a std::string_view and constructing a std::string - Remove the string-modifying version of zippath_parent - Change tag-based lookup functions in device_t to take std::string_view instead of const std::string & or const char * - Remove the subdevice tag cache from device_t (since device finders are now recommended) and replace it with a map covering directly owned subdevices only - Move the working directory setup method out of device_image_interface (only the UI seems to actually use the full version of this) - Change output_manager to use std::string_view for output name arguments - Change core_options to accept std::string_view for most name and value arguments (return values are still C strings for now) - Change miscellaneous other functions to accept std::string_view arguments - Remove a few string accessor macros from romload.h - Remove many unnecessary c_str() calls from logging/error messages
* -Lua cleanup and documentation migration checkpoint. Vas Crabb2020-12-161-194/+4
| | | | | | | | | | | | | | | | | | | | * Cleaned up some more of the Lua inteface. Mostly replacing methods with properties, some consistency fixes, a few renames, some more exposed functionality, and a couple of properties that have no business being set from scripts made read-only. * Moved a lot more Lua documentation out of source comments into the documentation, and expanded on it in the process. * Got more UI code out of the input manager. * Changed input sequence poller to a polymorphic class where you specify your intention upfront. * Changed the cheat plugin to use UI Clear to clear hotkey assignments and leave them unchanged if the user starts assignment but doesn't press any switches. * Ported AJR's fix for over-eager double-click recognition from SDL to Windows OSD. -goldnpkr.cpp: Cleaned up inputs, using standard keyout and payout types and key assignments.
* Move axis movement checking code down into input devices AJR2020-08-301-46/+14
|
* emu: correct some file headers (nw) hap2020-06-191-1/+1
|
* UI input menu: treat codes containing a postive and negative of the same ↵ Vas Crabb2019-11-211-5/+19
| | | | | | | | thing as invalid (e.g. A S not A) ioport.cpp: * better than 50% reduction in compile time, and better locality for static data * better encapsulation, const correctness and noexcept usage
* UI input mapping menu updates: Vas Crabb2019-11-211-176/+38
| | | | | | | | | | | | | | | | | | | | | | * When a switch-type input is selected, show feedback when it's pressed * If an invalid code is entered (e.g. only negatives) abandon the change rather than cycling default/none * If an invalid code is entered display a message until the user takes some other action input.cpp updates: * constexpr crusade on input_code and input_seq and some very slight optimisation to input_seq * seq_poll* is a frontend function and had no business being in the core, so it's a utility class now * seq_poll* now exposes a bit more detail, enabling improved interaction on the UI inputs menu * global state is reduced a little, but the poll_* functions are still members of the input manager with global state (nw) The Lua engine has been updated in a way that maintains source compatibility with existing Lua scripts. This is less than ideal, but it minimises impact. Ideally someone (possibly me) will be able to expose the input sequence poller helper properly. I tested the changes with the cheat and autofire plugins and I was able to assign sequences. However I found two issues: it's seems impossible to assign a more complex sequence than a single key/button in the autofire plugin (i.e. no AND or NOT conditions, I confirmed this is pre-existing, not a regression), and in both the cheat and autofire plugins I found it a bit unwieldy trying to enter a complex sequence without live feedback of the sequence as it's built (this was also applicable to MAME's own input mapping menu until I added the live display yesterday).
* simplest change possible to fix display of codes starting with 'not' - e.g. ↵ Vas Crabb2019-11-201-1/+1
| | | | this fixes 'not A S' being displayed as 'A S'
* restore code cleaning behaviour prior to ↵ Vas Crabb2019-11-201-11/+13
| | | | ae2cc6853d935d3daeadd84b0b740af82ea9c41e - it's broken in some corner cases but the regressions are fixed
* srcclean (nw) Vas Crabb2019-08-251-1/+1
| | | | I'm assuming atronic.cpp was supposed to be Windows-1252 with Euro currency symbol encoding. Everyone please use UTF-8 for source files.
* Extracting input sequence cleaning logic into an seq_clean() function npwoods2019-08-211-10/+25
| | | | and exposing to LUA
* Quick fix for symptom of #1778 but doesn't address how it decided the ↵ Vas Crabb2016-11-261-3/+38
| | | | joystick component was unknown to begin with
* Introduce u8/u16/u32/u64/s8/s16/s32/s64 Vas Crabb2016-11-191-15/+15
| | | | | | | | | | | | * New abbreviated types are in osd and util namespaces, and also in global namespace for things that #include "emu.h" * Get rid of import of cstdint types to global namespace (C99 does this anyway) * Remove the cstdint types from everything in emu * Get rid of U64/S64 macros * Fix a bug in dps16 caused by incorrect use of macro * Fix debugcon not checking for "do " prefix case-insensitively * Fix a lot of messed up tabulation * More constexpr * Fix up many __names
* Revert "Added IS_ENABLED, so we have compiler check for non used part, it is ↵ Miodrag Milanovic2016-11-121-2/+2
| | | | | | checked but not compiled in (nw)" This reverts commit c0407f073bf7afe26407c4add5cfeaf7104913c9.
* Added IS_ENABLED, so we have compiler check for non used part, it is checked ↵ Miodrag Milanovic2016-11-111-2/+2
| | | | | | but not compiled in (nw) false and true now used instead of integer where used as bool
* Polymorphize input_device and input_class; move to separate source file (nw) AJR2016-10-241-873/+48
|
* more TRUE/FALSE cleanup (nw) Miodrag Milanovic2016-10-221-2/+2
|
* NOTICE (TYPE NAME CONSOLIDATION) Miodrag Milanovic2016-10-221-48/+48
| | | | | Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8 also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8
* Misc. keyboard input improvements AJR2016-10-081-0/+4
| | | | | | | | - 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)
* srcclean (nw) Vas Crabb2016-09-261-4/+4
|
* Adding id() property to input_device Tomer Verona2016-09-201-16/+23
| | | | | | | | | | | | This change adds id() property to input_device, which represents the unique device id. This allows the osd layer when creating a device to pass a friendly display name along with a unique identifier. Currently the device id is only used to map a physical controller device to controller id, but can be used more generally in the future. For raw input devices, we use the full raw input name as the device id. For all other devices, we fall back to device name as the device id. The "uniqueness" of the device id is not currently enforced in code.
* A couple of fixes Tomer Verona2016-09-201-3/+6
| | | | | | - Fix null-reference exception when mapping device to unused (null) controller index - Restrict device map to controller configs
* Tweak info message Tomer Verona2016-09-141-1/+1
|
* Support for configuring device to conrtoller id Tomer Verona2016-09-121-0/+103
| | | | | | | | This change adds support for configuring device to conrtoller id. This allows for stable controller ids even if USB devices are plugged / unplugged, system is rebooted, etc. See documentation for additional context.
* Merge pull request #1159 from shattered/_74dec47 R. Belmont2016-08-071-0/+5
|\ | | | | keyboard: add F16..F20 keys (present on DEC LK201 keyboard and its cl…
| * keyboard: add F16..F20 keys (present on DEC LK201 keyboard and its clones) Sergey Svishchev2016-07-301-0/+5
| |
* | for bool type use true and false (nw) Miodrag Milanovic2016-07-311-1/+1
| |
* | std::min and std:max instead of MIN and MAX, also some more macros converted ↵ Miodrag Milanovic2016-07-311-4/+4
|/ | | | to inline functions (nw)
* Various cleanups suggested by static analyzer (nw) Miodrag Milanovic2016-04-241-5/+5
|
* Replace strformat, strprintf and strcatprintf with type-safe steam_format ↵ Vas Crabb2016-02-281-2/+2
| | | | | | | | | and string_format Update MAME to use new function Instantiate ODR-used static constant members Make some of the UI code more localisable Remove use of retired functions in tools
* Return std::string objects by value rather than pass by reference AJR2016-01-101-32/+25
| | | | | | - strprintf is unaltered, but strformat now takes one fewer argument - state_string_export still fills a buffer, but has been made const - get_default_card_software now takes no arguments but returns a string
* Cleanups and version bumpmame0169 Miodrag Milanovic2015-12-301-1/+1
|
* clang-modernize part 6 Miodrag Milanovic2015-12-041-2/+2
|
* clang-modernize part 1 (nw) Miodrag Milanovic2015-12-031-61/+61
|
* Initial conversion of core to C++14. Note that compilers are now limited to ↵ Miodrag Milanovic2015-12-031-10/+8
| | | | GCC 4.9.0 and up, Clang 3.4.0 and up, and VS2013 and up [Miodrag Milanovic]
* Fixed some suggestions by ReSharper C++ (nw) Miodrag Milanovic2015-11-141-12/+12
|
* more cleanups and fix (nw) Miodrag Milanovic2015-11-111-0/+1
|
* Some cleanups and init fixes with help of ReSharper C++ (nw) Miodrag Milanovic2015-11-111-1/+1
|
* Rename *.c -> *.cpp in our source (nw) Miodrag Milanovic2015-11-081-0/+2378