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

Introducing the usage of custom keybinds set by user to switch windows #88

Merged

Conversation

hasansultan92
Copy link
Contributor

@hasansultan92 hasansultan92 commented Jul 7, 2024

This PR closes #11. Instructions to follow setting a custom user keybind is as follows and can be found in the updated readme as well:

  • User selects one of the modifiers presented on the screen
  • User presses Record Keybind button
  • User presses a singular key on the keyboard
  • Keybind is now set!

Please ignore the branch name, the intial idea was to have a dropdown but settled for a segmented picker view instead

The default key bind for the window switcher for DockDoor is now CMD + Tab, replacing the default Mac OS window switcher unless otherwise programmed by the user.

@ShlomoCode
Copy link
Contributor

@hasansultan92 I'm curious why you didn't use https://github.com/sindresorhus/KeyboardShortcuts?

@hasansultan92
Copy link
Contributor Author

@ShlomoCode good question! I had a couple of reasons to stay away from this

  1. The vast majority of users who are using an application like this want to avoid the default Apple window-switching mechanism and want to use the CMD + Tab key bind. The issues we have been closing on the GitHub and myself included have been in favor of using CMD + Tab for this application. The library you sent above "marks" the default Mac OS shortcuts as unavailable for use and to be remapped and CMD + Tab was one of those key binds we could not reuse/remap.
  2. My personal preference when working on projects is to reduce external dependencies. What I have implemented is just intercepting the OS events that are fired from the keyboard and then resuing that information to do what we wanted to do, allowing the user to use a custom key bind to enable the window-switching mechanism. I did not see the need to have an external dependency for something the OS is allowing me by native and also allowing me to remap the default OS key binds to our needs.
  3. There was a type mismatch I had to deal with when using the library if I recall correctly. I had an implementation with this library in one of my other branches - the more I think about it that implementation probably does not work anymore. Essentially the OS emits the keyboard events with let's say type x but the library would be using type c for the data types. I was still having to convert them manually to do the operations we were looking into and it did not make sense to continue using the library if I could just create something that worked well with the OS's default types

@ejbills ejbills changed the base branch from main to keybind July 8, 2024 14:45
@ejbills ejbills merged commit 2285b77 into ejbills:keybind Jul 8, 2024
ejbills added a commit that referenced this pull request Jul 8, 2024
* Introducing the usage of custom keybinds set by user to switch windows (#88)

* generate appcast script

* Create draft_release.yml

* Update draft_release.yml

* Update draft_release.yml

* Update draft_release.yml

* Update draft_release.yml

* Update draft_release.yml

* Update draft_release.yml

* Adding Setting pane to toggle window switcher

* Addition of segmented picker

* Initial Segmented Picker implementation

* HotFix: Application was crashing when new user would launch

* fallback assignment

* Enabling usage of custom user keybinds

* Deprecate use of UserDefaults in favor of Defaults

* Remove: draft_release.yml

---------

Co-authored-by: Ethan Bills <ethanjacksonbills@gmail.com>
Co-authored-by: ejbills <74191134+ejbills@users.noreply.github.com>

* fix window view

* fix window title

---------

Co-authored-by: Hasan Sultan <52581466+hasansultan92@users.noreply.github.com>
@ShlomoCode
Copy link
Contributor

@ejbills Why does it go in as commit "v1.0.16"? In this way it will be terrible in the future to investigate changes in the git history :(

ejbills added a commit that referenced this pull request Jul 8, 2024
* Introducing the usage of custom keybinds set by user to switch windows (#88)

* generate appcast script

* Create draft_release.yml

* Update draft_release.yml

* Update draft_release.yml

* Update draft_release.yml

* Update draft_release.yml

* Update draft_release.yml

* Update draft_release.yml

* Adding Setting pane to toggle window switcher

* Addition of segmented picker

* Initial Segmented Picker implementation

* HotFix: Application was crashing when new user would launch

* fallback assignment

* Enabling usage of custom user keybinds

* Deprecate use of UserDefaults in favor of Defaults

* Remove: draft_release.yml

---------

Co-authored-by: Ethan Bills <ethanjacksonbills@gmail.com>
Co-authored-by: ejbills <74191134+ejbills@users.noreply.github.com>

* fix window view

* fix window title

---------

Co-authored-by: Hasan Sultan <52581466+hasansultan92@users.noreply.github.com>
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 this pull request may close these issues.

Ability to change ctrl+tab to another key combination
3 participants