Tablet with Windows 10 y mousewait

Previous topic - Next topic

msx

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.


spacefractal

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.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

msx

MouseState also fails but unfortunately I could not find out under what conditions this happens

spacefractal

Do Have newest updated glbasic v14. I'm remember it's was a issue there.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

Ian Price

GLB v12.xxx had problems with the mouse. V14 fixed the issues. So as SpaceFractal said, update to v14.
I came. I saw. I played.

msx

all tests are performed in GLB v14

msx

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.

Ian Price

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
I came. I saw. I played.

bigsofty

Also it's nice to give OS background services some time to think in some circumstances by using the SLEEP command.
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

msx

#9
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.

Ian Price

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.
I came. I saw. I played.

msx

#11
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

msx

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.