Here is how I used to handle mouse and it worked. I'm
transfering it from one program to another and its not
working for some reason. I am not sure how to trigger
a call to the event function.
struct my_mouse{
int button1;
int button2;
int x;
int y;
};
//this is global
my_mouse M;
static bool
WalkEventHandler (iEvent & ev);
//Then in initialization part:
if (!csInitializer::SetupEventHandler (object_reg,
WalkEventHandler))
{
csReport (object_reg, CS_REPORTER_SEVERITY_ERROR,
"crystalspace.application.g2dtest",
"Unable to init app!");
exit (0);
}
//Then at end
static bool
WalkEventHandler (iEvent & ev)
{
static csVector3 fake_position1,fake_position2;
//1=yes 0=no
//static int faked=0;
//if 1 then save undo cuz the things changed
static int drag=0;
if(ev.Type == csevMouseDown)
{
//printf("%d\n",ev.Mouse.Button);
if(ev.Mouse.Button==1)
M.button1=1;
if(ev.Mouse.Button==2)
M.button2=1;
}
if(ev.Type == csevMouseMove)
{
M.x=ev.Mouse.x;
M.y=ev.Mouse.y;
}
if(ev.Type == csevMouseUp)
{
//intf("%d\n",ev.Mouse.Button);
//sP1.losefocus();
if(ev.Mouse.Button==1)
M.button1=0;
if(ev.Mouse.Button==2)
M.button2=0;
drag=0;
}
}
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Crystal-main mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-main
Unsubscribe: mailto:[EMAIL PROTECTED]