It isn't working because the mod only listens for on_lua_shortcut events, whereas key inputs send the command directly as an event.
You can still toggle it using the shortcut menu. Click the "..." button on the top-right corner of the command bar on the bottom of the screen and you'll see the buttons there.