By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,199 Members | 1,120 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,199 IT Pros & Developers. It's quick & easy.

Reverse of SendKeys??

P: n/a
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...
--

_________ .__ __ ______________
/ _____/ ___________|__|______/ |_ ___________ / | \______ \
\_____ \_/ ___\_ __ \ \____ \ __\/ __ \_ __ \/ | |_ / /
/ \ \___| | \/ | |_ | \ ___/| | \/ ^ / / /
/_______ /\___ >__| |__| __/|__| \___ >__| \____ | /____/
\/ \/ |__| \/ |__|
Dec 28 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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?
Dec 28 '06 #2

P: n/a

Scripter47 wrote:
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.

Dec 29 '06 #3

P: n/a
"Erik Johnson" <ej at somewhere.com<typed
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.

--
Freedom is always the freedom of dissenters.
(Rosa Luxemburg)
Dec 29 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.