mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-14 00:14:18 +00:00
iPhone on-screen keyboard support, when a TextEditor or CodeEditor is focused.
This commit is contained in:
parent
7bc8db2ff4
commit
49320b25d2
20 changed files with 375 additions and 114 deletions
|
|
@ -1585,6 +1585,12 @@ void TextEditor::insertTextAtCaret (const String& newText_)
|
|||
if (allowedCharacters.isNotEmpty())
|
||||
newText = newText.retainCharacters (allowedCharacters);
|
||||
|
||||
if ((! returnKeyStartsNewLine) && newText == T("\n"))
|
||||
{
|
||||
returnPressed();
|
||||
return;
|
||||
}
|
||||
|
||||
if (! isMultiLine())
|
||||
newText = newText.replaceCharacters (T("\r\n"), T(" "));
|
||||
else
|
||||
|
|
@ -2002,11 +2008,7 @@ bool TextEditor::keyPressed (const KeyPress& key)
|
|||
else if (key == KeyPress::returnKey)
|
||||
{
|
||||
newTransaction();
|
||||
|
||||
if (returnKeyStartsNewLine)
|
||||
insertTextAtCaret (T("\n"));
|
||||
else
|
||||
returnPressed();
|
||||
insertTextAtCaret (T("\n"));
|
||||
}
|
||||
else if (key.isKeyCode (KeyPress::escapeKey))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue