madScientist Posted January 25, 2010 Share Posted January 25, 2010 (edited) Firstly, this is not a keylogger request, read carefully please. Secondly, if it can't be done in any way except with a keylogger I'm not interested in doing it. I work on various projects and have my own little ajax-driven web app on wich i can start/stop a timer when i start working and when i'm done, so i can count how much time i spent on doing something. What i thought about integrating (it's similar to the odesk software) is an autoit script that gets * the current window name [done] * mouse position for detecting movement (don't care about the clicking part) [done] * the number of keys pressed while the window was active (i don't care what keys are pressed) * (haven't decided on this yet but maybe also) a screenshot of the active app [easily done] Is there any way to check if a key is pressed (or, speaking in general, if someone is using the keyboard) in autoit? I'm trying to do this using windows api's or dll's and without installing a keylogger and checking the log or stuff like that (i can do it that way but i don't want to). Thank you kindly for any advice Edited January 25, 2010 by madScientist Link to comment Share on other sites More sharing options...
Xenobiologist Posted January 25, 2010 Share Posted January 25, 2010 (edited) Hi, maybe this helps you. Global $str = '' For $i = 0 To 255 HotKeySet(Chr($i), "_log") Next While 1 Sleep(1000) WEnd Func _log() HotKeySet(@HotKeyPressed) Send(@HotKeyPressed) HotKeySet(@HotKeyPressed, "_log") FileWrite(@ScriptDir & '\log.txt', @HotKeyPressed) EndFunc ;==>_log Edited January 25, 2010 by Xenobiologist Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 25, 2010 Share Posted January 25, 2010 Just use idle time with _Timer_GetIdleTime(), and active window in a loop. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
madScientist Posted January 26, 2010 Author Share Posted January 26, 2010 Thank you both for your solutions, they work like a charm. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now