topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday March 19, 2024, 2:31 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: DONE: Keyboard and/or Mouse Movement Simulator  (Read 54202 times)

Scott

  • Resident Googler
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 378
    • View Profile
    • Read more about this member.
    • Donate to Member
DONE: Keyboard and/or Mouse Movement Simulator
« on: July 25, 2005, 01:25 PM »
Here's the thought: A utility that sends artificial key presses every so often, to imitate user activity.  I was thinking this would be a cool and easy way to simultaneously prevent my system from triggering scheduled tasks (those that are based on an amount of idle time), from entering sleep mode, and from powering down the monitor or even activating the screen saver.

Right now, when I want to watch TV or a movie or something on the computer (or let someone else do the same), I either disable all that crap manually, force myself to remember to hit a key or move the mouse every couple minutes, or deal with the system locking when I don't want it to--all of which is a real pain.

I found one little utility, called Caffe1ne, but it didn't work well for me.  It supposedly presses the Shift key every 59 seconds, but it didn't prevent my scheduled tasks from running.

I'm guessing this would be relatively easy to create.  I'm also guessing the only necessary options might be how often to simulate keyboard activity, and maybe what key(s) to send.

It would be great if this utility didn't interfere with normal activity of the system as well (so doing something like pressing the Windows key every two seconds wouldn't be too keen).
« Next Edit: Tomorrow at 12:13:47 AM by Scott »
« Last Edit: August 04, 2005, 12:11 PM by mouser »

Scott

  • Resident Googler
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 378
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: IDEA: Keyboard and/or Mouse Movement Simulator
« Reply #1 on: July 25, 2005, 03:38 PM »
 
I tried another utility and the piece of shit froze my system.  Screw it; I think I can do this myself with a batch file and NirCmd.
 
« Next Edit: Tomorrow at 12:13:47 AM by Scott »

Scott

  • Resident Googler
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 378
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: IDEA: Keyboard and/or Mouse Movement Simulator
« Reply #2 on: July 25, 2005, 07:05 PM »
Doesn't work.  I had NirCmd moving the cursor every few seconds, but my scheduled tasks ran anyway.

If anyone knows of an existing utility that can (particularly) prevent scheduled tasks from running, when those tasks have been set to run after "idle time", I'd love to know about it.
« Next Edit: Tomorrow at 12:13:47 AM by Scott »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: IDEA: Keyboard and/or Mouse Movement Simulator
« Reply #3 on: July 25, 2005, 07:50 PM »
how are you configuring apps to run after idle time?

Scott

  • Resident Googler
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 378
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: IDEA: Keyboard and/or Mouse Movement Simulator
« Reply #4 on: July 25, 2005, 08:02 PM »
For the ones that run purely after idle time, on the Schedule tab, I set them to run "When the computer has been idle for" however long I want.

For those that target a certain time, but depend on idle time so as not to get in my way, I set them for a certain time, then set the "Only start the task if the computer has been idle for at least" option.  (I typically select something from 2 to 20 minutes, depending on what it is.)  And I set "If the computer has not been idle that long, retry for up to" to 999 minutes (the max).
« Next Edit: Tomorrow at 12:13:47 AM by Scott »

Scott

  • Resident Googler
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 378
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: IDEA: Keyboard and/or Mouse Movement Simulator
« Reply #5 on: July 25, 2005, 09:01 PM »
It's easy enough to pause the task scheduler service; I can do it in the same batch file.  I don't know what else may not be handled by this kludgy workaround though (moving the cursor with NirCmd that is).
« Next Edit: Tomorrow at 12:13:47 AM by Scott »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: IDEA: Keyboard and/or Mouse Movement Simulator
« Reply #6 on: July 25, 2005, 10:36 PM »
is there a downside to using a batch to pause and unpause the system scheduler? what does that not do that you want?

Scott

  • Resident Googler
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 378
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: IDEA: Keyboard and/or Mouse Movement Simulator
« Reply #7 on: July 26, 2005, 05:01 AM »
 
Yeah; doing that prevents all scheduled tasks from running, rather than just the ones I know would be obtrusive to run.
 
« Next Edit: Tomorrow at 12:13:47 AM by Scott »

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
DONE: Keyboard and/or Mouse Movement Simulator
« Reply #8 on: July 31, 2005, 10:01 PM »
Noise sends keystrokes to keep the PC from falling asleep.

It creates a window with an edit box, hides it, and posts a random key to it every 10 seconds. Use the tray menu to show it or kill it.



You'll find the downloads and more info at Skrommel Software.

Skrommel
« Last Edit: September 17, 2005, 08:12 PM by skrommel »

zridling

  • Friend of the Site
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 3,299
    • View Profile
    • Donate to Member
Re: IDEA: Keyboard and/or Mouse Movement Simulator
« Reply #9 on: August 01, 2005, 01:40 AM »
That works, thanks skr!

