Hi,
GETMOUSECOUNT returns 32 on Win8 and Win10. When I run my exe with Win7 compatibility mode, it returns 1.
It slows down my program a lot when I check if all mouse buttons are released.
In some circumstances MOUSESTATE returns that mouse button 2 is always TRUE. It happens in a very big code, but in a small FUNCTION:
FUNCTION No_Click:
LOCAL mx,my,mb1,mb2
FOR i=0 TO GETMOUSECOUNT()-1
SETACTIVEMOUSE i
REPEAT
MOUSESTATE mx,my,mb1,mb2
UNTIL mb1=FALSE AND mb2=FALSE
NEXT
SETACTIVEMOUSE 0
ENDFUNCTION
The REPEAT loop never ends.
Are these bugs, or deliberate changes in OS?
GLBasic Precompiler V.14.721
GLBasic IDE, Version: 15.089
Thank you,
Adaz
More information:
My app does not work even on Android, the command returns false positive reply on that platform as well.
Strange, but if I start the IDE with Win7 compatibility mode, the compiled executables work on both platform. But this is obviously not a resolution.
Hey, some time ago I posted topic about similar (or same) issue with mouse functions, take a look: https://www.glbasic.com/forum/index.php?topic=10855 (https://www.glbasic.com/forum/index.php?topic=10855)
Generally I had problems on Win8.1 but Android was working ok. For workaround as my apps didn't require multi-mouse input on pc I just forced them to use standard single mouse input only.
Wasn't sure but now as you confirmed it, that really looks like a bug.
btw. your function isn't perfect, better to use something like this:
FUNCTION No_Click:
LOCAL i%,mx%,my%,mb1%,mb2%,mc% = GETMOUSECOUNT() - 1, clicks%
REPEAT
clicks% = 0
FOR i=0 TO mc
SETACTIVEMOUSE i
MOUSESTATE mx,my,mb1,mb2
IF (mb1 or mb2) THEN INC clicks%
NEXT
UNTIL clicks% = 0
SETACTIVEMOUSE 0
ENDFUNCTION
GETMOUSECOUNT can report much more than its is in system. so to opmize the code, only perform that number of touches your game required and then break out of the loop.
That's OK, but under Windows 10 the MOUSESTATE of the buttons are still wrong sometimes. There IS a bug, so these commands has to be tested on Windows 10 a lot more times.
im have not have the issue here. just dont use more number of mouse you can use. on Windows, most player use keyboard and joypad, if its that such a game.
I usually add a BREAK out of the FOR loop if the count (i) goes above the number of touches I want.
IF i>4 then BREAK
Quote from: MrPlow on 2018-Mar-14
I usually add a BREAK out of the FOR loop if the count (i) goes above the number of touches I want.
IF i>4 then BREAK
Then why don't use user FOR i=0 to 4? :-D
Its in case the there is no Mousecount to analyse...
It only BREAKs within a valid mousecount count.
I was not sure if 'SETMOUSECOUNT i' would fail or raise error if there were no mouse touches.
I have also used ...
mcount% = GETMOUSECOUNT()-1
if mcount>4 then mcount = 4
FOR i = 0 TO mcount
...
NEXT
I'm my self only checks max to touches. I'm did not require more than that. Rest is just skipped.