22

I'm on a MacBook Pro using Microsoft's Ergonomic Sculpt Desktop (i.e. keyboard, mouse, and number pad). The Number Pad looks like this and as you can see has a Calculator button. Unfortunately, on Macos, it seems that Calculator button does nothing. I would have expected it to ideally have opened the Calculator app, but it does nothing.

Incidentally, I happen to use a separate tool called "Better Touch Tool" (similar to Karabiner I think) to remap certain keystrokes, and I thought that perhaps I could use this tool to map whatever button press this Calculator button generates to a custom action that would open the Calculator app. However, BTT doesn't even detect a key press at all when I press the Calculator button. I don't see that Microsoft has made any drivers for Mac for this keyboard available so does that mean I'm stuck?

Does that mean this button is just totally unusable on Macs?

3
  • By "software developer", you mean Microsoft? Because that's the problem, there aren't any Microsoft drivers. So it's just using whatever default Mac drivers exist.
    – soapergem
    Commented Mar 7, 2018 at 22:02
  • 2
    A number of years ago I ran across a USB driver that purported to enable a bunch of 3rd party peripherals. A quick google search turned up nothing but knowing that it exists (or existed) might be motivation to search for such a thing with greater motivation... Commented Mar 7, 2018 at 22:19
  • 2
    @fsb and close voters - this question isn't a customer support question per se. The OP is asking that given the lack of drivers/support, is the button unusable on a Mac?
    – Allan
    Commented Mar 7, 2018 at 23:19

8 Answers 8

8

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. xev sample output XQuartz

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)

3
  • 4
    WOW! This is a phenomenal answer. I just tried out everything you said and confirmed that, sadly enough, xev cannot see the scancode for that button. So it looks like the answer is a simple no. But I greatly appreciate the incredible knowledge dump that lead up to that conclusion.
    – soapergem
    Commented Mar 7, 2018 at 23:30
  • Sorry to hear that....I actually thought about getting one of those (similar) num pads to program macros to. I opted for a Logitech full keyboard instead.
    – Allan
    Commented Mar 7, 2018 at 23:35
  • I just discovered that my keyboard registers itself as a mouse and its calculator button is sent as a mouse button rather than a keyboard key! That might explain why xev can’t hear these events? (or maybe it’s even catching them but your grep is filtering them out!?)
    – jes5199
    Commented Jul 3, 2019 at 2:52
5

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.

Karabiner-Elements configuration

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).

Launch Calculator Automator Service

In my case, I duplicated the Automator service (automator -> file -> duplicate) so that I could have two different keyboard shortcuts.

System Preferences -> Keyboard -> Shortcuts

It works perfectly to launch the calculator.

4

This will remap the calculator key to the space character:

hidutil property --set '{"UserKeyMapping":[
    {
        "HIDKeyboardModifierMappingSrc": 0xC00000192,
        "HIDKeyboardModifierMappingDst": 0x70000002C
    }
]}'

Can confirm it works on macOS Big Sur 11.2.2, with calculator keys of both the Microsoft Sculpt Keyboard For Business (5KV-00001) and its separate number pad.


Repurposing “menu” button on Windows keyboards used in OS X
https://apple.stackexchange.com/a/398797

USB HID to PS/2 Scan Code Translation Table
https://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/translate.pdf

0
3

It's been 9 months since Cobberboy posted a solution. It worked nearly perfect for me in 10.14.3 Mojave, but it only worked when the window focus was on Finder. To fix this, add an "App Shortcut" in the Keyboard Shortcuts menu (look at cobberboy's last photo on the left hand menu) and add a shortcut for all applications.

enter image description here

3

I have a Ducky-brand keyboard with a “calc” button, and I was having the same problem. I found that the shareware app “USB Overdrive” can remap it to launch a calculator or do any other action. It also explains why the other keyboard mappers don’t get the keypress - USB Overdrive registers it as a mouse click event, but apparently whatever mouse click number that is, it’s common enough that the app already knew it was named “calculator”.

2

Building on what @jes5199 discovered I also installed 'USB Overdrive'. It's essentially a rebinder for non-keyboard devices, e.g. mice. Installation requires a reboot, after which it appears as a system preferences panel. Pressing the calculator button revealed the preconfigured setting, and once I closed the panel it worked without any additional setup. USB Overdrive

I couldn't get Karabiner EventViewer to recognize either a keypress or mouseclick for the calculator button. Tested before and after installing USB Overdrive. Overdrive did manage to remap it to system Calculator without fuss, so I'm happy.

1
  • USB Overdrive by Alessandro Montalcini has been developed/published since 1999 and is well trusted. Commented Mar 5, 2022 at 22:49
2

You can also use Keyboard Maestro with a "USB Device Key" trigger (a normal Hot Key trigger is not enough):

enter image description here

It's paid software, but to me it was worth every penny because it does a lot more than this.

0

Combining answers from @Arbo and @Cobberboy its possible to have the Calculator button launch the calculator app. E.g.

Remap the calculator button (0xC00000192) to an unused keycode. I've chosen to use F13 (0x700000068) below:

hidutil property --set '{"UserKeyMapping":[
    {
        "HIDKeyboardModifierMappingSrc": 0xC00000192,
        "HIDKeyboardModifierMappingDst": 0x700000068
    }
]}'

Refer to Cobberboy's solution next. You can skip the part about Karabiner-Elements. Just create a single 'launch application' service via Automator. No need for a duplicate since this approach doesn't use separate keys. The UserKeyMapping above remaps the Sculpt's calc button on both the numpad and keyboard.

Finally return to the System Settings > Keyboard > Keyboard shortcuts > Services. On Mac OS Ventura you will see the launch service you created appear under 'General'. Go ahead and double-click to set the key and press the keyboard's Calculator button which will register as whatever you remapped above (F13 for me). enter image description here

1
  • Answers should stand on their own and not bounce around other people's answers. While unlikely, Cobberboy's answer can be changed or deleted ultimately making this answer useless.
    – Allan
    Commented Sep 25, 2023 at 9:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .