Retrieves the name or text of a key.

Name := GetKeyName(KeyName)



Type: String

This can be just about any single character from the keyboard or one of the key names from the key list. Examples: B, 5, LWin, RControl, Alt, Enter, Escape.

Alternatively, this can be an explicit virtual key code such as vkFF, an explicit scan code such as sc01D, or a combination of VK and SC (in that order) such as vk1Bsc001. Note that these codes must be in hexadecimal.

Return Value

Type: String

This function returns the name of the specified key, or blank if the key is invalid or unnamed.

GetKeyVK, GetKeySC, GetKeyState, Key List


Retrieves and reports the English name of Esc.

MsgBox GetKeyName("Esc") ; Shows Escape
MsgBox GetKeyName("vk1B") ; Shows also Escape