I am using a compact keyboard, the numpad won't work correctly until set Numlock on.
In previous Karabiner version, I can use following settings to achieve this:
This selection VK_IOHIKEYBOARD_TOGGLE_NUMLOCK doesn't seem to exist in the Karabiner-Elements.
Could you implement this to achieve the same as the existing version? this feature is really useful for users using compact keyboard, as the num pad is disabled by default, without Karabiner, the number pad cannot be used properly.
Thanks a lot.

I didn't find the VK_IOHIKEYBOARD_TOGGLE_NUMLOCK in the menu. Anyone could help me? Thanks a lot
@tekezo Dear 扶美彦 様、would you have time to implement this? thanks a mill. That feature is so useful for a compact keyboard. Without mapping, the num pad cannot be used to input number. Thanks.
I find there is a mapping from Locking_num_lock to keypad_num_lock but not vice versa.
Is it possible to have keypad_num_lock (mac clear key) map to Locking_num_lock(windows numLock key)? I find there is no Locking_num_lock in Pc keys column.

I find user can edit the JSON file, but for some reason cannot map a key to windows locking_num_lock. As it has "not_to" : true
{
"name": "locking_num_lock",
"not_to": true
},
The num_lock map to PC keyboard num_lock can be very important for certain users. Could any other having same issue please comment here.
I would also appreciate this feature, and would be willing to test or build this if provided some guidance
Hi guys, i had the same problem and just wanted to share my alternative solution so I could hopefully help some of you out.
Here you can find a program called setledsmac:
https://github.com/damieng/setledsmac
I have made a modified version with some minor changes. On my version, instead of having to specify if you want numlock on or off, you only have to do: "setleds num" and it will automatically change the state of numlock. I'm going to attach the altered version of setledsmac to this comment. I do not take any credit for this program as I did not make it (only altered it ever so slightly). All credit should go to @damieng.
Download attached zip file.
setledsmac.zip
Open terminal and navigate to the Source folder of setledmacs.
Run on terminal window:
xcodebuild -project SetLEDs.xcodeproj (alternatively just compile with gcc or other C compiler)
cd build/Release
sudo cp setleds /usr/local/bin
You can now run setleds num to change the state of your numlock, as long as you have /usr/local/bin on your PATH environment variable.
setleds num run when pressing numlock:Download Spark:
https://www.shadowlab.org/softwares/spark.php
Open spark and double-click AppleScript on the left-side.
Click on the shortcut field and then press the numlock key
Paste this script on the script field:
_do shell script "PATH=$PATH:/usr/local/bin
export PATH
setleds num"_
Click create and then click "Start Spark Daemon" at the bottom.
NumLock should now be functioning correctly.
P.S. If you get a segmentation fault while running setleds or numlock stops working, try restarting your computer.
@luismeruje Thanks for the tool, however, it gives the following error output when executed:
admin:~ admin$ setleds num
SetLEDs version 0.1 - http://github.com/damieng/setledsmac
Modified by: Luís Ferreira - [email protected]
Segmentation fault: 11
@whitebird Does the original setledsmac version work for you?
I'm also getting that error when compiling with latest tools in modified
version. Strangely works fine in the debugger.
On Thu, Nov 2, 2017, 6:53 AM luismeruje notifications@github.com wrote:
Does the original setledsmac version work for you?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/tekezo/Karabiner-Elements/issues/719#issuecomment-341427485,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAHQp16cHu9TPdY9ORWvBomoXWrL6g2Kks5syclXgaJpZM4NJcEk
.
Sorry, meant unmodified version.
@luismeruje It does for me yes. Output after compiling and running command setleds. When I tried your program again this morning after rebooting, it worked. I unplugged and replugged my keyboard in the meantime.
I remember it happening to me once too. It was giving out a segmentation fault, and then I did the same as you, I rebooted, and I haven't had any problems since.
As long as it doesn't happen very often I'm okay with rebooting once in a while. Sorry I can't be of more help.
Also, @damieng thank you so much for creating this tool, it turned out to be really useful.
@luismeruje thanks for the tip! Worked for me out of the gate without needing to reboot or replug my kb.
Rather than have a different version of setleds floating round with the same name but with different functionality I've added a new toggle mode so it can suit all, e.g.
setleds +caps ^num
Will turn on the caps lock and toggle the num lock. (You can still use - to turn a setting off)
@damieng any chance you could just attach the release version / binary on your github page for those of us w/o xcode?
I'd also like a precompiled binary if that is at all possible. I don't want to have to install Xcode (at over 4 GB last time I looked) on my SSD, nor do I want to have to get an Apple Developer Account that I will never use again just for this one program. Please?
Release binary up at https://github.com/damieng/setledsmac/releases/tag/0.2
Thank you for making the effort, but it doesn't seem to work. Here is the output of a few runs:
$ ./setleds +num
SetLEDs version 0.2 - https://github.com/damieng/setledsmac
"Karabiner VirtualHIDKeyboard"
"Logitech Illuminated Keyboard" ?num ?caps ?scroll
Some state could not be determined. Please try running as root/sudo.
$ sudo ./setleds ^num
SetLEDs version 0.2 - https://github.com/damieng/setledsmac
"Karabiner VirtualHIDKeyboard"
"Logitech Illuminated Keyboard" ?num ?caps ?scroll
Some state could not be determined. Please try running as root/sudo.
$ sudo ./setleds ^num -name "Logitech*"
SetLEDs version 0.2 - https://github.com/damieng/setledsmac
"Logitech Illuminated Keyboard" ?num ?caps ?scroll
Some state could not be determined. Please try running as root/sudo.
$ sudo ./setleds -v +num -name "Logitech*"
SetLEDs version 0.2 - https://github.com/damieng/setledsmac
"Logitech Illuminated Keyboard" ?num ?caps ?scroll
Some state could not be determined. Please try running as root/sudo.
Obviously it is finding the keyboard but for some reason it cannot seem to detect the current state. I am running MacOS High Sierra version 10.3.3.
The Logitech keyboard doesn't seen to have caps or scroll LED's, if that makes any difference. It only has a rather bright NumLock LED.
In case it's at all helpful, this was the private xml code that would work in the former version of Karabiner - this used the alt-command-control-escape keys (hold down alt-command-control and press ESC) to toggle the NumLock LED:
<?xml version="1.0"?>
<root>
<item>
<name>Toggle NumLock LED by holding Alt+Command+Control+Escape keys</name>
<identifier>private.toggle_numlock_by_alt-command-control-escape</identifier>
<autogen>
__KeyToKey__
KeyCode::ESCAPE, VK_COMMAND | VK_CONTROL | VK_OPTION
__{ KeyCode::VK_IOHIKEYBOARD_TOGGLE_NUMLOCK }__
</autogen>
</item>
</root>
Unfortunately it appears there is no way to use private XML in Karabiner Elements.
Yes, it seems Karabiner's virtual keyboard is still interfering with LED state calls as documented here https://github.com/damieng/setledsmac/issues/7
Well that stinks. It means I have to quit Karabiner-Elements, run setleds (which does work if K-E is not running) and then start Karabiner-Elements again. That said, I very much appreciate that you made your program available even with this limitation.
I attempted to figure out if there was some way to run your program at bootup before K-E runs. But however K-E is starting itself up, it's happening early enough in the bootup process that I have no idea how to get setleds to run first. I only need it to run once, right after startup - well, maybe more than once; for some reason with my keyboard I have to use the -v option and even then it seems like sometimes I have to run it two or three times (starting with the ^num option) to get it to work. I'm not sure why my keyboard is so stubborn, but it is.
Thank you again for your work on this, I will still use it despite the limitations, which are not your fault anyway.
EDIT: After writing the above I discovered this page https://developer.apple.com/library/content/technotes/tn2450/_index.html and found I could use the first method shown to do all the key remapping I was trying to do in Karabiner. So I used Automator to create an application and used the "Run Shell Script" action and created a script that runs your utility first, then a "hidutil property --set ..." command to remap my keys (I also had to check the "Ignore this action's input" box under "Options" to stop Automator from complaining). By doing that I can run the application that Automator builds as a Login Item under my account and it all seems to work. Not all Karabiner Elements users would be able to do that; if you are doing anything more than simple key remapping this wouldn't work, but for what I wanted to do (remap the numeric keypad so it always sends the directional keys rather than the numbers) it works great.
As an example this is what I put into the "Run Shell Script" action in Automator:
~/setleds -v ^num
~/setleds -v ^num
~/setleds -v -num
~/setleds -v -num
~/setleds -v -num
/usr/bin/hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000059,"HIDKeyboardModifierMappingDst":0x70000004D},{"HIDKeyboardModifierMappingSrc":0x70000005A,"HIDKeyboardModifierMappingDst":0x700000051},{"HIDKeyboardModifierMappingSrc":0x70000005B,"HIDKeyboardModifierMappingDst":0x70000004E},{"HIDKeyboardModifierMappingSrc":0x70000005C,"HIDKeyboardModifierMappingDst":0x700000050},{"HIDKeyboardModifierMappingSrc":0x70000005D,"HIDKeyboardModifierMappingDst":0x700000000},{"HIDKeyboardModifierMappingSrc":0x70000005E,"HIDKeyboardModifierMappingDst":0x70000004F},{"HIDKeyboardModifierMappingSrc":0x70000005F,"HIDKeyboardModifierMappingDst":0x70000004A},{"HIDKeyboardModifierMappingSrc":0x700000060,"HIDKeyboardModifierMappingDst":0x700000052},{"HIDKeyboardModifierMappingSrc":0x700000061,"HIDKeyboardModifierMappingDst":0x70000004B},{"HIDKeyboardModifierMappingSrc":0x700000062,"HIDKeyboardModifierMappingDst":0x700000049},{"HIDKeyboardModifierMappingSrc":0x700000063,"HIDKeyboardModifierMappingDst":0x70000004C}]}'
I only run setleds five times as shown here because this keyboard is so cranky that one time generally won't do it. Three times would probably be enough but I just prefer to make certain it will work. I also noticed it is more likely to work if the first attempt or two uses ^num rather than -num, and if I use the -v option - no idea why. If setleds doesn't seem to work, I'd try replacing ~/ with the actual path in the first five lines.
Of course if Karabiner Elements had a built-in way to turn off the numlock LED like the old Karabiner did, I'd probably still be using it, but using this I don't even have to press any key combination to turn it off, so I'm happy!
Is this going to be featured natively on Karabiner-Elements?
@citbr does this work for toggle num_lock on and off on a compact keyboard like cooler master stealth? As I will need to toggle the LED lights on and off in order to use number pad or the page up/ page down insert delete etc..
@carrigmore setleds literally just sets the led itself. Turning on the led does not turn on the functionality. i.e. with this you can turn on the caps lock light without actually turning on caps lock. It's just useful if you have backlit LED keyboards that look better with all the lights on.
@damieng thanks for your kind answer, I don't know how to toggle on the functionality between the number pad and normal insert delete button.
@damieng Actually I have a Cooler Master Quick Fire TK and by simply turning the light on the functionality is also activated. I guess there's an hardware connection that toggles the alternative keyboard matrix when the light is on. I'm not sure that's the case with every keyboard however.
Hello, I also could not figure out how to enable NumLock for an external USB numeric keypad, to support the use of the arrow/pgup/pgdn keys. I ended up having to find and install the last version of Karabiner to use the private.xml described here: https://apple.stackexchange.com/a/267439
@vitorio you mean the old non-"elements" version? Does that actually work on the current Mac OS? I thought from the notes that it did not.
Also a bit sad that there seems to be no movement on this issue from the developer, and half the conversation here has turned to controlling the LED.
Having the LED work properly is great and all, but the main issue is the num lock functionality. I'd happily take that without proper LED syncing…
@krc Karabiner 10.22.0 is working fine for me, but I'm still on 10.11 El Capitan
Any update for this?
@tekezo can you implement this or point me to where/how I might be able to implement that for you?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
+1
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Any update for this?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi! Is there any chance for this going to be implemented? Please 🙏🏼
Please could this get re-opened
I have a realforce 87u and want to use the embedded numpad via the NumLock key.
I have a QuickFire TKL 6 keys and I also need Karabiner-Elements to feature the option to remap my numlock key.
Side note: I downloaded KeyCastr to check what the key counts as on the keyboard. If I press NUMLK on my QuickFire TKS keyboard, KeyCastr interprets it as ESC (circle with arrow facing northwest). Likewise PRTSC, SCRLK, PAUSE are F13, F14, F15 on KeyCastr.
Most helpful comment
@damieng Actually I have a Cooler Master Quick Fire TK and by simply turning the light on the functionality is also activated. I guess there's an hardware connection that toggles the alternative keyboard matrix when the light is on. I'm not sure that's the case with every keyboard however.