OnKeyDown Event ....
Publicado: Mar Feb 26, 2008 6:32 pm
Hi,
I am trying to detect certain keys in an edit control using the OnKeyDown
event with code like this .......
METHOD CodeEditKeyDown( oSender, nKey, nFlags ) CLASS TMainForm
do case
case nKey == VK_UP
LogDisplay( "CodeEditKeyDown()", nkey, "VK_UP" )
case nKey == VK_DOWN
LogDisplay( "CodeEditKeyDown()", nkey, "VK_DOWN" )
case nKey == VK_F10
LogDisplay( "CodeEditKeyDown()", nkey, "VK_F10" )
endcase
RETURN Nil
It sort of works but ....
1. I get 2 Logdisplay messages for 1 K_UP or 1 K_DOWN key press ..... I
would have expected only one Logdisplay per key down ? What is going on
please ? ( see attached image )
2. I get nothing for the Function key F10. I oresume these are being
trapped somewhere else ?? How can I detect these ? ( I am not a great fan of
SetKey())
Some wisdom would be appreciated.
Regards
Chris Gillard
Attached files
I am trying to detect certain keys in an edit control using the OnKeyDown
event with code like this .......
METHOD CodeEditKeyDown( oSender, nKey, nFlags ) CLASS TMainForm
do case
case nKey == VK_UP
LogDisplay( "CodeEditKeyDown()", nkey, "VK_UP" )
case nKey == VK_DOWN
LogDisplay( "CodeEditKeyDown()", nkey, "VK_DOWN" )
case nKey == VK_F10
LogDisplay( "CodeEditKeyDown()", nkey, "VK_F10" )
endcase
RETURN Nil
It sort of works but ....
1. I get 2 Logdisplay messages for 1 K_UP or 1 K_DOWN key press ..... I
would have expected only one Logdisplay per key down ? What is going on
please ? ( see attached image )
2. I get nothing for the Function key F10. I oresume these are being
trapped somewhere else ?? How can I detect these ? ( I am not a great fan of
SetKey())
Some wisdom would be appreciated.
Regards
Chris Gillard
Attached files