You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently CommandPost uses hidutil to disable the default keyboard layout for Razer devices.
Essentially we remap the Razer device so that all the built-in buttons don't actually "type" anything. Then in our Objective-C Extension (hs.razer) we detect the button presses there.
This has always worked fine in the past, but interestingly Ross is having issues on his machine.
He has a Mac Studio running Ventura - and it's all working fine there. However, he cloned his operating system to an external SSD, and when booting from the external SSD, things no longer work. Given that it's exactly the same hardware, same operating system, and same configuration, makes me think it's some kind of security issue. However, I tried disabling and re-enabling all the various permissions CommandPost needs and it didn't seem to make a difference.
Interestingly however, when looking into this, it seems that hidutil stopped working on macOS Sonoma 14.2, which was fixed in macOS Sonoma 14.3 - but now requires sudo (see here).
I'm currently running macOS 14.3, and it looks like it's broken on my machine.
For a Razer Orbweaver Chroma for example, we use the following Terminal command:
Run as root to remap alphanumerics / special characters with UserKeyMapping
If I run with sudo, it works.
However, Ross is currently running macOS Ventura - so I think this might not be his specific issue.
I'm not really sure what the solution is here, as we don't really want CommandPost to have root access.
For reference, here's the Lua code that triggers hidutil:
--- hs.razer:defaultKeyboardLayout(enabled) -> boolean--- Method--- Allows you to remap the default Keyboard Layout on a Razer device so that the buttons no longer trigger their factory default actions, or restore the default keyboard layout.------ Parameters:--- * enabled - If `true` the Razer default will use its default keyboard layout.------ Returns:--- * The `hs.razer` object.--- * `true` if successful otherwise `false`functionrazerObject:defaultKeyboardLayout(enabled)
localproductID="0x" ..string.upper(string.format("%04x", self:_productID()))
localremapping=self:_remapping()
ifnotremappingthenlog.ef("This Razer device does not support remapping.")
returnfalseendlocalcommand=[[hidutil property --matching '{"ProductID":]] ..productID..[[}' --set '{"UserKeyMapping":[]] .."\n"forrealID, dummyIDinpairs(remapping) dolocalsrc=enabledandrealIDordummyIDlocaldst=enabledanddummyIDorrealIDcommand=command..[[ {"HIDKeyboardModifierMappingSrc":]] ..src..[[,]] .."\n"command=command..[[ "HIDKeyboardModifierMappingDst":]] ..dst.."\n"command=command..[[ },]] .."\n"endcommand=command:sub(1, #command-1)
command=command.." ]" .."\n"command=command.."}'"local_, status=execute(command)
returnself, status==trueend
The text was updated successfully, but these errors were encountered:
There is a way to grant password-less sudo access to /usr/bin/hidutil - but it's a pretty scary setup process:
Basically you need to run sudo visudo from macOS Terminal - this opens up a special file in a command line text editor - normally VIM.
And add this near the bottom: USERNAME ALL = (ALL) NOPASSWD: /usr/bin/hidutil (where USERNAME is your user name, and there's a tab between USERNAME and ALL). Do this by pressing i to go into edit mode, scroll down with your arrow keys, and add this entry after the %admin entry, press ESC, then type :x to save and exit.
You can then run sudo cat /etc/sudoers to see if it actually changed.
Reported by Ross Batten via phone call.
Currently CommandPost uses
hidutil
to disable the default keyboard layout for Razer devices.Essentially we remap the Razer device so that all the built-in buttons don't actually "type" anything. Then in our Objective-C Extension (
hs.razer
) we detect the button presses there.This has always worked fine in the past, but interestingly Ross is having issues on his machine.
He has a Mac Studio running Ventura - and it's all working fine there. However, he cloned his operating system to an external SSD, and when booting from the external SSD, things no longer work. Given that it's exactly the same hardware, same operating system, and same configuration, makes me think it's some kind of security issue. However, I tried disabling and re-enabling all the various permissions CommandPost needs and it didn't seem to make a difference.
Interestingly however, when looking into this, it seems that
hidutil
stopped working on macOS Sonoma 14.2, which was fixed in macOS Sonoma 14.3 - but now requiressudo
(see here).I'm currently running macOS 14.3, and it looks like it's broken on my machine.
For a Razer Orbweaver Chroma for example, we use the following Terminal command:
If I try this on macOS 14.3 I get the error:
Run as root to remap alphanumerics / special characters with UserKeyMapping
If I run with
sudo
, it works.However, Ross is currently running macOS Ventura - so I think this might not be his specific issue.
I'm not really sure what the solution is here, as we don't really want CommandPost to have root access.
For reference, here's the Lua code that triggers
hidutil
:The text was updated successfully, but these errors were encountered: