rxhanson / Multitouch-Community

Issue and feature request tracking for the Multitouch app
https://multitouch.app
38 stars 0 forks source link

Add control center shortcut #78

Open c-harding opened 3 years ago

c-harding commented 3 years ago

Hi, would it be possible to add a shortcut for opening Big Sur’s Control Center?

rxhanson commented 3 years ago

It's odd that Apple did not give us a way to do this with a keyboard shortcut, where it would be quite easy to pull this into the app.

After an initial search, it appears that the best way to programmatically open the Control Center would be using AppleScript, something like this.

tell application "System Events"
    tell process "Control Center"
        tell menu bar item "control center" of menu bar 1
            click
        end tell
    end tell
end tell

This could then be called by the Execute, Bash Script action. osascript /example/path/to/AppleScript.scpt

If I were to add a shortcut just for this, then that's basically what I would be limited to behind the scenes. I'll think about adding this in as a selectable shortcut so that it wouldn't have to be configured in this way.

c-harding commented 3 years ago

I had a brief test with this, and found that `menu bar item "control center" doesn’t work on my en-GB computer (it’s called "control centre"), so instead I went with using the 2nd menu bar item. I wonder if that’s too unreliable? It doesn’t seem possible to reorder it in the menu bar through the GUI.

osascript -e 'tell application "System Events" to tell process "ControlCenter" to tell menu bar item 2 of menu bar 1 to click'

I tried binding this to force touch in the top right, but annoyingly lifting my finger closed the menu immediately (and it meant force touch to look up stopped working). I’ve now gone with a top right tap, but my preference would be a swipe in from the top, analogue to the swipe in from the right for the notification center.

rxhanson commented 3 years ago

Thanks for posting back what you found. This might be too unreliable to put in place as a built-in option, but I won't rule it out just yet. I wonder what item 2 equates to.

Using any of the force gestures in Multitouch requires the app to intercept the force data, which in turn removes the look up functionality. It's one of the few areas where Multitouch will inhibit built-in macOS functionality, unfortunately, and there's no way around it that I'm aware of.

For the swipe from the top, were you thinking two finger swipe down from the top?

c-harding commented 3 years ago

The 2 refers to the menu position from the right: I think the clock was 1. But fair enough about not integrating it: just having a bash one-liner works well enough.

Yes, two fingers from the very top of the trackpad.

rxhanson commented 3 years ago

Good to know on the menu position.

There are some restrictions that make the two finger swipe from the top gesture something that I do not really want to add. However, I have been thinking about adding some simple one finger quick drawing from edge or corner gestures that I think would fit here just as well. I am planning on a first attempt at those next time I have a sprint on Multitouch.