Board index » cppbuilder » Capturing Key and cancel the key press.

Capturing Key and cancel the key press.

Hello there,

I captured the KeyUP of a Scrollbar, and after passing through another
function, i Would like to cancel the key press for that focus ...
I though setting Key to zero will do the trick, but it seems it's not
enough. Any idea ?

void __fastcall TCWGrid::DoScrollHorKeyUp(System::TObject* Sender, Word
&Key, Classes::TShiftState Shift)
{
   KeyUp(Key,Shift);
   Key = 0;

Quote
}

 

Re:Capturing Key and cancel the key press.


Set Key to 0 before you call the inherited one.

Thanks Rockie

Quote
"Laurent Lequenne" <laurent.leque...@chello.be> wrote in message

news:3c8e8c8a$1_2@dnews...
Quote
> Hello there,

> I captured the KeyUP of a Scrollbar, and after passing through another
> function, i Would like to cancel the key press for that focus ...
> I though setting Key to zero will do the trick, but it seems it's not
> enough. Any idea ?

> void __fastcall TCWGrid::DoScrollHorKeyUp(System::TObject* Sender, Word
> &Key, Classes::TShiftState Shift)
> {
>    KeyUp(Key,Shift);
>    Key = 0;
> }

Re:Capturing Key and cancel the key press.


Better yet, just don't call the inherited method at all

Gambit

Quote
"Rockie Roper" <rock...@lvcm.com> wrote in message

news:3c916b44$1_1@dnews...
Quote
> Set Key to 0 before you call the inherited one.

Re:Capturing Key and cancel the key press.


yes, but if so the Tscrollbar act just as the key has been pressed :-)

"Remy Lebeau [TeamB]" <gambi...@yahoo.com> wrote in message
news:3c9172b6_2@dnews...

Quote
> Better yet, just don't call the inherited method at all

> Gambit

> "Rockie Roper" <rock...@lvcm.com> wrote in message
> news:3c916b44$1_1@dnews...
> > Set Key to 0 before you call the inherited one.

Other Threads