Keys API

Constants

The Keys API has the following Constants which contains the numerical key code for the key:

  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • one
  • two
  • three
  • four
  • five
  • six
  • seven
  • eight
  • nine
  • zero
  • minus
  • equals
  • backspace
  • tab
  • leftBracket
  • rightBracket
  • enter
  • leftCtrl
  • semiColon
  • apostrophe
  • grave
  • leftShift
  • backslash
  • comma
  • period
  • slash
  • rightShift
  • multiply
  • leftAlt
  • space
  • capsLock
  • f1
  • f2
  • f3
  • f4
  • f5
  • f6
  • f7
  • f8
  • f9
  • f10
  • numLock
  • scollLock
  • numPad7
  • numPad8
  • numPad9
  • numPadSubtract
  • numPad4
  • numPad5
  • numPad6
  • numPadAdd
  • numPad1
  • numPad2
  • numPad3
  • numPad0
  • numPadDecimal
  • f11
  • f12
  • f13
  • f14
  • f15
  • kana
  • convert
  • noconvert
  • yen
  • numPadEquals
  • cimcumflex
  • at
  • colon
  • underscore
  • kanji
  • stop
  • ax
  • numPadEnter
  • rightCtrl
  • numPadComma
  • numPadDivide
  • rightAlt
  • pause
  • home
  • up
  • pageUp
  • left
  • right
  • end
  • down
  • pageDown
  • insert
  • delete

Functions

Functionkeys.getName
Returns the key name of a numerical key code. Returns nil if the key code is not valid.
Syntax keys.getName(
  • keyCode : number
)
Returns string keyName
Part of CC:Tweaked (source)
API keys
ExampleGet a key name
Get the name for the key code 50 and print it.
Code
<nowiki>
print(keys.getName(50))
    </nowiki>
Output m
gollark: Any recent computer will have hardware video encoders for at least H.264 also.
gollark: It would be weird if it wasn't.
gollark: But imagine if you could watch the trees experience wind or whatever at 30 FPS.
gollark: Maybe I should harvest it and transcode it into a timelapsey video on my end.
gollark: But more framerate/quality → more good.
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.