summaryrefslogtreecommitdiffstatshomepage
path: root/src/frontend
diff options
context:
space:
mode:
author ajrhacker <ajrhacker@users.noreply.github.com>2019-07-19 22:07:49 -0400
committer GitHub <noreply@github.com>2019-07-19 22:07:49 -0400
commitc8dcc39b1f498c8cea6884666497f8cf57eb9a46 (patch)
tree852eae295337abfa8f377b7a1ec2cea6e39bfbac /src/frontend
parent68139508715a0375e657add4197582271ef446ec (diff)
parent3aa9ee49927cd39b1dd7c06eaa1f4851ebf69b08 (diff)
Merge pull request #5363 from npwoods/lua_paste
Moving paste() from mame_ui_manager class to natural_keyboard class
Diffstat (limited to 'src/frontend')
-rw-r--r--src/frontend/mame/luaengine.cpp1
-rw-r--r--src/frontend/mame/ui/ui.cpp23
-rw-r--r--src/frontend/mame/ui/ui.h1
3 files changed, 2 insertions, 23 deletions
diff --git a/src/frontend/mame/luaengine.cpp b/src/frontend/mame/luaengine.cpp
index ee4f1cb4af0..f55be3c1e67 100644
--- a/src/frontend/mame/luaengine.cpp
+++ b/src/frontend/mame/luaengine.cpp
@@ -766,6 +766,7 @@ void lua_engine::initialize()
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["paste"] = [this](){ machine().ioport().natkeyboard().paste(); };
emu["time"] = [this](){ return machine().time().as_double(); };
emu["start"] = [this](const char *driver) {
int i = driver_list::find(driver);
diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp
index 62b84281b02..867a7b8bbf8 100644
--- a/src/frontend/mame/ui/ui.cpp
+++ b/src/frontend/mame/ui/ui.cpp
@@ -905,27 +905,6 @@ bool mame_ui_manager::can_paste()
//-------------------------------------------------
-// paste - does a paste from the keyboard
-//-------------------------------------------------
-
-void mame_ui_manager::paste()
-{
- // retrieve the clipboard text
- char *text = osd_get_clipboard_text();
-
- // was a result returned?
- if (text != nullptr)
- {
- // post the text
- machine().ioport().natkeyboard().post_utf8(text);
-
- // free the string
- free(text);
- }
-}
-
-
-//-------------------------------------------------
// draw_fps_counter
//-------------------------------------------------
@@ -1105,7 +1084,7 @@ uint32_t mame_ui_manager::handler_ingame(render_container &container)
{
// paste command
if (machine().ui_input().pressed(IPT_UI_PASTE))
- paste();
+ machine().ioport().natkeyboard().paste();
}
image_handler_ingame();
diff --git a/src/frontend/mame/ui/ui.h b/src/frontend/mame/ui/ui.h
index 64189344dcb..e54adc80f06 100644
--- a/src/frontend/mame/ui/ui.h
+++ b/src/frontend/mame/ui/ui.h
@@ -223,7 +223,6 @@ public:
void show_mouse(bool status);
virtual bool is_menu_active() override;
bool can_paste();
- void paste();
void image_handler_ingame();
void increase_frameskip();
void decrease_frameskip();