I have problems with my Lenovo Helix and GLBasic. When I use the MouseWait command, the system is frozen. I suspect that it may be because Windows does not take into account the multitouch.
use MOUSESTATE instead. Im have newer used MOUSESTATE. Yes its can been a issue here, and you do might require to update your v14 glbasic.
MouseState also fails but unfortunately I could not find out under what conditions this happens
Do Have newest updated glbasic v14. I'm remember it's was a issue there.
GLB v12.xxx had problems with the mouse. V14 fixed the issues. So as SpaceFractal said, update to v14.
all tests are performed in GLB v14
I have found the point where the system freezes. It happens when I use this code:
WHILE b1
MOUSESTATE mx,my,b1,b2
WEND
On android works properly.
I doubt that would work for long on any machine - there's no SHOWSCREEN there and you are constantly waiting for a mouse button press...
Try
WHILE TRUE
MOUSESTATE mx,my,b1,b2
IF b1 ....
SHOWSCREEN
WEND
Also it's nice to give OS background services some time to think in some circumstances by using the SLEEP command.
I explain.
The application has several buttons on the screen. When you press, you jump to a function and makes a number of operations. Then it is when waiting inside that WHILE loop until the button is released and then continue normally.
I have tested that occurs in the WHILE loop introducing the line
DEBUG b1
and I see that never changes state.
But it won't ever continue as normal in the manner that you've posted. The WHILE/WEND will continue to loop and hang.
Either you've got much more code (and a SHOWSCREEN) or you're barking up the wrong tree.
Right, Ian. Once out of the while loop, continues the code and find a SHOWSCREEN.
The strangest thing is that DEBUG b1 inside the loop, shows that b1 never changes state, whether or not there showscreen.
Add the function to be better understood
FUNCTION Sonido_ONOFF:
LOCAL mx,my,b1,b2
MOUSESTATE mx,my,b1,b2
WHILE b1
MOUSESTATE mx,my,b1,b2
WEND
Config[0][7]=bXOR(Config[0][7],1) // 7 Sin sonido
Graba_INI()
LOADSPRITE "Media/sonido"+Config[0][7]+".png",sprite.sonido
RETURN
ENDFUNCTION
Perfect Ian, I think I understand you. Indeed introduced in the Loop one SHOWSCREEN working properly. But I do not understand why this is necessary, in addition MouseWait not work and here you can not use SHOWSCREEN by what appears to be a bug.