[Sloved] Migrating from 3.15 to 3.18 Problems

Post

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

Not sure if I am doingh something wrong but I am having a problem I am trying to update from 3.15 to 3.18 on Debian (from the back port)

but when I do i get a issue where NON of my key input works

in 3.15 I can set focus to the form with in a workspace and it works fine but in 3.18 the form is not getting any input.

I have uninstalled 3.15 and installed a clean 3.18 but that has not sorted the problem

Any advise would be most welcomed (as I have a few applications that uses keyboard input)

Kind regards

Andrew
Online now: No Back to the top

Post

Posted
Rating:
#2
Avatar
Guru
cogier is in the usergroup ‘Guru’
Have you tried recompiling your program(s)?  Project>Compile All
Online now: No Back to the top

Post

Posted
Rating:
#3
Enthusiast
AndyGable is in the usergroup ‘Enthusiast’
 Hi Cogier,

Sorry for the delay i was trying what you (Had to wait to get into the office to try this) said and this is what I found

If I have a textbox on the screen then the Program will respond to keyboard input but if it is via the form Keypress it does not respond

I have even tried to capture the key.code to see what it is sending but this is not even working (and yes I have done a compile all)

I had to change the GTK as it was saying the one I was using was not available (so I selected gb.gkt3) recompiled it and ran the program and still nothing

Any ideas what this could be as I can not really upgrade to Debian 12 if None of my Keyboard based applications do not work

Andy
Online now: No Back to the top

Post

Posted
Rating:
#4
Avatar
Guru
cogier is in the usergroup ‘Guru’
I have done some testing and all seems to work as I would expect. Can you post some example code, so I/we can see what you are trying to do?
Online now: No Back to the top

Post

Posted
Rating:
#5
Enthusiast
AndyGable is in the usergroup ‘Enthusiast’

Code (gambas)

  1. Public Sub Form_KeyPress()
  2.  
  3.     Select Case Key.Code
  4.         Case Global.Key_SignOn ' lower case A
  5.             frmbackground.Workspace1.CloseAll
  6.             frmbackground.Workspace1.Add(FrmSignOn, 0)
  7.  
  8.         Case Global.Key_PriceCheck
  9.             frmPriceCheck_1.labCallingForm.Text = "frmSignedOff"
  10.             frmbackground.Workspace1.CloseAll
  11.             frmbackground.Workspace1.Add(frmPriceCheck_1, 0)
  12.  
  13.         Case Global.Key_UserMenu
  14.             frmbackground.Workspace1.CloseAll
  15.             frmbackground.Workspace1.Add(frmSignedOffMenu, 0)
  16.        
  17.     End Select
  18.  
  19.  

The keys are defined as below

Code (gambas)

  1. Public Key_SignOn As Integer = 65                'A
  2. Public Key_PriceCheck As Integer = 67                'C
  3. Public Key_UserMenu As Integer = 69                'E
  4.  

This is the code I am using on my signed off screen

This works fine in 3.15 but when I move it to 3.18 it does not work at all
Online now: No Back to the top

Post

Posted
Rating:
#6
Guru
BruceSteers is in the usergroup ‘Guru’

AndyGable said

Code (gambas)

  1. Public Sub Form_KeyPress()
  2.  
  3.     Select Case Key.Code
  4.         Case Global.Key_SignOn ' lower case A
  5.             frmbackground.Workspace1.CloseAll
  6.             frmbackground.Workspace1.Add(FrmSignOn, 0)
  7.  
  8.         Case Global.Key_PriceCheck
  9.             frmPriceCheck_1.labCallingForm.Text = "frmSignedOff"
  10.             frmbackground.Workspace1.CloseAll
  11.             frmbackground.Workspace1.Add(frmPriceCheck_1, 0)
  12.  
  13.         Case Global.Key_UserMenu
  14.             frmbackground.Workspace1.CloseAll
  15.             frmbackground.Workspace1.Add(frmSignedOffMenu, 0)
  16.        
  17.     End Select
  18.  
  19.  

