Welcome Guest.   Make a donation to an author on the site November 26, 2014, 12:22:34 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Read the full one-year retrospective report on DonationCoder.com.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: DONE: Keyboard and/or Mouse Movement Simulator  (Read 32245 times)
Scott
Resident Googler
Charter Member
***
Posts: 377


see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« on: July 25, 2005, 01:25:56 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).
« Last Edit: August 04, 2005, 12:11:38 PM by mouser » Logged

« Next Edit: Tomorrow at 12:13:47 AM by Scott »
Scott
Resident Googler
Charter Member
***
Posts: 377


see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: July 25, 2005, 03:38:30 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.
 
Logged

« Next Edit: Tomorrow at 12:13:47 AM by Scott »
Scott
Resident Googler
Charter Member
***
Posts: 377


see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #2 on: July 25, 2005, 07:05:32 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.
Logged

« Next Edit: Tomorrow at 12:13:47 AM by Scott »
mouser
First Author
Administrator
*****
Posts: 33,699



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: July 25, 2005, 07:50:15 PM »

how are you configuring apps to run after idle time?
Logged
Scott
Resident Googler
Charter Member
***
Posts: 377


see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #4 on: July 25, 2005, 08:02:04 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).
Logged

« Next Edit: Tomorrow at 12:13:47 AM by Scott »
Scott
Resident Googler
Charter Member
***
Posts: 377


see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #5 on: July 25, 2005, 09:01:15 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).
Logged

« Next Edit: Tomorrow at 12:13:47 AM by Scott »
mouser
First Author
Administrator
*****
Posts: 33,699



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #6 on: July 25, 2005, 10:36:04 PM »

is there a downside to using a batch to pause and unpause the system scheduler? what does that not do that you want?
Logged
Scott
Resident Googler
Charter Member
***
Posts: 377


see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #7 on: July 26, 2005, 05:01:17 AM »

 
Yeah; doing that prevents all scheduled tasks from running, rather than just the ones I know would be obtrusive to run.
 
Logged

« Next Edit: Tomorrow at 12:13:47 AM by Scott »
skrommel
Fastest code in the west
Developer
***
Posts: 882



View Profile WWW Give some DonationCredits to this forum member
« Reply #8 on: July 31, 2005, 10:01:35 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:17 PM by skrommel » Logged

Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.
zridling
Friend of the Site
Charter Member
***
Posts: 3,291


Linux captive

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #9 on: August 01, 2005, 01:40:25 AM »

That works, thanks skr!
Logged

- zaine (on Google+)
Scott
Resident Googler
Charter Member
***
Posts: 377


see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #10 on: August 02, 2005, 09:34:20 PM »

 
I still have scheduled tasks kick off.  I give up.

Thanks anyway; I really appreciate it.
 
« Last Edit: August 02, 2005, 09:40:29 PM by Scott » Logged

« Next Edit: Tomorrow at 12:13:47 AM by Scott »
JxFriday
Charter Member
***
Posts: 7

View Profile Give some DonationCredits to this forum member
« Reply #11 on: November 30, 2005, 11:01:11 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!!!
Logged
skrommel
Fastest code in the west
Developer
***
Posts: 882



View Profile WWW Give some DonationCredits to this forum member
« Reply #12 on: November 30, 2005, 11:59:13 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
Logged

Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.
JxFriday
Charter Member
***
Posts: 7

View Profile Give some DonationCredits to this forum member
« Reply #13 on: November 30, 2005, 11:33:25 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.
Logged
JxFriday
Charter Member
***
Posts: 7

View Profile Give some DonationCredits to this forum member
« Reply #14 on: December 01, 2005, 12:05:56 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.
Logged
skrommel
Fastest code in the west
Developer
***
Posts: 882



View Profile WWW Give some DonationCredits to this forum member
« Reply #15 on: December 01, 2005, 01:45:58 AM »

 ohmy You're absolutely right!

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

Skrommel
Logged

Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.
JxFriday
Charter Member
***
Posts: 7

View Profile Give some DonationCredits to this forum member
« Reply #16 on: December 01, 2005, 01:55:05 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:

Quote
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!
Logged
skrommel
Fastest code in the west
Developer
***
Posts: 882



View Profile WWW Give some DonationCredits to this forum member
« Reply #17 on: December 01, 2005, 02:03:16 AM »

 Grin 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
Logged

Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.
skrommel
Fastest code in the west
Developer
***
Posts: 882



View Profile WWW Give some DonationCredits to this forum member
« Reply #18 on: December 01, 2005, 02:05:18 AM »

 Grin And then there's reading the documentation...

Great job, JxFriday!

Do you want your donation returned?

Skrommel
Logged

Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.
JxFriday
Charter Member
***
Posts: 7

View Profile Give some DonationCredits to this forum member
« Reply #19 on: December 01, 2005, 02:09: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:03 AM by JxFriday » Logged
JxFriday
Charter Member
***
Posts: 7

View Profile Give some DonationCredits to this forum member
« Reply #20 on: December 01, 2005, 04:18:55 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!
Logged
skrommel
Fastest code in the west
Developer
***
Posts: 882



View Profile WWW Give some DonationCredits to this forum member
« Reply #21 on: December 01, 2005, 05:02:33 AM »

 smiley 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
Logged

Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.
JxFriday
Charter Member
***
Posts: 7

View Profile Give some DonationCredits to this forum member
« Reply #22 on: December 01, 2005, 09:26:31 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:32 AM by JxFriday » Logged
skrommel
Fastest code in the west
Developer
***
Posts: 882



View Profile WWW Give some DonationCredits to this forum member
« Reply #23 on: December 01, 2005, 01:12:26 PM »

 smiley Done!

Great working with you!

Skrommel
Logged

Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.
The Mighty Boosh
Participant
*
Posts: 1


View Profile Give some DonationCredits to this forum member
« Reply #24 on: June 16, 2009, 02:22:55 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?
Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.043s | Server load: 2.22 ]