reading keyboard



I am trying to read the keyboard input. I do not 
want to display the input.But I just want to be 
able to give it to my application so that 
I can send it on the network.

I have used following methods, with no success in 
any.

1)  I have used key_press_event, but it does 
not give me the key, which has been pressed.

2) I have tried to use "entry" type of widget, I 
can hide the input, but the reading of char is not 
available, till the control is returned to 
gtk_main(). So, I cannot use it. Moreover, I am 
using a text type of widget and not an enry type of 
widget.

3)  I also tried to use "text" type of widget. 
Again, I cannot read it till the control is returned
 to gtk_main.

4)  I also tried the reading of the file descriptor.
For example, gtk_input_add (fileno(stdin)........). 
But it does not get activated.I mean the callback 
does not get activated when I type something, so I 
cannot read the key. I also used
  FILE *input = fopen("/dev/tty", "r") and then 
fileno(input) to read it. But again no success.

Request:
  Could someone pleasegive me a method of reading a 
key from the keyboard without displaying it anywhere 
it in any window?

bye
shiraz


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com



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