The keys are defined as below

Code (gambas)

  1. Public Key_SignOn As Integer = 65                'A
  2. Public Key_PriceCheck As Integer = 67                'C
  3. Public Key_UserMenu As Integer = 69                'E
  4.  

This is the code I am using on my signed off screen

This works fine in 3.15 but when I move it to 3.18 it does not work at all

have you tried using Key[] for the integers, you should not rely on code values

Code (gambas)

  1. Public Key_SignOn As Integer
  2. Public Key_PriceCheck As Integer
  3. Public Key_UserMenu As Integer
  4.  
  5. Public Sub _new()
  6.   Key_SignOn = Key["A"]
  7.   Key_PriceCheck = Key["C"]
  8.   Key_UserMenu= Key["E"]
  9.  
  10.  
Online now: No Back to the top

Post

Posted
Rating:
#7
Guru
BruceSteers is in the usergroup ‘Guru’
 something will be getting the keypress

maybe the active control needs to relay it to Form_KeyPress()

I assume the different gambas versions are on different machines.

If so post the gambas system information from both machines so we might get a hint as to what the problem may be.
Online now: No Back to the top

Post

Posted
Rating:
#8
Enthusiast
AndyGable is in the usergroup ‘Enthusiast’
System informtion Request

the only differance between the machines is one is a 32 bit install the other is a 64bit install BUT this is the same when I installed 3.18.0 on my 32 bit machine (I have gone back to the 3.15.2 that is in the normal apt install at the moment)

Development PC

Code (gambas)

  1. Gambas=3.15.2
  2. OperatingSystem=Linux
  3. Kernel=5.10.0-23-686-pae
  4. Architecture=x86
  5. Distribution=debian 11.7
  6. Desktop=XFCE
  7. Theme=fusion
  8. Language=en_GB.UTF-8
  9. Memory=2976M
  10.  
  11. [Libraries]
  12. Cairo=libcairo.so.2.11600.0
  13. Curl=libcurl.so.4.7.0
  14. DBus=libdbus-1.so.3.19.15
  15. GDK2=libgdk-x11-2.0.so.0.2400.33
  16. GDK3=libgdk-3.so.0.2404.20
  17. GStreamer=libgstreamer-1.0.so.0.1804.0
  18. GTK+2=libgtk-x11-2.0.so.0.2400.33
  19. GTK+3=libgtk-3.so.0.2404.20
  20. OpenGL=libGL.so.1.7.0
  21. Poppler=libpoppler.so.102.0.0
  22. QT5=libQt5Core.so.5.15.2
  23. SQLite=libsqlite3.so.0.8.6
  24.  
  25. [Environment]
  26. DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
  27. DESKTOP_SESSION=lightdm-xsession
  28. DISPLAY=:0.0
  29. GB_GUI=gb.qt5
  30. GDMSESSION=lightdm-xsession
  31. GTK_MODULES=gail:atk-bridge
  32. HOME=<home>
  33. LANG=en_GB.UTF-8
  34. LANGUAGE=en_GB.UTF-8
  35. LC_ALL=en_GB.UTF-8
  36. LOGNAME=<user>
  37. PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
  38. PWD=<home>
  39. QT_ACCESSIBILITY=1
  40. QT_LOGGING_RULES=*.debug=false
  41. SESSION_MANAGER=local/<hostname>:@/tmp/.ICE-unix/958,unix/<hostname>:/tmp/.ICE-unix/958
  42. SHELL=/bin/bash
  43. SSH_AGENT_PID=1001
  44. SSH_AUTH_SOCK=/tmp/ssh-d0qqHzdAtzst/agent.958
  45. TZ=:/etc/localtime
  46. USER=<user>
  47. XAUTHORITY=<home>/.Xauthority
  48. XDG_CONFIG_DIRS=/etc/xdg
  49. XDG_CURRENT_DESKTOP=XFCE
  50. XDG_DATA_DIRS=/usr/share/xfce4:/usr/local/share/:/usr/share/:/usr/share
  51. XDG_GREETER_DATA_DIR=/var/lib/lightdm/data/<user>
  52. XDG_MENU_PREFIX=xfce-
  53. XDG_RUNTIME_DIR=/run/user/1000
  54. XDG_SEAT=seat0
  55. XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
  56. XDG_SESSION_CLASS=user
  57. XDG_SESSION_DESKTOP=lightdm-xsession
  58. XDG_SESSION_ID=2
  59. XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
  60. XDG_SESSION_TYPE=x11
  61. XDG_VTNR=7
  62.  

