| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Changes the return value of function LastKey()
SetLastKey( <nKey> ) --> cNullString
The function changes the return value of LastKey() to <nKey> and returns a null string ("")
| See also: | Inkey(), LastKey(), NextKey() |
| Category: | CT:Settings , Keyboard functions |
| Header: | Inkey.ch |
| Source: | ct\setlast.c |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example changes LastKey() to K_ESC as soon as an
// alphabetic key is pressed
#include "Inkey.ch"
PROCEDURE Main
LOCAL nKey := 0
CLS
DO WHILE LastKey() <> K_ESC
nKey := Inkey(0.1)
@ 0,0 SAY "Inkey code: "
?? nKey
IF IsAlpha( Chr(nKey) )
SetLastKey( K_ESC )
ENDIF
ENDDO
RETURN
http://www.xHarbour.com