[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: capture keycode in valuefield


On Tue, 18 Jun 2024 at 00:11, Dag JNJ <gambas@xxxxxxxxxxxx> wrote:

> Hi,
>
> I wanted to jump between fields in the GUI using Enter, Return, Down- and
> Up-Arrows. In textbox-fields it. it works, like this:
>
>
>
>
>
>
> *Public Sub FLD_vorgabe_tbx_KeyPress()   If Key.Code = Key.Enter Or
> Key.Code = Key.Return Or Key.Code = Key.Down Then
> FLD_kommentar_tba.SetFocus   If Key.Code = Key.Up Then
> FLD_nachkomma_vbx.SetFocus End*
>
> All 4 keys are captured. But in a valuebox field only enter and return are
> captured.
>
>
>
>
>
>
> *Public Sub FLD_nachkomma_vbx_KeyPress()   If Key.Code = Key.Enter Or
> Key.Code = Key.Return Or Key.Code = Key.Down Then FLD_vorgabe_tbx.SetFocus
>   If Key.Code = Key.Up Then FLD_laenge_vbx.SetFocus End*
>
> Do I make something wrong, or are the capturing of arrow-keys left out for
> some reason? (I tried with other keys too, none seem to work).
>
> Thankful for any hint, kind regards, Dag
>

I found only up and down arrow keys get swallowed and do not fire the event
but left and right keys do.

I wonder if there is code to make up and down keys adjust the value but it
is not working?
For whatever the reason up and down key events seem to be eaten by the
control.
The wiki does explain that some non-native controls can swallow key events,
this is one of those cases.

Respects
BruceS

Follow-Ups:
Re: capture keycode in valuefieldBruce Steers <bsteers4@xxxxxxxxx>
References:
capture keycode in valuefieldDag JNJ <gambas@xxxxxxxxxxxx>