473,768 Members | 1,392 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4960
Mi****@gmail.co m 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.progr ammer, or
perhaps a Linux or Ubuntu forum.

--
Keith Thompson (The_Other_Keit h) 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.co m 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.progr ammer, 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.co m 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.progr ammer, or
perhaps a Linux or Ubuntu forum.

--
Keith Thompson (The_Other_Keit h) 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
9452
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 pass the socket to a class which just reads from the socket (in a thread). class Reader(Thread): def run(self): while 1:
6
2506
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 window service in such a manner that my application may invoke the process. Is there any way that I can call some method written in window service apart from Start, Stop, Pause etc from my application or firing some custom event to the window service...
13
7497
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 it, a frontend and a backend. Case 1: If vba code on the frontend updates many rows (360,000) on the backend, a form's timer event (from the frontend) will stop firing until the user gives the form focus. (Note that the update itself always...
6
2880
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 TimerState object similar to the example in the System.Threading.Timer documentation. The method which handles the timer events, among other things, periodically calls a method in this TimerState object which raises an event to the startup form,...
2
2558
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 just check the sender.commandargument) i want to do the same thing with 10 dropdownlists. i.e. onselectedindexchanged fire the same event and pass an integer each time, thats the only diff, rest is common. At the moment I'm doing a switch case
3
13484
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 System.Diagnostics.Process process1; .... this.process1 = new System.Diagnostics.Process();
4
2259
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 without SMTP installed?
2
5503
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 create a new custom protocol handler in Windows to handle locations like "myProtocol:", which lets me have a shortcut pointing to "myProtocol:myPrimaryKey" and have my application automatically open and display the given account. That's great. I
6
2076
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
9576
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10176
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10018
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9844
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8840
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6656
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5425
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3933
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3540
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.