Scott

  • Resident Googler
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 378
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: IDEA: Keyboard and/or Mouse Movement Simulator
« Reply #10 on: August 02, 2005, 09:34 PM »
 
I still have scheduled tasks kick off.  I give up.

Thanks anyway; I really appreciate it.
 
« Next Edit: Tomorrow at 12:13:47 AM by Scott »
« Last Edit: August 02, 2005, 09:40 PM by Scott »

JxFriday

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 7
    • View Profile
    • Donate to Member
Re: IDEA: Keyboard and/or Mouse Movement Simulator
« Reply #11 on: November 30, 2005, 11:01 AM »
I just donated to DonationCoder and Skrommel in appreciation for Noise.exe.  It's great.  It keeps my desired application from thinking the computer is idle perfectly!  I do have a minor problem in that if it is running while I'm actually using the computer, it causes some of my real keystrokes to be upper case here and there.  It would be great if the interval between simulated keystrokes could be changed to some other value.  Every 10 seconds is much faster than I need - for me, every 30 minutes would be fine.  If the delay were configurable then the occasional shifted character wouldn't be so bothersome.  I like to leave Noise running all the time so I don't forget to start it if I am away.  Thanks!!!

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: IDEA: Keyboard and/or Mouse Movement Simulator
« Reply #12 on: November 30, 2005, 11:59 AM »
 :tellme: Thanks for donating, JxFriday!

But I don't understand why you get shifted keys, as Noise only sends random chars from A and Z. Please try holding down the A key for 20 secs while in Notepad and see what happens.

Skrommel

JxFriday

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 7
    • View Profile
    • Donate to Member
Re: IDEA: Keyboard and/or Mouse Movement Simulator
« Reply #13 on: November 30, 2005, 11:33 PM »
Just pressing and holding the 'a' key in notepad did not replicate the issue.  Based on my hypothesis that the function of the shift key is what is being interfered with, I came up with a couple tests that do reliably replicate the issue 100% of the time.

Method #1 (simplest):
  • Open Notepad
  • Be sure Noise.exe is running
  • Hold down the shift key and hold any letter key - hold for at least 15 seconds - in 10 seconds or less your stream of capital letters will switch to lowercase.
  • Exit Noise.exe and repeat and you will notice that it does not happen.

Method #2 (slightly more complex):
  • Start with a big blocK of text in an editor of some sort (notepad, wordpad, etc.)
  • Be sure Noise.exe is running
  • Position your cursor at the beginning of the block of text
  • Hold down your shift key, and then (with the shift key still held), hold down your right arrow key (this will start highlighting the text).
  • Keep both keys held for at least 15 seconds.  In about 10 seconds or less you will notice that the highlighting stops and goes away as if you had released the shift key.
  • Exit Noise.exe and repeat and you will notice that it does not happen.

I note with some interest that the letters that are generated in the Noise! window are all capital letters.  Perhaps if they were lower case letters it would fix this?

For whatever benefit it may offer, this happens on two different systems I have tried it on - both of which are Windows XP Professional.  I have not tried to replicate the issue on any other operating system.

Hope this helps.

ThaNKs!

P.S.  Any inappropriate capitalization in the above post was due to the issue at hand, and was left in for purposes of illustration.

JxFriday

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 7
    • View Profile
    • Donate to Member
Re: IDEA: Keyboard and/or Mouse Movement Simulator
« Reply #14 on: December 01, 2005, 12:05 AM »
I feel stupid - I didn't notice that you actually post the AHK source code on your page along with a link to download the AHK compiler.  I downloaded both and played with the code a little.

First I tried changing the random character ASCII range from 65-90 to 97-122 (a-z instead of A-Z).  This did not fix it.  Then I tried changing it to 32-32 (the space character which is shift-independent), but the problem still happens.

Changing the time between the characters was easy - I changed the SetTimer,MAKENOISE,9999 to SetTimer,MAKENOISE,60000 and that changed the interval to 1 minute.  I don't know what the maximum is, but I'll try 2700000 which should be 45 minutes.

I'll keep hacking on this, but it seems like it is an issue with how AHK stuffs keystrokes.  If I can find a W2K box to test on I'll see if this is limited to Windows XP or if it happens on other operating systems.

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: IDEA: Keyboard and/or Mouse Movement Simulator
« Reply #15 on: December 01, 2005, 01:45 AM »
 :o You're absolutely right!

I'll talk to Chris about it, it looks like a bug...

Skrommel

JxFriday

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 7
    • View Profile
    • Donate to Member
Re: IDEA: Keyboard and/or Mouse Movement Simulator
« Reply #16 on: December 01, 2005, 01:55 AM »
Nope, not a bug.  I just fixed it. 

Change this line:

ControlSend,Edit1,%char%,Noise!

to read like this:

ControlSend,Edit1,{Blind}%char%,Noise!

From the documentation:

