keyboard alllways activ, even not programmed

Post your Gambas programming questions here.
User avatar
BruceSteers
Posts: 1523
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: keyboard alllways activ, even not programmed

Post by BruceSteers »

Nope.

You have a customised setting somewhere making backspace behave like the tab button.
that is wrong and going to cause other problems.. if you do not know how or where you have set it then re-install manjaro.
If at first you don't succeed , try doing something differently.
BruceS
User avatar
grayghost4
Posts: 174
Joined: Wednesday 5th December 2018 5:00am
Location: Marengo, Illinois usa

Re: keyboard alllways activ, even not programmed

Post by grayghost4 »

User avatar
vito49
Posts: 8
Joined: Sunday 20th December 2020 8:19am

Re: keyboard alllways activ, even not programmed

Post by vito49 »

Hello all, I feel a bit stupid about this topic, because I told you that I used key.backspase but I found out I wasn't, in fact I wanted the key.SPACE and of course I was pushing the wrong button all the time ...
So I changed it into:
Public Sub Form_KeyPress()
  If Button3.Visible = True Then   
            If Key.Code = Key.Space Then
                firstControl = Int(Rnd(6, 180))
                Button3.Visible = False
                 Label7.Text += 1
             End If
    End If
 End
but again, tapping the Space key also made my pc doing strange things.
I finally checked my code, didn't find any errors, but rearranged some functions and suddenly everything was OK.
I have no idea what code was causing the error.
So please forgive me for wasting your time :oops:
Vito
born 19 may 1949
using Gambas3 for therapy ;)
on a Manjaro XFCE4 PC
User avatar
BruceSteers
Posts: 1523
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: keyboard alllways activ, even not programmed

Post by BruceSteers »

vito49 wrote: Sunday 27th December 2020 9:16am Hello all, I feel a bit stupid about this topic, because I told you that I used key.backspase but I found out I wasn't, in fact I wanted the key.SPACE and of course I was pushing the wrong button all the time ...
So I changed it into:
Public Sub Form_KeyPress()
  If Button3.Visible = True Then   
            If Key.Code = Key.Space Then
                firstControl = Int(Rnd(6, 180))
                Button3.Visible = False
                 Label7.Text += 1
             End If
    End If
 End
but again, tapping the Space key also made my pc doing strange things.
I finally checked my code, didn't find any errors, but rearranged some functions and suddenly everything was OK.
I have no idea what code was causing the error.
So please forgive me for wasting your time :oops:
Not a waste dude. we're here to help and be helped :)
I should add this...

Keypress event is strange.
QT and GTK behave quite differently.
GTK will show warnings about not allowing some methods while in a keypress event while QT seems not to.
There's probably pro's and con's for both gui's.
It can help to rearrange the code as you have done or changing to QT can sometimes help.
bigger problems can be fixed by making Timers, so the keypress event just starts a timer then freely exits, then the timer runs the process.

There's possibly a better way to get around it.

Also it can make a difference if for example your keypress events are from a TextArea control,
Using TextArea1_KeyPress() or using From_KeyPress() can make things behave differently.

Try different things.
Experimentation is the father of invention :)
Bruce
If at first you don't succeed , try doing something differently.
BruceS
Post Reply