Navigation:  ThinBASIC Modules > Console >

Console_WaitKey

Previous pageReturn to chapter overviewNext page

 

Description

 

Waits until a keys was been pressed (within a timeout) then it retuns it.

 

Syntax

 

Console_WaitKey[(nSecsTimeOut)]

 

Returns

 

Return a string

Returns the key pressed like encloses into a square brakets.

 

Parameters

 

Name

Type

Optional

Meaning

nSecsTimeOut

Numeric

Yes

Specifies the maximun number of seconds to wait for a key (timeout)





 

Remarks

 

Specials keys are returned like:

    [F1]

    [F2]

    [F3]

    [F4]

    [F5]

    [F6]

    [F7]

    [F8]

    [F9]

    [F10]

    [F11]

    [F12]

    [UP]

    [DOWN]

    [LEFT]

    [RIGHT]

    [PGUP]

    [PGDOWN]

    [HOME]

    [END]

    [CANC]

    [DELETE]

    [TAB]

    [RETURN]

    [ESC]

    [ALT]

    [CTRL]

    [SHIFT]

 

Or if timeout is expired:

    [TIMEOUT]

 

Restrictions

 

Alias

 

WaitKey

 

See also

 

Console Module, Console_Read, Console_ReadLine

 

Examples

 

Console_WriteLine("Key pressed: " + Console_WaitKey(10))

' if the caps lock is enabled and the user press the X key,

' results: Key pressed: [X]