[Implemented] #PB_EventType_Right/LeftButtonDown

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Hurga
Enthusiast
Enthusiast
Posts: 148
Joined: Thu Jul 17, 2003 2:53 pm
Contact:

[Implemented] #PB_EventType_Right/LeftButtonDown

Post by Hurga »

I would like to have these two Events to check is the Left or Right Mousebutton is pushed.


Thx
Tranquil
Addict
Addict
Posts: 952
Joined: Mon Apr 28, 2003 2:22 pm
Location: Europe

Post 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.
Tranquil
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

*cough*

Code: Select all

Debug #PB_EventType_LeftClick
Debug #PB_EventType_RightClick
oh... and have a nice day.
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Post by Fluid Byte »

RTFM?
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
Tranquil
Addict
Addict
Posts: 952
Joined: Mon Apr 28, 2003 2:22 pm
Location: Europe

Post 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.
Tranquil
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

Hurga wrote he wanted EventType-Constants... :roll:
oh... and have a nice day.
Tranquil
Addict
Addict
Posts: 952
Joined: Mon Apr 28, 2003 2:22 pm
Location: Europe

Post 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....
Tranquil
User avatar
pdwyer
Addict
Addict
Posts: 2813
Joined: Tue May 08, 2007 1:27 pm
Location: Chiba, Japan

Post 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
Paul Dwyer

“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
Hurga
Enthusiast
Enthusiast
Posts: 148
Joined: Thu Jul 17, 2003 2:53 pm
Contact:

Post 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
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post 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...
oh... and have a nice day.
Hurga
Enthusiast
Enthusiast
Posts: 148
Joined: Thu Jul 17, 2003 2:53 pm
Contact:

Post 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)
Niffo
Enthusiast
Enthusiast
Posts: 504
Joined: Tue Jan 31, 2006 9:43 am
Location: France

Post by Niffo »

+1
At least, "#PB_EventType_RightClick" on a Button(Image)Gadget is essential (IE to open a context-menu ...)
Niffo
Post Reply