Hi Fred,
you have created following functions for Windows and Desktop:
WindowMouseX() and WindowMouseY()
DesktopMouseX() and DesktopMouseY()
But i missing following functions for Mouseclicks:
WindowMouseButton() ; 1 for left button, 2 for right button and 3 for middle button
the same wish to DesktopMouseButton().
Can you do create this functions for Windowuser?
Regards Falko
Sorry, my english.
More Windows-Functions
Re: More Windows-Functions
Nice wishesFalko wrote:Hi Fred,
you have created following functions for Windows and Desktop:
WindowMouseX() and WindowMouseY()
DesktopMouseX() and DesktopMouseY()
But i missing following functions for Mouseclicks:
WindowMouseButton() ; 1 for left button, 2 for right button and 3 for middle button
the same wish to DesktopMouseButton().
Can you do create this functions for Windowuser?
Regards Falko
Sorry, my english.

The same for Mac users (and Linux too).
And don't forget, sometimes there is a mousewheel instead of a middle button

michel51
Mac OS X Snow Leopard (10.6.8 ) Intel
PureBasic V 5.21(x64), V 5.22beta
Mac OS X Snow Leopard (10.6.8 ) Intel
PureBasic V 5.21(x64), V 5.22beta
Re: More Windows-Functions
If i up this topic is not to force PBTeam !
i would like to put this code
I forget the name of people(s?) who make this procedure
But it will better if this procedure will be native in PB
Edit: source about this code from DarkDragon
http://www.purebasic.fr/english/viewtop ... ouseButton
i would like to put this code
I forget the name of people(s?) who make this procedure
But it will better if this procedure will be native in PB

Edit: source about this code from DarkDragon
http://www.purebasic.fr/english/viewtop ... ouseButton
Code: Select all
Procedure WindowMouseButton(Wnd, ButtonNr)
CompilerIf #PB_Compiler_OS = #PB_OS_Linux
;Linux Version
Protected gdkWnd.l, x.l, y.l, mask.l
If Wnd
*Window.GTKWindow = Wnd
gdkWnd = *Window\bin\child\window
gdk_window_get_pointer_(gdkWnd, @x, @y, @mask)
Select ButtonNr
Case 0
If (mask & #GDK_BUTTON1_MASK)
ProcedureReturn 1
EndIf
Case 1
If (mask & #GDK_BUTTON3_MASK)
ProcedureReturn 1
EndIf
Case 2
If (mask & #GDK_BUTTON2_MASK)
ProcedureReturn 1
EndIf
EndSelect
EndIf
CompilerElse
;Windows Version
If Wnd And GetForegroundWindow_() = Wnd
Select ButtonNr
Case 0
If GetAsyncKeyState_(#VK_LBUTTON) > 0
ProcedureReturn 1
EndIf
Case 1
If GetAsyncKeyState_(#VK_RBUTTON) > 0
ProcedureReturn 1
EndIf
Case 2
If GetAsyncKeyState_(#VK_MBUTTON) > 0
ProcedureReturn 1
EndIf
EndSelect
EndIf
CompilerEndIf
ProcedureReturn 0
EndProcedure