Reverse of SendKeys??

S

Scripter47

Hey!

I know there is a module named SendKeys.
SendKeys module it can type strings as you where typing it, on the keyboard.
But is there a module that does the reverse. A module that gets
_anything_ what the keyboard writes.
For example. If i type "hey" on my keyboard. Will the program get the
string even if the program not is on focus..

Thanks :)

Sorry for bad English...
--

_________ .__ __ ______________
/ _____/ ___________|__|______/ |_ ___________ / | \______ \
\_____ \_/ ___\_ __ \ \____ \ __\/ __ \_ __ \/ | |_ / /
/ \ \___| | \/ | |_> > | \ ___/| | \/ ^ / / /
/_______ /\___ >__| |__| __/|__| \___ >__| \____ | /____/
\/ \/ |__| \/ |__|
 
E

Erik Johnson

Aside from the obvious security issues such a program would represent
(and your name and signature are curious in that respect as well), you are
basically asking for functionality (i.e., a key logger) I believe to be
outside what is offered by Python and/or the API of most operating systems.

Perhaps you should take up assembly programming?
 
R

Ravi Teja

Scripter47 said:
Hey!

I know there is a module named SendKeys.
SendKeys module it can type strings as you where typing it, on the keyboard.
But is there a module that does the reverse. A module that gets
_anything_ what the keyboard writes.
For example. If i type "hey" on my keyboard. Will the program get the
string even if the program not is on focus..

PyHook is what you need.
http://www.cs.unc.edu/~parente/tech/tr08.shtml
It can signal for both global keyboard as well as mouse events.
 
S

Sebastian 'lunar' Wiesner

Erik Johnson said:
Aside from the obvious security issues such a program would
represent (and your name and signature are curious in that respect as
well), you are basically asking for functionality (i.e., a key logger)
I believe to be outside what is offered by Python and/or the API of
most operating systems.

I agree on the security issues, and on the statement, that writing a key
logger is outside the scope of the standard python library. But it is
easily possible to write a key logger using the API of common operating
systems. Windows provides hooks for intercepting messages from input
devices such as keyboard and mouse. On Linux you can either write a
kernel module, which is the less portable, but more effective way, or
you can code a X11 key logger, which will also work on other unix-like
systems with a working X11 installation.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top