Re: reading keyboard



I am reading the keyboard from keypress event. But the
key read is the scan code. I need to do lot of jiggery
pokery to get the ASCII key. I am sure there must be a
function call in gtk to get the ascii key.

I need to read the key that is being typed in a text
box. But I do not want to display that key. I want to
send it over the network. When that key is echoed back
from the server then only I shall display it.
So requirement is get the ASCII key code.

bye
shiraz

--- Noah Levitt <nlevitt columbia edu> wrote:
> Where are you trying to read the keyboard? It sounds
> like
> key-press-event is what you want. You definitely do
> not want
> #4 (reading from the tty) unless you are designing a
> terminal app, which I doubt. It is not clear from
> your email
> exactly what you want to do.
> 
> Noah
> 
> On Sun, May 18, 2003 at  1:28:03 -0700, Shiraz Baig
> wrote:
> > 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]