keyboard.tostring(key1, [key2], ...)
Converts a combination of keys to the resulting string.
Parameters
key1, [key2], ...
One ore morestring
or number
that represents the combination of keys. See the list of supported key codes.
Return value
This function returns astring
representing the string that results of the provided keys combination.
Example
local kb = require "keyboard"
local sysutils = require "sysutils"
if sys.locale == "fr-FR" then
-- outputs a "@" character on french and italian keyboards
print(kb.tostring("0", "MENU", "CONTROL"))
else
-- outputs a "@" on non french keyboards
print(kb.tostring("2", "SHIFT"))
end