diff options
Diffstat (limited to 'src/frontend/mame/luaengine.cpp')
-rw-r--r-- | src/frontend/mame/luaengine.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/frontend/mame/luaengine.cpp b/src/frontend/mame/luaengine.cpp index 688dca7aa44..df730b7019f 100644 --- a/src/frontend/mame/luaengine.cpp +++ b/src/frontend/mame/luaengine.cpp @@ -1709,6 +1709,7 @@ void lua_engine::initialize() * manager:machine():ioport() * * ioport:count_players() - get count of player controllers + * ioport:type_group(type, player) * * ioport.ports[] - ioports table (k=tag, v=ioport_port) */ @@ -1716,6 +1717,9 @@ void lua_engine::initialize() sol().registry().new_usertype<ioport_manager>("ioport", "new", sol::no_constructor, "count_players", &ioport_manager::count_players, "natkeyboard", &ioport_manager::natkeyboard, + "type_group", [](ioport_manager &im, ioport_type type, int player) { + return im.type_group(type, player); + }, "ports", sol::property([this](ioport_manager &im) { sol::table port_table = sol().create_table(); for (auto &port : im.ports()) @@ -1795,6 +1799,7 @@ void lua_engine::initialize() * field:input_seq(seq_type) * field:set_default_input_seq(seq_type, seq) * field:default_input_seq(seq_type) + * field:keyboard_codes(which) * * field.device - get associated device_t * field.port - get associated ioport_port @@ -1846,6 +1851,14 @@ void lua_engine::initialize() input_seq_type seq_type = parse_seq_type(seq_type_string); return sol::make_user(f.defseq(seq_type)); }, + "keyboard_codes", [this](ioport_field &f, int which) + { + sol::table result = sol().create_table(); + int index = 1; + for (char32_t code : f.keyboard_codes(which)) + result[index++] = code; + return result; + }, "device", sol::property(&ioport_field::device), "port", sol::property(&ioport_field::port), "name", sol::property(&ioport_field::name), |