Welcome Guest.   Make a donation to an author on the site April 24, 2014, 06:04:05 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.
 
The N.A.N.Y. Challenge 2011! Download 30+ custom programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: Sticky Keys Ahk request  (Read 9274 times)
CleverCat
Supporting Member
**
Posts: 1,112


Cat's Are Fun!

see users location on a map View Profile Give some DonationCredits to this forum member
« on: December 08, 2008, 08:20:28 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?  Wink
Logged

If you need help - JUST ASK!
aCkRiTe
Honorary Member
**
Posts: 21

View Profile Give some DonationCredits to this forum member
« Reply #1 on: December 10, 2008, 05:04:15 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...

[copy or print]
#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
Logged
CleverCat
Supporting Member
**
Posts: 1,112


Cat's Are Fun!

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #2 on: December 11, 2008, 02:07:37 AM »

Thanks so much - I loaded the script then turned of Sticky Keys and no message that they were off?
Logged

If you need help - JUST ASK!
CleverCat
Supporting Member
**
Posts: 1,112


Cat's Are Fun!

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #3 on: December 11, 2008, 02:10:16 AM »

But if I double click script in folder where I keep it I get the message! Am I doing something wrong?
Logged

If you need help - JUST ASK!
justice
Supporting Member
**
Posts: 1,885



Solve issues simply.

View Profile WWW Give some DonationCredits to this forum member
« Reply #4 on: December 11, 2008, 04:25:23 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:
[copy or print]
#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:46 AM by justice » Logged

CleverCat
Supporting Member
**
Posts: 1,112


Cat's Are Fun!

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #5 on: December 11, 2008, 04:46:50 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... smiley
Logged

If you need help - JUST ASK!
CleverCat
Supporting Member
**
Posts: 1,112


Cat's Are Fun!

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #6 on: December 11, 2008, 06:02:23 AM »

Just lost StickyKeys - no pop up....
Logged

If you need help - JUST ASK!
aCkRiTe
Honorary Member
**
Posts: 21

View Profile Give some DonationCredits to this forum member
« Reply #7 on: December 11, 2008, 08:37:07 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.
Logged
CleverCat
Supporting Member
**
Posts: 1,112


Cat's Are Fun!

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #8 on: December 11, 2008, 11:36:36 PM »

I'm on XP Home...SP3

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

If you need help - JUST ASK!
aCkRiTe
Honorary Member
**
Posts: 21

View Profile Give some DonationCredits to this forum member
« Reply #9 on: December 12, 2008, 01:27:28 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?
Logged
CleverCat
Supporting Member
**
Posts: 1,112


Cat's Are Fun!

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #10 on: December 12, 2008, 07:34:46 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?
Logged

If you need help - JUST ASK!
CleverCat
Supporting Member
**
Posts: 1,112


Cat's Are Fun!

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #11 on: December 12, 2008, 07:40:14 AM »

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
Logged

If you need help - JUST ASK!
aCkRiTe
Honorary Member
**
Posts: 21

View Profile Give some DonationCredits to this forum member
« Reply #12 on: December 12, 2008, 11:02:39 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.
Logged
CleverCat
Supporting Member
**
Posts: 1,112


Cat's Are Fun!

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #13 on: December 12, 2008, 11:32:11 PM »

I'm happy for now aCkRite as at least I know they are off and can easily turn them on!  Wink

Thanks for your help - much appreciated... Thmbsup
Logged

If you need help - JUST ASK!
aCkRiTe
Honorary Member
**
Posts: 21

View Profile Give some DonationCredits to this forum member
« Reply #14 on: December 13, 2008, 12:33:13 AM »

This is really ugly, but it works for now I guess....  embarassed

[copy or print]
#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
Logged
CleverCat
Supporting Member
**
Posts: 1,112


Cat's Are Fun!

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #15 on: December 13, 2008, 03:12:00 AM »

Eureka it works! Thmbsup

Don't care how    Grin Tis 'beautiful too me!!  Thmbsup Thmbsup


Logged

If you need help - JUST ASK!
cranioscopical
Friend of the Site
Supporting Member
**
Posts: 4,158



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #16 on: December 13, 2008, 09:59:07 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!



Logged

Chris
CleverCat
Supporting Member
**
Posts: 1,112


Cat's Are Fun!

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #17 on: December 13, 2008, 11:40:14 PM »

Yes, and not many use Sticky Keys so it's all the more appreciated!
Logged

If you need help - JUST ASK!
aCkRiTe
Honorary Member
**
Posts: 21

View Profile Give some DonationCredits to this forum member
« Reply #18 on: December 14, 2008, 01:24:12 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...
Logged
CleverCat
Supporting Member
**
Posts: 1,112


Cat's Are Fun!

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #19 on: December 14, 2008, 01:49:31 AM »

Ugly? It's great and works as I need - not sure how you can make it 'prettier'!  Wink Thmbsup
Logged

If you need help - JUST ASK!
CleverCat
Supporting Member
**
Posts: 1,112


Cat's Are Fun!

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #20 on: December 15, 2008, 02:46:08 AM »

Just lost Sticky Keys - no pop up warning... Sad

On ly works if I deliberately uncheck them?
Logged

If you need help - JUST ASK!
aCkRiTe
Honorary Member
**
Posts: 21

View Profile Give some DonationCredits to this forum member
« Reply #21 on: December 15, 2008, 11:24:46 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.  Sad
Logged
CleverCat
Supporting Member
**
Posts: 1,112


Cat's Are Fun!

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #22 on: December 16, 2008, 12:15:44 AM »

Next time, I'll check registry values...
Logged

If you need help - JUST ASK!
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.038s | Server load: 0.04 ]