[Implemented] window mouse button command or event

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

[Implemented] window mouse button command or event

Post by BackupUser »

Restored from previous forum. Originally posted by BalrogSoft.


Hi...

Fred: i think that it could be a great command to add a WindowMouseButton, because exists WindowMouseX and WindowMouseY, i think that is logic to add this command, or at least add a mouse button event in WindowEvent(), i need for some projects, and probably it could help to other coders...

Bye... Balrog Soft.


Balrog Soft
Amiga and PC Coder
http://www.balrogsoftware.com
[url]mailto:balrog@balrogsoftware.com[/url]
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Danilo.

Yes, this should be included in PurebBasic
with PB-Constants (for all Platforms).

In the meanwhile you can use the following for Windows:

Code: Select all

hWnd = OpenWindow(1,10,10,300,300,#PB_Window_SystemMenu,"")
 
Repeat
   Select WaitWindowEvent()
      Case #WM_RButtonDown  : A$ = "Right Mouse Button pressed"
      Case #WM_RButtonUp    : A$ = "Right Mouse Button released"
      
      Case #WM_LButtonDown  : A$ = "Left Mouse Button pressed"
      Case #WM_LButtonUp    : A$ = "Left Mouse Button released"
      
      Case #WM_MOUSEMOVE    : A$ = "Mouse has moved"
      
      Case #PB_EventCloseWindow: End
   EndSelect
   SetWindowText_(hWnd, A$):
ForEver
cya,
...Danilo

(registered PureBasic user)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Franco.

Are there WM constants for the wheel and the middle button :)

Have a nice day...
Franco

Sometimes you have to go a lonely way to accomplish genius things.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by blueb.

Franco:
These are the standard API mouse messages.

WM_CAPTURECHANGED
WM_LBUTTONDBLCLK
WM_LBUTTONDOWN
WM_LBUTTONUP
WM_MBUTTONDBLCLK
WM_MBUTTONDOWN
WM_MBUTTONUP
WM_MOUSEACTIVATE
WM_MOUSEMOVE
WM_MOUSEWHEEL
WM_NCHITTEST
WM_NCLBUTTONDBLCLK
WM_NCLBUTTONDOWN
WM_NCLBUTTONUP
WM_NCMBUTTONDBLCLK
WM_NCMBUTTONDOWN
WM_NCMBUTTONUP
WM_NCMOUSEMOVE
WM_NCRBUTTONDBLCLK
WM_NCRBUTTONDOWN
WM_NCRBUTTONUP
WM_RBUTTONDBLCLK
WM_RBUTTONDOWN
WM_RBUTTONUP

--Bob
Post Reply