Just a simple script that shows you the ASCII code for any keystroke (single keys or keycombos (e.g: SHIFT + F2)).
--[[----------------------------------------------------------------------
' filename: c2a.wlua
' author: noize
------------------------------------------------------------------------]]
require("iuplua")
prompt = iup.text {
expand = "YES",
value = "Press one or more keys",
tip = "Key combos are accepted as well",
}
output = iup.text {
value = "together",
expand = "YES",
}
function prompt:k_any(key)
prompt.value = ""
output.value = key
end
dlg = iup.dialog {
iup.vbox {
iup.frame {
iup.hbox {
prompt,
},
title = "ASCII char",
},
iup.frame {
iup.hbox {
output
},
title = "ASCII code",
},
margin = "5x5",
gap = "5",
},
title = "Char to ASCII",
size = "EIGHTH",
background = "255 255 255",
}
dlg:show()
iup.SetFocus(prompt)
iup.MainLoop()
A quick one.