keyboard.tostring(key, [modifier...])function

Converts a combination of keys to the resulting string.

Parameters

key

A string representing the key name (for example "A", "0", "SPACE"...).

[modifier...]

Optional modifier key names such as "SHIFT", "CONTROL", "MENU".

Return value

This function returns astring representing the string that results of the provided keys combination.

Example

--! luart-extensions import keyboard local sysutils = require "sysutils" if sys.locale == "fr-FR" then -- outputs a "@" character on french and italian keyboards print(keyboard.tostring("0", "MENU", "CONTROL")) else -- outputs a "@" on non french keyboards print(keyboard.tostring("2", "SHIFT")) end