Welcome Guest.   Make a donation to an author on the site July 27, 2014, 11:17:48 PM  *

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 2013! Download dozens of custom programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: Request: Force NUMLOCK always on  (Read 10003 times)
Ralf Maximus
Supporting Member
**
Posts: 927



View Profile Read user's biography. Give some DonationCredits to this forum member
« 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
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« 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 Wink
Logged

Ralf Maximus
Supporting Member
**
Posts: 927



View Profile Read user's biography. Give some DonationCredits to this forum member
« 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
That scary taskbar girl
Global Moderator
*****
Posts: 5,116



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: June 28, 2007, 02:33:02 PM »

I found this:

http://www.petri.co.il/ch...numlock_default_state.htm

Quote
To control the state of the NumLock key follow these steps:

1. Open Registry Editor.

2. In Registry Editor, navigate to the following registry key:

[copy or print]
HKEY_USERS\.DEFAULT\Control Panel\Keyboard

3. Create the following value (DWORD):

[copy or print]
InitialKeyboardIndicators

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
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« 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 Sad
Logged

Ralf Maximus
Supporting Member
**
Posts: 927



View Profile Read user's biography. Give some DonationCredits to this forum member
« 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
Global Moderator
*****
Posts: 6,087



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #6 on: June 28, 2007, 11:22:42 PM »

try this then: KLOCKS - Commandline Lock Keys Controller. smiley

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
That scary taskbar girl
Global Moderator
*****
Posts: 5,116



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« 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
Supporting Member
**
Posts: 927



View Profile Read user's biography. Give some DonationCredits to this forum member
« 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
Global Moderator
*****
Posts: 6,087



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« 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.. Wink btw, Ralf what's the model of your Optiflex?
Logged

jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« 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.. Wink 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 Sad
Logged

lanux128
Global Moderator
*****
Posts: 6,087



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« 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
Supporting Member
**
Posts: 927



View Profile Read user's biography. Give some DonationCredits to this forum member
« 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
Global Moderator
*****
Posts: 6,087



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« 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. smiley

NumLock Enforcer
• monitors and keeps your NumLock key on.
• needs Autohotkey.


* NumLock Enforcer.ahk (0.79 KB - downloaded 670 times.)
Logged

Ralf Maximus
Supporting Member
**
Posts: 927



View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #14 on: July 01, 2007, 12:48:56 PM »

Yayy!  That works!  Exactly what I need.

Thank you.
Logged
lanux128
Global Moderator
*****
Posts: 6,087



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #15 on: July 01, 2007, 09:16:38 PM »

you're welcome! glad to be of help.. Cool
Logged

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.045s | Server load: 0.13 ]