ios stuff
This commit is contained in:
parent
9a27aacbab
commit
c20fd99897
@ -9,9 +9,12 @@ const std::string CONST_CLICK_SIGNAL_NAME = "OnClick";
|
||||
const std::string CONST_DRAG_SIGNAL_NAME = "OnDrag";
|
||||
|
||||
|
||||
boost::mutex KeyMutex;
|
||||
void GuiManagerSetKeyboardText(std::string newText)
|
||||
{
|
||||
KeyMutex.lock();
|
||||
ResourceManager->GUIManager.SetTextSignal(newText);
|
||||
KeyMutex.unlock();
|
||||
}
|
||||
|
||||
|
||||
|
@ -78,8 +78,9 @@ void GuiManagerSetKeyboardText(std::string newText); //Find it in GUIManager.cpp
|
||||
|
||||
void SetKeyboardText(const char* newText)
|
||||
{
|
||||
GuiManagerSetKeyboardText(newText);
|
||||
NSLog(@"text: %s", newText);
|
||||
SE::PerformInMainThreadAsync(boost::bind(&GuiManagerSetKeyboardText, newText));
|
||||
//GuiManagerSetKeyboardText(newText);
|
||||
//NSLog(@"text: %s", newText);
|
||||
}
|
||||
|
||||
} //namespace SE
|
||||
|
@ -71,6 +71,10 @@ void SetKeyboardText(const char* newText);
|
||||
|
||||
_hiddenTextField = [[UITextField alloc] initWithFrame:CGRectMake(-200,-200,0,0)];
|
||||
|
||||
//[_hiddenTextField setReturnKeyType: UIReturnKeyDone];
|
||||
|
||||
_hiddenTextField.autocorrectionType = UITextAutocorrectionTypeNo;
|
||||
|
||||
[self.view addSubview:_hiddenTextField];
|
||||
|
||||
extKeyboardTextView = _hiddenTextField;
|
||||
@ -145,6 +149,12 @@ void SetKeyboardText(const char* newText);
|
||||
NSLog(@"End");
|
||||
}
|
||||
|
||||
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
|
||||
{
|
||||
if([string isEqualToString:@"\n"])
|
||||
[textField resignFirstResponder];
|
||||
return YES;
|
||||
}
|
||||
|
||||
#pragma mark - GLKView and GLKViewController delegate methods
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user