Keys (API)

From ComputerCraft Wiki
Revision as of 23:19, 5 May 2013 by Hawk777 (Talk | contribs) (Add return type column)

Jump to: navigation, search

The Keys API provides a table of numerical codes corresponding to keyboard keys, suitable for decoding key events.

Grid disk.png   keys (API)

ReturnMethod NameDescription
string keyName keys.getName(int code) Translates a numerical key code to a human-readable name.

Although this API contains only one method, it also contains a vast number of constants, one per key, containing the numerical key codes for those keys. As of ComputerCraft 1.52, the following constants are defined:

  • 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