ExamineMouse lag resets Mousebutton

Everything else that doesn't fall into one of the other PB categories.
#NULL
Addict
Addict
Posts: 1504
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

ExamineMouse lag resets Mousebutton

Post 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?
User avatar
STARGÅTE
Addict
Addict
Posts: 2315
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: ExamineMouse lag resets Mousebutton

Post 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
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
DarkDragon
Addict
Addict
Posts: 2348
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Re: ExamineMouse lag resets Mousebutton

Post 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.
bye,
Daniel
#NULL
Addict
Addict
Posts: 1504
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: ExamineMouse lag resets Mousebutton

Post 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.
Post Reply