Laptop Running Debian 11 3.18.0

Code (gambas)

  1. Gambas=3.18
  2. OperatingSystem=Linux
  3. Kernel=5.10.0-23-amd64
  4. Architecture=x86_64
  5. Distribution=debian 11.7
  6. Desktop=XFCE
  7. Font=Inconsolata,10,Bold
  8. Scale=7
  9. Theme=xfce
  10. Language=en_GB.UTF-8
  11. Memory=1844M
  12.  
  13. [Programs]
  14. gcc=gcc (Debian 10.2.1-6) 10.2.1 20210110
  15.  
  16. [Libraries]
  17. Cairo=libcairo.so.2.11600.0
  18. Curl=libcurl.so.4.7.0
  19. DBus=libdbus-1.so.3.19.15
  20. GDK2=libgdk-x11-2.0.so.0.2400.33
  21. GDK3=libgdk-3.so.0.2404.20
  22. GStreamer=libgstreamer-1.0.so.0.1804.0
  23. GTK+2=libgtk-x11-2.0.so.0.2400.33
  24. GTK+3=libgtk-3.so.0.2404.20
  25. OpenGL=libGL.so.1.7.0
  26. Poppler=libpoppler.so.102.0.0
  27. RSvg=librsvg-2.so.2.47.0
  28. SQLite=libsqlite3.so.0.8.6
  29.  
  30. [Environment]
  31. DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
  32. DESKTOP_SESSION=lightdm-xsession
  33. DISPLAY=:0.0
  34. GB_GUI=gb.gtk3
  35. GDMSESSION=lightdm-xsession
  36. GTK_MODULES=gail:atk-bridge
  37. HOME=<home>
  38. LANG=en_GB.UTF-8
  39. LANGUAGE=en_GB.UTF-8
  40. LC_ALL=en_GB.UTF-8
  41. LOGNAME=<user>
  42. PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
  43. PWD=<home>
  44. QT_ACCESSIBILITY=1
  45. QT_LOGGING_RULES=*.debug=false
  46. SESSION_MANAGER=local/<hostname>:@/tmp/.ICE-unix/909,unix/<hostname>:/tmp/.ICE-unix/909
  47. SHELL=/bin/bash
  48. SSH_AGENT_PID=952
  49. SSH_AUTH_SOCK=/tmp/ssh-XKWRkb92kbDg/agent.909
  50. TZ=:/etc/localtime
  51. USER=<user>
  52. XAUTHORITY=<home>/.Xauthority
  53. XDG_CONFIG_DIRS=/etc/xdg
  54. XDG_CURRENT_DESKTOP=XFCE
  55. XDG_DATA_DIRS=/usr/share/xfce4:/usr/local/share/:/usr/share/:/usr/share
  56. XDG_GREETER_DATA_DIR=/var/lib/lightdm/data/<user>
  57. XDG_MENU_PREFIX=xfce-
  58. XDG_RUNTIME_DIR=/run/user/1000
  59. XDG_SEAT=seat0
  60. XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
  61. XDG_SESSION_CLASS=user
  62. XDG_SESSION_DESKTOP=lightdm-xsession
  63. XDG_SESSION_ID=5
  64. XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session1
  65. XDG_SESSION_TYPE=x11
  66. XDG_VTNR=7
  67.  
Online now: No Back to the top

Post

