Anita Kishore (kishore++at++triavest.com)
Wed, 20 Aug 1997 10:08:25 -0700
The following works for me. But I use pf pipe window for rendering.
In the pipe window's config function, do:
// register some keypress events
Dsp = pfGetCurWSConnection();
win = pfGetPWinWSWindow(pw);
XSelectInput(Dsp, win, KeyPressMask);
In the channel draw function, do :
pfClearChan(chan);
pfDraw();
// check for any keypress events
GetXInput();
GetXInput() function has :
pfWSConnection dsp = pfGetCurWSConnection();
if (XEventsQueued(dsp, QueuedAfterFlush))
{
while (XEventsQueued(dsp, QueuedAlready))
{
XEvent event;
XNextEvent(Dsp, &event);
switch (event.type)
{
case KeyPress:
{
char buf[100];
int rv;
KeySym ks;
rv = XLookupString(&event.xkey, buf, sizeof(buf), &ks, 0);
switch(ks)
{
case XK_F1:
printf("XK_F1 pressed\n");
break;
}
}
}
}
}
This type of event checking is used in several of Pf sample programs that are
distributed.
Hope this helps.
-anita
kishore++at++triavest.com
--
Anita Kishore
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:55:45 PDT