From 0e55a0bfc0581b58ba0b2ba08ffc5ad86171c423 Mon Sep 17 00:00:00 2001 From: AJR Date: Sat, 8 Oct 2016 20:53:58 -0400 Subject: [PATCH] Misc. keyboard input improvements - 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) --- src/emu/input.cpp | 4 +++ src/emu/input.h | 12 +++++++++ src/emu/ioport.cpp | 27 +++---------------- src/emu/ioport.h | 1 - src/emu/natkeyboard.cpp | 37 +++++++++++++++++++------- src/frontend/mame/luaengine.cpp | 1 - src/frontend/mame/ui/info.cpp | 3 +++ src/frontend/mame/ui/info.h | 2 ++ src/frontend/mame/ui/mainmenu.cpp | 2 +- src/frontend/mame/ui/ui.cpp | 2 +- src/mame/drivers/cbm2.cpp | 2 +- src/mame/drivers/fmtowns.cpp | 2 +- src/mame/drivers/mz2000.cpp | 2 +- src/mame/drivers/mz80.cpp | 2 +- src/mame/drivers/p2000t.cpp | 6 ++--- src/mame/machine/compiskb.cpp | 4 +-- src/mame/machine/m20_kbd.cpp | 2 +- src/mame/machine/victor9kb.cpp | 2 +- src/osd/modules/input/input_common.cpp | 6 ++++- 19 files changed, 71 insertions(+), 48 deletions(-) diff --git a/src/emu/input.cpp b/src/emu/input.cpp index 93f349cee3a..1c1570b06e8 100644 --- a/src/emu/input.cpp +++ b/src/emu/input.cpp @@ -288,6 +288,10 @@ static const code_string_table itemid_token_table[] = { ITEM_ID_PLUS_PAD, "PLUSPAD" }, { ITEM_ID_DEL_PAD, "DELPAD" }, { ITEM_ID_ENTER_PAD, "ENTERPAD" }, + { ITEM_ID_BS_PAD, "BSPAD" }, + { ITEM_ID_TAB_PAD, "TABPAD" }, + { ITEM_ID_00_PAD, "00PAD" }, + { ITEM_ID_000_PAD, "000PAD" }, { ITEM_ID_PRTSCR, "PRTSCR" }, { ITEM_ID_PAUSE, "PAUSE" }, { ITEM_ID_LSHIFT, "LSHIFT" }, diff --git a/src/emu/input.h b/src/emu/input.h index dff829f5d54..750b2fdc873 100644 --- a/src/emu/input.h +++ b/src/emu/input.h @@ -189,6 +189,10 @@ enum input_item_id ITEM_ID_PLUS_PAD, ITEM_ID_DEL_PAD, ITEM_ID_ENTER_PAD, + ITEM_ID_BS_PAD, + ITEM_ID_TAB_PAD, + ITEM_ID_00_PAD, + ITEM_ID_000_PAD, ITEM_ID_PRTSCR, ITEM_ID_PAUSE, ITEM_ID_LSHIFT, @@ -821,6 +825,10 @@ private: #define KEYCODE_PLUS_PAD_INDEXED(n) input_code(DEVICE_CLASS_KEYBOARD, n, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, ITEM_ID_PLUS_PAD) #define KEYCODE_DEL_PAD_INDEXED(n) input_code(DEVICE_CLASS_KEYBOARD, n, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, ITEM_ID_DEL_PAD) #define KEYCODE_ENTER_PAD_INDEXED(n) input_code(DEVICE_CLASS_KEYBOARD, n, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, ITEM_ID_ENTER_PAD) +#define KEYCODE_BS_PAD_INDEXED(n) input_code(DEVICE_CLASS_KEYBOARD, n, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, ITEM_ID_BS_PAD) +#define KEYCODE_TAB_PAD_INDEXED(n) input_code(DEVICE_CLASS_KEYBOARD, n, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, ITEM_ID_TAB_PAD) +#define KEYCODE_00_PAD_INDEXED(n) input_code(DEVICE_CLASS_KEYBOARD, n, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, ITEM_ID_00_PAD) +#define KEYCODE_000_PAD_INDEXED(n) input_code(DEVICE_CLASS_KEYBOARD, n, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, ITEM_ID_000_PAD) #define KEYCODE_PRTSCR_INDEXED(n) input_code(DEVICE_CLASS_KEYBOARD, n, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, ITEM_ID_PRTSCR) #define KEYCODE_PAUSE_INDEXED(n) input_code(DEVICE_CLASS_KEYBOARD, n, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, ITEM_ID_PAUSE) #define KEYCODE_LSHIFT_INDEXED(n) input_code(DEVICE_CLASS_KEYBOARD, n, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, ITEM_ID_LSHIFT) @@ -936,6 +944,10 @@ private: #define KEYCODE_PLUS_PAD KEYCODE_PLUS_PAD_INDEXED(0) #define KEYCODE_DEL_PAD KEYCODE_DEL_PAD_INDEXED(0) #define KEYCODE_ENTER_PAD KEYCODE_ENTER_PAD_INDEXED(0) +#define KEYCODE_BS_PAD KEYCODE_BS_PAD_INDEXED(0) +#define KEYCODE_TAB_PAD KEYCODE_TAB_PAD_INDEXED(0) +#define KEYCODE_00_PAD KEYCODE_00_PAD_INDEXED(0) +#define KEYCODE_000_PAD KEYCODE_000_PAD_INDEXED(0) #define KEYCODE_PRTSCR KEYCODE_PRTSCR_INDEXED(0) #define KEYCODE_PAUSE KEYCODE_PAUSE_INDEXED(0) #define KEYCODE_LSHIFT KEYCODE_LSHIFT_INDEXED(0) diff --git a/src/emu/ioport.cpp b/src/emu/ioport.cpp index 5c5b328f49f..ee9279bcf8b 100644 --- a/src/emu/ioport.cpp +++ b/src/emu/ioport.cpp @@ -795,6 +795,10 @@ std::string ioport_field::key_name(int which) const case UCHAR_MAMEKEY(PLUS_PAD): return "Keypad +"; case UCHAR_MAMEKEY(DEL_PAD): return "Keypad ."; case UCHAR_MAMEKEY(ENTER_PAD): return "Keypad Enter"; + case UCHAR_MAMEKEY(BS_PAD): return "Keypad Backspace"; + case UCHAR_MAMEKEY(TAB_PAD): return "Keypad Tab"; + case UCHAR_MAMEKEY(00_PAD): return "Keypad 00"; + case UCHAR_MAMEKEY(000_PAD): return "Keypad 000"; case UCHAR_MAMEKEY(PRTSCR): return "Print Screen"; case UCHAR_MAMEKEY(PAUSE): return "Pause"; case UCHAR_MAMEKEY(LSHIFT): return "Left Shift"; @@ -1944,29 +1948,6 @@ bool ioport_manager::type_class_present(ioport_type_class inputclass) } -//------------------------------------------------- -// has_keyboard - determine if there is a -// keyboard present in the control list -//------------------------------------------------- - -bool ioport_manager::has_keyboard() const -{ - // iterate over ports and fields - for (auto &port : m_portlist) - for (ioport_field &field : port.second->fields()) - { - // if we are at init, check IPT_KEYBOARD - if (!m_safe_to_read && field.type() == IPT_KEYBOARD) - return true; - - // else, check if there is a keyboard and if such a keyboard is enabled - if (field.type() == IPT_KEYBOARD && field.enabled()) - return true; - } - - return false; -} - //------------------------------------------------- // count_players - counts the number of active // players diff --git a/src/emu/ioport.h b/src/emu/ioport.h index faf60068f3e..1f182d03137 100644 --- a/src/emu/ioport.h +++ b/src/emu/ioport.h @@ -1412,7 +1412,6 @@ public: digital_joystick &digjoystick(int player, int joysticknum); int count_players() const; bool crosshair_position(int player, float &x, float &y); - bool has_keyboard() const; INT32 frame_interpolate(INT32 oldval, INT32 newval); ioport_type token_to_input_type(const char *string, int &player) const; std::string input_type_to_token(ioport_type type, int player); diff --git a/src/emu/natkeyboard.cpp b/src/emu/natkeyboard.cpp index 1301ecd2926..9a654c2078d 100644 --- a/src/emu/natkeyboard.cpp +++ b/src/emu/natkeyboard.cpp @@ -279,7 +279,27 @@ const char_info charinfo[] = { 0xffee, "\xE2\x97\xA6" }, // fullwidth open circle { UCHAR_MAMEKEY(ESC), "\033" }, // Esc key { UCHAR_MAMEKEY(DEL), "\010" }, // Delete key - { UCHAR_MAMEKEY(HOME), "\014" } // Home key + { UCHAR_MAMEKEY(HOME), "\014" }, // Home key + { UCHAR_MAMEKEY(0_PAD), "0" }, // 0 on the numeric keypad + { UCHAR_MAMEKEY(1_PAD), "1" }, // 1 on the numeric keypad + { UCHAR_MAMEKEY(2_PAD), "2" }, // 2 on the numeric keypad + { UCHAR_MAMEKEY(3_PAD), "3" }, // 3 on the numeric keypad + { UCHAR_MAMEKEY(4_PAD), "4" }, // 4 on the numeric keypad + { UCHAR_MAMEKEY(5_PAD), "5" }, // 5 on the numeric keypad + { UCHAR_MAMEKEY(6_PAD), "6" }, // 6 on the numeric keypad + { UCHAR_MAMEKEY(7_PAD), "7" }, // 7 on the numeric keypad + { UCHAR_MAMEKEY(8_PAD), "8" }, // 8 on the numeric keypad + { UCHAR_MAMEKEY(9_PAD), "9" }, // 9 on the numeric keypad + { UCHAR_MAMEKEY(SLASH_PAD), "/" }, // / on the numeric keypad + { UCHAR_MAMEKEY(ASTERISK), "*" }, // * on the numeric keypad + { UCHAR_MAMEKEY(MINUS_PAD), "-" }, // - on the numeric Keypad + { UCHAR_MAMEKEY(PLUS_PAD), "+" }, // + on the numeric Keypad + { UCHAR_MAMEKEY(DEL_PAD), "." }, // . on the numeric keypad + { UCHAR_MAMEKEY(ENTER_PAD), "\015" }, // Enter on the numeric keypad + { UCHAR_MAMEKEY(BS_PAD), "\010" }, // Backspace on the numeric keypad + { UCHAR_MAMEKEY(TAB_PAD), "\011" }, // Tab on the numeric keypad + { UCHAR_MAMEKEY(00_PAD), "00" }, // 00 on the numeric keypad + { UCHAR_MAMEKEY(000_PAD), "000" } // 000 on the numeric keypad }; @@ -299,18 +319,17 @@ natural_keyboard::natural_keyboard(running_machine &machine) m_status_keydown(false), m_last_cr(false), m_timer(nullptr), - m_current_rate(attotime::zero) + m_current_rate(attotime::zero), + m_queue_chars(), + m_accept_char(), + m_charqueue_empty() { - m_queue_chars = ioport_queue_chars_delegate(); - m_accept_char = ioport_accept_char_delegate(); - m_charqueue_empty = ioport_charqueue_empty_delegate(); - - // posting keys directly only makes sense for a computer - if (machine.ioport().has_keyboard()) + // try building a list of keycodes; if none are available, don't bother + build_codes(machine.ioport()); + if (!m_keycode_map.empty()) { m_buffer.resize(KEY_BUFFER_SIZE); m_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(natural_keyboard::timer), this)); - build_codes(machine.ioport()); } } diff --git a/src/frontend/mame/luaengine.cpp b/src/frontend/mame/luaengine.cpp index 86b0b71b93f..4dd56437644 100644 --- a/src/frontend/mame/luaengine.cpp +++ b/src/frontend/mame/luaengine.cpp @@ -2413,7 +2413,6 @@ void lua_engine::initialize() .addFunction ("select_next_state", &cheat_entry::select_next_state) .endClass() .beginClass ("ioport") - .addFunction ("has_keyboard", &ioport_manager::has_keyboard) .addFunction ("count_players", &ioport_manager::count_players) .addProperty ("ports", &lua_engine::l_ioport_get_ports) .endClass() diff --git a/src/frontend/mame/ui/info.cpp b/src/frontend/mame/ui/info.cpp index 8041ce29136..4dfc260be57 100644 --- a/src/frontend/mame/ui/info.cpp +++ b/src/frontend/mame/ui/info.cpp @@ -29,6 +29,7 @@ machine_info::machine_info(running_machine &machine) m_has_analog = false; m_has_dips = false; m_has_bioses = false; + m_has_keyboard = false; // scan the input port array to see what options we need to enable for (auto &port : machine.ioport().ports()) @@ -40,6 +41,8 @@ machine_info::machine_info(running_machine &machine) m_has_configs = true; if (field.is_analog()) m_has_analog = true; + if (field.type() == IPT_KEYBOARD) + m_has_keyboard = true; } for (device_t &device : device_iterator(machine.root_device())) diff --git a/src/frontend/mame/ui/info.h b/src/frontend/mame/ui/info.h index 1a038763a5c..51c81c807cd 100644 --- a/src/frontend/mame/ui/info.h +++ b/src/frontend/mame/ui/info.h @@ -27,6 +27,7 @@ public: bool has_analog() const { return m_has_analog; } bool has_dips() const { return m_has_dips; } bool has_bioses() const { return m_has_bioses; } + bool has_keyboard() const { return m_has_keyboard; } // text generators std::string warnings_string(); @@ -43,6 +44,7 @@ private: bool m_has_analog; bool m_has_dips; bool m_has_bioses; + bool m_has_keyboard; }; class menu_game_info : public menu diff --git a/src/frontend/mame/ui/mainmenu.cpp b/src/frontend/mame/ui/mainmenu.cpp index 969f9b5b9f0..61f8fef7764 100644 --- a/src/frontend/mame/ui/mainmenu.cpp +++ b/src/frontend/mame/ui/mainmenu.cpp @@ -109,7 +109,7 @@ void menu_main::populate() item_append(_("Network Devices"), "", 0, (void*)NETWORK_DEVICES); /* add keyboard mode menu */ - if (machine().ioport().has_keyboard() && machine().ioport().natkeyboard().can_post()) + if (ui().machine_info().has_keyboard() && machine().ioport().natkeyboard().can_post()) item_append(_("Keyboard Mode"), "", 0, (void *)KEYBOARD_MODE); /* add sliders menu */ diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp index 3fd87f5f0cb..9b988c93075 100644 --- a/src/frontend/mame/ui/ui.cpp +++ b/src/frontend/mame/ui/ui.cpp @@ -1070,7 +1070,7 @@ UINT32 mame_ui_manager::handler_ingame(render_container &container) } // determine if we should disable the rest of the UI - bool has_keyboard = machine().ioport().has_keyboard(); + bool has_keyboard = machine_info().has_keyboard(); bool ui_disabled = (has_keyboard && !machine().ui_active()); // is ScrLk UI toggling applicable here? diff --git a/src/mame/drivers/cbm2.cpp b/src/mame/drivers/cbm2.cpp index f3552ae69d7..35dfe16705c 100644 --- a/src/mame/drivers/cbm2.cpp +++ b/src/mame/drivers/cbm2.cpp @@ -1039,7 +1039,7 @@ static INPUT_PORTS_START( cbm2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 9") PORT_CODE(KEYCODE_9_PAD) PORT_CHAR(UCHAR_MAMEKEY(9_PAD)) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 6") PORT_CODE(KEYCODE_6_PAD) PORT_CHAR(UCHAR_MAMEKEY(6_PAD)) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 3") PORT_CODE(KEYCODE_3_PAD) PORT_CHAR(UCHAR_MAMEKEY(3_PAD)) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 00") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 00") PORT_CODE(KEYCODE_00_PAD) PORT_CHAR(UCHAR_MAMEKEY(00_PAD)) PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("PA7") diff --git a/src/mame/drivers/fmtowns.cpp b/src/mame/drivers/fmtowns.cpp index 115d7a96b78..5b489a2c17d 100644 --- a/src/mame/drivers/fmtowns.cpp +++ b/src/mame/drivers/fmtowns.cpp @@ -2402,7 +2402,7 @@ static INPUT_PORTS_START( towns ) PORT_BIT(0x00000080,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey .") PORT_CODE(KEYCODE_DEL_PAD) PORT_BIT(0x00000100,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("INS(?)") PORT_CODE(KEYCODE_INSERT) PORT_BIT(0x00000200,IP_ACTIVE_HIGH,IPT_UNUSED) - PORT_BIT(0x00000400,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey 000") + PORT_BIT(0x00000400,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey 000") PORT_CODE(KEYCODE_000_PAD) PORT_BIT(0x00000800,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("DEL(?)/EL") PORT_CODE(KEYCODE_DEL) PORT_BIT(0x00001000,IP_ACTIVE_HIGH,IPT_UNUSED) PORT_BIT(0x00002000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Up") PORT_CODE(KEYCODE_UP) diff --git a/src/mame/drivers/mz2000.cpp b/src/mame/drivers/mz2000.cpp index ce7e7857c62..925a1e23170 100644 --- a/src/mame/drivers/mz2000.cpp +++ b/src/mame/drivers/mz2000.cpp @@ -422,7 +422,7 @@ static INPUT_PORTS_START( mz2000 ) PORT_BIT(0x02,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("F10") PORT_CODE(KEYCODE_F10) PORT_BIT(0x04,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("8 (PAD)") PORT_CODE(KEYCODE_8_PAD) PORT_BIT(0x08,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("9 (PAD)") PORT_CODE(KEYCODE_9_PAD) - PORT_BIT(0x10,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("00 (PAD)") //PORT_CODE(KEYCODE_SLASH_PAD) + PORT_BIT(0x10,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("00 (PAD)") PORT_CODE(KEYCODE_00_PAD) PORT_BIT(0x20,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME(". (PAD)") PORT_CODE(KEYCODE_DEL_PAD) PORT_BIT(0x40,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("+ (PAD)") PORT_CODE(KEYCODE_PLUS_PAD) PORT_BIT(0x80,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("- (PAD)") PORT_CODE(KEYCODE_MINUS_PAD) diff --git a/src/mame/drivers/mz80.cpp b/src/mame/drivers/mz80.cpp index 708c795463d..725b3ed668f 100644 --- a/src/mame/drivers/mz80.cpp +++ b/src/mame/drivers/mz80.cpp @@ -221,7 +221,7 @@ static INPUT_PORTS_START( mz80a ) PORT_START("LINE8") PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR(UCHAR_MAMEKEY(0_PAD)) - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("00") + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_00_PAD) PORT_CHAR(UCHAR_MAMEKEY(00_PAD)) PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR(UCHAR_MAMEKEY(1_PAD)) PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_2_PAD) PORT_CHAR(UCHAR_MAMEKEY(2_PAD)) PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_4_PAD) PORT_CHAR(UCHAR_MAMEKEY(4_PAD)) diff --git a/src/mame/drivers/p2000t.cpp b/src/mame/drivers/p2000t.cpp index 0e6b48303f0..6cbe0602a6b 100644 --- a/src/mame/drivers/p2000t.cpp +++ b/src/mame/drivers/p2000t.cpp @@ -96,7 +96,7 @@ Also, notice that pictures of p2000 units shows slightly different key mappings, many different .chr roms could exist Small note about natural keyboard support: currently, -- "Keypad 00" and "Keypad ," are not mapped +- "Keypad ," is mapped to keypad '.' - "Code" is mapped to 'F1' - "Clrln" is mapped to 'F2' */ @@ -123,9 +123,9 @@ static INPUT_PORTS_START (p2000t) PORT_BIT (0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') PORT_START("KEY.2") - PORT_BIT (0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Keypad ,") PORT_CODE(KEYCODE_ENTER_PAD) + PORT_BIT (0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Keypad ,") PORT_CODE(KEYCODE_ENTER_PAD) PORT_CHAR(UCHAR_MAMEKEY(DEL_PAD)) PORT_BIT (0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') - PORT_BIT (0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Keypad 00") PORT_CODE(KEYCODE_DEL_PAD) + PORT_BIT (0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_DEL_PAD) PORT_CHAR(UCHAR_MAMEKEY(00_PAD)) PORT_BIT (0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR(UCHAR_MAMEKEY(0_PAD)) PORT_BIT (0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("# \xE2\x96\xAA") PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('#') PORT_BIT (0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) diff --git a/src/mame/machine/compiskb.cpp b/src/mame/machine/compiskb.cpp index 82da6141872..cfde9de9cb0 100644 --- a/src/mame/machine/compiskb.cpp +++ b/src/mame/machine/compiskb.cpp @@ -109,8 +109,8 @@ INPUT_PORTS_START( compis_keyboard ) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("COMPIS ?") PORT_CODE(KEYCODE_F4) PORT_CHAR(UCHAR_MAMEKEY(F4)) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("COMPIS |") PORT_CODE(KEYCODE_F5) PORT_CHAR(UCHAR_MAMEKEY(F5)) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR(UCHAR_MAMEKEY(0_PAD)) - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 000") PORT_CODE(KEYCODE_ASTERISK) - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 00") PORT_CODE(KEYCODE_SLASH_PAD) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR(UCHAR_MAMEKEY(000_PAD)) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_CHAR(UCHAR_MAMEKEY(00_PAD)) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNUSED ) // 49 PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNUSED ) // 52 diff --git a/src/mame/machine/m20_kbd.cpp b/src/mame/machine/m20_kbd.cpp index 6d2bbbd6e44..d5e367152e4 100644 --- a/src/mame/machine/m20_kbd.cpp +++ b/src/mame/machine/m20_kbd.cpp @@ -123,7 +123,7 @@ static INPUT_PORTS_START( m20_keyboard ) PORT_BIT(0x08,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("S2") PORT_CODE(KEYCODE_BACKSPACE) PORT_BIT(0x10,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Keypad .") PORT_CODE(KEYCODE_DEL_PAD) PORT_CHAR(UCHAR_MAMEKEY(DEL_PAD)) PORT_BIT(0x20,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR(UCHAR_MAMEKEY(0_PAD)) - PORT_BIT(0x40,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Keypad 00") PORT_CODE(KEYCODE_ENTER_PAD) + PORT_BIT(0x40,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER_PAD) PORT_CHAR(UCHAR_MAMEKEY(00_PAD)) PORT_BIT(0x80,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR(UCHAR_MAMEKEY(1_PAD)) PORT_START("LINE7") diff --git a/src/mame/machine/victor9kb.cpp b/src/mame/machine/victor9kb.cpp index 4b0d1778595..3f56a6e7576 100644 --- a/src/mame/machine/victor9kb.cpp +++ b/src/mame/machine/victor9kb.cpp @@ -526,7 +526,7 @@ INPUT_PORTS_START( victor9k_keyboard ) PORT_START("YB") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("UNUSED S04") // unused // S104 PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad .") PORT_CODE(KEYCODE_DEL_PAD) // S103 - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 00") // S102 + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 00") PORT_CODE(KEYCODE_00_PAD) // S102 PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 0") PORT_CODE(KEYCODE_0_PAD) // S101 PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_RIGHT"/Contrast Down \xe2\x97\x90\xe2\x96\xbe") PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) // U+2190/U+25D0 + U+25BE S100 PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_LEFT"/Contrast Up \xe2\x97\x90\xe2\x96\xb4") PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) // U+2190/U+25D0 + U+25B4 S99 diff --git a/src/osd/modules/input/input_common.cpp b/src/osd/modules/input/input_common.cpp index 73af2e9e9e1..a3531b0e254 100644 --- a/src/osd/modules/input/input_common.cpp +++ b/src/osd/modules/input/input_common.cpp @@ -154,7 +154,11 @@ key_trans_entry keyboard_trans_table::s_default_table[] = KEY_TRANS_ENTRY1(RWIN, RGUI, RGUI, RWIN, VK_RWIN, 0), KEY_TRANS_ENTRY1(MENU, MENU, MENU, APPS, VK_APPS, 0), KEY_TRANS_ENTRY1(PAUSE, PAUSE, PAUSE, PAUSE, VK_PAUSE, 0), - KEY_TRANS_ENTRY0(CANCEL, UNKNOWN, UNKNOWN, UNKNOWN, 0, 0, "CANCEL"), + KEY_TRANS_ENTRY0(CANCEL, CANCEL, CANCEL, UNKNOWN, 0, 0, "CANCEL"), + KEY_TRANS_ENTRY1(BS_PAD, KP_BACKSPACE, KP_BACKSPACE, UNKNOWN, 0, 0), + KEY_TRANS_ENTRY1(TAB_PAD, KP_TAB, KP_TAB, UNKNOWN, 0, 0), + KEY_TRANS_ENTRY1(00_PAD, KP_00, KP_00, UNKNOWN, 0, 0), + KEY_TRANS_ENTRY1(000_PAD, KP_000, KP_000, UNKNOWN, 0, 0), // New keys introduced in Windows 2000. These have no MAME codes to // preserve compatibility with old config files that may refer to them