Keyboard input problem (newbie alert)




Help!

I am playing with a small calculator project to help me learn gtk+.  I
would like to have keyboard input available for the digits and operators
as well as buttons.  I guess I don't understand how this works and cannot
get just plain keystrokes to work.   Here is a modification to the
helloworld program (from tutorial) which I tried:

  atbl = gtk_accelerator_table_new();
  gtk_widget_install_accelerator(button,atbl,"clicked",
     GDK_B,GDK_KEY_RELEASE_MASK);

I thought that this would have the keyboard "B"  click the one and only
button.  Or at least call the same callback.  Nope!  Didn't work.  Any
ideas?

I also read about key_snooper or something like that.  What is that?
Is that a better method for my purposes?

Bill



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