aboutsummaryrefslogtreecommitdiffstats
path: root/Demo
AgeCommit message (Collapse)Author
2016-10-28Use modern key mask constants instead of the ones deprecated in 10.12Tomáš Znamenáček
See #99 for details.
2016-08-08Upgrade Projects to Xcode 7Vadim Shpakovski
2016-02-10Added basic German localization to the demo project.Tomáš Znamenáček
This makes it possible to test the German MASShortcut localization on the demo project.
2015-10-14Japanese localizationshinya takahashi
2015-08-18Added Czech localization.Tomáš Znamenáček
2015-01-19Improved screenshot quality.Tomáš Znamenáček
2015-01-19Smaller screenshot.Tomáš Znamenáček
2015-01-19Added a list of features and a screenshot of the demo project.Tomáš Znamenáček
2015-01-12Added support for older OS X releases back to 10.6 included.Tomáš Znamenáček
Apart from turning off Auto Layout for the Demo project, the only thing remaining was several __weak qualifiers to prevent retain cycles in blocks. I have replaced them with __unsafe_unretained since __weak is not supported on 10.6. There should be no safety concerns here, since we are certain the pointers will remain valid.
2015-01-09Remove Xcode warnings and fix the hard-coded shortcut.Vadim Shpakovski
2015-01-09Expanded demo functionality (preparing for 2.0.0, see #54).Tomáš Znamenáček
Mostly back to the previous version with enable/disable checkboxes & one settable and one hard-coded shortcut. I have tried to come up with a nicer pattern to watch the enabled/disabled checkboxes, but without external dependencies like Facebook’s KVOController I didn’t come up with anything better than plain old KVO.
2015-01-08Simplified and updated the demo project.Tomáš Znamenáček
2015-01-07Added a simplified binding API for MASShortcutView.Tomáš Znamenáček
This returns the associatedUserDefaultsKey property used in previous code versions, only the implementation uses less magic.
2015-01-07Redesigned demo app layout & feedback.Tomáš Znamenáček
I have replaced the modal alert with a beep, it’s faster to test without having to close the alert.
2015-01-07Added a shared binder instance singleton.Tomáš Znamenáček
This adds a really simple API to set up some bindings without having to keep a binder instance around by hand. If somebody wants to, it’s not a problem to allocate a separate instance and have precise control over its lifetime.
2015-01-07Turned MASShortcutMonitor into a singleton.Tomáš Znamenáček
There can only be one Carbon event handler, so it doesn’t make sense to create multiple instances of the shortcut monitor.
2015-01-07Refactored the shortcut dispatcher and bindings to user defaults.Tomáš Znamenáček
This is a big change that was hard to split into smaller commits. There’s now a new class to bind shortcuts to actions, a new class to bind user defaults’ keys to actions, and a new way to associate user defaults with the recorder control (MASShortcutView). I have also updated the demo app to go with the changes. The new class to associate shortcuts with actions is called MASShortcutMonitor. It wraps the Carbon hotkey magic and offers a simple interface to add a shortcut along with a block that should be run when the shortcut is pressed. It’s the lowest-level interface. Since the usual requirement is to store the shortcuts into user defaults, there’s also a higher-level interface offered by the MASShortcutBinder class. That takes a defaults key and associates it with a block. When the shortcut stored under the defaults key changes, the binder automatically switches to the new shortcut. The class is a wrapper built atop of the previous one, the MASShortcutMonitor – it simply adds, updates and removes shortcuts as the user defaults change. I have removed the special user defaults integration code from the recorder control (MASShortcutView) and replaced it with a small Cocoa Bindings shim. This means that in order to keep the recorder control in sync with the defaults you just have to call the usual bind:toObject:withKeyPath:options: method, like this: [_shortcutView bind:MASShortcutBinding toObject:[NSUserDefaultsController sharedUserDefaultsController] withKeyPath[@"values.ExampleDefaultsKey" options:@{NSValueTransformerNameBindingOption:NSKeyedUnarchiveFromDataTransformerName}]; That’s more verbose than the previous solution, but it’s much cleaner and can be swept under a convenience call if needed. I might also add a dictionaryValue property later that would make it possible to bind the value to user defaults directly, without a transformer, and would enable backward compatibility with Shortcut Recorder.
2015-01-07Created an umbrella header.Tomáš Znamenáček
Now you can just `#import <MASShortcut/Shortcut.h>`.
2015-01-07Repackaged the code as a framework and included the demo.Tomáš Znamenáček
Packaging the code as a framework is mostly just a formality. It doesn’t really change much, it just turns the code into a regular component. What it does change is that the code now has its own Xcode settings, which could make compatibility easier in the long run. Including the demo in the main repository makes it easier to hack on the library, since you can try the changes immediately. It also shows how to bundle the framework into an app that uses it.