473,396 Members | 1,879 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,396 software developers and data experts.

How to send a key event to another process?

Hello,
I'm working on a C program under Ubuntu.
It's basd on socket.
Browser calls a client cgi (C program), and send some parameters to
server (C program).
Server runs another program (ooimpress, open office ppt), and
translate the commands from client to a key event, and send it to
child process.

For example.
first, after openning xxx.odp on server, I need to display it in "full
screen mode", so I need to send "F5" from server program to child
process "ooimpress".

Now, I need to send F5, ESC, char n, and char p. and
I open the child process by using pipe (popen), and I send (fputc) the
command key to the pipe.......

But I cannot get the correct result......The ppt doesn't respond
anything......
My question is,
1, if I can implement this under pipe, how should I do,
2, if I cannot implement this under pipe, how should I do.

My main goal is open ooimpress, and control it to show next, previous
slide, esc, and full screen (F5 is hotkey for that).

Thanks a lot!!

Patrick
May 31 '08 #1
5 4939
Mi****@gmail.com writes:
I'm working on a C program under Ubuntu.
It's basd on socket.
Browser calls a client cgi (C program), and send some parameters to
server (C program).
Server runs another program (ooimpress, open office ppt), and
translate the commands from client to a key event, and send it to
child process.
[snip]

There's no way to do this in standard C. Try comp.unix.programmer, or
perhaps a Linux or Ubuntu forum.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
May 31 '08 #2
Mi****@gmail.com wrote:
I'm working on a C program under Ubuntu.
It's basd on socket.
Sorry, but you will be in for a bad surprise, sockets (and
networking at all) aren't part of the C language, they are
deal with (often system specific libraries).
Browser calls a client cgi (C program), and send some parameters to
server (C program).
Hmm, a browser doesn't call a "client cgi". A browser may
send a request to a HTTP server which, in turn, may invoke
a CGI script/program (written in whatever language, but you
will find that it's rarely C).
Server runs another program (ooimpress, open office ppt), and
translate the commands from client to a key event, and send it to
child process.
Why should the HTTP server run such a program? Many servers
may run all day without even screen attached, so running one
of those programs will be rather futile.
For example.
first, after openning xxx.odp on server, I need to display it in "full
screen mode", so I need to send "F5" from server program to child
process "ooimpress".
Sorry, but I guess you've got a lot of things mixed up here.
Now, I need to send F5, ESC, char n, and char p. and
I open the child process by using pipe (popen), and I send (fputc) the
command key to the pipe.......
Now you seem to be talking about two processes on a UNIX-
like platform. That doesn't fit too well with the browser
(client) and HTTP server things you wrote about before.
Just note that pipes and the popen() function are POSIX
terms, they have no real meaning when it comes to the
language C.
But I cannot get the correct result......The ppt doesn't respond
anything......
I guess you're trying something with certain programs that
are installed on your machine. But from a language point of
view C doesn't support networking by any built-in functions,
it doesn't have a native popen() function (or anything for
pipes) and definitely doesn't have any special built-in support
for dealing with program like "ooimpress" or "open office".
My question is,
1, if I can implement this under pipe, how should I do,
2, if I cannot implement this under pipe, how should I do.
My main goal is open ooimpress, and control it to show next, previous
slide, esc, and full screen (F5 is hotkey for that).
I find it difficult to come up with proposals where you should
ask since you mix too many unrelated things into a single
question. So a few tentative suggestions: if you have problems
with pipes and popen() ask in comp.unix.programmer, that's where
the experts for these functions can be found. Regarding control-
ling some kind of parts from the open office suite from another
program I am a bit at a loss, but there should be quite a number
of mailing lists, web forums etc. that are suitable for these
kind of questions (but I can't tell you were they are since I
never had to have to deal with that). And about the browser/HTTP
stuff you started of with I can only recommend to relax, take a
good look at what exactly you are trying to do and formulate it
in a somewhat more clear language that takes into account how
browsers and HTTP servers interact and what is happening on
both sides. Perhaps the first step you should take is to write
a clear description of what you intend to do, not already in-
sisting of the ways to do it. That may clear up the way to a
workable solution a lot. Write down what you want to, not mixing
it up with how to do it, and you may come up with a question that
can be answered (although not completely or even in parts here
in clc).

Regards, Jens
--
\ Jens Thoms Toerring ___ jt@toerring.de
\__________________________ http://toerring.de
May 31 '08 #3
Hi guys, thanks a lot for all your replies.

Seems I need to move my question to unix group :)

Thanks again for the hearty reply.

Good Luck~~

Patrick
May 31 '08 #4
Mi****@gmail.com writes:
I'm working on a C program under Ubuntu.
It's basd on socket.
Browser calls a client cgi (C program), and send some parameters to
server (C program).
Server runs another program (ooimpress, open office ppt), and
translate the commands from client to a key event, and send it to
child process.
[snip]

There's no way to do this in standard C. Try comp.unix.programmer, or
perhaps a Linux or Ubuntu forum.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Jun 27 '08 #5
Hi guys, thanks a lot for all your replies.

Seems I need to move my question to unix group :)

Thanks again for the hearty reply.

Good Luck~~

Patrick
Jun 27 '08 #6

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

Similar topics

4
by: jas | last post by:
I have a basic client/server socket situation setup....where the server accepts a connection and then waits for commands. On the client side, I create a socket, connect to the server...then I...
6
by: Usman | last post by:
Hi I have a window service written in C#. I have another application that requires a lengthy process to be performed like taking backup. How can I make this lengthy process be performed by...
13
by: Manuel Lopez | last post by:
I have a puzzling form timer problem that I didn't experience prior to Access 2003 (though I'm not sure access 2003 is to blame). Here's the situation: a computer has two access 2003 databases on...
6
by: Dan | last post by:
I've created a pocketpc app which has a startup form containing a listview. The form creates an object which in turn creates a System.Threading.Timer. It keeps track of the Timer state using a...
2
by: louise raisbeck | last post by:
hi, if i cause the onclick event to fire with an ImageButton I can send CommandArgument which I find really handy to grab some relevant value (which means i can reuse code for many buttons and...
3
by: WRH | last post by:
Hello I used the VS designer to set up Process code as follows... the problem is, although the process is executed, when it is shut down I never get the Exited event. .... private...
4
by: CLEAR-RCIC | last post by:
I want to send an email from our Intranet site to myself whenever an error happens. Our manager will not let us install SMTP on the web server. Is it possible to send email programatically...
2
by: Mesan | last post by:
Hello everyone, Thanks to many useful posts in this newsgroup and others, I've been able to come very close to something I've been wanting to do for a very long time. I've figured out how to...
6
by: Martin Priebe | last post by:
Hi, I need a possibility to fire an event in one process and react in another process. can anybody help me ? Martin
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.