Posted
Rating:
#9
Enthusiast
AndyGable is in the usergroup ‘Enthusiast’
 I just noticed I do not have qt5 installed on the 64bit machine and I can not find a way to install it

does anyone know how I can install qt5?
Online now: No Back to the top

Post

Posted
Rating:
#10
Guru
BruceSteers is in the usergroup ‘Guru’

AndyGable said

I just noticed I do not have qt5 installed on the 64bit machine and I can not find a way to install it

does anyone know how I can install qt5?

it should be in the same repository

actually is "should" be installed.

maybe

sudo apt install libqt5core5a

or load synaptic package manager and search for qt5 stuff
Online now: No Back to the top

Post

Posted
Rating:
#11
Avatar
Guru
cogier is in the usergroup ‘Guru’
This code might help.

Code (gambas)

  1. Public Sub Form_KeyPress()
  2.  
  3.   Select Case Key.Text
  4.     Case "a" ''lower case A
  5.       frmbackground.Workspace1.CloseAll
  6.       frmbackground.Workspace1.Add(FrmSignOn, 0)
  7.  
  8.     Case "c" ''lower case C
  9.       frmPriceCheck_1.labCallingForm.Text = "frmSignedOff"
  10.       frmbackground.Workspace1.CloseAll
  11.       frmbackground.Workspace1.Add(frmPriceCheck_1, 0)
  12.  
  13.     Case "e" ''lower case E
  14.       frmbackground.Workspace1.CloseAll
  15.       frmbackground.Workspace1.Add(frmSignedOffMenu, 0)
  16.  
  17.  
Online now: No Back to the top

Post

Posted
Rating:
#12
Enthusiast
AndyGable is in the usergroup ‘Enthusiast’
 That's great bud how can I capture the differnt keyboard layout?

Some of them I can program to a,b,c etc but others are like shift F1 etc

That was why I use the key.code is that what seem to be the issue?
Online now: No Back to the top

Post

Posted
Rating:
#13
Guru
BruceSteers is in the usergroup ‘Guru’
I don't think it's the issue, it's just advice on propper keyboard handling.

for example Shift+F1 should be tested like..

Code (gambas)

  1. If Key.Code = Key.F1 And If Key.Shift
  2.  
to correctly get key values you should use either a gambas key constant like Key.F1 or from the Key[] array Key["F1"]

if you load a program that tells you Key.Code you will see gtk and qt use very different values. the gambas Key class constants and Key[] array handle that okay.


or there's a Key.Shortcut trick too…

Code (gambas)

  1. If Key.Shortcut = "Shift+F1"
  2.  

But..
I think the issue is that one is using gtk and the other qt , both toolkits behave differently when it comes to things like key input behaviour.

(assuming you took my earlier advice and stopped using integer values)
a good example.
F1 key code in qt is 16777264
with gtk it's 65470

although Key["A"] is 65 for both toolkits i think you can see why the advice :)
Online now: No Back to the top

Post

Posted
Rating:
#14
Enthusiast
AndyGable is in the usergroup ‘Enthusiast’
I see what you mean but I've noticed on the 3.18.0 version no matter what version got or gtk im using no keyboard input is being handled

I've even done

Code (gambas)

  1. Public sub form1_keypress
  2. Print key.code
  3. Print key.text
  4.  

And I've put a breakpoint on the first one but the breakpoint never kicks in.
Online now: No Back to the top

Post

Posted
Rating:
#15
Guru
BruceSteers is in the usergroup ‘Guru’

AndyGable said

I see what you mean but I've noticed on the 3.18.0 version no matter what version got or gtk im using no keyboard input is being handled

I've even done

Code (gambas)

  1. Public sub form1_keypress
  2. Print key.code
  3. Print key.text
  4.  

And I've put a breakpoint on the first one but the breakpoint never kicks in.

can you send an example program that has the problem and we can test it on our systems and try to find a fix.

you might need an observer in the class that has the Form1_Keypress() sub.
Dim hObs As Observer = New Observer(Form1) As "Form1"

