This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: Keyboard input (i386)
- From: "Richardson, Anthony" <ar63 at evansville dot edu>
- To: "Leandro" <leandro at hasar dot com>,<ecos-discuss at sources dot redhat dot com>
- Date: Mon, 1 Mar 2004 15:14:09 -0600
- Subject: RE: [ECOS] Keyboard input (i386)
Leandro wrote:
> Hello, I'm trying to get input from the keyboard in a POS
> context, i386
> platform. The only thing I could find in eCos is to open /dev/ttydiag
> and read from there, but for some reason I still can't understand,
> everytime I read a byte from there that same byte is written on the
> screen. If I do not open ttydiag, no echo is shown, and I
> couldn't find
> where this behaviour takes place inside the code of the
> kernel. Is there
> any other way to read from the PS/2 keyboard preventing the echo, id
> est, in a raw fashion?
I think there are a couple of ways to do this, but the following
is what I've used in the past:
hal_virtual_comm_table_t* comm;
comm = CYGACC_CALL_IF_CONSOLE_PROCS();
while(1) {
// Get a character
c = CYGACC_COMM_IF_GETC(*comm);
// other stuff here
}
The input is unbuffered, i.e. you don't have to press
newline to get the character. Also, there is no echo
of the character to the display.
Tony
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss