KeyPress event no longer works - How to troubleshoot?

Post

Posted
Rating:
#1 (In Topic #1451)
Regular
JumpyVB is in the usergroup ‘Regular’
The KeyPress event in Gambas no longer works on my PC.

I can recreate the problem like this: File > New project > QT Application or Graphical Application > right click on FMain.form and select Event > KeyPress, and add this code:

Code (gambas)

  1. Public Sub Form_KeyPress()
  2.   Me.Text = Key.Code
  3.  

And finally when I Run it and try to use the keyboard the KeyPress event doesn't get raised at all.

If I add a TextBox control I am able to input text to it. But even if I add this code Me.Text never changes:

Code (gambas)

  1. Public Sub TextBox1_KeyPress()
  2.   Me.Text = Key.Code
  3.  

Do you guys have any ideas what I could try next?

PS: I am using Gambas Stable 3.20.2
Online now: No Back to the top

Post

Posted
Rating:
#2
Guru
BruceSteers is in the usergroup ‘Guru’
It's all working as expected here.

I'm getting KeyPress events from both TextBox and Form

Code (gambas)

  1.  
  2. Public Sub TextBox1_KeyPress()
  3.  
  4.   Debug Key.Code
  5.  
  6.  
  7. Public Sub Form_KeyPress()
  8.  
  9.   Debug Key.Code
  10.  
  11.  
Online now: No Back to the top

Post

Posted
Rating:
#3
Avatar
Regular
thatbruce is in the usergroup ‘Regular’
Explain exactly what you mean by:
And finally when I Run it and try to use the keyboard the KeyPress event doesn't get raised at all.

(I see the same as BruceS)
Image

(Click to enlarge)

b

Online now: No Back to the top

Post

Posted
Rating:
#4
Avatar
Guru
cogier is in the usergroup ‘Guru’
It works OK for me as well.
Online now: No Back to the top

Post

Posted
Rating:
#5
Regular
JumpyVB is in the usergroup ‘Regular’
Thank you guys! Your tests encouraged me to install and try the same Gambas test app in another distribution - And I have no issues there  :o

The issue is clearly related to the operating system and has appeared at some point after updates of my main OS. Unfortunately the time frame is several months. I cannot pinpoint it better.

I did some further testing with my main OS. I changed the desktop environment from Budgie to Gnome. And found out that KeyPress events are bugged under X.org (both budgie and Gnome), but work fine under the Wayland version of Gnome.

This is clearly an issue I have to discus on the support forum of my main OS.

Thank you.
Online now: No Back to the top

Post

Posted
Rating:
#6
Regular
JumpyVB is in the usergroup ‘Regular’
Today I finally found the KeyPress thief: Budgie Window Shuffler Control drag-snap advanced edge-tiling
Image

(Click to enlarge)

As soon as I flip the switch Gambas apps can no longer detect KeyPress event like they should.
And once I disable the switch the remedy is instant and all KeyPress event stat working.
Online now: No Back to the top
1 guest and 0 members have just viewed this.