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 change ctrl+tab to another key combination #11

Closed
moonlinx opened this issue Jun 24, 2024 · 5 comments · Fixed by #88
Closed

Ability to change ctrl+tab to another key combination #11

moonlinx opened this issue Jun 24, 2024 · 5 comments · Fixed by #88

Comments

@moonlinx
Copy link

moonlinx commented Jun 24, 2024

As the title says, I am use to using command + tab to look at previews as I use alt+tab. This feature would be cool

@moonlinx moonlinx changed the title Ctrl+tab does not pull up window preview Ability to change ctrl+tab to another key combination Jun 24, 2024
@ejbills
Copy link
Owner

ejbills commented Jun 24, 2024

Apologies for the confusion with me calling it "alt-tab functionality" but it actually being invoked with CTRL-tab. That is definitely confusing.

Customization of the invocation button is planned, stay tuned!!

@alessandro-newzoo
Copy link

I second this request, most apps use CTRL+TAB to navigate tabs within the app itself (like Arc) and DockDoor is taking that over, so I'm forced to quit the app at the moment.
Amazing work though, keep it up! :)

@hasansultan92
Copy link
Contributor

Hey, so Im thinking of taking on this issue along with #22. Can we discuss how to solve this? I was thinking along the lines of having a separate tab/view in the settings section of the application and there the user can choose if they want to add their own custom combination of keys or if we can disable the current MacOS CMD+TAB combination in favor of DockDoor and allow it to be on or off as per #22

@ejbills
Copy link
Owner

ejbills commented Jun 25, 2024

Hey, so Im thinking of taking on this issue along with #22. Can we discuss how to solve this? I was thinking along the lines of having a separate tab/view in the settings section of the application and there the user can choose if they want to add their own custom combination of keys or if we can disable the current MacOS CMD+TAB combination in favor of DockDoor and allow it to be on or off as per #22

Hey, thanks for looking into these issues.

For the keybind, I was going to use this library: https://github.com/sindresorhus/KeyboardShortcuts

All of the current implementation of the keybind is in Utilities/KeybindHelper.swift. If you go with that library, I assume it means you will have to rip out a majority of the code in that file. One thing to note: Ensure that whatever you do, pressing tab is blocked while the menu is open. Otherwise, tab will still interact with other apps on screen and it causes a mess. For the settings page, it is very simple. Copy the other settings tab code in View/Settings/settings.swift (and make a separate SwiftUI view file for it).

For implementing a toggle to disable the hover/ctrl-tab menu all together, it should be relatively easy. See in consts.swift, how I define a bool setting with Defaults.Keys -> if you search for this bool, you will see how it is injected into the settings page and is controlled with a check box. (Make sure you prompt a restart is required for this-there is an example of this code block for some other settings)
For the actual logic of disabling either function:
On line 40-44 of the AppDelegate.swift file, you will see the initialization of dockObserver and keybindHelper. Simply check: if Defaults[.ctrlTabEnabled] (and another similar bool for dock peeking) before running the initialization. I think that will achieve it, but more testing is required to confirm. DockObserver is for the dock peeking, KeybindHelper is the keybind as mentioned previously. Lmk if you have any other questions!

@ejbills
Copy link
Owner

ejbills commented Jul 8, 2024

This will be in 1.0.16! Thanks @hasansultan92

@ejbills ejbills closed this as completed Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants