[Gambas-user] Keyboard-commands navigating buttons

Bruce Steers bsteers4 at gmail.com
Tue May 2 02:19:58 CEST 2023


On Mon, 1 May 2023 at 22:54, Hartmut Wagener <hartmut.w.wagener at t-online.de>
wrote:

> Thanks a lot, this works... :)
>
You're welcome :)
I think you will find the problem is with the various toolkits/themes on
each system.
gtk and qt themes can behave differently with keypress events, some support
movement via arrow keys and others do not.

I know for a fact a group of checkbox controls in a panel can be navigated
by arrow keys with QT5 but not with GTK3

So it's hard to say if keyboard control is going to be supported or not if
you use gb.gui
The best you can do is what you are doing and using Stop Event to make sure
nothing else tries to do it as well.

Respects
BruceS


> Am 01.05.23 um 23:22 schrieb Bruce Steers:
>
>
>
> On Mon, 1 May 2023 at 22:01, Hartmut Wagener <
> hartmut.w.wagener at t-online.de> wrote:
>
>> Hi,
>>
>> i have some tools that is use to start rograms. These are several
>> Gambas-Programs that use buttons to start different programs.
>>
>> In the past (some years ago), the cursor-commands went through the
>> buttons, so i could use them to navigate a button and press enter to
>> start it.
>>
>> Since some time (a year or more), this was not possible, i added a
>> keyboard-control to stear the focus of the buttons.
>>
>> Since today i have changed my desktop from Mate to Plasma, and i was
>> astonished that each Cursor-Keypress now moves two buttons, so i need to
>> disable my keyboard-control.
>>
>>
>> How can i manage to find out if the programs runs on a system that needs
>> the additional- keyboard-thing or not?
>>
>> Thanks a lot
>>
>
> Have you tried using the instruction...
>
> Stop Event
>
> http://gambaswiki.org/wiki/lang/stopevent
>
> see if it stops the keypress event going any further than your custom
> method.
>
>      Select Case chara
>        Case Key.Up
>          moveup
>         Stop Event
>        Case Key.Down
>          movedown
>          Stop Event
>      End Select
>
>
> BruceS
>
>
>>
>>
>> PS: My keyboard-control looks like that:
>>
>>
>> Public Sub Form_KeyPress()
>>    ' Tastendruck
>>    Dim ltext As Variant
>>    Dim chara As Integer
>>    ltext = Key.Text
>>    chara = Key.Code
>>    If Not IsNull(ltext) Then
>>      chara = Asc(ltext)
>>      If chara = 27 Then
>>        Me.close
>>
>>      endif
>>
>> Else
>>      Select Case chara
>>        Case Key.Up
>>          moveup
>>        Case Key.Down
>>          movedown
>>      End Select
>>    Endif
>>
>>
>> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>>
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230502/c5007b7c/attachment.htm>


More information about the User mailing list