nanogui: Difficulty Using GrInjectKeyboardEvent()
Subject:
Difficulty Using GrInjectKeyboardEvent()
From:
"Gil Glass" ####@####.####
Date:
27 Aug 2008 14:29:57 -0000
Message-Id: <6ECE57DF49376146B91A92A3C37EFC0E0695F5D7@SJEXCH03.ds.jdsu.net>
Hello,
I've been away from this list for quite a while and don't know whether
this issue has already been addressed.
I am using Nano-X version 0.91, server linked into application, and I am
trying to use GrInjectKeyboardEvent() to post an event to the main loop
of execution. I am wondering whether there is a known problem with this
function or whether I'm using it incorrectly.
In one thread, I make the following calls:
...
status = GrOpen() // Open another connection to the Nano-X server
(necessary?)
...
// Inject a keyboard event in order to wake up main loop in the main
thread.
GrInjectKeyboardEvent(GR_ROOT_WINDOW_ID, MWKEY_SYSREQ, 0, 0, GR_TRUE);
In the main thread:
// Wake up on ALL events for now.
GrSelectEvents(GR_ROOT_WINDOW_ID, GR_EVENT_MASK_ALL);
while (!done)
{
// Block, waiting for events. INJECTED KEYBOARD EVENTS FROM THE OTHER
THREAD
// DO NOT TRIGGER THIS!
GrGetNextEvent(&event);
...
}
Finally, is there another way to post events to the queue is
GrInjectKeyboardEvent() does not work the way I think it should?
Thanks very much!
Cheers,
Gil Glass
Senior Software Engineer
JDSU, Communications Test and Measurement
Germantown, MD, USA
+1 (240) 404-2551