This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
cmdpwnd's profile picture

Alternate key detection

Started by cmdpwnd, 19 March 2016 - 04:42 PM
cmdpwnd #1
Posted 19 March 2016 - 05:42 PM

local key = os.pullEvent('key')
keys.getName(key)

should allow detection for alternate keys somehow(idk how seeing a pullEvent only pulls well, one event), so that you can detect an explicit '?' char or '!' etc…
Edited on 19 March 2016 - 04:43 PM
apemanzilla #2
Posted 19 March 2016 - 06:14 PM

local key = os.pullEvent('key')
keys.getName(key)

should allow detection for alternate keys somehow(idk how seeing a pullEvent only pulls well, one event), so that you can detect an explicit '?' char or '!' etc…
Try the char event. It is only sent when there is an explicit character typed - for example 'g', 'G', '_', ' ', ')', etc


local _, c = os.pullEvent("char")
print(c)
cmdpwnd #3
Posted 19 March 2016 - 07:58 PM
Thanks :)/>
Edited on 19 March 2016 - 07:16 PM
Lyqyd #4
Posted 19 March 2016 - 09:49 PM
Moved to Ask a Pro.