DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Sticky Keys Ahk request  (Read 28,798 times)

CleverCat

  • Cat's Are Fun!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
Sticky Keys Ahk request
« on: December 08, 2008, 02:20 PM »
Can someone pleeeeeze make me an AHK script to tell me if If my Sticky Keys 'disappear' and are not running!

I spend a few frustrating minutes before I realize they're gone!!

Thanks in Advance?  ;)
If you need help - JUST ASK!

aCkRiTe

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 21
Re: Sticky Keys Ahk request
« Reply #1 on: December 10, 2008, 11:04 PM »
Here is an AHK script that checks every second to see if the Sticky Keys are on or off. If they are turned off, a pop-up will appear letting you know they are turned off and give you the option to turn them on. If you choose not to the script will exit cause the pop-up will not go away if they are off. I assume this is what you were looking for. Feel free to tweak in anyway. HTH...

Code
#SingleInstance Force
#Persistent
#NoEnv
SetBatchLines -1

SetTimer, Timer, 1000

Timer:
RegRead, OutputVar, HKEY_CURRENT_USER, Control Panel\Accessibility\StickyKeys, Flags
If OutputVar <> 511
	{
		MsgBox, 68, Sticky Keys, The Sticky Keys are turned off. Would you like to turn them on?
			IfMsgBox Yes
				RegWrite, REG_SZ, HKEY_CURRENT_USER, Control Panel\Accessibility\StickyKeys, Flags, 511
			Else
				ExitApp
	}
Return

CleverCat

  • Cat's Are Fun!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
Re: Sticky Keys Ahk request
« Reply #2 on: December 11, 2008, 08:07 AM »
Thanks so much - I loaded the script then turned of Sticky Keys and no message that they were off?
If you need help - JUST ASK!

CleverCat

  • Cat's Are Fun!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
Re: Sticky Keys Ahk request
« Reply #3 on: December 11, 2008, 08:10 AM »
But if I double click script in folder where I keep it I get the message! Am I doing something wrong?
If you need help - JUST ASK!

justice

  • Solve issues simply.
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • Participated in NANY Challenge Four Times
    • Cody Award
    • Coding Snacks
    • DJ Badge - DJ
Re: Sticky Keys Ahk request
« Reply #4 on: December 11, 2008, 10:25 AM »
the Else Exitapp lines from the script, means the script will stop checking (exit) if you press NO, presumably to stop you getting the same prompt again the next second.

try this instead:
Code
#SingleInstance Force
#Persistent
#NoEnv

SetTimer, Timer, 2000

Timer:
OldValue := OutputVar
RegRead, OutputVar, HKEY_CURRENT_USER, Control Panel\Accessibility\StickyKeys, Flags
IfNotEqual, OldValue, %OutputVar%
If OutputVar <> 511
	{
		MsgBox, 68, Sticky Keys, The Sticky Keys are turned off. Would you like to turn them on?
			IfMsgBox Yes
				RegWrite, REG_SZ, HKEY_CURRENT_USER, Control Panel\Accessibility\StickyKeys, Flags, 511
	}
Return
This way when stickykeys goes off but you dont want to turn it on the script won't ask again until stickykeys has been turned on manually and goes off again. Also made the script less cpuhungry by only checking every  2 seconds and the script no longer runs at maximum speed.
« Last Edit: December 11, 2008, 10:27 AM by justice »

CleverCat

  • Cat's Are Fun!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
Re: Sticky Keys Ahk request
« Reply #5 on: December 11, 2008, 10:46 AM »
I tested your script, still nothing. I turned them off then on then off again manually but no warning! Maybe it will only work if I lose them without doing anything, which does happen... I'll run for while and see what happens... :Thmbsup:

Thanks... :)
If you need help - JUST ASK!

CleverCat

  • Cat's Are Fun!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
Re: Sticky Keys Ahk request
« Reply #6 on: December 11, 2008, 12:02 PM »
Just lost StickyKeys - no pop up....
If you need help - JUST ASK!

aCkRiTe

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 21
Re: Sticky Keys Ahk request
« Reply #7 on: December 11, 2008, 02:37 PM »
What OS are you using? I tested under WinXP. If you're not using WinXP, check the registry and see what the value is set to when the Sticky Keys are on and then change it in the script.

CleverCat

  • Cat's Are Fun!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
Re: Sticky Keys Ahk request
« Reply #8 on: December 12, 2008, 05:36 AM »
I'm on XP Home...SP3

Registry values match!
If you need help - JUST ASK!
« Last Edit: December 12, 2008, 05:38 AM by CleverCat »

aCkRiTe

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 21
Re: Sticky Keys Ahk request
« Reply #9 on: December 12, 2008, 07:27 AM »
So when you lose the Sticky Keys, have you checked to see what the registry value is set at right after you lose them? If so, what is the value set at? If not, look and see without the script running. I get 510 when off and 511 when on. If you're saying the values match, then Im not too sure what the problem could be. Has anyone else tested the script or have any ideas?

CleverCat

  • Cat's Are Fun!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
Re: Sticky Keys Ahk request
« Reply #10 on: December 12, 2008, 01:34 PM »
Yes 510 off 511 on. Now when I turn off I get the message box, click ok then they don't come on...

