How do I get the calculator button on a Microsoft Sculpt keyboard working?
If macOS isn't "seeing" the scan code then there's not much that can be done in mapping it - it's got to see it to map it.
There is a utility you can use that can verify if the keyboard is sending the code or not - xev
. You'll need to run it in XQuartz which is an X11 environment.
Using the following command, you can get the output of each keypress
xev | grep -A2 --line-buffered '^KeyRelease' \
| sed -n '/keycode /s/^.*keycode \([0-9]*\).* (.*, \(.*\)).*$/\1 \2/p'
Below is some random keypresses on my wired Unix keyboard attached to my Mac.
I've used this to test and map Sun Microsystems Type 5, 6, and 7 keyboards on my Mac and can verify that it detected the extra keys. If xev
can see it, it means that the scancode is being sent, it's just the HID kexts macOS uses are insufficient.
Can it be fixed?
That would be a software development question outside my and this site's scope.
Bottom Line
If it's not being detectable at all, it's unusable. If it is being detected, there's a chance of using it, but you'll need an application to see the keypress to utilize it.
(You might want to try ControllerMate)
I just bought myself a (fantastic) sculpt keyboard, and had the same question. Using Karabiner-Elements I came to the same conclusion as Allan above: the keycode just doesn't get received by the OS.
However, I can launch the calculator by remapping the otherwise-useless 'pause' key on the main keyboard, and the numlock key on the number pad (in both cases these keys are immediately to the left of the calculator key).
First, using Karabiner-Elements, remap the keys you want to use (e.g. 'pause') to an unused function key that your mac can recognise F13-19 (e.g. F19). The screenshot below shows my Karabiner-Elements configuration; the last 2 entries are relevant ones here.
Secondly, launch Automator and configure a 'launch application' service as per the instructions here, and follow the instructions to map the service as a keyboard shortcut (System Preferences -> Keyboard -> Shortcuts).
In my case, I duplicated the Automator service (automator -> file -> duplicate) so that I could have two different keyboard shortcuts.
It works perfectly to launch the calculator.