重构
This commit is contained in:
26
CustomKeyboard/View/KBKeyboardView/KBKeyboardInputHandler.m
Normal file
26
CustomKeyboard/View/KBKeyboardView/KBKeyboardInputHandler.m
Normal file
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// KBKeyboardInputHandler.m
|
||||
// CustomKeyboard
|
||||
//
|
||||
|
||||
#import "KBKeyboardInputHandler.h"
|
||||
#import "KBKey.h"
|
||||
|
||||
@implementation KBKeyboardInputHandler
|
||||
|
||||
- (BOOL)handleKeyTap:(KBKey *)key {
|
||||
if (!key) { return NO; }
|
||||
switch (key.type) {
|
||||
case KBKeyTypeShift:
|
||||
if (self.onToggleShift) { self.onToggleShift(); }
|
||||
return YES;
|
||||
case KBKeyTypeSymbolsToggle:
|
||||
if (self.onToggleSymbols) { self.onToggleSymbols(); }
|
||||
return YES;
|
||||
default:
|
||||
if (self.onKeyTapped) { self.onKeyTapped(key); }
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user