# BASIC 256 - Language Documentation

fr:key

## Key

### Format

key
key()

### Description

Immediately returns an integer value corresponding to the currently pressed keyboard key. If no key has been pressed since the last call to the key function then the number zero (0) will be returned.

### Note

    if key = 47 then print key

will not display the desired results, because it's calling key twice in succession, and will return different values each time. This code will do what you want:

    a = key
    if a = 47 then print a

fr/key.txt · Last modified: 2011/03/29 11:56 (external edit)