Or will it only work if I lose them without doing anything?
If you need help - JUST ASK!

CleverCat

  • Cat's Are Fun!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
Re: Sticky Keys Ahk request
« Reply #11 on: December 12, 2008, 01:40 PM »
Is the script right?

Quote
#SingleInstance Force
#Persistent
#NoEnv

SetTimer, Timer, 2000

Timer:
OldValue := OutputVar
RegRead, OutputVar, HKEY_CURRENT_USER, Control Panel\Accessibility\StickyKeys, Flags
IfNotEqual, OldValue, %OutputVar%
If OutputVar <> 511
{
MsgBox, 68, Sticky Keys, The Sticky Keys are turned off. Would you like to turn them on?
IfMsgBox Yes
RegWrite, REG_SZ, HKEY_CURRENT_USER, Control Panel\Accessibility\StickyKeys, Flags, 511
}
Return
If you need help - JUST ASK!

aCkRiTe

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 21
Re: Sticky Keys Ahk request
« Reply #12 on: December 12, 2008, 05:02 PM »
Yes that is correct... I see whats happening now. When you click on yes in the message box to turn on the Sticky Keys, it updates the registry with the correct value, but if you run access.cpl, you will notice the check box for use Sticky Keys is still not checked. Im not sure why, but will see if there is anything I can come up with that updates to turn the Sticky Keys on. I assumed changing the registry value would do this, but thats not the case.

CleverCat

  • Cat's Are Fun!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
Re: Sticky Keys Ahk request
« Reply #13 on: December 13, 2008, 05:32 AM »
I'm happy for now aCkRite as at least I know they are off and can easily turn them on!  ;)

Thanks for your help - much appreciated... :Thmbsup:
If you need help - JUST ASK!

aCkRiTe

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 21
Re: Sticky Keys Ahk request
« Reply #14 on: December 13, 2008, 06:33 AM »
This is really ugly, but it works for now I guess....  :-[

Code
#SingleInstance Force
#Persistent
#NoEnv

SetTimer, Timer, 2000

Timer:
OldValue := OutputVar
RegRead, OutputVar, HKEY_CURRENT_USER, Control Panel\Accessibility\StickyKeys, Flags
IfNotEqual, OldValue, %OutputVar%
If OutputVar <> 511
	{
		MsgBox, 68, Sticky Keys, The Sticky Keys are turned off. Would you like to turn them on?
		IfMsgBox Yes
			{
				RegWrite, REG_SZ, HKEY_CURRENT_USER, Control Panel\Accessibility\StickyKeys, Flags, 511
				Run, Access.cpl
				WinWait, Accessibility Options
				WinWaitActive, Accessibility Options
				Send, {Space}{Enter}
			}
	}
Return

CleverCat

  • Cat's Are Fun!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
Re: Sticky Keys Ahk request
« Reply #15 on: December 13, 2008, 09:12 AM »
Eureka it works! :Thmbsup:

Don't care how    ;D Tis 'beautiful too me!!  :Thmbsup: :Thmbsup:


If you need help - JUST ASK!

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • Cody Award
    • Official Forum Clown
    • rotten turkey sandwich - Rotten Turkey Sandwich
Re: Sticky Keys Ahk request
« Reply #16 on: December 13, 2008, 03:59 PM »
It strikes me that this is another example of DC working at very its best.
Somebody patiently investing time to create an item that yields a significant benefit for another user.

Well done, aCkRiTe!



Chris

CleverCat

  • Cat's Are Fun!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
Re: Sticky Keys Ahk request
« Reply #17 on: December 14, 2008, 05:40 AM »
Yes, and not many use Sticky Keys so it's all the more appreciated!
If you need help - JUST ASK!

aCkRiTe

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 21
Re: Sticky Keys Ahk request
« Reply #18 on: December 14, 2008, 07:24 AM »
Well I hope it will do for now CleverCat. I know its ugly, but will try to see if I get figure out a better method for you.

and thanks Cranioscopical... I dont visit the forum that often, but try to help out when I can. Its a great forum and a lot of help all around...

CleverCat

  • Cat's Are Fun!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
Re: Sticky Keys Ahk request
« Reply #19 on: December 14, 2008, 07:49 AM »
Ugly? It's great and works as I need - not sure how you can make it 'prettier'!  ;) :Thmbsup:
If you need help - JUST ASK!

CleverCat

  • Cat's Are Fun!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
Re: Sticky Keys Ahk request
« Reply #20 on: December 15, 2008, 08:46 AM »
Just lost Sticky Keys - no pop up warning... :(

On ly works if I deliberately uncheck them?
If you need help - JUST ASK!

aCkRiTe

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 21
Re: Sticky Keys Ahk request
« Reply #21 on: December 15, 2008, 05:24 PM »
If you're not getting the pop-up then its not changing the registry value when it loses the StickyKeys. If thats the case then Im not sure how else to tell that you're losing the StickyKeys.  :(

CleverCat

  • Cat's Are Fun!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
Re: Sticky Keys Ahk request
« Reply #22 on: December 16, 2008, 06:15 AM »
Next time, I'll check registry values...
If you need help - JUST ASK!

Original address: https://www.donationcoder.com/forum/index.php?topic=16081.0