diff options
author | AJR <ajrhacker@users.noreply.github.com> | 2020-12-26 13:38:14 -0500 |
---|---|---|
committer | AJR <ajrhacker@users.noreply.github.com> | 2020-12-26 13:39:34 -0500 |
commit | c04e2cbe0b88d67fed6b0316633cb9cbed4c76aa (patch) | |
tree | 2d845a3297d90e110ee4364510ae982b1b0a098f /src/frontend/mame | |
parent | 43f569e58f26d23032b950ebcbd02f352532ba95 (diff) |
natkeyboard: Remove from ioport_manager
Diffstat (limited to 'src/frontend/mame')
-rw-r--r-- | src/frontend/mame/luaengine.cpp | 3 | ||||
-rw-r--r-- | src/frontend/mame/luaengine_input.cpp | 1 | ||||
-rw-r--r-- | src/frontend/mame/ui/keyboard.cpp | 4 | ||||
-rw-r--r-- | src/frontend/mame/ui/mainmenu.cpp | 2 | ||||
-rw-r--r-- | src/frontend/mame/ui/ui.cpp | 8 |
5 files changed, 9 insertions, 9 deletions
diff --git a/src/frontend/mame/luaengine.cpp b/src/frontend/mame/luaengine.cpp index fe534302f9e..0c7b9c046fc 100644 --- a/src/frontend/mame/luaengine.cpp +++ b/src/frontend/mame/luaengine.cpp @@ -717,7 +717,7 @@ void lua_engine::initialize() emu["gamename"] = [this] () { return machine().system().type.fullname(); }; emu["romname"] = [this] () { return machine().basename(); }; emu["softname"] = [this] () { return machine().options().software_name(); }; - emu["keypost"] = [this] (const char *keys) { machine().ioport().natkeyboard().post_utf8(keys); }; + emu["keypost"] = [this] (const char *keys) { machine().natkeyboard().post_utf8(keys); }; emu["time"] = [this] () { return machine().time().as_double(); }; emu["start"] = [this](const char *driver) @@ -1287,6 +1287,7 @@ void lua_engine::initialize() else return sol::lua_nil; }); + machine_type["natkeyboard"] = sol::property(&running_machine::natkeyboard); machine_type["paused"] = sol::property(&running_machine::paused); machine_type["samplerate"] = sol::property(&running_machine::sample_rate); machine_type["exit_pending"] = sol::property(&running_machine::exit_pending); diff --git a/src/frontend/mame/luaengine_input.cpp b/src/frontend/mame/luaengine_input.cpp index 1dc0f491cb6..7e5019c1da4 100644 --- a/src/frontend/mame/luaengine_input.cpp +++ b/src/frontend/mame/luaengine_input.cpp @@ -170,7 +170,6 @@ void lua_engine::initialize_input(sol::table &emu) &ioport_manager::input_type_to_token, [] (ioport_manager &im, ioport_type type) { return im.input_type_to_token(type, 0); }); ioport_manager_type["ports"] = sol::property([] (ioport_manager &im) { return tag_object_ptr_map<ioport_list>(im.ports()); }); - ioport_manager_type["natkeyboard"] = sol::property(&ioport_manager::natkeyboard); auto natkeyboard_type = sol().registry().new_usertype<natural_keyboard>("natkeyboard", sol::no_constructor); diff --git a/src/frontend/mame/ui/keyboard.cpp b/src/frontend/mame/ui/keyboard.cpp index 3d58d28d2d9..36f12753e0c 100644 --- a/src/frontend/mame/ui/keyboard.cpp +++ b/src/frontend/mame/ui/keyboard.cpp @@ -30,7 +30,7 @@ menu_keyboard_mode::menu_keyboard_mode(mame_ui_manager &mui, render_container &c void menu_keyboard_mode::populate(float &customtop, float &custombottom) { - natural_keyboard &natkbd(machine().ioport().natkeyboard()); + natural_keyboard &natkbd(machine().natkeyboard()); if (natkbd.can_post()) { @@ -69,7 +69,7 @@ void menu_keyboard_mode::handle() event const *const menu_event(process(0)); if (menu_event && uintptr_t(menu_event->itemref)) { - natural_keyboard &natkbd(machine().ioport().natkeyboard()); + natural_keyboard &natkbd(machine().natkeyboard()); uintptr_t const ref(uintptr_t(menu_event->itemref)); bool const left(IPT_UI_LEFT == menu_event->iptkey); bool const right(IPT_UI_RIGHT == menu_event->iptkey); diff --git a/src/frontend/mame/ui/mainmenu.cpp b/src/frontend/mame/ui/mainmenu.cpp index 9fb66331249..15c1f6207d5 100644 --- a/src/frontend/mame/ui/mainmenu.cpp +++ b/src/frontend/mame/ui/mainmenu.cpp @@ -109,7 +109,7 @@ void menu_main::populate(float &customtop, float &custombottom) if (network_interface_enumerator(machine().root_device()).first() != nullptr) item_append(_("Network Devices"), 0, (void*)NETWORK_DEVICES); - if (machine().ioport().natkeyboard().keyboard_count()) + if (machine().natkeyboard().keyboard_count()) item_append(_("Keyboard Mode"), 0, (void *)KEYBOARD_MODE); item_append(_("Slider Controls"), 0, (void *)SLIDERS); diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp index 7ba294c446c..64f68d92049 100644 --- a/src/frontend/mame/ui/ui.cpp +++ b/src/frontend/mame/ui/ui.cpp @@ -992,7 +992,7 @@ void mame_ui_manager::process_natural_keyboard() { // if this was a UI_EVENT_CHAR event, post it if (event.event_type == ui_event::type::IME_CHAR) - machine().ioport().natkeyboard().post_char(event.ch); + machine().natkeyboard().post_char(event.ch); } // process natural keyboard keys that don't get UI_EVENT_CHARs @@ -1015,7 +1015,7 @@ void mame_ui_manager::process_natural_keyboard() *key_down_ptr |= key_down_mask; // post the key - machine().ioport().natkeyboard().post_char(UCHAR_MAMEKEY_BEGIN + code.item_id()); + machine().natkeyboard().post_char(UCHAR_MAMEKEY_BEGIN + code.item_id()); } else if (!pressed && (*key_down_ptr & key_down_mask)) { @@ -1244,14 +1244,14 @@ uint32_t mame_ui_manager::handler_ingame(render_container &container) } // is the natural keyboard enabled? - if (machine().ioport().natkeyboard().in_use() && (machine().phase() == machine_phase::RUNNING)) + if (machine().natkeyboard().in_use() && (machine().phase() == machine_phase::RUNNING)) process_natural_keyboard(); if (!ui_disabled) { // paste command if (machine().ui_input().pressed(IPT_UI_PASTE)) - machine().ioport().natkeyboard().paste(); + machine().natkeyboard().paste(); } image_handler_ingame(); |