Core Function InputC
From Sputnik Wiki
(Difference between revisions)
m (1 revision) |
|||
(One intermediate revision by one user not shown) | |||
Line 1: | Line 1: | ||
<pre> | <pre> | ||
− | InputC( < | + | InputC( <prompt/flag> ) |
</pre> | </pre> | ||
=== Description === | === Description === | ||
− | Capture a char typed to console window. | + | Capture a char (or info about the char) typed to console window. |
=== Parameters === | === Parameters === | ||
− | ==== | + | ==== prompt/flag ==== |
Optional; A message to display to user. | Optional; A message to display to user. | ||
+ | |||
+ | OR a boolean of the value TRUE which will cause more information to be given about the key pressed. | ||
+ | |||
+ | See examples. | ||
=== Return Value === | === Return Value === | ||
− | + | The key pressed or information about the key. | |
=== Remarks === | === Remarks === | ||
Line 22: | Line 26: | ||
=== Example === | === Example === | ||
+ | |||
+ | Simply read a key the user typed | ||
<syntaxhighlight lang="sputnik"> | <syntaxhighlight lang="sputnik"> | ||
$c = InputC("Press any key..."); | $c = InputC("Press any key..."); | ||
println("You typed $c"); | println("You typed $c"); | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | Read more information about the key typed | ||
+ | |||
+ | <syntaxhighlight lang="sputnik"> | ||
+ | my List($Key, $KeyChar, $sKey, $sKeyChar, $Modifiers) = InputC(true); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
[[Category:Core Function]] | [[Category:Core Function]] |
Latest revision as of 13:17, 18 June 2015
InputC( <prompt/flag> )
Contents |
Description
Capture a char (or info about the char) typed to console window.
Parameters
prompt/flag
Optional; A message to display to user.
OR a boolean of the value TRUE which will cause more information to be given about the key pressed.
See examples.
Return Value
The key pressed or information about the key.
Remarks
None.
Example
Simply read a key the user typed
$c = InputC("Press any key..."); println("You typed $c");
Read more information about the key typed
my List($Key, $KeyChar, $sKey, $sKeyChar, $Modifiers) = InputC(true);