[Solved] GTK3 Keyboard

Post

Posted
Rating:
#1 (In Topic #1158)
Enthusiast
AndyGable is in the usergroup ‘Enthusiast’
 Hi Everyone,

I hope someone could help me

I have make a small application to test why I can not key any keyboard input on a form with in a workspace

I have discovered the Main Form (FMain) is still holding onto the keyboard

in QT the keyboard input is on the form that is showing in the Workspace

So does anyone know how I can get the Form in the workspace to have the keyboard and NOT the FMain

What should happen is when the app starts you will see in the workspace FrmSignedOff and when you Press A the Form Signed on should show
and when you press B the form FrmSignedOn should close and you will return to FrmSignedOff

Anyone who could help me with this I would be most grateful.

Attachment

This is my test application to see what is happening with the Keyboard input(s)

Online now: No Back to the top

Post

Posted
Rating:
#2
Enthusiast
AndyGable is in the usergroup ‘Enthusiast’
update on this issuse

IF i put a textbox on the frmSignedOff and when the screen is loaded I click inside the textbox the form gets focus and the keyboard
works

sooo how do I make the frm get focus

I have tried

Code (gambas)

  1. Public Sub Form_Open()
  2.   Me.SetFocus
  3.  

but that is not working i have even tired when I load the form at the beginning (with in FMain)

Code (gambas)

  1. Public Sub Form_Open()
  2.   FMain.Workspace1.Add(frmSignedOff, 0)
  3.   frmSignedOff.SetFocus

any recommendations I am open to all idea's

Attachment
Online now: No Back to the top

Post

Posted
Rating:
#3
Guru
BruceSteers is in the usergroup ‘Guru’
maybe you can simply send the logoff form the keypress in FMain_KeyPress.

FMain.class

Code (gambas)

  1.  
  2. Public Sub Form_Open()
  3.  
  4.   FMain.Workspace1.Add(frmSignedOff, 0)
  5.  
  6.  
  7. Public Sub Form_KeyPress()
  8.  
  9.   Select Case Key.Code
  10.     Case 65 'Key A
  11.       Me.Text = "Key being captured by FMain"
  12.       frmSignedOff.Form_KeyPress   ' run  frmSignedoff KeyPress event
  13.  
  14.  
  15.  

you may want to add handling if the application can use either qt or gtk (gb.gui) as they behave differently (as you have found)

Code (gambas)

  1.  
  2. Public Sub Form_KeyPress()
  3.  
  4.   Select Case Key.Code
  5.     Case 65 'Key A
  6.       Me.Text = "Key being captured by FMain"
  7.      If Env["GB_GUI"] Like "gb.gtk*" Then frmSignedOff.Form_KeyPress   ' run  frmSignedoff KeyPress event only if using gtk
  8.  
Online now: No Back to the top

Post

Posted
Rating:
#4
Enthusiast
AndyGable is in the usergroup ‘Enthusiast’
 That's works perfectly

I've moved to GTK3 as that does seem to be giving me any issues (unlike qt5)
Online now: No Back to the top
1 guest and 0 members have just viewed this.