GLBasic forum

Main forum => Bug Reports => Topic started by: msx on 2016-Jul-03

Title: Tablet with Windows 10 y mousewait
Post by: msx on 2016-Jul-03
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.

Title: Re: Tablet with Windows 10 y mousewait
Post by: spacefractal on 2016-Jul-04
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.
Title: Re: Tablet with Windows 10 y mousewait
Post by: msx on 2016-Jul-04
MouseState also fails but unfortunately I could not find out under what conditions this happens
Title: Re: Tablet with Windows 10 y mousewait
Post by: spacefractal on 2016-Jul-04
Do Have newest updated glbasic v14. I'm remember it's was a issue there.
Title: Re: Tablet with Windows 10 y mousewait
Post by: Ian Price on 2016-Jul-04
GLB v12.xxx had problems with the mouse. V14 fixed the issues. So as SpaceFractal said, update to v14.
Title: Re: Tablet with Windows 10 y mousewait
Post by: msx on 2016-Jul-04
all tests are performed in GLB v14
Title: Re: Tablet with Windows 10 y mousewait
Post by: msx on 2016-Jul-04
I have found the point where the system freezes. It happens when I use this code:

Code (glbasic) Select
WHILE b1
MOUSESTATE mx,my,b1,b2
WEND


On android works properly.
Title: Re: Tablet with Windows 10 y mousewait
Post by: Ian Price on 2016-Jul-04
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

Code (glbasic) Select

WHILE TRUE

MOUSESTATE mx,my,b1,b2

IF b1 ....

SHOWSCREEN

WEND
Title: Re: Tablet with Windows 10 y mousewait
Post by: bigsofty on 2016-Jul-04
Also it's nice to give OS background services some time to think in some circumstances by using the SLEEP command.
Title: Re: Tablet with Windows 10 y mousewait
Post by: msx on 2016-Jul-04
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
Code (glbasic) Select

DEBUG b1


and I see that never changes state.
Title: Re: Tablet with Windows 10 y mousewait
Post by: Ian Price on 2016-Jul-04
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.
Title: Re: Tablet with Windows 10 y mousewait
Post by: msx on 2016-Jul-04
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

Code (glbasic) Select
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
Title: Re: Tablet with Windows 10 y mousewait
Post by: msx on 2016-Jul-04
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.