PDA

View Full Version : using glutKeyboardFunc w/ ungetc(..)



09-14-2001, 07:42 AM
hi, i am using the glutKeyboardFunc keyboard input but i would also like to push messages to the keyboard buffer using an ungetc call like this:
ungetc('B', stdin); to simulate a 'B' being pushed on the keyboard. this is not working though, does anyone have any insight into this? thanks in advance.

cyclone
09-14-2001, 07:57 AM
Why not make exactly the same thing that in your glutKeyboard func ???


@+
Cyclone

cyclone
09-14-2001, 08:00 AM
Or more simple, make a call to your glutKeyboard func with the goods arguments ...

@+
Cyclone

09-14-2001, 11:12 AM
the problem is that i am using multiple threads with the main thread running the glutMainLoop(). any of the worker threads would like to send a message to the main thread by doing an ungetc(), this way it is buffered (same way keyboard input is buffered) and the main thread can receive the keyboard input with my glutKeyboardFunc callback method. in short there are multiple threads. thanks