Testing keyboard state



I've just started using GTK and Glade to develop a small app through the Anjuta IDE. When a button is 
clicked, 
I want to determine if the Ctrl key is also pressed. I've found some SDL library functions that should do 
this:
SDL_GetKeyState and SDL_GetModState.

However, these functions always return 0 for all keys: that is, they never show that any key is pressed. I've 
tried 
calling the functions in main() as well as in the button clicked handler.

I've initialised the SDL library and it returns a valid return code. I've called SDL_PumpEvents() to ensure 
that the 
key state is read. But no joy.

Can anyone suggest why this may be? Does GTK or Glade inhibit signals from the keyboard in any way? 

Thanks.

John



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]