Function | Package: cg | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 9.0 Unrevised from 8.2 to 9.0. 8.2 version

## key-is-down-p

Arguments: virtual-key-code

Returns two values indicating whether a particular key on the keyboard is currently depressed. The argument should be either the char-int of some graphic character or the value of one of the symbols beginning with vk-. This check is done asynchronously.

The first value indicates whether the key is down now (true if it is, `nil` if it is not). The second returned value indicates whether the key has been pressed since the last time this function was called.

For a letter key, the key code is the char-int of the uppercase character shown on the key (and NOT the corresponding lowercase character). For a numeral key, it is the char-int of the numeral character. For any other key, the key code is the value of the `vk-` constant for that key (see `key-names` for a list of `vk-` constants); for keys that show both a shifted character and an unshifted character, this constant will be named after the unshifted character.

### GTK Note

We have not found a way to ask whether a key is really down right now, and so key-is-down-p behaves just like key-was-down-p when called on GTK. And neither of these functions return the second value, which indicates whether the key has been pressed since the previous call.

Copyright (c) 1998-2019, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.2 page.
Created 2012.5.30.

|  | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 9.0 Unrevised from 8.2 to 9.0. 8.2 version