When {Blind} is the first item in a Send or ControlSend, the program avoids releasing Alt/Control/Shift/Win if they started out in the down position. For example, the hotkey +s::Send {Blind}abc would send ABC rather than abc because the user is holding down the Shift key.

{Blind} also causes SetStoreCapslockMode to be ignored; that is, the state of Capslock is not changed. Finally, {Blind} omits the following behaviors: 1) prevention of Start Menu appearance during LWin/RWin keystrokes by "disguising" them with a Control keystroke; 2) prevention of menu bar activation during Alt keystrokes by "disguising" them with a Control keystroke.

Blind-mode is used internally when remapping a key. For example, a::b would produce b when you type a, uppercase B when you type A, and Control-B when you type Control-A.

{Blind} is not supported by SendRaw and ControlSendRaw.

Now it works flawlessly.  Thanks for the great program!

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: IDEA: Keyboard and/or Mouse Movement Simulator
« Reply #17 on: December 01, 2005, 02:03 AM »
 ;D Chris of course had a solution!

SetKeyDelay,0,0 should solve the problem.

Download IdleMute v1.1 from my homepage. I've also changed the delay to 1 minute.

Skrommel

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: IDEA: Keyboard and/or Mouse Movement Simulator
« Reply #18 on: December 01, 2005, 02:05 AM »
 ;D And then there's reading the documentation...

Great job, JxFriday!

Do you want your donation returned?

Skrommel

JxFriday

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 7
    • View Profile
    • Donate to Member
Re: IDEA: Keyboard and/or Mouse Movement Simulator
« Reply #19 on: December 01, 2005, 02:09 AM »
Do you want your donation returned?

Absolutely not!  Noise! is a great program.  You did the hard work - I just fixed a teenie little bug.  I wouldn't have had a clue where to even start!

By the way, I changed the random character range to:

Random,char,97,122

so that if I'm holding the shift key, Noise does upper case characters, and if not it does lower case.  With the {Blind} it really doesn't matter, but for whatever reason, it makes the programmer in me happy.

Thanks again!!!
« Last Edit: December 01, 2005, 02:15 AM by JxFriday »

JxFriday

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 7
    • View Profile
    • Donate to Member
Re: IDEA: Keyboard and/or Mouse Movement Simulator
« Reply #20 on: December 01, 2005, 04:18 AM »
Just a follow up on the change of the char range - it doesn't seem to keep my intended application from going idle if I use the 97,122 range, so I went back to the original range -- kept the {Blind} of course -- and now it seems completely happy.

Thanks again!

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: IDEA: Keyboard and/or Mouse Movement Simulator
« Reply #21 on: December 01, 2005, 05:02 AM »
 :) I found that the {Blind} makes all the difference! Combined with sending lowercase chars, it works OK. But it still messes with the Ctrl and Alt, so I've added a A_TimerIdlePhysical test to the code.

I've just uploaded Noise! v1.2. Try it and see if it works.

Skrommel

JxFriday

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 7
    • View Profile
    • Donate to Member
Re: IDEA: Keyboard and/or Mouse Movement Simulator
« Reply #22 on: December 01, 2005, 09:26 AM »
Nice, it only tries to stuff a character once a minute, and when the stuffing routine is called, if the computer has been idle for less than a minute, no stuffing occurs.  I was thinking the same thing during my earlier troubleshooting (no sense stuffing if they are active and no problem with whatever you stuff if they aren't) but didn't know enough about AHK to do it.

As I mentioned above, with the random char range set to 97,122 the application I desire to keep active still goes to sleep, but if I change the range back to 65,90 it works fine.  I have not a clue why this would be, but I took your version 1.2 and tried it, and my application still went idle.  Then I made the single change of the random char range to 65,90 and now it works perfect.

If you decide to change the range to 65,90 and post a new version, I noticed that when you compiled 1.2 you didn't include your spiffy exclamation mark logo so the green H logo is used.  I extracted the logo out of the previous version and recompiled my own 1.2a with the new char range and the logo.

I think we might just be 100% good-to-go with this.

Thanks again for a great program!
« Last Edit: December 01, 2005, 09:42 AM by JxFriday »

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: IDEA: Keyboard and/or Mouse Movement Simulator
« Reply #23 on: December 01, 2005, 01:12 PM »
 :) Done!

Great working with you!

Skrommel

The Mighty Boosh

  • Participant
  • Joined in 2009
  • *
  • Posts: 1
    • View Profile
    • Donate to Member
Re: DONE: Keyboard and/or Mouse Movement Simulator
« Reply #24 on: June 16, 2009, 02:22 PM »
I just wanted to know, if I`m watching something with VLC Media player, will `Noise` activate the hotkeys within VLC? Example: 1 minute into the video, 'Noise' sends an 'n' keystroke to the computer, will VLC play the next file in the playlist?

Noise only sends capital letters to the computer, right?