-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
Allow to use in XIB #14
Comments
Replaces the global hotkey library from combination of KeyHolder, Magnet and Sauce to KeyboardShortcuts. The package has few benefits: 1. More native-like UI. 2. Better non-US keyboard support (fixes #108). 3. Built-in storage via UserDefaults. The package has few limitations: 1. Storage key and type is hardcoded. This requires us to migrate from old "hotKey" string preference to "KeyboardShortcuts_popup" JSON preference. 2. There is no way to initialize KeyboardShortcuts.Key with character string. This is needed for migration. To workaround the limitation, Sauce package is left and is used to construct the key from string, retrieve key code from it and construct KeyboardShortcuts.Key with it. 3. There is no support for default shortcuts. This is addressed in sindresorhus/KeyboardShortcuts#13, which is why forked branch is used. 4. Recorder view cannot be previewed in Interface Builder: sindresorhus/KeyboardShortcuts#14. 5. It's impossible to register the same shortcut twice: sindresorhus/KeyboardShortcuts#15. The package is great even with all these limitations. The most important piece is of course better non-US keyboard support. DVORAK is supported as well.
That was not implemented as I had problems in the past where Interface Builder wouldn't display custom views from a package, and also, it's not something I needed personally. Happy to accept a PR to add it, but it's not something I plan to work on. It's probably the easiest to just add a custom view in Interface Builder, get an outlet reference, and then programmatically add |
Fair enough - the package is great without it as well. I managed to get it working but I don't know Cocoa programming well enough and it took me some time to figure it out. I was migrating from https://github.com/Clipy/KeyHolder which has this feature and it's nice to see what you get in XIB files (though there are additional workarounds I had to do make it work Clipy/KeyHolder#6). I'm not experienced enough to send a PR to add this. Feel free to close the issue if you want. |
This will be really nice if we can just drag a |
I have decided to pass on this. SwiftUI is quickly maturing and I personally don't have any XIB/Storyboard usage left to warrant maintaining this. |
Hello, thank you for the great package!
I'm trying to figure out how to use recorded in Interface Builder? I'd normally add custom view and set its class to
KeyboardShortcuts.RecorderCocoa
but it doesn't work. I couldn't find any documentation about this too.Is it possible to use
KeyboardShortcuts.RecorderCocoa
from XIB files?The text was updated successfully, but these errors were encountered: