Which command is the window version of the MouseButton() ?

Just starting out? Need help? Post your questions and find answers here.
User avatar
Primoz128
Enthusiast
Enthusiast
Posts: 212
Joined: Sat Sep 10, 2011 8:25 pm
Location: Slovenia

Which command is the window version of the MouseButton() ?

Post by Primoz128 »

What title says...
rrpl
Enthusiast
Enthusiast
Posts: 121
Joined: Fri Apr 18, 2008 7:22 am
Location: Australia

Re: Which command is the window version of the MouseButton()

Post by rrpl »

Do you mean for monitoring the mouse button in an window event loop?

Case #WM_LBUTTONDOWN :MessageRequester("Test Left Click","")
Case #WM_RBUTTONDOWN :MessageRequester("Test Right Click","")
Case #WM_MBUTTONDOWN :MessageRequester("Test Middle Click","")
"What you are is what you have been. What you’ll be is what you do now.” -Buddha
User avatar
Primoz128
Enthusiast
Enthusiast
Posts: 212
Joined: Sat Sep 10, 2011 8:25 pm
Location: Slovenia

Re: Which command is the window version of the MouseButton()

Post by Primoz128 »

So your saying that window works on events ?
User avatar
Bisonte
Addict
Addict
Posts: 1313
Joined: Tue Oct 09, 2007 2:15 am

Re: Which command is the window version of the MouseButton()

Post by Bisonte »

The question is.... What do you want exactly ??
PureBasic 6.21 (Windows x64) | Windows 11 Pro | AsRock B850 Steel Legend Wifi | R7 9800x3D | 64GB RAM | RTX 5080 | ThermaltakeView 270 TG ARGB | build by vannicom​​
English is not my native language... (I often use DeepL.)
rrpl
Enthusiast
Enthusiast
Posts: 121
Joined: Fri Apr 18, 2008 7:22 am
Location: Australia

Re: Which command is the window version of the MouseButton()

Post by rrpl »

Bisonte wrote:The question is.... What do you want exactly ??
Yeah what he said!

An example of what I said;

Code: Select all

Procedure.s MouseLoc() ; a procedure to get mouse location in window
  Protected.s LocText
  x = WindowMouseX(0) 
  y = WindowMouseY(0) 
  LocText = "Mouse Located at X="+Str(x)+" Y="+Str(y)
  ProcedureReturn LocText
EndProcedure

OpenWindow(0,0,0,550,350,"Basic Window Eventloop",#PB_Window_MinimizeGadget|#PB_Window_ScreenCentered)

Repeat
  Select WaitWindowEvent():
    Case #PB_Event_CloseWindow
      End
    Case #WM_LBUTTONDOWN :MessageRequester("Test Left Click",MouseLoc())
    Case #WM_RBUTTONDOWN :MessageRequester("Test Right Click",MouseLoc())
    Case #WM_MBUTTONDOWN :MessageRequester("Test Middle Click",MouseLoc())
  EndSelect
ForEver
But is this what you are looking for?
Giving a example of the code you are trying to create will help people to know what you are looking for.
"What you are is what you have been. What you’ll be is what you do now.” -Buddha
User avatar
Primoz128
Enthusiast
Enthusiast
Posts: 212
Joined: Sat Sep 10, 2011 8:25 pm
Location: Slovenia

Re: Which command is the window version of the MouseButton()

Post by Primoz128 »

If i wanted more help, i would have said that.
User avatar
Demivec
Addict
Addict
Posts: 4270
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: Which command is the window version of the MouseButton()

Post by Demivec »

Primoz128 wrote:What title says...
EventType()
User avatar
luis
Addict
Addict
Posts: 3895
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: Which command is the window version of the MouseButton()

Post by luis »

Primoz128 wrote:If i wanted more help, i would have said that.
Priceless.

Oh what a day today.
"Have you tried turning it off and on again ?"
Post Reply