Share this post

Link to post

Share on other sites

erifash 0

erifash 0

Okay, thanks to ezzetabi's _IsPressed function I can now copy the mouse clicks on both the left and right buttons! _MouseCopy can now technically be classified as a "mouselogger". I also added a pause function. Here's the code:

Share this post

Link to post

Share on other sites

Matt @ MPCS 0

Matt @ MPCS 0

That looks really good, and I hate to pick at it but just a suggestion...

You may consider taking the logging algohithm out of _MouseCopy and make a seperate function just for that. I know it doesn't matter right? Well actually if you take it out your code will be more modular and you could build both functions independently to be used in all of the scripts you need the functionality in.

Share this post

Link to post

Share on other sites

Matt @ MPCS 0

Matt @ MPCS 0

I just looked over your code again, and you do things very odd. Are you sure it doesn't give you an error when you run it? The reason I ask is all of your $line lines are formatted illegally (i believe so anyway could be wrong). Here is an example:

This is what you do:

$line = "HotKeySet(""`"", ""EndMove"")" & @CRLF & @CRLF

And this is what in this language makes sense to do:

$line = 'HotKeySet("`", "EndMove")' & @CRLF & @CRLF

You also use two loops instead of one. You have one for the application (so it doesn't close when logging is disabled) and a second for when you are doing the logging (actually a third to pause). This could all be accomplished with the single application loop (the first one) using variable flags. This is not as critical to change but is just another way to solve the same problem.

What I was saying is that you could create a logging Function that looked something like this (bare minimum) (untested):