By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,388 Members | 1,823 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,388 IT Pros & Developers. It's quick & easy.

How to simulate keyboard.../dev/tty0?

P: n/a
Hi all,

I'm trying to send chars to the current console (currently having cursor
focus) - /dev/tty0 - in my program by:

char st = 'K', ri = 'L', ng = 'J'
int tty;

tty = open(">/dev/tty0", O_WRONLY);
ioctl(tty, TIOCSTI, &st);
ioctl(tty, TIOCSTI, &ri);
ioctl(tty, TIOCSTI, &ng);

I'm using redhat 9, kde.
Everything is ok in the linux console (on tty1 chars are sending
properly - KLJ...), but in kde i see strange things (and not only for
those characters):
^[[D- on ttyp1
- on mozilla window
My question is why chars are not properly sending by ioctl call, is
there any additional settings to do (setting termios, keyboard driver?)??

thanks,
Keeper

Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Tue, 11 Nov 2003 17:28:03 +0100, Keeper <ke****@iosys.no-ip.org>
wrote in comp.lang.c:
Hi all,

I'm trying to send chars to the current console (currently having cursor
focus) - /dev/tty0 - in my program by:


[snip]

Your post is still off-topic in comp.lang.c and comp.lang.c++.

It still belongs in a Linux group.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.