mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-31 03:00:05 +00:00
TextInputTarget: Add password keyboard type
This commit is contained in:
parent
03a2b557ad
commit
06798ab897
4 changed files with 14 additions and 3 deletions
|
|
@ -108,7 +108,8 @@ public:
|
|||
decimalKeyboard,
|
||||
urlKeyboard,
|
||||
emailAddressKeyboard,
|
||||
phoneNumberKeyboard
|
||||
phoneNumberKeyboard,
|
||||
passwordKeyboard
|
||||
};
|
||||
|
||||
/** Returns the target's preference for the type of keyboard that would be most appropriate.
|
||||
|
|
|
|||
|
|
@ -456,9 +456,10 @@ public:
|
|||
case TextInputTarget::urlKeyboard: return UIKeyboardTypeURL;
|
||||
case TextInputTarget::emailAddressKeyboard: return UIKeyboardTypeEmailAddress;
|
||||
case TextInputTarget::phoneNumberKeyboard: return UIKeyboardTypePhonePad;
|
||||
default: jassertfalse; break;
|
||||
case TextInputTarget::passwordKeyboard: return UIKeyboardTypeASCIICapable;
|
||||
}
|
||||
|
||||
jassertfalse;
|
||||
return UIKeyboardTypeDefault;
|
||||
}
|
||||
|
||||
|
|
@ -1816,6 +1817,10 @@ void UIViewComponentPeer::grabFocus()
|
|||
|
||||
void UIViewComponentPeer::textInputRequired (Point<int>, TextInputTarget&)
|
||||
{
|
||||
// We need to restart the text input session so that the keyboard can change types if necessary.
|
||||
if ([hiddenTextInput.get() isFirstResponder])
|
||||
[hiddenTextInput.get() resignFirstResponder];
|
||||
|
||||
[hiddenTextInput.get() becomeFirstResponder];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2306,6 +2306,11 @@ void TextEditor::setTemporaryUnderlining (const Array<Range<int>>& newUnderlined
|
|||
repaint();
|
||||
}
|
||||
|
||||
TextInputTarget::VirtualKeyboardType TextEditor::getKeyboardType()
|
||||
{
|
||||
return passwordCharacter != 0 ? passwordKeyboard : keyboardType;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
UndoManager* TextEditor::getUndoManager() noexcept
|
||||
{
|
||||
|
|
|
|||
|
|
@ -742,7 +742,7 @@ public:
|
|||
/** @internal */
|
||||
void setTemporaryUnderlining (const Array<Range<int>>&) override;
|
||||
/** @internal */
|
||||
VirtualKeyboardType getKeyboardType() override { return keyboardType; }
|
||||
VirtualKeyboardType getKeyboardType() override;
|
||||
|
||||
protected:
|
||||
//==============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue