Gamestudio Links
Zorro Links
Newest Posts
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
M1 Oversampling
by 11honza11. 04/20/24 20:57
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (Quad), 454 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Mouse handling at buttons #447600
12/21/14 13:09
12/21/14 13:09
Joined: Sep 2009
Posts: 993
Budapest
Aku_Aku Offline OP
User
Aku_Aku  Offline OP
User

Joined: Sep 2009
Posts: 993
Budapest
From the atypes.h
Code:
#define EVENT_CLICKUP		14	// left click over down toggle
#define EVENT_BUTTONUP		15	// mouse button released over entity
#define EVENT_TOUCH		16	// mouse pointer moves over entity
#define EVENT_RELEASE		17	// mouse pointer leaves entity
#define EVENT_CLICK		18	// left click over entity
#define EVENT_RIGHTCLICK 	19	// right click over entity


I wrote a little code that tries to detect what happened...
It is a panel with one button on it.
Code:
function btn_mouse() {
	printf("btn_mouse event_type %d",(long)event_type);
	if (event_type == EVENT_CLICK) {
		printf("btn_mouse EVENT_CLICK");
	}
	if (event_type == EVENT_RIGHTCLICK) {
		printf("btn_mouse EVENT_RIGHTCLICK");
	}
	if (event_type == EVENT_TOUCH) {
		printf("btn_mouse EVENT_TOUCH");
	}
	if (event_type == EVENT_RELEASE) {
		printf("btn_mouse EVENT_RELEASE");
	}
	if (event_type == EVENT_CLICKUP) {
		printf("btn_mouse EVENT_CLICKUP");
	}
	if (event_type == EVENT_BUTTONUP) {
		printf("btn_mouse EVENT_BUTTONUP");
	}


I was surprised when my code showed only two event types EVENT_RELEASE and EVENT_BUTTONUP.
What did i do wrong or what did i miss?
My system is A7 with latest patch.

Last edited by Aku_Aku; 12/21/14 13:11. Reason: Extend with the description of the situation
Re: Mouse handling at buttons [Re: Aku_Aku] #447725
12/31/14 08:08
12/31/14 08:08
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
Have you set enable_mouse to 2?

Re: Mouse handling at buttons [Re: jcl] #447726
12/31/14 11:35
12/31/14 11:35
Joined: Sep 2009
Posts: 993
Budapest
Aku_Aku Offline OP
User
Aku_Aku  Offline OP
User

Joined: Sep 2009
Posts: 993
Budapest
No, i didn't.

I used this statement:
mouse_mode = 4;
I thought it is good for testing this behaviour.
Let me know if i am wrong.

Re: Mouse handling at buttons [Re: jcl] #447768
01/03/15 17:52
01/03/15 17:52
Joined: Sep 2009
Posts: 993
Budapest
Aku_Aku Offline OP
User
Aku_Aku  Offline OP
User

Joined: Sep 2009
Posts: 993
Budapest
Well i gave a try to the enable_mouse = 2 setting.
Nothing was changed.
Do you have another suggestion?
Thanks in advance...

Re: Mouse handling at buttons [Re: Aku_Aku] #447797
01/06/15 11:46
01/06/15 11:46
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
Hmm, it works here with the code from the manual. Have you set the panel event? Note it's not the button, it's the panel that reacts on the mouse click and sets the event type.

Re: Mouse handling at buttons [Re: jcl] #447825
01/07/15 19:27
01/07/15 19:27
Joined: Sep 2009
Posts: 993
Budapest
Aku_Aku Offline OP
User
Aku_Aku  Offline OP
User

Joined: Sep 2009
Posts: 993
Budapest
Maybe i wasn't clear enough.
My code checks the events attached to a button.
So i don't think, i should set any panel event.
Does it change something?

Re: Mouse handling at buttons [Re: Aku_Aku] #447908
01/12/15 15:29
01/12/15 15:29
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
Yes! I thought you meant a panel mouse event.

The buttons have different actions according to the button() definition, I don't know if they use the event type at all.

Re: Mouse handling at buttons [Re: jcl] #452117
06/02/15 17:55
06/02/15 17:55
Joined: Sep 2003
Posts: 9,859
F
FBL Offline
Senior Expert
FBL  Offline
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
It would be nice if they did... and if they also reacted on rightclick...


Moderated by  old_bill, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1