@jikjik
Hi.
You can choose to retrieve the input as an
integer instead of char-based. All the keys have equivalent numeric
codes. Let's just disregard
internationalization and keyboard-vendor
issues and assume every character can fit within the US/american
standards, so roughly, there is
a integer number associated with each keyboard key.
In windows, devs have the convenience of using getch() which accepts any single
keyboard press event without the need for the
user
to press enter or newline(linux devs would have to use ncurses or some
other means to emulate this). So you can even make an while
loop
around getch(), and for every call to getch() you then print the %d
(numeric equivalent) of the data retrieved using getch(). That way, the
user
will be able to see the numeric code values of the keys he had pressed.
Here's some dummy code:
while (1)
{
d = getch();
/* print or process or check input or whatever you want to do */
}
_________________________________________________
Kagay-Anon Linux Users' Group (KLUG) Mailing List
[email protected] (http://lists.linux.org.ph/mailman/listinfo/klug)
Searchable Archives: http://archives.free.net.ph