> in an application of mine I have two threads: > 1. The main GUI thread and > 2. A worker thread > The worker thread is created with the boost thread library > and does its > job in general pretty well. > Now I need to listen for a keystroke in the worker thread. Up to now I > was using the following function for this: > bool key_pressed = fltk::get_key_state(m_keyForward); // > m_keyForward is
It may depend on your Xserver or indeed on which WM you are running whether or not any thread other than the main() thread are permitted to access the Xserver i/o. In general, for maximum portability, you need to localise all your graphics and i/o in the main() thread, and have the subsidiary threads do other work... SELEX Sensors and Airborne Systems Limited Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 3EL A company registered in England & Wales. Company no. 02426132 ******************************************************************** This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ******************************************************************** _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

