Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Enter key to Tab
Thu, Mar 22 2018 5:44 PMPermanent Link

KimHJ

Comca Systems, Inc

In the Keyevent on the Form I can't reassign the Key like in Delphi.

I'm trying to convert Enter (#13) to Tab (#9).

I notice that Tab is not captured in OnKeyPress, but the event is fired.

This will not work in OnKeyPress
if Key= #9 then
but this works
if Key= #13 then

In onKeyDown both works
if Key=9 then
or
if key=13 then

Is it possible to transform a Enter to a Tab?

Kim
Fri, Mar 23 2018 5:24 AMPermanent Link

Matthew Jones

KimHJ wrote:

> Is it possible to transform a Enter to a Tab?

First step with all these things is to google for this in Javascript terms. Can it be done at all? When you find how they do it, you can then work out how to apply it to WebBuilder code.

--

Matthew Jones
Tue, Mar 27 2018 4:31 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Kim,

<< In the Keyevent on the Form I can't reassign the Key like in Delphi.

I'm trying to convert Enter (#13) to Tab (#9). >>

You can't convert keys "directly" in EWB.  You can only accept them or prevent them and do your own thing.

The main problem is that the Tab method for the base TControl is protected, not public.  I will see about surfacing the Tab method as a public method, and then you will be able to do what you want in event handlers.  You're also free to modify the WebCtrls unit and do the same as a hot-fix until I get this implemented.

<< I notice that Tab is not captured in OnKeyPress, but the event is fired. >>

EWB is passing the key character pressed directly from the browser, but browsers can differ on how they deal with keys that are < #32 (space), so you should always use the OnKeyDown event for handling such keys.


This will not work in OnKeyPress
if Key= #9 then
but this works
if Key= #13 then

In onKeyDown both works
if Key=9 then
or
if key=13 then

Is it possible to transform a Enter to a Tab?

Kim

Tim Young
Elevate Software
www.elevatesoft.com
Wed, Mar 28 2018 3:31 PMPermanent Link

KimHJ

Comca Systems, Inc

Thanks,
Kim
Image