Author Topic: Tablet with Windows 10 y mousewait  (Read 4550 times)

Offline msx

  • Prof. Inline
  • *****
  • Posts: 773
    • View Profile
Tablet with Windows 10 y mousewait
« 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.


Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3930
    • View Profile
    • Space Fractal
Re: Tablet with Windows 10 y mousewait
« Reply #1 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.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline msx

  • Prof. Inline
  • *****
  • Posts: 773
    • View Profile
Re: Tablet with Windows 10 y mousewait
« Reply #2 on: 2016-Jul-04 »
MouseState also fails but unfortunately I could not find out under what conditions this happens

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3930
    • View Profile
    • Space Fractal
Re: Tablet with Windows 10 y mousewait
« Reply #3 on: 2016-Jul-04 »
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 and The beagle Jam.

Offline Ian Price

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4160
  • On the shoulders of giants.
    • View Profile
    • My Apps
Re: Tablet with Windows 10 y mousewait
« Reply #4 on: 2016-Jul-04 »
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.

Offline msx

  • Prof. Inline
  • *****
  • Posts: 773
    • View Profile
Re: Tablet with Windows 10 y mousewait
« Reply #5 on: 2016-Jul-04 »
all tests are performed in GLB v14

Offline msx

  • Prof. Inline
  • *****
  • Posts: 773
    • View Profile
Re: Tablet with Windows 10 y mousewait
« Reply #6 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.

Offline Ian Price

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4160
  • On the shoulders of giants.
    • View Profile
    • My Apps
Re: Tablet with Windows 10 y mousewait
« Reply #7 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
I came. I saw. I played.

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2702
    • View Profile
Re: Tablet with Windows 10 y mousewait
« Reply #8 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.
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)

Offline msx

  • Prof. Inline
  • *****
  • Posts: 773
    • View Profile
Re: Tablet with Windows 10 y mousewait
« Reply #9 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.
« Last Edit: 2016-Jul-04 by msx »

Offline Ian Price

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4160
  • On the shoulders of giants.
    • View Profile
    • My Apps
Re: Tablet with Windows 10 y mousewait
« Reply #10 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.
I came. I saw. I played.

Offline msx

  • Prof. Inline
  • *****
  • Posts: 773
    • View Profile
Re: Tablet with Windows 10 y mousewait
« Reply #11 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
« Last Edit: 2016-Jul-04 by msx »

Offline msx

  • Prof. Inline
  • *****
  • Posts: 773
    • View Profile
Re: Tablet with Windows 10 y mousewait
« Reply #12 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.