From: Tom Szabo on
I have to change something once the user pressed an ASCII key in a
datawindow

How can I capture it?

As I understand the datawindow doesn't support KeyDown and KeyUp.

TIA,

Tom


From: Geoff Schaller on
Sure it does Tom, but more to the point, you have to be certain of the
control.

Let's assume SLE on a datawindow.
(This is even easier if it is RightSLE)

Subclass the SLE so that you can provide its own dispatch
(Copy RightSLE if you want an example)

Now you can trap key up and down and wm_char.

Cheers,

Geoff




"Tom Szabo" <tom(a)intersoft.net.au> wrote in message
news:4c1ddba0$1(a)dnews.tpgi.com.au:

> I have to change something once the user pressed an ASCII key in a
> datawindow
>
> How can I capture it?
>
> As I understand the datawindow doesn't support KeyDown and KeyUp.
>
> TIA,
>
> Tom

From: Tom Szabo on
Hi Geoff,

I need it at Window level! Is this possible?

If say someone presses the "a" on the keyboard, I need to trigger something.
I don't want to set this up for each control.

Is this possible through the Dispatch() of the DataWindow?

TIA,

Tom


"Geoff Schaller" <geoffx(a)softxwareobjectives.com.au> wrote in message
news:NKlTn.3716$Ls1.1210(a)news-server.bigpond.net.au...
> Sure it does Tom, but more to the point, you have to be certain of the
> control.
>
> Let's assume SLE on a datawindow.
> (This is even easier if it is RightSLE)
>
> Subclass the SLE so that you can provide its own dispatch
> (Copy RightSLE if you want an example)
>
> Now you can trap key up and down and wm_char.
>
> Cheers,
>
> Geoff
>
>
>
>
> "Tom Szabo" <tom(a)intersoft.net.au> wrote in message
> news:4c1ddba0$1(a)dnews.tpgi.com.au:
>
>> I have to change something once the user pressed an ASCII key in a
>> datawindow
>>
>> How can I capture it?
>>
>> As I understand the datawindow doesn't support KeyDown and KeyUp.
>>
>> TIA,
>>
>> Tom
>


From: Geoff Schaller on
Tom,

No, not at the window level. Every control would need to have a dispatch
and then pass such a key up to the window. But there is a better way:

BeforeDispatch()

This will work. You can trap EVERY key and event here, detect the one
you want and simply send it to the window dispatch for processing. This
kind of thing is possible:

// Need to trap Ctrl-F10 key sequence
IF uMsg = WM_SYSKEYDOWN .AND. wParam = VK_F10
IF CTRL_ON()
// bypass - operate on the key up
RETURN FALSE
ENDIF
ENDIF
IF uMsg = WM_SYSKEYUP .AND. wParam = VK_F10
IF CTRL_ON()
oObject := GetObjectByHandle(hWnd)
IF IsMethod(SELF, #RunVK_F10)
RETURN Send(SELF, #RunVK_F10, oObject)
ENDIF
ENDIF
ENDIF

And then the object (the one to receive the message) can give you its
owner window oObject:Owner so now you can send this same message to the
owner window, regardless of the control and process it there. My example
is looking for function keys but any char value is possible.

Geoff



"Tom Szabo" <tom(a)intersoft.net.au> wrote in message
news:4c1de946$1(a)dnews.tpgi.com.au:

> Hi Geoff,
>
> I need it at Window level! Is this possible?
>
> If say someone presses the "a" on the keyboard, I need to trigger something.
> I don't want to set this up for each control.
>
> Is this possible through the Dispatch() of the DataWindow?
>
> TIA,
>
> Tom
>
>
> "Geoff Schaller" <geoffx(a)softxwareobjectives.com.au> wrote in message
> news:NKlTn.3716$Ls1.1210(a)news-server.bigpond.net.au...
>
> > Sure it does Tom, but more to the point, you have to be certain of the
> > control.
> >
> > Let's assume SLE on a datawindow.
> > (This is even easier if it is RightSLE)
> >
> > Subclass the SLE so that you can provide its own dispatch
> > (Copy RightSLE if you want an example)
> >
> > Now you can trap key up and down and wm_char.
> >
> > Cheers,
> >
> > Geoff
> >
> >
> >
> >
> > "Tom Szabo" <tom(a)intersoft.net.au> wrote in message
> > news:4c1ddba0$1(a)dnews.tpgi.com.au:
> >
>
> >> I have to change something once the user pressed an ASCII key in a
> >> datawindow
> >>
> >> How can I capture it?
> >>
> >> As I understand the datawindow doesn't support KeyDown and KeyUp.
> >>
> >> TIA,
> >>
> >> Tom
>
> >

From: Tom Szabo on
Thanks Geoff

Works nicely

Regards,

Tom


"Geoff Schaller" <geoffx(a)softxwareobjectives.com.au> wrote in message
news:fpmTn.3730$Ls1.2761(a)news-server.bigpond.net.au...
> Tom,
>
> No, not at the window level. Every control would need to have a dispatch
> and then pass such a key up to the window. But there is a better way:
>
> BeforeDispatch()
>
> This will work. You can trap EVERY key and event here, detect the one you
> want and simply send it to the window dispatch for processing. This kind
> of thing is possible:
>
> // Need to trap Ctrl-F10 key sequence
> IF uMsg = WM_SYSKEYDOWN .AND. wParam = VK_F10
> IF CTRL_ON()
> // bypass - operate on the key up
> RETURN FALSE
> ENDIF
> ENDIF
> IF uMsg = WM_SYSKEYUP .AND. wParam = VK_F10
> IF CTRL_ON()
> oObject := GetObjectByHandle(hWnd)
> IF IsMethod(SELF, #RunVK_F10)
> RETURN Send(SELF, #RunVK_F10, oObject)
> ENDIF
> ENDIF
> ENDIF
>
> And then the object (the one to receive the message) can give you its
> owner window oObject:Owner so now you can send this same message to the
> owner window, regardless of the control and process it there. My example
> is looking for function keys but any char value is possible.
>
> Geoff
>
>
>
> "Tom Szabo" <tom(a)intersoft.net.au> wrote in message
> news:4c1de946$1(a)dnews.tpgi.com.au:
>
>> Hi Geoff,
>>
>> I need it at Window level! Is this possible?
>>
>> If say someone presses the "a" on the keyboard, I need to trigger
>> something.
>> I don't want to set this up for each control.
>>
>> Is this possible through the Dispatch() of the DataWindow?
>>
>> TIA,
>>
>> Tom
>>
>>
>> "Geoff Schaller" <geoffx(a)softxwareobjectives.com.au> wrote in message
>> news:NKlTn.3716$Ls1.1210(a)news-server.bigpond.net.au...
>>
>> > Sure it does Tom, but more to the point, you have to be certain of the
>> > control.
>> >
>> > Let's assume SLE on a datawindow.
>> > (This is even easier if it is RightSLE)
>> >
>> > Subclass the SLE so that you can provide its own dispatch
>> > (Copy RightSLE if you want an example)
>> >
>> > Now you can trap key up and down and wm_char.
>> >
>> > Cheers,
>> >
>> > Geoff
>> >
>> >
>> >
>> >
>> > "Tom Szabo" <tom(a)intersoft.net.au> wrote in message
>> > news:4c1ddba0$1(a)dnews.tpgi.com.au:
>> >
>>
>> >> I have to change something once the user pressed an ASCII key in a
>> >> datawindow
>> >>
>> >> How can I capture it?
>> >>
>> >> As I understand the datawindow doesn't support KeyDown and KeyUp.
>> >>
>> >> TIA,
>> >>
>> >> Tom
>>
>> >
>