[Sloved] Migrating from 3.15 to 3.18 Problems
Posted
#1
(In Topic #1067)
Enthusiast

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
Posted
Guru

Posted
Enthusiast

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
Posted
Guru

Posted
Enthusiast

Code (gambas)
- frmbackground.Workspace1.CloseAll
- frmbackground.Workspace1.Add(FrmSignOn, 0)
- Case Global.Key_PriceCheck
- frmPriceCheck_1.labCallingForm.Text = "frmSignedOff"
- frmbackground.Workspace1.CloseAll
- frmbackground.Workspace1.Add(frmPriceCheck_1, 0)
- Case Global.Key_UserMenu
- frmbackground.Workspace1.CloseAll
- frmbackground.Workspace1.Add(frmSignedOffMenu, 0)
The keys are defined as below
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
Posted
Guru

AndyGable said
Code (gambas)
frmbackground.Workspace1.CloseAll frmbackground.Workspace1.Add(FrmSignOn, 0) Case Global.Key_PriceCheck frmPriceCheck_1.labCallingForm.Text = "frmSignedOff" frmbackground.Workspace1.CloseAll frmbackground.Workspace1.Add(frmPriceCheck_1, 0) Case Global.Key_UserMenu frmbackground.Workspace1.CloseAll frmbackground.Workspace1.Add(frmSignedOffMenu, 0)
The keys are defined as below
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
Posted
Guru

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.
Posted
Enthusiast

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)
- Gambas=3.15.2
- OperatingSystem=Linux
- Kernel=5.10.0-23-686-pae
- Architecture=x86
- Distribution=debian 11.7
- Desktop=XFCE
- Theme=fusion
- Language=en_GB.UTF-8
- Memory=2976M
- [Libraries]
- Cairo=libcairo.so.2.11600.0
- Curl=libcurl.so.4.7.0
- DBus=libdbus-1.so.3.19.15
- GDK2=libgdk-x11-2.0.so.0.2400.33
- GDK3=libgdk-3.so.0.2404.20
- GStreamer=libgstreamer-1.0.so.0.1804.0
- GTK+2=libgtk-x11-2.0.so.0.2400.33
- GTK+3=libgtk-3.so.0.2404.20
- OpenGL=libGL.so.1.7.0
- Poppler=libpoppler.so.102.0.0
- QT5=libQt5Core.so.5.15.2
- SQLite=libsqlite3.so.0.8.6
- [Environment]
- DESKTOP_SESSION=lightdm-xsession
- DISPLAY=:0.0
- GB_GUI=gb.qt5
- GDMSESSION=lightdm-xsession
- GTK_MODULES=gail:atk-bridge
- HOME=<home>
- LANG=en_GB.UTF-8
- LANGUAGE=en_GB.UTF-8
- LC_ALL=en_GB.UTF-8
- LOGNAME=<user>
- PWD=<home>
- QT_ACCESSIBILITY=1
- SESSION_MANAGER=local/<hostname>:@/tmp/.ICE-unix/958,unix/<hostname>:/tmp/.ICE-unix/958
- SSH_AGENT_PID=1001
- SSH_AUTH_SOCK=/tmp/ssh-d0qqHzdAtzst/agent.958
- TZ=:/etc/localtime
- XAUTHORITY=<home>/.Xauthority
- XDG_CONFIG_DIRS=/etc/xdg
- XDG_CURRENT_DESKTOP=XFCE
- XDG_DATA_DIRS=/usr/share/xfce4:/usr/local/share/:/usr/share/:/usr/share
- XDG_GREETER_DATA_DIR=/var/lib/lightdm/data/<user>
- XDG_MENU_PREFIX=xfce-
- XDG_SEAT=seat0
- XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
- XDG_SESSION_CLASS=user
- XDG_SESSION_DESKTOP=lightdm-xsession
- XDG_SESSION_ID=2
- XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
- XDG_SESSION_TYPE=x11
- XDG_VTNR=7
Laptop Running Debian 11 3.18.0
Code (gambas)
- Gambas=3.18
- OperatingSystem=Linux
- Kernel=5.10.0-23-amd64
- Architecture=x86_64
- Distribution=debian 11.7
- Desktop=XFCE
- Scale=7
- Theme=xfce
- Language=en_GB.UTF-8
- Memory=1844M
- [Programs]
- gcc=gcc (Debian 10.2.1-6) 10.2.1 20210110
- [Libraries]
- Cairo=libcairo.so.2.11600.0
- Curl=libcurl.so.4.7.0
- DBus=libdbus-1.so.3.19.15
- GDK2=libgdk-x11-2.0.so.0.2400.33
- GDK3=libgdk-3.so.0.2404.20
- GStreamer=libgstreamer-1.0.so.0.1804.0
- GTK+2=libgtk-x11-2.0.so.0.2400.33
- GTK+3=libgtk-3.so.0.2404.20
- OpenGL=libGL.so.1.7.0
- Poppler=libpoppler.so.102.0.0
- RSvg=librsvg-2.so.2.47.0
- SQLite=libsqlite3.so.0.8.6
- [Environment]
- DESKTOP_SESSION=lightdm-xsession
- DISPLAY=:0.0
- GB_GUI=gb.gtk3
- GDMSESSION=lightdm-xsession
- GTK_MODULES=gail:atk-bridge
- HOME=<home>
- LANG=en_GB.UTF-8
- LANGUAGE=en_GB.UTF-8
- LC_ALL=en_GB.UTF-8
- LOGNAME=<user>
- PWD=<home>
- QT_ACCESSIBILITY=1
- SESSION_MANAGER=local/<hostname>:@/tmp/.ICE-unix/909,unix/<hostname>:/tmp/.ICE-unix/909
- SSH_AGENT_PID=952
- SSH_AUTH_SOCK=/tmp/ssh-XKWRkb92kbDg/agent.909
- TZ=:/etc/localtime
- XAUTHORITY=<home>/.Xauthority
- XDG_CONFIG_DIRS=/etc/xdg
- XDG_CURRENT_DESKTOP=XFCE
- XDG_DATA_DIRS=/usr/share/xfce4:/usr/local/share/:/usr/share/:/usr/share
- XDG_GREETER_DATA_DIR=/var/lib/lightdm/data/<user>
- XDG_MENU_PREFIX=xfce-
- XDG_SEAT=seat0
- XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
- XDG_SESSION_CLASS=user
- XDG_SESSION_DESKTOP=lightdm-xsession
- XDG_SESSION_ID=5
- XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session1
- XDG_SESSION_TYPE=x11
- XDG_VTNR=7
Posted
Enthusiast

does anyone know how I can install qt5?
Posted
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
Posted
Guru

Code (gambas)
- frmbackground.Workspace1.CloseAll
- frmbackground.Workspace1.Add(FrmSignOn, 0)
- frmPriceCheck_1.labCallingForm.Text = "frmSignedOff"
- frmbackground.Workspace1.CloseAll
- frmbackground.Workspace1.Add(frmPriceCheck_1, 0)
- frmbackground.Workspace1.CloseAll
- frmbackground.Workspace1.Add(frmSignedOffMenu, 0)
Posted
Enthusiast

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?
Posted
Guru

for example Shift+F1 should be tested like..
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…
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
Posted
Enthusiast

I've even done
And I've put a breakpoint on the first one but the breakpoint never kicks in.
Posted
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
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.
Posted
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?
Posted
Guru

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
Posted
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?
Posted
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.
Posted
Guru

Posted
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.
1 guest and 0 members have just viewed this.



