Win 'sticky keys'
Blitz3D Forums/Blitz3D Beginners Area/Win 'sticky keys'
| ||
Just spent a load of time on tweaking my UI and included the use of SHIFT key. And ran smack bang into the classic schoolboy error as WinXP popped up the 'Turn on sticky keys' dialog. Is there any way to turn this off from within a program - or do I have to revert my GUI ? |
| ||
You will have to do a win32 call most likely, found some info here... http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/GamesForWindows/DisablingShortcutKeys.asp |
| ||
Cheers Shambler... ... yet another excuse to throw a dll into the mix ! I will possibly try this in the next few days and post it to the codearcs if I get it working |
| ||
Disable the Windows Key with a Keyboard Hook Where do I get one of those hooks? I assume I put it under the key and prise the key off the keyboard ;P |
| ||
Suppose that's what you'd call a real pirate coder ;) Sigh... :D |
| ||
That pun was just... bad. |
| ||
:( |
| ||
I have posted a dll to the codearcs. Disabling sticky keys and stuff |
| ||
without having to include a dll you could try this. XP/2000. Check for OS. I don't think 98 has the stickykeys annoyance in it. http://www.blitzbasic.com/codearcs/codearcs.php?code=1136 Default [HKEY_CURRENT_USER\Control Panel\Accessibility\StickyKeys] "Flags"="510" Off [HKEY_CURRENT_USER\Control Panel\Accessibility\StickyKeys] "Flags"="506" Although you should read and store the original value to put it back when the game exits |
| ||
What does sticky keys even do that justifies its evilness, anyways?! |
| ||
If you press 'Shift' 5 times, a dialog pops up that will drop you out of full screen mode to show a 'Turn on sticky keys ?' dialog... not very good for the flow of your game. If you hold down the Right Shift key for 8 seconds you will get a similar dialog for 'Filter Keys' that ignores very quick key presses (e.g. hammering the fire button !) @Ice9: That's a good solution - wish you had popped it up earlier :-( N.B. it is probably not enough to store the original value as a variable to be restored at the end of the program... If your program crashes then you will have changed the registry without restoring it - not good style from the user's point of view. Store it to a file instead, probably with some kind of flag to show that the program exited gracefully. |