1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-30 02:50:05 +00:00
JUCE/modules/juce_gui_basics/native
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 macOS/iOS: Fix unguarded availability warnings 2022-04-19 11:54:55 +01:00
java/app/com/rmsl/juce Accessbility: Improve support for touch-to-explore on Android 2022-01-17 10:58:17 +00:00
javaopt/app/com/rmsl/juce InAppPurchases: Add support for Android BillingClient 5.0.0 2022-06-06 21:21:41 +01:00
x11 X11: Avoid leaking result of XGetAtomName 2022-02-23 10:56:12 +00:00
juce_android_ContentSharer.cpp AndroidDocument: Support file access to shared storage locations on Android 30+ 2022-05-23 12:19:38 +01:00
juce_android_FileChooser.cpp AndroidDocument: Support file access to shared storage locations on Android 30+ 2022-05-23 12:19:38 +01:00
juce_android_Windowing.cpp TextEditor: Add option to dismiss the virtual keyboard on touches outside 2022-06-08 19:51:11 +01:00
juce_ios_ContentSharer.cpp ObjC Helpers: Automatically derive appropriate signature for function 2021-11-24 11:51:11 +00:00
juce_ios_FileChooser.mm FileChooser: Find an appropriate peer to focus when the FileChooser is destroyed 2022-01-10 22:15:20 +00:00
juce_ios_UIViewComponentPeer.mm TextEditor: Add option to dismiss the virtual keyboard on touches outside 2022-06-08 19:51:11 +01:00
juce_ios_Windowing.mm iOS: Fix native message box leak when no callback is provided 2021-12-07 16:25:22 +00:00
juce_linux_FileChooser.cpp FileChooser: In Linux FileChoosers, prefer to open files rather than directories if both are requested 2021-09-27 12:48:59 +01:00
juce_linux_Windowing.cpp Linux: Adjust natively reported border size by the current scale factor 2022-05-18 18:41:14 +02:00
juce_mac_FileChooser.mm macOS/iOS: Fix unguarded availability warnings 2022-04-19 11:54:55 +01:00
juce_mac_MainMenu.mm ObjC Helpers: Automatically derive appropriate signature for function 2021-11-24 11:51:11 +00:00
juce_mac_MouseCursor.mm ScaledImage: Use in a few more places 2021-12-01 15:44:07 +00:00
juce_mac_NSViewComponentPeer.mm Android: Fix dismissing screen keyboard when interacting with TextEditor 2022-04-27 18:08:17 +02:00
juce_mac_Windowing.mm NativeMessageBox: Use associatedComponent on macOS 2022-02-18 16:43:26 +00:00
juce_MultiTouchMapper.h Updated all license headers 2020-06-29 08:30:22 +01:00
juce_ScopedDPIAwarenessDisabler.h ScopedDPIAwarenessDisabler: Move to juce_gui_basics 2021-09-28 11:31:50 +01:00
juce_win32_DragAndDrop.cpp Windows: Fix and suppress some analysis warnings 2021-05-26 15:34:26 +01:00
juce_win32_FileChooser.cpp MinGW: Improve compatibility 2022-01-17 10:58:18 +00:00
juce_win32_ScopedThreadDPIAwarenessSetter.h Windows: Added ScopedThreadDPIAwarenessSetter for correctly setting and resetting thread DPI-awareness for methods which interact with an HWND and removed some DPI workarounds 2021-03-02 15:56:10 +00:00
juce_win32_Windowing.cpp TextEditor: Add option to dismiss the virtual keyboard on touches outside 2022-06-08 19:51:11 +01:00