summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/uiinput.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Initial touch input support: Vas Crabb2024-04-121-195/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* -Lua engine: run everything in coroutines. (#11019) Vas Crabb2023-03-251-3/+1
| | | | | | | | | * This lets you use emu.wait(...) directly without mucking around creating coroutines. * Allow emu.wait to accept an attotime argument. * Added a couple more wait helper functions. -emu/profiler.h: Actually use scope-based profiling helpers. * This makes the comment at the top of emu/profile.h less dishonest, and makes it easier to write exception-safe code. * Got rid of some do { ... } while (0) loops that only existed so break could be used like a goto.
* Miscellaneous fixes and refactoring: Vas Crabb2023-01-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* -A few incremental UI code improvements: Vas Crabb2021-03-121-8/+34
| | | | | | | | | * Simplified message when toggling UI controls. * Show actual configured UI toggle key, not misleading hard-coded text. * Push window activated/deactivated events to UI manager. * Simplified SDL window event handling code - events are pretty precise. -Miscellaneous code cleanup.
* Eliminate ARRAY_LENGTH template in favor of C++17's std::size AJR2021-02-141-3/+3
| | | | | | | | | | * 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
* Miscellaneous cleanup: Vas Crabb2020-10-101-22/+22
| | | | | * osd/windows: Use steady clock for timing double-clicks. * emu/uiinput.cpp: Made the event type a scoped enum.
* emu/machine.cpp: Get rid of remaining make_unique_clear on 'manager' objects. Vas Crabb2020-09-301-3/+4
|
* emu: correct some file headers (nw) hap2020-06-191-0/+1
|
* Added ui_input_manager::[set_]presses_enabled() and exposed to LUA npwoods2019-07-211-4/+13
|
* Make layout format more flexible: Vas Crabb2019-07-061-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * There is no longer a concept of "layers" - there are only screens and elements. * Elements are now instantiated with <element ref="..."> * Screens and elements can have explicit blending mode specified with blend="..." * Default blending mode for screens is "add" and default for other elements is "alpha" * Other supported modes are "none" and "multiply" * This removes the options to enable/disable layers individually - use views instead * Legacy layouts can still be loaded, and support won't be removed for at least a year The current artwork model is over-stretched. It's based on a Space Invaders cabinet model, and isn't applicable to a lot of the systems MAME emulates now. The fact that MAME has to switch to an "alternate" mode to deal with games like Golly! Ghost! without requiring pre-matted bitmaps shows that the Space Invaders model wasn't even adequate for general arcade use. It shows in that for a lot of the systems that heavily depend on artwork, people just seem to randomly choose layers for elements until they get something that works. Also, the fact that MAME will switch to an alternate (Golly! Ghost!) mode depending on the combination of elements is a trap for people learning to make artwork. There are cases that the current approach of implying the blending mode from the layer doesn't work with. Examples include LEDs behind diffusers (requires additive blending for layout elements), and mutliple stacked LCD panels (requires RGB multiplication for screens). For configurability, it's now a lot easier to make multiple views using groups. For example, if you want to make it possible to hide the control panel section of your layout, you can put the control panel elements in a group and create views with and without it. I will gradually migrate the internal artwork to use the new approach. I have an XSLT stylesheet that helps with this, but I'm not comfortable adding it because it isn't a complete solution and it still requires manul steps. I wanted to get the re-worked pointer handling done sooner so I could push them both at the same time, but unfortunately various things have prevented me from progressing as quickly as I wanted to. Sorry guys, that stuff's going to have to wait.
* Don't process every character individually when searching - this reduces Vas Crabb2017-08-101-27/+24
| | | | | | lag if you keep typing while a big list is searched. (nw) patch up German translation
* Double-check key state before UI autorepeat. Fixes #1169 Brad Hughes2016-12-061-1/+8
|
* Introduce u8/u16/u32/u64/s8/s16/s32/s64 Vas Crabb2016-11-191-8/+8
| | | | | | | | | | | | * 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
* Do not use FUNC in delegate where applicable (nw) Miodrag Milanovic2016-11-061-1/+1
|
* more TRUE/FALSE cleanup (nw) Miodrag Milanovic2016-10-221-3/+3
|
* NOTICE (TYPE NAME CONSOLIDATION) Miodrag Milanovic2016-10-221-8/+8
| | | | | 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
* use standard types uintptr_t, char16_t and char32_t instead of FPTR, ↵ Miodrag Milanovic2016-10-221-1/+1
| | | | utf16_char, unicode_char (nw)
* some bool <-> int not needed conversions, also cleaned drivenum.* was using ↵ Miodrag Milanovic2016-10-211-1/+1
| | | | memset for clearing vector (nw)
* Ioport refactoring and cleanups (nw) AJR2016-05-181-3/+43
| | | | | | - Completely move mouse hit testing down into the UI input module. This reduces some dependencies. - Never return a null pointer from ioport_field::name() to prevent potential crashes. All anonymous inputs are classified as INPUT_CLASS_INTERNAL, so several frontend functions now check type_class instead. - Correct a couple of typos.
* ui: Re-enabled configuration menu for single-machine and added some options. dankan18902016-04-151-0/+30
| | | | Adding handler for the right mouse button in the main menu, calls the machine configuration.
* ui: Moved options "Configure Directories" and "Save Configuration" into ↵ dankan18902016-02-271-1/+1
| | | | | | | | "Configure Options" menu. Removed unnecessary icons from the toolbar (performed the same actions of entries already in the menu). Proper handling the export of the list. Updated the .po files.
* Cleanups and version bump Miodrag Milanovic2016-02-241-3/+3
|
* Initial import of MEWUI to MAME [Dankan1890] Dankan18902016-02-041-1/+18
|
* Do not handle any UI inputs immediately after state load/save Victor Vasiliev2016-02-021-0/+10
| | | | | | | | Before this change, if you try to save state to a bound which already does something as a UI button, it will save state there and then immediately execute the bound action (sometimes it would not happen). So, if you have state to P, with default button it would pause the game immediately after saving state (except sometimes it would not).
* Cleanups and version bumpmame0170 Miodrag Milanovic2016-01-271-19/+18
|
* let's use our templates to clear (nw) Miodrag Milanovic2016-01-111-4/+0
|
* modernized ui_input_manager (nw) Miodrag Milanovic2016-01-101-106/+152
|
* removed memory tracking (nw) Miodrag Milanovic2016-01-081-1/+1
|
* clang-modernize part 1 (nw) Miodrag Milanovic2015-12-031-5/+5
|
* Fixed some suggestions by ReSharper C++ (nw) Miodrag Milanovic2015-11-141-1/+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/+285