|
Ralf Maximus
|
 |
« on: June 28, 2007, 12:36:23 PM » |
|
Howdy,
I've searched for a utility (or HotKeys script) that automatically forces NUMLOCK to remain on at all times. I have some ill-behaved apps that turn it off, and when I go to use the keypad...
So, anything?
Thanks, Ralf
|
|
|
|
|
Logged
|
|
|
|
|
jgpaiva
|
 |
« Reply #1 on: June 28, 2007, 01:27:20 PM » |
|
In autohotkey, the following code was supposed to do what you're asking for: [ copy or print] ; ;By jgpaiva ;date: June 2007 ;Function: #installkeybdhook SetNumLockState,On SetNumLockState,AlwaysOn return It isn't working here, maybe because i own a laptop, so.. Just give it a go 
|
|
|
|
|
Logged
|
|
|
|
|
Ralf Maximus
|
 |
« Reply #2 on: June 28, 2007, 02:13:08 PM » |
|
Thanks for the reply!
Alas, I tried it here and no workee. I've got a Dell Optiplex with a standard 101 keyboard (USB). All the other AutoHotKey stuff I have works fine, and the code above compiles without complaint. But the numlock refuses to stay locked on.
Bah...
|
|
|
|
|
Logged
|
|
|
|
|
|
app103
|
 |
« Reply #3 on: June 28, 2007, 02:33:02 PM » |
|
I found this: http://www.petri.co.il/ch...numlock_default_state.htmTo control the state of the NumLock key follow these steps: 1. Open Registry Editor. 2. In Registry Editor, navigate to the following registry key: 3. Create the following value (DWORD): and give it a value of 0 (zero) or 2 (two) - 0 = NumLock is turned off after logon
- 2 = NumLock is turned on after logon
Note: As always, before making changes to your registry you should always make sure you have a valid backup. In cases where you're supposed to delete or modify keys or values from the registry it is possible to first export that key or value(s) to a .REG file before performing the changes. 4. Close Registry Editor and reboot the computer. Have you tried something like this yet? Also check here to see if the setting is 0 or 2: [ copy or print] HKEY_CURRENT_USER\Control Panel\Keyboard\ [InitialKeyboardIndicators] If you have a 2 in the first key but a 0 in the 2nd one that could be the problem.
|
|
|
|
|
Logged
|
|
|
|
|
jgpaiva
|
 |
« Reply #4 on: June 28, 2007, 02:35:46 PM » |
|
Interesting... Apparently, the command does have an effect on my computer: the led signaling numlock's state doesn't change anymore. Too bad that numlock's state does 
|
|
|
|
|
Logged
|
|
|
|
|
Ralf Maximus
|
 |
« Reply #5 on: June 28, 2007, 03:02:47 PM » |
|
Hacking the registry only sets the default state upon Windows login. Alas, it does not prevent the numlock state from toggling.
Too bad...
|
|
|
|
|
Logged
|
|
|
|
|
lanux128
|
 |
« Reply #6 on: June 28, 2007, 11:22:42 PM » |
|
try this then: KLOCKS - Commandline Lock Keys Controller.  Klocks is a Win32 commandline utility for NT4/W2K/XP/2003 that allows the Num, Caps and Scroll lock keys to be turned on, off or toggled. Just put create a shortcut in the startup folder with the appropriate parameter. http://www.commandline.co.uk/klocks/index.html
|
|
|
|
|
Logged
|
|
|
|
|
app103
|
 |
