Key elements let you listen for presses on keyboard keys.
Creation:
newKey("myKey", "")
Example:
[js try=”true” highlight=”4,5″]newText(“instructions”, “Please press the spacebar”)
.print()
,
newKey(“space”, ” “)
.wait()
,
newText(“thanks”, “Thank you!”)
.print()
[/js]
The code above adds a text asking for a press of the spacebar key. The text Thank you! get printed below it only after the spacebar was pressed.
Note: pass the void string ""
for a press on any key.
Actions
[yadawiki-list category=”Action command,Key element”]
Settings
[yadawiki-list category=”Settings command,Key element”]
Tests
[yadawiki-list category=”Test command,Key element”]
Index
- Installing PennController
- Ontology
- Aesthetics
- Preloading resources
- ZIPped resources
- Spreadsheet (CSV)
- Canvas creation
- Setup for audio recordings collection
- Commands by element categories
- Standard Element Commands
- Audio element
- Button element
- Canvas element
- Function element
- Html element
- Image element
- Key element
- Scale element
- Selector element
- Text element
- TextInput element
- Tooltip element
- Timer element
- Var element
- Video element
- VoiceRecorder element
- Youtube element
- Special clear command
- Special end command
- Global PennController Commands
- PennController
- PennController.AddHost
- PennController.AddTable
- PennController.CheckPreloaded
- PennController.DownloadVoiceButton
- PennController.FeedItems
- PennController.Footer
- PennController.GetTable
- PennController.GetURLParameter
- PennController.Header
- PennController.InitiateRecorder
- PennController.PreloadZip
- PennController.ResetPrefix
- PennController.Template