From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

Keyboard.Keyname(keycode as Integer) As String

New in 5.5

Supported for all project types and targets.

Returns as a String the name of the keycode passed.


Refer to the Keyboard Notes to a list of key codes.

This returns a value that indicates the character the key produces. In most cases, special keys will be named as follows: Esc, Tab, CapsLock, Shift, Control, Option, Alt, Command, Win, Return, Enter, Space, Fn, Delete, Backspace, Help, Insert, Home, PageUp, Del, End, PageDown, F1 through F15, PrintScreen, ScrollLock, Pause/Break, Clear, NumLock, KP=, KP/, KP*, KP-, KP0 through KP9, Up, Left, Down, and Right.


The following example returns the name of character &h7D. It is the Down arrow key.