Page 1 of 1

ExamineMouse lag resets Mousebutton

Posted: Sun Oct 31, 2010 11:13 pm
by #NULL

Code: Select all

InitSprite()
InitMouse()
ww=800
wh=600
style | #PB_Window_ScreenCentered
style | #PB_Window_SystemMenu
style | #PB_Window_MinimizeGadget
hWin=OpenWindow(0, 50,100,ww,wh, "",style) :: AddKeyboardShortcut(0,#PB_Shortcut_Escape,10)
OpenWindowedScreen( hWin, 0,0,ww,wh, 0,0,0)

ExamineMouse()

Repeat
  Debug "-----------"
  Debug "examinemouse: "+Str(ExamineMouse())
  Debug "mb: "+Str(MouseButton(1))
  Debug "gaks"+Str(GetAsyncKeyState_(#VK_LBUTTON))
  event=WaitWindowEvent(30)
  em=EventMenu()
  Select event
    Case #PB_Event_CloseWindow
      quit=1
    Case #PB_Event_Menu
      Select em
      Case 10
        quit=1
      EndSelect
  EndSelect
  StartDrawing(ScreenOutput())
    Box(MouseX(),MouseY(),3,3,$ffffff)
  StopDrawing()
  FlipBuffers()
  Delay(150)
  ClearScreen($333333)
Until quit
if i press and hold left mousse button and move the mouse quickly, ExamineMouse() will return zero sometimes, which is not a big deal, but MouseButton() returns zero from then on even if i did not release the button.
using PB451 32bit, WinXP SP2
can somebody confirm this?

Re: ExamineMouse lag resets Mousebutton

Posted: Sun Oct 31, 2010 11:40 pm
by STARGÅTE
why you have in yout code Delay(150) ?

without Delay(150) it runs normal ...

with Delay(150) i have ExamineMouse() = 0 , too

Re: ExamineMouse lag resets Mousebutton

Posted: Mon Nov 01, 2010 11:56 am
by DarkDragon
STARGÅTE wrote:why you have in yout code Delay(150) ?

without Delay(150) it runs normal ...

with Delay(150) i have ExamineMouse() = 0 , too
:lol: Because it simulates the "lag":
ExamineMouse lag resets Mousebutton
Please read the topic title.

Confirmed on Windows XP Home SP3 (German, x86).
Post it in the bug section.

Re: ExamineMouse lag resets Mousebutton

Posted: Mon Nov 01, 2010 3:26 pm
by #NULL
yes, the delay is on purpose.

@stårgate
did you realize that when dune2077 lagged due to too many units, it was sometimes impossible to draw the selection recangle with the mouse? now you know why :lol: and that's exactly what occured to me with a game of mine too.

maybe someone could move it to the bugs section.