Re: Question about hooking and simulating input in C++
On Jul 19, 4:54 am, gara.m...@gmail.com wrote:
I was wondering if its possible to "hook" programs as in windows on
linux (ubuntu specifically.) I doubt it is as its a big security flaw,
but "hooking" is very useful for automating things I'd I'm
interested.
Also is it possible to simulate input through a mouse click or a
keystroke using c++ libraries? For example, this is possible through
the Java class awt.Robot. Documentation of this class can be found
herehttp://java.sun.com/j2se/1.5.0/docs/api/java/awt/Robot.html. This
class is also really useful for automating things, and I was wondering
if the same thing or something like it exists in the c++ libraries on
linux (ubuntu.)
Within C++ itself, all you have is the iostreams. It's possible
to change the streambuf on cin, of course, but I don't think
that is really what you're looking for.
For anything concerning a GUI, you'd have to ask in a group
specialized for that GUI library. I'm not too sure what you're
asking, as I'm not familiar with the tools you mention. (I can
imagine how it might work in Java, but it would be in a higher
level layer than just the language or the OS---somewhere in AWT,
for example.) Under Unix, you might want to Google for pseudo
terminal or expect, but I'm not sure how they interact with X.
(Expect is often used for testing socket based applications, and
pseudo terminals for interactive ones.)
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34