1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-31 03:00:05 +00:00
JUCE/modules/juce_gui_basics
reuk 2fc7d12ae7 TextEditor: Add option to dismiss the virtual keyboard on touches outside
Previously, individual components had to ask the peer to hide and show
the keyboard, by calling textInputRequired() and
dismissPendingTextInput() respectively. When an onscreen keyboard (OSK)
was required, most Peer implementation would directly hide/show the OSK
inside these function. However, the iOS ComponentPeer implementation
instead listened to the application's global keyboard focus, and only
opened the OSK when the focused component was also a TextInputTarget
with active input.

The iOS scheme seems like a better design, as it enforces that the OSK
hiding and showing is synced with the keyboard focus of the application.
In the other implementations, it was possible for a Component to call
textInputRequired even when it didn't have the keyboard focus, putting
the application into an inconsistent state. The iOS scheme also makes
the TextInputTarget interface more useful, as it enforces that the OSK
will only display for components that implement TextInputTarget, and
return true from isTextInputActive().

This patch changes all Peer implementations to match the iOS
implementation, improving consistency. Each time the global keyboard
focus changes, refreshTextInputTarget is called automatically, and the
OSK is shown if the focused component is a TextInputTarget that returns
true from isTextInputActive, and hidden otherwise. Components can also
call refreshTextInputTarget manually. This should be done whenever the
component updates the return value of isTextInputActive(). Effectively,
the Peer is now responsible for keeping track of the focused
TextInputTarget, rather than allowing individual components to hide and
show the OSK at will.

Additionally, this patch adds an option to the TextEditor to
automatically dismiss the OSK when the mouse is clicked outside of the
editor. This should improve user experience on mobile platforms, where
touches on sibling components may cause a TextEditor to gain keyboard
focus and unnecessarily display the OSK.
2022-06-08 19:51:11 +01:00
..
accessibility Nodiscard: Add to builder-pattern functions 2022-01-27 18:43:21 +00:00
application Updated all license headers 2020-06-29 08:30:22 +01:00
buttons Accessibility: Report Button on/off state via AccessibilityValueInterface 2021-10-08 17:19:04 +01:00
commands Update code to use C++14 [[deprecated]] attribute 2021-09-29 16:14:00 +01:00
components TextEditor: Add option to dismiss the virtual keyboard on touches outside 2022-06-08 19:51:11 +01:00
desktop Fix some deprecation warnings 2022-03-22 17:27:54 +00:00
drawables Fix some deprecation warnings 2022-03-22 17:27:54 +00:00
filebrowser DirectoryContentsList: Fix a bug in isStillLoading 2022-04-21 12:05:41 +01:00
keyboard Nodiscard: Add to builder-pattern functions 2022-01-27 18:43:21 +00:00
layout Viewport: Fix a scrolling bug when internal components have a transform applied 2022-04-27 12:49:14 +01:00
lookandfeel LookAndFeel: Update default name for tab/toolbar missing-item button 2022-02-23 10:56:10 +00:00
menus PopupMenu Accessibility: Report menu-item ticked state on Windows 2022-03-07 11:03:55 +00:00
misc DropShadower: Fix bug when setOwner() is called with a component without a parent 2022-05-18 18:41:14 +02:00
mouse ComponentPeer: Correctly scale drag and drop coordinates to account for global scale 2022-02-23 10:56:12 +00:00
native TextEditor: Add option to dismiss the virtual keyboard on touches outside 2022-06-08 19:51:11 +01:00
positioning CharacterFunctions: Add new function to move pointer past whitespace 2021-02-18 10:54:29 +00:00
properties Update property component constructors to allow temporary ValueTreePropertyWithDefault objects 2021-12-10 15:49:01 +00:00
widgets TextEditor: Add option to dismiss the virtual keyboard on touches outside 2022-06-08 19:51:11 +01:00
windows TextEditor: Add option to dismiss the virtual keyboard on touches outside 2022-06-08 19:51:11 +01:00
juce_gui_basics.cpp AndroidDocument: Support file access to shared storage locations on Android 30+ 2022-05-23 12:19:38 +01:00
juce_gui_basics.h Bump version number to 6.1.6 2022-02-28 12:53:10 +00:00
juce_gui_basics.mm Updated all license headers 2020-06-29 08:30:22 +01:00