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, 6:44 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: Sticky Keys Ahk request  (Read 22850 times)

CleverCat

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Sticky Keys Ahk request
« on: December 08, 2008, 08:20 AM »
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?  ;)

aCkRiTe

  • Honorary Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 21
    • View Profile
    • Donate to Member
Re: Sticky Keys Ahk request
« Reply #1 on: December 10, 2008, 05: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...

#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

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: Sticky Keys Ahk request
« Reply #2 on: December 11, 2008, 02:07 AM »
Thanks so much - I loaded the script then turned of Sticky Keys and no message that they were off?

CleverCat

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: Sticky Keys Ahk request
« Reply #3 on: December 11, 2008, 02:10 AM »
But if I double click script in folder where I keep it I get the message! Am I doing something wrong?

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Re: Sticky Keys Ahk request
« Reply #4 on: December 11, 2008, 04: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:
#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, 04:27 AM by justice »

CleverCat

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: Sticky Keys Ahk request
« Reply #5 on: December 11, 2008, 04: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... :)

CleverCat

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: Sticky Keys Ahk request
« Reply #6 on: December 11, 2008, 06:02 AM »
Just lost StickyKeys - no pop up....

aCkRiTe

  • Honorary Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 21
    • View Profile
    • Donate to Member
Re: Sticky Keys Ahk request
« Reply #7 on: December 11, 2008, 08:37 AM »
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

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: Sticky Keys Ahk request
« Reply #8 on: December 11, 2008, 11:36 PM »
I'm on XP Home...SP3

Registry values match!
« Last Edit: December 11, 2008, 11:38 PM by CleverCat »

aCkRiTe

  • Honorary Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 21
    • View Profile
    • Donate to Member
Re: Sticky Keys Ahk request
« Reply #9 on: December 12, 2008, 01: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

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: Sticky Keys Ahk request
« Reply #10 on: December 12, 2008, 07:34 AM »
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?

CleverCat

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: Sticky Keys Ahk request
« Reply #11 on: December 12, 2008, 07:40 AM »
Is the script right?

#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

aCkRiTe

  • Honorary Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 21
    • View Profile
    • Donate to Member
Re: Sticky Keys Ahk request
« Reply #12 on: December 12, 2008, 11:02 AM »
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

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: Sticky Keys Ahk request
« Reply #13 on: December 12, 2008, 11:32 PM »
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:

aCkRiTe

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

#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

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: Sticky Keys Ahk request
« Reply #15 on: December 13, 2008, 03:12 AM »
Eureka it works! :Thmbsup:

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



cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • View Profile
    • Donate to Member
Re: Sticky Keys Ahk request
« Reply #16 on: December 13, 2008, 09:59 AM »
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!




CleverCat

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: Sticky Keys Ahk request
« Reply #17 on: December 13, 2008, 11:40 PM »
Yes, and not many use Sticky Keys so it's all the more appreciated!

aCkRiTe

  • Honorary Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 21
    • View Profile
    • Donate to Member
Re: Sticky Keys Ahk request
« Reply #18 on: December 14, 2008, 01: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

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

CleverCat

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: Sticky Keys Ahk request
« Reply #20 on: December 15, 2008, 02:46 AM »
Just lost Sticky Keys - no pop up warning... :(

On ly works if I deliberately uncheck them?

aCkRiTe

  • Honorary Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 21
    • View Profile
    • Donate to Member
Re: Sticky Keys Ahk request
« Reply #21 on: December 15, 2008, 11:24 AM »
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

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: Sticky Keys Ahk request
« Reply #22 on: December 16, 2008, 12:15 AM »
Next time, I'll check registry values...