Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to Toggle Control Strip Using Keybind similar to fn key for Function Keys #57

Closed
mikozee opened this issue Apr 30, 2019 · 4 comments

Comments

@mikozee
Copy link

mikozee commented Apr 30, 2019

Ability to key bind (hopefully one key) to show partial and full control strip layout similar to how the fn key works for function keys. May also include toggles, key bind or shortcut for persistent items etc. (other hidden items). Sometimes you just need to access these items quickly without going through the pock menu but want to display your beautiful well organised dock unobstructed by default.

@mikozee
Copy link
Author

mikozee commented May 1, 2019

Just want to expound that if you set the fn key to show the full control strip while it is "hidden" in Pock, you can't expand the control strip because Pock takes priority. Plus I also want to keep the fn key to show the function keys and bind another key to show and the hide the control strip and or the persistent items.

@BLamy
Copy link

BLamy commented Jun 6, 2019

I was able to hack this behavior using the following code segment in the app delegate

    /// Finish launching
    func applicationDidFinishLaunching(_ aNotification: Notification) {
        // Insert code here to initialize your application
        NSApp.isAutomaticCustomizeTouchBarMenuItemEnabled = true
        
        var isHoldingFunction = false;
        NSEvent.addGlobalMonitorForEvents(matching: .flagsChanged) {
            switch $0.modifierFlags.intersection(.deviceIndependentFlagsMask) {
            case [.function]:
                if (defaults[.hideControlStrip]) {
                    isHoldingFunction = true;
                    defaults[.hideControlStrip] = false
                    NSWorkspace.shared.notificationCenter.post(name: .shouldReloadPock, object: nil)
                }
            default:
                if (isHoldingFunction) {
                    isHoldingFunction = false;
                    defaults[.hideControlStrip] = true
                    NSWorkspace.shared.notificationCenter.post(name: .shouldReloadPock, object: nil)
                }
            }
        }

@pigigaldi
Copy link
Collaborator

Introduced in the latest release! https://pock.dev

@pySilver
Copy link

Worth mentioning that double press requires application restart (at least that was the case for me)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants