summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/natkeyboard.cpp
Commit message (Collapse)AuthorAgeFilesLines
* emu/natkeyboard.cpp: Add CAPSLOCK, CR and LF escapes to post_coded AJR2024-12-071-0/+3
|
* Natural keyboard improvements AJR2024-12-041-2/+2
| | | | | | | - NUL is no longer a reserved character, and PORT_CHAR(0) is meaningful now. The ioport_field structure now uses a reserved Unicode character rather than 0 as a filler. - PORT_CHAR() with no arguments (formerly illegal) may be used to skip over shift positions that produce no useful codes. * ioport.h: Use the empty string rather than nullptr as default tag for ioport_condition. (ioport_condition::operator== was blindly passing the null pointers to strcmp.)
* natkeyboard.cpp: Convert more string posting methods to std::string_view AJR2024-09-141-74/+48
|
* Patched up some gaps in functionality and fixed some bugs. Vas Crabb2022-09-021-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ui: Added some missing functionality: * Added an option to copy input device IDs to the relevant menus. * Added an item for setting the software lists files path (-hashpath) to the folder setup menu. * Allow pasting text from clipboard in most places that allow typing (searching, entering filenames, entering barcodes). * Changed the software selection menu heading to be a bit less misleading. * Made barcode menu less eager to rebuild itself unnecessarily, and removed some confusing and apparently pointless code. Exposed more Lua bindings: * Added low-level palette objects. * Added indexed bitmap types. * Added a bitmap method for extracting pixels from a rectangular area as a packed binary string. * Changed screen device pixels method to return width and height in addition to the pixels. osd: Added some functionality and cleaned up a little: * Added a function for copying text to the clipboard. * Moved function for converting Windows error codes to standard error conditions to winutil.cpp so it can be used from more places. * Removed duplicate declaration of osd_get_clipboard_text and made the function noexcept (including fixing implementations). * Made macOS implementation of osd_get_clipboard_text skip the encoding conversion if it finds UTF-8 text first. * Changed the default -uimodekey setting so it doesn't lose the "not shift" that stops the default from interfering with UI paste. Various bug fixes: * util/unicode.cpp: Fixed the version of utf8_from_uchar that returns std::string blowing up on invalid codepoints. * util/bitmap.h: Fixed wrapping constructors for indexed bitmaps taking the wrong parameter type (nothing was using them before). * util/bitmap.cpp: Fixed potential use-after-free issues with bitmap palettes. * emu/input.cpp, emu/inputdev.cpp: Log 1-based device numbers, matching what's shown in the internal UI and used in tokens in CFG files. * emu/emumem.cpp: Added the bank tag to a fatal error message where it was missing. docs: Reworked and expanded documentation on configuring stable controller IDs. For translators, the changes are quite minor: * There's a menu item for copying a device ID to the clipboard, and associated success/failure messages. * There's the menu item for setting the software list file search path. * One of the lines in the software selection menu heading has changes as it could be interpreted as implying it showed a software list name.
* Change debugger command handler parameter vector element type from ↵ AJR2022-08-021-4/+4
| | | | std::string to std::string_view
* Remove void *ptr parameter from emu_timer, timer_device and all related ↵ AJR2022-01-261-1/+1
| | | | callbacks
* 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
* -Qt debugger updates: Vas Crabb2021-01-281-2/+4
| | | | | | | | * Added context menu with Copy Visible and Paste commands to debug views (partially addresses #6066). * Made memory view last PC display a context menu item. * Fixed crash on right-clicking a memory view showing something other than an address space. -debugger: Fixed commas in dumpkbd output.
* Much more core std::string_view modernization AJR2021-01-201-0/+2
| | | | | | | | | | | | | | | - 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
* unicode.h: Updates AJR2020-12-151-0/+1
| | | | | - Remove from emu.h (except for UTF8_xxx macros, which have been transplanted to emucore.h since a lot of drivers use them) and osdepend.h - Add std::string_view overrides for uchar_from_utf8 and normalize_unicode
* natkeyboard: Fix natural mods for pc_keyboard & at_keyboard devices; add ↵ AJR2020-10-151-1/+7
| | | | more logging
* emu/natkeyboard.cpp: Fixed uninitialised variable. Vas Crabb2020-10-141-0/+1
|
* emu/ioport.cpp: Improved initial keyboard enable settings when changing slot ↵ Vas Crabb2020-10-111-0/+1
| | | | options.
* -emu/natkeyboard.cpp: Allow keyboard devices to be enabled/disabled. Vas Crabb2020-10-111-66/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the "typing on all keyboards at once" issue. You can now enable and disable keyboard/keypad inputs per device in the Keyboard Mode menu. Default is to enable the first device with keyboard inputs, and all device with keypad inputs but no keyboard inputs. The settings are saved in the CFG file for the machine. Typing in natural keyboard mode only ever types on one keyboard at a time, but now you can control which keyboard it types on, as it will be the first enabled keyboard. You can easily try this out with something like: mame64d zorba -rs232 terminal cpm -ui/inputmap.cpp: Show device descriptions as well as tag paths. -mac128.cpp: Fixed mouse axis wrap compensation, cleaned up mouse code, eliminated static variables for mouse input state. You could see the issue with wrap detection easily enough just by running mac128k/mac512k/macplus and tapping the arrow keys to move the mouse one pixel at a time. As you moved past the point where the axis count wrapped, it would move one pixel in the opposite direction. There were two function static variables related to mouse input state, probably still lurking from when the code was initially made to use a driver state class. This obviously messes with save states and prevents multiple instances. - bus/a2bus/mouse.cpp: Fixed mouse axis wrap compensation. This device had the same bug with wrap compensation as mac128k.cpp.
* Slotified Mac 128k/512k/512ke/Plus keyboard port. Vas Crabb2020-07-011-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Available keyboards are us (M0110, U.S.), gb (M0110B, British), fr (M0110F, French), pad (M0120F, numeric keypad with passthrough port) and plus (M0110A, U.S. with integrated numeric keypad). The mac128k, mac512k and mac512ke drivers default to the numeric keypad with the U.S. keyboard connected to the passthrough port; the macplus driver defaults to the U.S. keyboard with integrated numeric keypad. Note that the numeric keypad may seem strange. Four of the operators work as cursor arrows if you don't hold shift. There is a comma on one of the keys, but by the time System 6 was released, Apple had decided an equals sign was more useful, so that's what it will produces on newer system versions. The U.S. keyboard with integrated numeric keypad emulates these aspects of the stand-alone keypad - pressing the operator keys on the keypad sends fake shit key down/up events, and using the arrow keys while holding shift will produces operator characters rather than selecting text. The ISO layout keyboards (M0110B and M0110F) produce different scan codes to the ANSI keyboards (M0110 and M0110A) but they don't report a different identification byte. To use an ISO keyboard, you must open the Keyboard control panel and change the layout to International (and change it back to Domestic if you switch back to an ANSI keyboard). This doesn't actually work at the moment due to issues with 6522 VIA emulation, but it will work with macplus sys603 if applied on top of revision 963a2c166d080e78e6de7fe432ed7944c59a6083. -----------------------------------------------------------------------
* -bus/coco/coco_ram.cpp: fix a rather obvious bug in shift/mask Vas Crabb2020-06-251-1/+1
| | | | -misc. formatting consistency
* srcclean and cleanup (nw) Vas Crabb2020-06-211-3/+3
|
* Fix for UI Paste with the Default Serial Terminal (#6648) Frank Palazzolo2020-05-061-31/+41
| | | * This fixes the ability for one to use UI Paste with the Default Serial Terminal. Without this fix, 8 characters @^&()\:" cannot be pasted from the UI.
* PG police (nw) hap2020-02-171-1/+1
|
* fixed some clang-tidy warnings (nw) (#6236) Oliver Stöneberg2020-01-301-3/+3
| | | | | | | | | | | | | | | | * fixed some modernize-redundant-void-arg clang-tidy warnings (nw) * fixed some modernize-use-bool-literals clang-tidy warnings (nw) * fixed some modernize-use-emplace clang-tidy warnings (nw) * fixed some performance-move-const-arg clang-tidy warnings (nw) * fixed some readability-redundant-control-flow clang-tidy warnings (nw) * fixed some readability-redundant-string-cstr clang-tidy warnings (nw) * fixed some performance-unnecessary-value-param clang-tidy warnings (nw)
* natkeyboard.cpp: Turn logging back off (nw) AJR2020-01-101-1/+1
|
* input_sdl: Process control characters so that the natural keyboard can see ↵ AJR2020-01-101-17/+20
| | | | | | them (SDL normally strips these out) Don't strip linefeed characters (Ctrl-J) from natural keyboard input except when pasting strings
* Merge pull request #5614 from npwoods/natkeyboard_std_array R. Belmont2019-09-111-7/+4
|\ | | | | Changing some arrays to use std::array<> in natkeyboard
| * Changing some arrays to use std::array<> in natkeyboard npwoods2019-09-101-7/+4
| |
* | Changed osd_get_clipboard_text() to return std::string (#5615) npwoods2019-09-111-10/+3
|/ | | | | | | | | | * Changed osd_get_clipboard_text() to return std::string This change has only been tested on Windows. The Un*x/Mac versions were made blindly; they might not even build. This needs to be checked prior to merging. * Fixing Mac OS X build (hopefully)
* Exposed natual_keyboard object to LUA (#5364) npwoods2019-07-201-0/+14
|
* Moving paste() from mame_ui_manager class to natural_keyboard class, npwoods2019-07-191-0/+21
| | | | exposing to LUA
* Revert "Send LF with CR when using natuaral keyboard on systems with a line ↵ AJR2018-08-111-11/+0
| | | | | | feed key" This reverts commit 409c0663bc69bccee39f26afe65cddb3f104851e.
* Misc. fixes for recent commits (nw) AJR2018-08-101-1/+0
|
* Send LF with CR when using natuaral keyboard on systems with a line feed key AJR2018-08-101-0/+12
|
* Make "Keypad ," and "Keypad =" standard keys AJR2018-05-111-1/+3
|
* Added support for multiple PORT_CHAR() bindings, and adopted in the CoCo ↵ Nathan Woods2017-09-241-29/+35
| | | | driver (addresses MT#2618)
* natural keyboard: prefer lower shift states, eliminate O(n) lookup Vas Crabb2017-09-051-28/+34
| | | | | | allows Alt-combos on European Amiga keyboards to be restored as MAME will now prefer the simpler Shift-combos to get characters that can be typed in more than one way
* Overhaul to how MAME handles options, take two (#2341) npwoods2017-06-251-3/+1
|
* general cleanup: Vas Crabb2017-05-231-32/+41
| | | | | | | | | | | * move rarely-used output and pty interfaces out of emu.h * consolidate and de-duplicate forward declarations, also remove some obsolete ones * clean up more #include guard macros * scope down a few more things (nw) Everyone, please keep forward declarations for src/emu in src/emu/emufwd.h - this will make it far easier to keep them in sync with declarations than having them scattered through all the other files.
* Revert "Overhaul to how MAME handles options (#2260)" Vas Crabb2017-05-071-1/+3
| | | | | | | | | | | | This reverts commit 536990e77b49ccc50ef275bfbf1018cc29c16154. Conflicts: src/frontend/mame/mame.cpp Sorry, but this change was half-baked. It breaks a lot of existing functionality and clearly hasn't been tested in more than a tiny subset of use cases. Please play this work back onto your own branch, and test it before submitting another PR.
* Overhaul to how MAME handles options (#2260) npwoods2017-05-051-3/+1
| | | | | | | | | | | | This is an overhaul to how MAME handles options to provide a better foundation for what MAME is already doing in practice. Previously, core_options was designed to provide an input/output facility for reading options from the command line and INI files. However, the current needs (image/slot/get_default_card_software calculus and MewUI) go way beyond that. Broadly, this PR makes the following changes: * core_options now has an extensibility mechanism, so one can register options that behave dramatically differently * With that foundation, emu_options now encapsulates all of the funky image/slot/get_default_card_software calculus that were previously handled by static methods in mameopts.cpp. Changes to emu_options should not automatically cascade in such a way so that it stays in a consistent state * emu_options no longer provides direct access to the slot_options/image_options maps; there are simpler API functions that control these capabilities * Many core_options functions that expose internal data structures (e.g. - priority) that were only really needed because of previous (now obsolete) techniques have been removed. * core_options is now exception based (rather than dumping text to an std::string). The burden is on the caller to catch these, and discern between warnings and errors as needed. Obviously this is a risky change; that's why this is being submitted at the start of the dev cycle.
* Amiga keyboard updates: Vas Crabb2017-02-051-61/+93
| | | | | | | | | | | * Fixed Shift-Alt combinations with natural keyboard * Fixed crash on keyboard inputs with four characters * Corrected polarity of KB_DATA from Amiga to keyboard * Completely rewrote 68HC05CxA-based A1200 keyboard device, now working * Fixed KB_DATA mixing in A500 keyboard * Made A500 keyboard caps lock LED output name consistent with A1200 * Added Alt- and Alt-Shift- characters to A500 US keyboard * Fixed natural keyboard modifiers with LLE keyboards
* Fix for a potential problem if natural keyboard input gets disabled while ↵ AJR2016-12-311-0/+6
| | | | machine is running (nw)
* Correct natural keyboard handling of toggle keys AJR2016-12-311-2/+17
|
* Revert "Added IS_ENABLED, so we have compiler check for non used part, it is ↵ Miodrag Milanovic2016-11-121-3/+3
| | | | | | 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-3/+3
| | | | | | but not compiled in (nw) false and true now used instead of integer where used as bool
* more TRUE/FALSE cleanup (nw) Miodrag Milanovic2016-10-221-4/+4
|
* use standard types uintptr_t, char16_t and char32_t instead of FPTR, ↵ Miodrag Milanovic2016-10-221-20/+20
| | | | utf16_char, unicode_char (nw)
* Lock out ioport_fields independently of natural keyboard state (nw) AJR2016-10-201-0/+29
|
* Misc. keyboard input improvements AJR2016-10-081-9/+28
| | | | | | | | - 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)
* Separate natural keyboard support from ioport.cpp (nw) AJR2016-10-021-0/+842