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

How to send a Shift-Tab

67 views
Skip to first unread message

Dale Fox

unread,
May 14, 1999, 3:00:00 AM5/14/99
to

I know I can send a Tab message to a DataWindow using
Send(Handle(this), 256, 9, 0)
but how do I send a shift-Tab?

Thanks.

Dale Fox
df...@canada.com

Erich Heard

unread,
May 14, 1999, 3:00:00 AM5/14/99
to

You use two calls to Send:

Send(Handle(This),256, 161, 0) // This simulates the left shift key
Send(Handle(This),256, 9, 0)

Dale Fox wrote in message ...

Dale Fox

unread,
May 14, 1999, 3:00:00 AM5/14/99
to

Erich,

I tried this code, but it seems that the first line is not having an effect,
as the focus is still moved to the next field, instead of the previous one.

The pbm_dwnkey event on the DW does get fired twice though; the second time
is the tab key as normal. The first time the "key" variable has no value
and flags is set to 0.

Any ideas?


Erich Heard wrote in message <79Rxi7jn#GA....@forums.sybase.com>...

Ken Drendel

unread,
May 14, 1999, 3:00:00 AM5/14/99
to

Here put this into your external declerations :

Function long keybd_event(long lgcur, long lflag, long lint, long leds ) &
Library "user32.dll"

now put this in the code of the event you want to
use:

keybd_event(16, 42, 0, 0)
keybd_event(9,15, 0, 0)
keybd_event(9,15, 2, 0)
keybd_event(16,42, 2, 0)


This will give you the results that you want!

Ken Drendel
If you have any questions or comments you can reach me
via email at kdre...@hotmail.com
or via ICQ @ 34027019

Erich Heard

unread,
May 14, 1999, 3:00:00 AM5/14/99
to
Dale,
This is the exact code from my DWC ancestor's key (pbm_dwnkey) event. It
causes the END key to act as a TAB:

/*
END key will work like a tab key
SHIFT+END will work like backtab
*/
if Key = KeyEnd! then
Choose Case KeyFlags
Case 0
Send( Handle( this ), 256, 9, Long( 0, 0) )
return( 1 )
Case 1
// Send a SHIFT then a TAB
Send( Handle( This ), 256, 161, Long( 0, 0 ) )
Send( Handle( This ), 256, 9, Long( 0, 0 ) )
Return( 1 )
End Choose
end if

Ken Drendel

unread,
May 14, 1999, 3:00:00 AM5/14/99
to
I read an insert, it says that I should not use the hardware scaan codes. so try
this

Do this instead same results,no confussion.
//Key Down
keybd_event(16,0, 0, 0)
keybd_event(9,0, 0, 0)
//Key Up
// I f you don't do this part it will not release the shift key. Until you
// Press it again.!!!
keybd_event(16,0, 2, 0)
keybd_event(9,0, 2, 0)

Simon Caldwell

unread,
May 17, 1999, 3:00:00 AM5/17/99
to

The problem is that you need to send both the key depression and the key
release.
Ken Drendel's posts give the solution.

Simon

Erich Heard wrote in message ...

0 new messages