Event decoding

Just starting out? Need help? Post your questions and find answers here.
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Event decoding

Post by Tenaja »

How do you decode an event? I have this in my

Code: Select all

 Case #PB_Event_Gadget
		Select EventGadget()
			Default
				Debug "Default Event " + Str(EventType())
The code I am getting is 512. How do I figure out what it is?

I am getting the code when I right-click on a Scintilla gadget that does not have the focus, but this test does not show a 512:

Code: Select all

Debug  #PB_EventType_LeftClick       ; Left mouse button click
Debug  #PB_EventType_RightClick      ; right mouse button click
Debug  #PB_EventType_LeftDoubleClick ; Left mouse button double click
Debug  #PB_EventType_RightDoubleClick; Right mouse button double click
Debug  #PB_EventType_Focus           ; Get the focus.
Debug  #PB_EventType_LostFocus       ; Lose the focus.
Debug  #PB_EventType_Change          ; Content change.
Debug  #PB_EventType_DragStart       ; The user tries To start a Drag & Drop operation.
So, while I DO want to know what event 512 is, even more, I want to know how to reverse-lookup an event number. Clearly, I can just put a DisplayPopupMenu() in that default case, but without knowing for certain what a 512 is, I don't know what unexpected behavior may result.

Thanks!

Edit: It must have to do with focus, because it occurs with left or right clicks.
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: Event decoding

Post by Danilo »

Don't know about decoding, i would just check the windows headers if search engines
don't give a good result.
Searching google for "windows message 512" gives List Of Windows Messages - The Official Wine Wiki
as the first result, and according to the list it is:

Code: Select all

HEX     Decimal   Symbolic
0200    512       WM_MOUSEMOVE
User avatar
TI-994A
Addict
Addict
Posts: 2740
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: Event decoding

Post by TI-994A »

Great resource. Thanks for sharing that, Danilo.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
User avatar
luis
Addict
Addict
Posts: 3895
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: Event decoding

Post by luis »

EDIT: original post removed, I've updated it but the new version is too big too fit in a single post.

Anyways you can get a similar code from netmaestro here: http://www.purebasic.fr/english/viewtop ... 12&t=52180
Last edited by luis on Mon Nov 26, 2012 3:11 pm, edited 3 times in total.
"Have you tried turning it off and on again ?"
A little PureBasic review
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: Event decoding

Post by Tenaja »

That list of WM's is great, but it is the PB gadget events that mostly interest me. It turns out the 512 is a SCI message #SCEN_SETFOCUS.

Now that I have that figured out, I'm wondering if anybody knows how to get a right-click popup on the same click that sets the focus? It seems that the event handlers only get the one event, but if you have focus on another place in the program, then right-click on the SCI window hoping to bring up a popup, you don't get it. Does it require use of the gaming mouse commands?
User avatar
dobro
Enthusiast
Enthusiast
Posts: 766
Joined: Sun Oct 31, 2004 10:54 am
Location: France
Contact:

Re: Event decoding

Post by dobro »

Image
Windows 98/7/10 - PB 5.42
■ sites : http://michel.dobro.free.fr/
User avatar
TI-994A
Addict
Addict
Posts: 2740
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: Event decoding

Post by TI-994A »

Hi luis! Thanks for the PBI; even better.
À votre bon cœur, dobro.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
Post Reply