Is there any known way to get the value of a keypad key (like 5, or period, etc) and to change said value all within scripts? I looked a bit and couldn't find anything to do this.
Keypad Value & Changes?
Posted by MattMc on Fri 16 Jun 2006 04:42 AM — 5 posts, 22,212 views.
Setting I think can be achieved using the Accelerator functions, but I am not sure, as I have both CTRL and non-CTRL keypad buttons set, so I have 30 buttons I can set, I have all non-CTRL set, and most of the CTRL have a function.
Hope that helps a little lol...
Laterzzz,
Onoitsu2
Hope that helps a little lol...
Laterzzz,
Onoitsu2
If you set your keypad with Accelerator() then you can later retrieve the bindings with AcceleratorList(). There's no way, I think, to get what a keypad button was set to if it was set through the dialogue.
You could use ExportXML to get keypad values. For example to see what is bound to the "/" key:
Run that through a string.gsub in Lua and you have the answer:
print (ExportXML (5, "/"))
Output
<keypad>
<key name="/" >
<send>inventory</send>
</key>
</keypad>
Run that through a string.gsub in Lua and you have the answer:
_, _, k = string.find (ExportXML (5, "/"), "<send>(.*)</send>")
print (k) --> inventory
Of course you could use ImportXML to change it. :)
/ImportXML [[
<keypad>
<key name="/" >
<send>say ohno!</send>
</key>
</keypad>
]]