From f1228d6594f59b240fd41477f55289930d469cac Mon Sep 17 00:00:00 2001 From: Jonathan Rahn Date: Mon, 6 Jan 2014 13:59:26 +0100 Subject: Silence compiler warning "No previous prototype for function..." and added an explicit typecast, update README with a hint to the view's height --- MASShortcut+Monitoring.m | 6 +++--- MASShortcut.m | 2 +- README.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/MASShortcut+Monitoring.m b/MASShortcut+Monitoring.m index bd0282b..b6750b4 100644 --- a/MASShortcut+Monitoring.m +++ b/MASShortcut+Monitoring.m @@ -1,9 +1,9 @@ #import "MASShortcut+Monitoring.h" -NSMutableDictionary *MASRegisteredHotKeys(); -BOOL InstallCommonEventHandler(); +NSMutableDictionary *MASRegisteredHotKeys(void); +BOOL InstallCommonEventHandler(void); BOOL InstallHotkeyWithShortcut(MASShortcut *shortcut, UInt32 *outCarbonHotKeyID, EventHotKeyRef *outCarbonHotKey); -void UninstallEventHandler(); +void UninstallEventHandler(void); #pragma mark - diff --git a/MASShortcut.m b/MASShortcut.m index f03be0e..4e9888d 100644 --- a/MASShortcut.m +++ b/MASShortcut.m @@ -189,7 +189,7 @@ NSString *const MASShortcutModifierFlags = @"ModifierFlags"; UniCharCount length = 0; UniChar chars[256] = { 0 }; UInt32 deadKeyState = 0; - error = UCKeyTranslate(layoutData, self.keyCode, kUCKeyActionDisplay, 0, // No modifiers + error = UCKeyTranslate(layoutData, (UInt16)self.keyCode, kUCKeyActionDisplay, 0, // No modifiers LMGetKbdType(), kUCKeyTranslateNoDeadKeysMask, &deadKeyState, sizeof(chars) / sizeof(UniChar), &length, chars); keystroke = ((error == noErr) && length ? [NSString stringWithCharacters:chars length:length] : @""); diff --git a/README.md b/README.md index 47032aa..7479031 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ The project MASShortcut introduces modern API and user interface for recording, I hope, it is really easy: ```objective-c -// Drop a custom view into XIB and set its class to MASShortcutView +// Drop a custom view into XIB, set its class to MASShortcutView and its height to 19 @property (nonatomic, weak) IBOutlet MASShortcutView *shortcutView; // Think up a preference key to store a global shortcut between launches -- cgit v1.2.3 From ce5760d61c27243d4d08c4f9693226f805975dad Mon Sep 17 00:00:00 2001 From: Jonathan Rahn Date: Mon, 6 Jan 2014 14:08:32 +0100 Subject: update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7479031..bbdf2c2 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ The project MASShortcut introduces modern API and user interface for recording, I hope, it is really easy: ```objective-c -// Drop a custom view into XIB, set its class to MASShortcutView and its height to 19 +// Drop a custom view into XIB, set its class to MASShortcutView and its height to 19. If you select another appearance style look up the correct values in MASShortcutView.h @property (nonatomic, weak) IBOutlet MASShortcutView *shortcutView; // Think up a preference key to store a global shortcut between launches -- cgit v1.2.3