-
I'm messing around with the LUA scripting, trying to figure out a way to dump out all the input assignments. I'm looking at the ioport_field type. I'm trying this:
I'm trying to get values like "P1_BUTTON1", "P2_JOYSTICK_LEFT", etc. But What part of the LUA API do I need to look at to get this information? Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
They are the internal port names MAME uses, I believe you'll need to provide your own mapping atm if you want to use other naming. Although i'd also be interested to hear otherwise. It all starts to get interesting when you start to look at fields for keyboards as I have started to do here |
Beta Was this translation helpful? Give feedback.
-
mach = manager.machine
portman = mach.ioport
for tag, port in pairs(portman.ports) do
for name, field in pairs(port.fields) do
print(portman:input_type_to_token(field.type, field.player))
end
end |
Beta Was this translation helpful? Give feedback.
field.name
is the display name, you want an input type token. Remember they aren’t necessarily unique within a device.