Restored from previous forum. Originally posted by BalrogSoft.
Hi...
Im writting a 3d editor for my 3d engine, and i need a command to read the mouse button on a window, but mouse library is only for screens, and EventType() command is only for gadgets, why not a WindowMouseButton, to know if the mouse button is pushed on a window, without gadgets and windowed screens.
Bye Balrog Soft
Balrog Soft
Amiga and PC Coder
http://www.balrogsoftware.com
[url]mailto:balrog@balrogsoftware.com[/url]
Why not a windowmousebutton command?
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by BalrogSoft.
Balrog Soft
Amiga and PC Coder
http://www.balrogsoftware.com
[url]mailto:balrog@balrogsoftware.com[/url]
Mousebutton is for screens, and not windows, for this reason exists WindowMouseX() and WindowMouseY(), but not WindowMouseButton()....mousebutton() from mouse libary isnt work for your project ?
Christos
Balrog Soft
Amiga and PC Coder
http://www.balrogsoftware.com
[url]mailto:balrog@balrogsoftware.com[/url]
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Pupil.
Why not try the win constants #WM_LBUTTONDOWN, #WM_LBUTTONUP, #WM_RBUTTONDOWN, #WM_RBUTTONUP in your event-loop, i think this would work...Mousebutton is for screens, and not windows, for this reason exists WindowMouseX() and WindowMouseY(), but not WindowMouseButton()....
Code: Select all
event.l = WaitWindowEvent()
Select event
Case #WM_LBUTTONDOWN
;do something
...
EndSelect
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by BalrogSoft.
Bye, Balrog Soft.
Balrog Soft
Amiga and PC Coder
http://www.balrogsoftware.com
[url]mailto:balrog@balrogsoftware.com[/url]
I tryed all this, and dont work...Why not try the win constants #WM_LBUTTONDOWN, #WM_LBUTTONUP, #WM_RBUTTONDOWN, #WM_RBUTTONUP in your event-loop, i think this would work...Mousebutton is for screens, and not windows, for this reason exists WindowMouseX() and WindowMouseY(), but not WindowMouseButton()....Code: Select all
event.l = WaitWindowEvent() Select event Case #WM_LBUTTONDOWN ;do something ... EndSelect
Bye, Balrog Soft.
Balrog Soft
Amiga and PC Coder
http://www.balrogsoftware.com
[url]mailto:balrog@balrogsoftware.com[/url]
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by PB.
> > Why not try the win constants #WM_LBUTTONDOWN [snip]
>
> I tryed all this, and dont work...
Note: This tip is for Windows only (not Amiga/Linux). And I suspect there's a
better way to do it that perhaps you're overlooking, but without your entire
source it's too hard to tell.
At the start of your app, before its main loop:
Then, during your main loop:
Same for #VK_RBUTTON and #VK_MBUTTON.
PB - Registered PureBasic Coder
Edited by - PB on 27 July 2002 00:29:07
> > Why not try the win constants #WM_LBUTTONDOWN [snip]
>
> I tryed all this, and dont work...
Note: This tip is for Windows only (not Amiga/Linux). And I suspect there's a
better way to do it that perhaps you're overlooking, but without your entire
source it's too hard to tell.
At the start of your app, before its main loop:
Code: Select all
GetAsyncKeyState_(#VK_LBUTTON) ; To clear the LMB before use.
Code: Select all
If GetAsyncKeyState_(#VK_LBUTTON)=-32767 ; LMB clicked!
; Do whatever.
EndIf
PB - Registered PureBasic Coder
Edited by - PB on 27 July 2002 00:29:07