X-Git-Url: https://git.yukkurigames.com/?p=enjoyable.git;a=blobdiff_plain;f=Classes%2FNJKeyInputField.h;h=bc1876c129ac02b7666887ef4212b68dc1388f65;hp=ad026d3f4f0cb163f936f44d20bf727911fb8e99;hb=HEAD;hpb=0064c1fbff36795885a9724081af2a17d83c20a3 diff --git a/Classes/NJKeyInputField.h b/Classes/NJKeyInputField.h index ad026d3..bc1876c 100644 --- a/Classes/NJKeyInputField.h +++ b/Classes/NJKeyInputField.h @@ -7,20 +7,19 @@ #import -extern CGKeyCode NJKeyInputFieldEmpty; +extern const CGKeyCode NJKeyInputFieldEmpty; @protocol NJKeyInputFieldDelegate; -@interface NJKeyInputField : NSTextField +@interface NJKeyInputField : NSControl // An NJKeyInputField is a NSTextField-like widget that receives // exactly one key press, and displays the name of that key, then // resigns its first responder status. It can also inform a // special delegate when its content changes. -+ (NSString *)stringForKeyCode:(CGKeyCode)keyCode; - // Give the string name for a virtual key code. ++ (NSString *)displayNameForKeyCode:(CGKeyCode)keyCode; -@property (nonatomic, weak) IBOutlet id keyDelegate; +@property (nonatomic, weak) IBOutlet id delegate; @property (nonatomic, assign) CGKeyCode keyCode; // The currently displayed key code, or NJKeyInputFieldEmpty if no @@ -28,14 +27,14 @@ extern CGKeyCode NJKeyInputFieldEmpty; // inform the delegate. @property (nonatomic, readonly) BOOL hasKeyCode; - // True if any key is active, false otherwise. + // YES if any key is set, NO otherwise. - (void)clear; // Clear the currently active key and call the delegate. @end -@protocol NJKeyInputFieldDelegate +@protocol NJKeyInputFieldDelegate - (void)keyInputField:(NJKeyInputField *)keyInput didChangeKey:(CGKeyCode)keyCode;