Docs 1.6
Accidentally uploaded outdated 1.6 docs
This commit is contained in:
28
docs/docs1_6/objects/Object/onChar.md
Normal file
28
docs/docs1_6/objects/Object/onChar.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# Object - Event
|
||||
|
||||
## onChar
|
||||
|
||||
`onChar(self, event, char)`
|
||||
|
||||
The computercraft event which triggers this method is `char`.
|
||||
|
||||
The char event always happens after the key event (just like in cc:tweaked)
|
||||
|
||||
Here is a example on how to add a onChar event to your frame:
|
||||
|
||||
```lua
|
||||
local basalt = require("basalt")
|
||||
|
||||
local main = basalt.createFrame()
|
||||
local subFrame = main:addFrame()
|
||||
:setPosition(3,3)
|
||||
:setSize(18,6)
|
||||
:hide()
|
||||
|
||||
function openSubFrame(self, event, char)
|
||||
if(char=="a")then
|
||||
subFrame:show()
|
||||
end
|
||||
end
|
||||
main:onChar(openSubFrame)
|
||||
```
|
||||
Reference in New Issue
Block a user