pqrs-org / Karabiner-archived

Karabiner (KeyRemap4MacBook) is a powerful utility for keyboard customization.
https://pqrs.org/osx/karabiner/
The Unlicense
3.82k stars 309 forks source link

IOHIDLib SCROLLLOCK indicator #280

Open nw opened 10 years ago

nw commented 10 years ago

This is a bit out of my domain just trying to put the pieces together.

After looking at VK_IOHIKEYBOARD_TOGGLE_NUMLOCK an inspecting IOHIKeyboard I realized that SCROLLOCK cannot be implemented in the same fashion.

I stumbled across HID LED test tool from Apple.

After a few tests with multiple keyboards it appears that element 0x310960 is the standard for SCROLLLOCK LED.

lines 190-230 in main.c from the downloadable zip linked above has all the logic for toggling a LED directly. Which pretty much boils down to this one line

   IOHIDDeviceSetValue( tIOHIDDeviceRefs[deviceIndex], tIOHIDElementRef, tIOHIDValueRef );

Is this something you would consider adding to Karabiner yourself or in the form of a pull request?

tekezo commented 10 years ago

It's interesting! I would like to add it into Karabiner, but it takes a little time.

The earliest way is making it a shell command and call it with vkopenurldef. https://pqrs.org/osx/karabiner/xml.html.en#vkopenurldef