Questions tagged [num-lock]

Use this tag for all topics relating to the Num-Lock functionality of a keyboard or its Num-Lock LED.

The Num-Lock(Number-Lock) is a functionality of keyboards to toggle the mapping of the so-called Number Block. It is usually realized with a Num-Lock-Key and changes between either a Cursor Block(Num-Lock off) or a Number Block(Num-Lock on). The respective LED on the keyboard usually indicates the state of this function, but can be reprogrammed for any purpose via the PS/2 keyboard controller.

31 questions
9
votes
2 answers

Check Scroll Lock, Num Lock & Caps Lock in JavaScript on Page Load

Is it possible to check the status of Scroll Lock, Num Lock and Caps Lock on page load of a web page? I've found ways to check after a keypress using JavaScript, but that's not what I'm asking.
JustBeingHelpful
  • 18,332
  • 38
  • 160
  • 245
5
votes
0 answers

How do I use the NumLock LED to indicate Compose is active in X.org?

I have a Compose key on my keyboard, but use the NumLock key for other purposes whilst using the numpad for entering numbers only. So I don't really need a NumLock indicator, but would like to use this LED to indicate that the Compose key is active.…
Neppomuk
  • 1,102
  • 1
  • 11
  • 24
5
votes
1 answer

Detecting a NUMLOCK / CAPSLOCK / SCRLOCK keypress/keyup in Python

In a game I'm developing, I want to detect a NUMLOCK keypress (or keyup), like registering a "callback" function when it gets pressed. I'm not asking to read its state in a given moment, I can do that already, nor I'm interested in changing its…
MestreLion
  • 12,698
  • 8
  • 66
  • 57
5
votes
3 answers

Disabling num-lock toggle in C#?

I would like to maintain num-lock ON as long as my application is running, so that if the user un-toggles num-lock, it will immediately be toggled back on. What's the simplest way to achieve that in C#? To clarify, while my application is running I…
Roee Adler
  • 33,434
  • 32
  • 105
  • 133
4
votes
2 answers

Can you turn NumLock on in XNA?

Can you turn NumLock on in XNA? (I'm looking for a solution to XNA Number lock affects input.)
Xonatron
  • 15,622
  • 30
  • 70
  • 84
4
votes
3 answers

How can I check and toggle Num-Lock programmatically in C#?

I would like to programmatically check the value of, and be able to toggle num-lock. What's the simplest way to do that in C#? The reason is that I want to verify num-lock is "ON" at program start. Thanks
Roee Adler
  • 33,434
  • 32
  • 105
  • 133
3
votes
1 answer

Is there any way, in Python, to programmatically change the CAPS LOCK/NUM LOCK/SCROLL LOCK states on a hidraw device

This is the same question as in Change keyboard locks in Python or How to change caps lock status without key press. But there is a difference!! I don't want to change the lights on /dev/console or /dev/tty but on a human interface device that is…
Jorg K
  • 91
  • 3
2
votes
0 answers

How to check NUM LOCK key state in Java in a portable way without displaying a frame?

I want to know at runtime if the NUM LOCK or the CAPS LOCK key is on or off. But I need to do that in a portable way (for all Java platforms). The following two methods don't work: 1) It throws UnsupportedOperationException:…
Luis Soeiro
  • 4,262
  • 6
  • 35
  • 45
2
votes
1 answer

Why is numlock off by default?

Is there any specific reason for that? Any thought would be appreciated. Not looking for how to enable it.
Dragas
  • 1,140
  • 13
  • 29
2
votes
0 answers

How to prevent NumLock from disabling?

I'm making a simple game and I want to control it using numeric keyboard (including NumLock key). A player should be able to press several keys simultaneously, or press and hold any key. After NumLock key is pressed, I have to turn NumLock back on…
grabantot
  • 2,111
  • 20
  • 31
2
votes
1 answer

Getting and setting NumLock state in Lazarus

Is there a reliable cross-platform way to programmatically get and set the NumLock state in Lazarus / Free Pascal? I've found GetKeyState() in LclIntf which seems to work for getting the state (and is apparently cross-platform), but I can't find an…
Fat Monk
  • 2,077
  • 1
  • 26
  • 59
2
votes
1 answer

Keylistener not responding to numlock numbers

i'm making a keylistener that listens to ctrl-1 and ctrl-2. Im making a quiz for teams. Team 1 should press ctrl-1 if they want to answer. Team 2 should press ctrl-2 if they want to answer. The reason i chose for ctrl is because there are 2 control…
1
vote
1 answer

How do I manually toggle the NumLock Key with C# in WPF?

I've been searching for a while and there are mostly results in C++ or other languages, and not C#. Things I've seen: keybd_event() // A c++ method that theoretically can be included with a DLL import, but hasn't worked in testing …
not_a_generic_user
  • 1,906
  • 2
  • 19
  • 34
1
vote
1 answer

Excel VBA - make sure Numlock is always ON

I know this has been put to the attention before, but I can't solve it. I have a button that calls a sub and in that sub I want to make sure that numlock is always on. The first time, i.e. if the numlock is off it turns it on. If it's already on,…
Dolphin975
  • 157
  • 2
  • 10
1
vote
2 answers

How do I remap the NumLock key in Java Swing?

You may have read my earlier question about remapping my keyboard at a low level in Java and I did find a solution - mostly. To be honest, I oversimplified the problem I was trying to solve. I not only want to match NumericKeypad 1-3 to 7-9 and…
Steve Cohen
  • 4,679
  • 9
  • 51
  • 89
1
2 3