Erick Muis
|
Re: event handling and cursor manipulation in fullscreen direct mode
|
Erick Muis
11/30/2009 1:32 PM
post42878
|
Re: event handling and cursor manipulation in fullscreen direct mode
Hi Nick,
Are you trying to hide the cursor? If so this code should do it for you:
int CursorOnOff( PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t *cbinfo ) //Toggle (int state)
{
FILE *fp;
char buffer[20];
PhRegion_t region;
int rid;
static int state = 0;
widget = widget, apinfo = apinfo, cbinfo = cbinfo;
PhAttach (NULL, NULL); //find pointer region
fp = popen( "phin -h -Pdevi-hirun -f r", "r" );
if (fgets (buffer, 20, fp))
{
rid = atoi (buffer);
PhRegionQuery (rid, ®ion, NULL, NULL, 0);
/* Toggle Cursor */
state ? (region.flags |= Ph_PTR_REGION) : (region.flags &= ~Ph_PTR_REGION);
PhRegionChange(Ph_REGION_FLAGS, 0, ®ion, NULL, NULL );
state = 1 - state;
}
return (Pt_CONTINUE);
}
Getting the event from the mouse should be a region setup to capture mouse events. See the attached example.
Best regards,
Erick
> Hello colleagues!
> I have created an application with direct mode (PdCreateDirectContext),
> because I have to draw animation and work in fullscreen mode. But I can't
> control cursor now. I want to switch it off, or to get event from mouse. How I
> can do it?
> Thanks in advance!
|
|
|