diff options
author | 2019-07-21 12:35:03 +1000 | |
---|---|---|
committer | 2019-07-21 12:35:03 +1000 | |
commit | dac4ed89a80685fd3a6076eb76d6649df46f02d4 (patch) | |
tree | 217ea69c017fbec45a7c732f5655914aea8a01ea /src/emu/natkeyboard.cpp | |
parent | d2926fa02cef5bf728eac74c9e5586aced02a80b (diff) | |
parent | 1440861929a344f4bd7f78616854e041f55702d5 (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/emu/natkeyboard.cpp')
-rw-r--r-- | src/emu/natkeyboard.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/emu/natkeyboard.cpp b/src/emu/natkeyboard.cpp index 9a50109eb6f..17782815d22 100644 --- a/src/emu/natkeyboard.cpp +++ b/src/emu/natkeyboard.cpp @@ -486,6 +486,13 @@ void natural_keyboard::post_utf8(const char *text, size_t length, const attotime } +void natural_keyboard::post_utf8(const std::string &text, const attotime &rate) +{ + if (!text.empty()) + post_utf8(text.c_str(), text.size(), rate); +} + + //------------------------------------------------- // post_coded - post a coded string //------------------------------------------------- @@ -564,6 +571,34 @@ void natural_keyboard::post_coded(const char *text, size_t length, const attotim } +void natural_keyboard::post_coded(const std::string &text, const attotime &rate) +{ + if (!text.empty()) + post_coded(text.c_str(), text.size(), rate); +} + + +//------------------------------------------------- +// paste - does a paste from the keyboard +//------------------------------------------------- + +void natural_keyboard::paste() +{ + // retrieve the clipboard text + char *text = osd_get_clipboard_text(); + + // was a result returned? + if (text != nullptr) + { + // post the text + post_utf8(text); + + // free the string + free(text); + } +} + + //------------------------------------------------- // build_codes - given an input port table, create // an input code table useful for mapping unicode |