Re: reading keyboard
- From: Shiraz Baig <shiraz_baig yahoo com>
- To: Noah Levitt <nlevitt columbia edu>
- Cc: gtk-list gnome org
- Subject: Re: reading keyboard
- Date: Sun, 18 May 2003 21:18:16 -0700 (PDT)
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.
--- Noah Levitt <nlevitt columbia edu> wrote:
> Where are you trying to read the keyboard? It sounds
> 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.
> On Sun, May 18, 2003 at 1:28:03 -0700, Shiraz Baig
> > 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
> > widget.
> > 3) I also tried to use "text" type of widget.
> > Again, I cannot read it till the control is
> > to gtk_main.
> > 4) I also tried the reading of the file
> > For example, gtk_input_add
> > 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
> > key from the keyboard without displaying it
> > it in any window?
> > bye
> > shiraz
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
] [Thread Prev