Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

OnKeyDown && TShiftState

910 views
Skip to first unread message

Brian Solomons

unread,
Mar 3, 1998, 3:00:00 AM3/3/98
to

Could someone give me an example of how to trap the TShiftState type in a
KeyDown event?

Many thanks
Brian

Steve Balcombe

unread,
Mar 3, 1998, 3:00:00 AM3/3/98
to

Is this what you mean?

if (Shift.Contains(ssShift))
...

I don't really know what you mean by 'trap'.


Brian Solomons wrote in message <6dhd2e$is...@forums.borland.com>...

Brian Solomons

unread,
Mar 4, 1998, 3:00:00 AM3/4/98
to

Steve

Thanks. That is what I wanted. You obviously did know what I meant by
'trap' :-).

Seriously, can you tell me how you knew this was the correct approach? I
couldn't find any info in the help as to how to use TShiftState. Or is it
just that my knowledge of C++ is limited?

Thanks
Brian

Steve Balcombe wrote in message <6dhhlr$is...@forums.borland.com>...

Steve Balcombe

unread,
Mar 4, 1998, 3:00:00 AM3/4/98
to

Brian Solomons wrote in message <6djna6$l5...@forums.borland.com>...

>Seriously, can you tell me how you knew this was the correct approach? I
>couldn't find any info in the help as to how to use TShiftState. Or is it
>just that my knowledge of C++ is limited?


Look once again at the online help for OnKeyDown. The second line reads...

typedef Set<Classes_1, ssShift, ssDouble> TShiftState;

... where Set is hotlinked, so click that - it takes you to a description
of 'Set', which is a C++ template class designed to emulate the Delphi
Set type.

... and TShiftState is also hotlinked - follow that also.

If you can't find this in the online help, you need to download the help
file updates from Borland's web site. It's a fairly large download but
it's well worth it.

Brian Solomons

unread,
Mar 5, 1998, 3:00:00 AM3/5/98
to

Thanks for that. I'm slowly beginning to understand all about BCB...

Brian


Steve Balcombe wrote in message <6dk0r7$ll...@forums.borland.com>...

dou...@gmail.com

unread,
Jan 17, 2005, 2:06:04 PM1/17/05
to
Here's an example in Delphi.

procedure TfMyForm.TabCycleOnKey(Sender: TObject; var Key: Word; Shift:
TShiftState);
begin
if (key = VK_TAB) and not(ssShift in Shift) then begin
PageControl.SetFocus;
end;
end;

0 new messages