473,225 Members | 1,490 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,225 software developers and data experts.

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

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 sendt by ioctl call, is there
any additional settings to do (setting termios, keyboard driver?)??

thanks,
Keeper

Jul 19 '05 #1
2 7488
"Keeper" <ke****@iosys.no-ip.org> wrote...
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 sendt by ioctl call, is there
any additional settings to do (setting termios, keyboard driver?)??


[answering in comp.lang.c++, where I read it]

You need to post your question to a Linux programming newsgroup.
Try comp.os.linux.development.*

Your question has nothing to do with either C or C++ language.

Victor
Jul 19 '05 #2
On Tue, 11 Nov 2003 11:25:04 +0100, Keeper <ke****@iosys.no-ip.org>
wrote in comp.lang.c:
Hi all,
Hi yourself.
I'm trying to send chars to the current console (currently having cursor
focus) - /dev/tty0 - in my program by:
I don't know about pl.comp.lang.c, because I don't read it, but I can
speak for comp.lang.c and comp.lang.c++, namely:

Your post is off-topic in these two groups at least. These groups
discuss, respectively, the standard C and C++ languages. And there is
no /dev/tty0 in either C or C++.
char st='K',ri='L',ng='J';
int tty;

tty = open(">/dev/tty0", O_WRONLY);
There is no open function in C or C++.
ioctl(tty, TIOCSTI, &st);
ioctl(tty, TIOCSTI, &ri);
ioctl(tty, TIOCSTI, &ng);
There is no ioctl function in C or C++.
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 sendt by ioctl call, is there
any additional settings to do (setting termios, keyboard driver?)??

thanks,
Keeper


Your question is about Linux, its system calls, and its file system,
not the C or C++ language. You will probably get excellent answers in
a group like news:comp.os.linux.development.aps.

--
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 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Michael J Whitmore | last post by:
Greetings, I have a very simple question. How do you simulate a user input to turn off a screen saver in Windows (either a mouse movement, mouse click, or keyboard input)? I promise I searched...
1
by: Keeper | last post by:
Hi all, I'm trying to send chars to the current console (currently having cursor focus) - /dev/tty0 - in my program by: my $st = 'K' my $ri = 'L' my $ng = 'J' open(TTY, ">/dev/tty0");...
1
by: Keeper | last post by:
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",...
0
by: Mythran | last post by:
I'm trying to create a library that will 1.) Simulate an input device (IE: keyboard, mouse, joystick) and 2.) Capture data sent from an input device (IE: keyboard, mouse, joystick). The reason's...
3
by: John Dalberg | last post by:
I have an app that keeps popping up a windows with a 'Yes' or 'OK' button on it. I am trying to write a little app that automates hitting the enter key so I don't have to do it myself. I used...
18
by: eliss.carmine | last post by:
Is it possible to simulate a mouse click in the window I made (it's a Form), but not give it focus? I tried using WinAPI's mouseevent and SendMessage of WM_LBUTTONDOWN/WM_LBUTTONUP as suggested...
3
by: =?Utf-8?B?cHJvZ2dlcg==?= | last post by:
I have a C# application that hosts an AxWebBrowser control which I automate by sending mouse clicks and keyboard input. I have had various problems in doing this due to a bug in the AxWebBrowser...
2
by: Brice Rebsamen | last post by:
Hi I wrote the following program that reads the keyboard in medium raw mode (keycode mode). Here is the initialization code, the full code is at the end. fd = open("/dev/tty0", O_RDONLY);...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.