« Reply #7 on: June 29, 2007, 02:44:21 AM » |
|
I was just taking a look at that Klocks thing (didn't try it though).
Is that just some sort of switch that turns it on & off that needs to be run each time you want it done?
He said that some application keeps switching it off and he doesn't know which one it could be. If he were to run that Klocks thing to turn it back on, exactly how could he do it and it be in any way effective and automated? On a timer, as a scheduled task? If so, how often?
I have been thinking about this little problem and how to solve it. I think what needs to be done is some sort of application that can run in the background that has a global keyboard hook that on every keypress will check to see if the numlock is on, and if not then turn it on. Then if some application turns it off, the next key that is pressed would turn it back on automatically. It would be turning every key on the keyboard into a 'numlock on' key, in addition to the normal key functionality.
Then at the very worst it would just be one keypress that would be affected if he were to use the numpad without it being on. (which is a bit unlikely to happen if he is a keyboard freak that switches windows with alt+tab or uses something like FARR to run applications)
|
|
|
|
|
Logged
|
|
|
|
|
Ralf Maximus
|
 |
« Reply #8 on: June 29, 2007, 08:33:54 AM » |
|
App103: Bingo, that's it.
I have something called CAPShift that does that for the Caps Lock; the minute you turn on Caps Lock, CAPShift toggles it off again. CAPShift gets loaded at the start of my Windows session and runs silently in the background. It stays in memory until the machine reboots.
I need something that does that same trick for Num Lock, but in this case keep the bugger turned on forever.
Thanks!
|
|
|
|
|
Logged
|
|
|
|
|
lanux128
|
 |
« Reply #9 on: June 30, 2007, 03:31:14 AM » |
|
ah, i misread the earlier posts but still a script written in AHK could monitor the situation and toggle the numlock status. i'll post one in a day or two if no one beats me to it..  btw, Ralf what's the model of your Optiflex?
|
|
|
|
|
Logged
|
|
|
|
|
jgpaiva
|
 |
« Reply #10 on: June 30, 2007, 05:10:12 AM » |
|
ah, i misread the earlier posts but still a script written in AHK could monitor the situation and toggle the numlock status. i'll post one in a day or two if no one beats me to it..  btw, Ralf what's the model of your Optiflex? I also thought so,but apparently an ahk script that toggles the state of numlock has no effect on my computer, other than toggling the led that reports numlock's state... Possibly it's because a laptop, but that means i can't test any script i make 
|
|
|
|
|
Logged
|
|
|
|
|
lanux128
|
 |
« Reply #11 on: June 30, 2007, 05:21:59 AM » |
|
i suspect that it's a laptop too, that's why i asked for the model because sometimes laptop manufacturers put in their own combinations with the Fn keys..
|
|
|
|
|
Logged
|
|
|
|
|
Ralf Maximus
|
 |
« Reply #12 on: June 30, 2007, 11:39:04 AM » |
|
I've got an Optiplex GX620. Love it, love it, love it. Bought it for cheap at the Dell outlet store online.
USB keyboard, if that matters. The only software I've discovered that it doesn't like is anything that tries to toggle the keyboard LED's in real-time according to disk activity. No big loss. :-)
To summarize the thread so far:
0. Need a utility to monitor the state of NUMLOCK and switch it back on if it gets turned off, either by keyboard action (butterfingers) or via a rude application.
1. The "standard" AHK script to toggle NUMLOCK doesn't work here, but according to others it doesn't seem to work anywhere.
2. I have other AHK scripts purring along in the background that work fine. I keep everything in autohotkey.ini, but a standalone .exe would be fine.
3. Hacking the registry only sets the state of NUMLOCK at startup. Not my problem, since the Dell BIOS has a nice feature to configure that.
Thanks!
|
|
|
|
|
Logged
|
|
|
|
|
lanux128
|
 |
« Reply #13 on: July 01, 2007, 01:59:15 AM » |
|
thanks Ralf, can you try this script and let me know if it works? since you already have AHK, i haven't compiled the script into an EXE. NumLock Enforcer• monitors and keeps your NumLock key on. • needs Autohotkey. ; NumLock Enforcer ; To monitor and switch on the NumLock key ; Date: 01/07/2007 ;Last Updated: 01/07/2007 ; Refer: hxxp://www.donationcoder.com/forum/index.php?topic=9018 ; Changes since: ; ***** ; #SingleInstance force ;#NoTrayIcon ;if you don't need a tray icon #InstallKeybdHook #Persistent
;Menu, tray, Icon, %A_WinDir%\System32\shell32.dll, 105 appname=NumLock Enforcer SetTimer, EnforceNumLock, 500 Return
EnforceNumLock: NumLockStatus := GetKeyState("Numlock", "T") IfEqual, NumLockStatus, 0 { SetNumLockState, On ;Uncomment the below line if you want some kind of feedback. ;TrayTip,%appname%,NumLock Status = On,,1 } Return
;Win+p pauses the script,just in case you need the NumLock. #p::Pause
;Win+q exits... #q::ExitApp NumLock Enforcer.ahk (0.79 KB - downloaded 477 times.)
|
|
|
|
|
Logged
|
|
|
|
|
Ralf Maximus
|
 |
« Reply #14 on: July 01, 2007, 12:48:56 PM » |
|
Yayy! That works! Exactly what I need.
Thank you.
|
|
|
|
|
Logged
|
|
|
|
|
lanux128
|
 |
« Reply #15 on: July 01, 2007, 09:16:38 PM » |
|
you're welcome! glad to be of help.. 
|
|
|
|
|
Logged
|
|
|
|
|