bKeyDown-RETURN is not processed, another event may be used?
Posted: Thu Apr 09, 2009 12:53 pm
Hi!
I try write code for event when RETURN key is pressed on window ( window have not any input elements ) .
In bKeyDown events every key is processed , but RETURN is not.
What event block may be used for this?
Reagards
Andrej
It is my code:
function Main()
LOCAL cSearch:=""
DEFINE WINDOW oWnd TITLE "KEYTEST"
@ 1,1 SAY oSay PROMPT cSearch SIZE 80, 30
oWnd:bKeyChar = { | nKey | Search( nKey, @cSearch ),;
oSay:Refresh() }
oWnd:bKeyDown = { | nKey | Search( nKey, @cSearch ),;
oSay:Refresh() }
ACTIVATE WINDOW oWnd
return nil
function Search( nKey, cSearch )
if nKey == 8
cSearch := SubStr( cSearch, 1, Len( cSearch ) - 1 )
elseif nKey==27
cSearch :=""
else
cSearch += Upper( Chr( nKey ) )
endif
MsgInfo(str(nKey))
return nil
I try write code for event when RETURN key is pressed on window ( window have not any input elements ) .
In bKeyDown events every key is processed , but RETURN is not.
What event block may be used for this?
Reagards
Andrej
It is my code:
function Main()
LOCAL cSearch:=""
DEFINE WINDOW oWnd TITLE "KEYTEST"
@ 1,1 SAY oSay PROMPT cSearch SIZE 80, 30
oWnd:bKeyChar = { | nKey | Search( nKey, @cSearch ),;
oSay:Refresh() }
oWnd:bKeyDown = { | nKey | Search( nKey, @cSearch ),;
oSay:Refresh() }
ACTIVATE WINDOW oWnd
return nil
function Search( nKey, cSearch )
if nKey == 8
cSearch := SubStr( cSearch, 1, Len( cSearch ) - 1 )
elseif nKey==27
cSearch :=""
else
cSearch += Upper( Chr( nKey ) )
endif
MsgInfo(str(nKey))
return nil