It's hard to guess all the possibilities without some test code you know fails on your system.
Online now: No Back to the top

Post

Posted
Rating:
#16
Enthusiast
AndyGable is in the usergroup ‘Enthusiast’

BruceSteers said

AndyGable said

I just noticed I do not have qt5 installed on the 64bit machine and I can not find a way to install it

does anyone know how I can install qt5?

it should be in the same repository

actually is "should" be installed.

maybe

sudo apt install libqt5core5a

or load synaptic package manager and search for qt5 stuff

I fixed it

I installed the QT5 that was not installed when I installed Gambas3 from the backports and now I have installed qt5 it works fine.

so does the 64bit version of Gambas not install the QT5 when it is installed?
Online now: No Back to the top

Post

Posted
Rating:
#17
Guru
BruceSteers is in the usergroup ‘Guru’
it will install gambas qt5 and gtk3 components if you have the toolkits installed,
no it does not install the toolkits for you it just uses what you have.

glad you sorted it out. (well kind of, now though you know the code only works with qt and not gtk3 so something is not right and working only by luck ;) )
Online now: No Back to the top

Post

Posted
Rating:
#18
Enthusiast
AndyGable is in the usergroup ‘Enthusiast’

BruceSteers said

it will install gambas qt5 and gtk3 components if you have the toolkits installed,
no it does not install the toolkits for you it just uses what you have.

glad you sorted it out. (well kind of, now though you know the code only works with qt and not gtk3 so something is not right and working only by luck ;) )

Could someone tell me i there is any major need to move to 3.18.0?
Online now: No Back to the top

Post

Posted
Rating:
#19
Guru
BruceSteers is in the usergroup ‘Guru’

AndyGable said

BruceSteers said

it will install gambas qt5 and gtk3 components if you have the toolkits installed,
no it does not install the toolkits for you it just uses what you have.

glad you sorted it out. (well kind of, now though you know the code only works with qt and not gtk3 so something is not right and working only by luck ;) )

Could someone tell me i there is any major need to move to 3.18.0?

keeping up to date.
and from 3.15 i'd say yes. there's been many updates since then.
any bug fixes like for what you may have found here will only happen on the latest versions

to be horribly blunt you have to consider that gambas itself runs fine on both qt and gtk so there is probably a more correct way to get your Form_Keypress event (only Benoit i think truly understands how it all works best) and it's just a chance that qt does it your way.

Or possibly it's due to a bug that's now been fixed (the bug letting your code work but was not supposed to).

it'd be interesting to have a small test app you know has this glitch then i could find out what the problem is.
Online now: No Back to the top

Post

Posted
Rating:
#20
Guru
BruceSteers is in the usergroup ‘Guru’
3.18.90 (dev branch) is where the real magic happens  ;)
Online now: No Back to the top

Post

Posted
Rating:
#21
Enthusiast
AndyGable is in the usergroup ‘Enthusiast’

BruceSteers said

AndyGable said

BruceSteers said

it will install gambas qt5 and gtk3 components if you have the toolkits installed,
no it does not install the toolkits for you it just uses what you have.

glad you sorted it out. (well kind of, now though you know the code only works with qt and not gtk3 so something is not right and working only by luck ;) )


Could someone tell me i there is any major need to move to 3.18.0?

keeping up to date.
and from 3.15 i'd say yes. there's been many updates since then.
any bug fixes like for what you may have found here will only happen on the latest versions

to be horribly blunt you have to consider that gambas itself runs fine on both qt and gtk so there is probably a more correct way to get your Form_Keypress event (only Benoit i think truly understands how it all works best) and it's just a chance that qt does it your way.

Or possibly it's due to a bug that's now been fixed (the bug letting your code work but was not supposed to).

it'd be interesting to have a small test app you know has this glitch then i could find out what the problem is.

That's the thing if I create an app from scratch it works fine in both gtk and qt but if I migrate over one of my 3.15.2 apps and recompile all it still does not work.
Online now: No Back to the top
1 guest and 0 members have just viewed this.