Page 1 of 1

[Implemented] #PB_EventType_Right/LeftButtonDown

Posted: Mon Apr 20, 2009 10:38 am
by Hurga
I would like to have these two Events to check is the Left or Right Mousebutton is pushed.


Thx

Posted: Mon Apr 20, 2009 6:27 pm
by Tranquil
You can use #WM_LBUTTONDOWN for example on a windows system as long as there is no event definied in PB for that.

Posted: Mon Apr 20, 2009 7:10 pm
by Kaeru Gaman
*cough*

Code: Select all

Debug #PB_EventType_LeftClick
Debug #PB_EventType_RightClick

Posted: Mon Apr 20, 2009 7:18 pm
by Fluid Byte
RTFM?

Posted: Mon Apr 20, 2009 7:55 pm
by Tranquil
These events are only send on some desired Gadgets, they are not an WindowEvent().

Hurga might want to catch these events by clicking inside the windows and not an gadget.

Posted: Mon Apr 20, 2009 9:42 pm
by Kaeru Gaman
Hurga wrote he wanted EventType-Constants... :roll:

Posted: Tue Apr 21, 2009 5:09 am
by Tranquil
Of course he did. But as this makes no sense I believe he wants normal windows events. Maybe he can clarify this a bit up....

Posted: Tue Apr 21, 2009 7:48 am
by pdwyer
+1

Assuming I'm understanding the request.

This is for the ability to catch the mouse down event isn't it? (not click, which is mouse up)

I think when I needed to do this Sparkie got me some API code to show me how to do it. Linked below in case it helps.

http://www.purebasic.fr/english/viewtop ... ight=mouse

Apologies if I'm off topic

Posted: Tue Apr 21, 2009 4:50 pm
by Hurga
Hello Guys
I´m a little bit surprised about this amount of reactions. 8)

So lets see what we have...
*cough*
Code:
Debug #PB_EventType_LeftClick
Debug #PB_EventType_RightClick
*cough* *cough*

"Click" and "Button Down" is a bit differetn, isnt it
Cmon Kaeru, Do you think Im that stupid? Arghh, that hurts me deep in my heart :wink:


@Fluid Byte - Can you be a bit more specific? I didnt found anything in the PB-help...


@pdwyer - nop, your just right..


My request is: two new Events which will be returnd by Eventtype() to check if the left or right mouse is pressed (but not released yet).

WinAPI is ok, but I think it will be better, if it is supported on all Platforms.

@Tranquil: Why doesnt it make sense? If some (or all) gadgets return this Event, and maybe also the window itself, it would open some new possibilities i think

Posted: Tue Apr 21, 2009 5:42 pm
by Kaeru Gaman
Hurga wrote:"Click" and "Button Down" is a bit differetn, isnt it
Cmon Kaeru, Do you think Im that stupid? Arghh, that hurts me deep in my heart :wink:
I'm not talking about stupidity... yet

I don't think "Hold my Button" is an Event.

there are DRAG events, wich mean movements with button down.
but they are handled as DragStart and Drop, no continous hold,
and they are no EventTypes, what was literally your request:
(ok, DragStart is an EventType)
#PB_EventType_LeftButtonDown and #PB_EventType_Rightbut...
surely you could check for holding a mousebutton down, but this is an active check like GetAsyncKeystate,
not passively waiting for some event to happen...

Posted: Tue Apr 21, 2009 8:06 pm
by Hurga
Did you see the " :wink: " i was not serios...

Hm, I dont think about an drag event.

I think I got it with that, that Button down is not an event...
Maybe this would cause problems if it will be an event.

So lets say an other way to natively ask the buttonstatus in a window.

Maybe this is the a more proper way

(But maybe this Eventtype thing could be nice, anyway)

Posted: Wed Aug 12, 2009 1:16 pm
by Niffo
+1
At least, "#PB_EventType_RightClick" on a Button(Image)Gadget is essential (IE to open a context-menu ...)