snake
game)ask()
task will wait for the to enter any amount of text until a line break is entered. A message must be supplied that lets the user what you'd like to receive from them. The task will return their response in a string variable.waitForKey()
method. A message must be supplied that lets the user know what you need. This method can capture a single standard character and also has some special (multi-char) return values that represent special key presses. key_left
- Left arrowkey_right
-
Right arrowkey_up
- Up arrowkey_down
- Down arrowback_tab
- Shift-tab. (Regular tab will come through as a normal tab char)key_home
- Home keykey_end
- End endkey_dc
- Deletekey_ic
- Insert keykey_npage
-
Page downkey_ppage
- Page upkey_f1
- F1 keykey_f2
- F2 keykey_f3
- F3 keykey_f4
- F4 keykey_f5
- F5 keykey_f6
- F6 keykey_f7
- F7 keykey_f8
- F8 keykey_f9
- F9 keykey_f10
-
F10 keykey_f11
- F11 keykey_f12
- F12 keyesc
- Escape keyconfirm()
method. Any boolean that evaluates to true or a y
will return true. Everything else will return false. This allows your users to respond with what's natural to them like yes
, y
, no
, n
, true
, or false
. You must pass a question into the method and you will receive a boolean back.ask()
as freetext, but that is more prone to errors. This is where the Multiselect input control comes in handy. It blocks just like the ask command until the user responds but allows the user to interact with it via their keyboard. Think of it like radio buttons or checkboxes. If you configure it to only allow a single response (radio buttons) then a string will come back containing the answer. If you configure it to allow multiple selections, you will receive an array of responses back, even if there was only one selection made. accessKey
setting in the struct.