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

Re: Pre-release of Gambas 3.21.6


On Sunday, April 19th, 2026 at 19:18, Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx> wrote:

> Le 19/04/2026 à 13:44, gbWilly a écrit :
> >>
> >> Sorry, bad fix. It should work correctly now.
> >>
> >
> > Tab now works, BUT acts as if it is Key.Enter or Key.Return.
> > See attached project button 1 and button 2 keypress code.
> >
> > Tabbing triggers code that should only be triggerd by Enter of Return
> >
> > In button 3 code I test for Key.Tab and make it exit the event, but now the Key.Enter and Key.Return also skip the ketpress event.
> > It's on Qt only, on gtk3 button 3 works as should and activates when hitting enter or return
> >
> > So, in short button 1 and 2 work for enter and return but also activates when hitting Tab (not intented behaviour)
> > Trying to eliminate the Tab by a test in button 3 and Return and Enter are no longer working.
> >
>
> Your project works as expected.
>
> 'Key.Enter' does not tell you if the 'Enter' key is pressed. It's a
> constant that returns the code associated with the Enter key, that you
> must compare with the value of 'Key.Code'.
>
> You must not write:
>
>    If Key.Enter Or Key.Return Then
>
> which makes no sense (you are making a binary OR between two integers), but:
>
>    If Key.Code = Key.Enter Or If Key.Code = Key.Return Then
>
> Regards,
>
> --
> Benoît Minisini.
>

You are right, they ain't no Boolean.
Where was I when writing this code I wonder?

One more thing. Above code does accept spacebar as enter or return.
Is there any reasoning behind this or is this toolbox behaviour, default behaviour? Just trying to understand what is happeing there

gbWilly

GambOS
Gambas3 for Debian/Ubuntu

...there is always a Catch if things go wrong!


Follow-Ups:
Re: Pre-release of Gambas 3.21.6Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
References:
Pre-release of Gambas 3.21.6Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
Re: Pre-release of Gambas 3.21.6Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
Re: Pre-release of Gambas 3.21.6gbWilly <gbWilly@xxxxxxxxxxxxxx>
Re: Pre-release of Gambas 3.21.6Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
Re: Pre-release of Gambas 3.21.6Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
Re: Pre-release of Gambas 3.21.6gbWilly <gbWilly@xxxxxxxxxxxxxx>
Re: Pre-release of Gambas 3.21.6Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>