JDK-8166772 : Touch keyboard is not shown for text components on a screen touch
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6u131,7u121,8,9,10
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_8,windows_10
  • Submitted: 2016-09-27
  • Updated: 2018-08-14
  • Resolved: 2017-10-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 10 JDK 7 JDK 8
10 b29Fixed 7u201Fixed 8u172Fixed
Related Reports
Blocks :  
CSR :  
Relates :  
Relates :  
Relates :  
Sub Tasks
JDK-8189235 :  
Description
FULL PRODUCT VERSION :
JDK 10, JDK 9, JDK 8, JDK 7, JDK 6

ADDITIONAL OS VERSION INFORMATION :
MS Windows 10 OS, MS Windows 8.1 OS

A DESCRIPTION OF THE PROBLEM :
Touch keyboard which is specific to MS Windows 10, MS Windows 8.1, MS Windows 8 OSes is not automatically shown, when a user touches Swing or AWT text components with text editing functionality, while other native applications provide automatic showing of the touch keyboard, for example MS Edge, Firefox browsers.

Screenshots:
1. Correct behaviour - An example of the touch keyboard shown on a touch of URL editing field (address bar) in MS Edge 40 browser on MS Windows 10 OS is demonstrated on the attached screenshot "TouchKeyboardShownInEdgeOnWin10.jpg".
2. Incorrect behaviour ��� Not showing of the touch keyboard on a touch of "javax.swing.JTextField" component in JDK 9 b149 on MS Windows 10 OS is demonstrated on the attached screenshot "TouchKeyboardNotShownInJDK9b149OnWin10.jpg".

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Make sure that Windows 8 or later is installed on the host.
2. Make sure that a display with the touch screen is connected to the host.
 
   OR
 
If the touch screen is absent, make sure that all keyboards can be disconnected from the host. Please note that a notebook cannot be used for this purpose, because at least one keyboard is connected to it always.

3. Go to "Windows -> Settings -> Devices -> Typing -> Touch keyboard" and turn on the option "Automatically show the touch keyboard in windowed apps when there's no keyboard attached to your device".

4. Compile and run the test case attached as "TouchKeyboardAutoShowTest.java" file.
5. If the display with touch screen is present, touch any Swing or AWT text component shown in the window of the test case, otherwise, disconnect all keyboards from the host and click into any Swing or AWT text component in the test case window. The issue is reproduced, if no touch keyboard is shown.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED - When you touch any text input area such as JTextField or JTextArea, a touch keyboard should pop up.
ACTUAL - The touch keyboard doesn't show up as expected.
Comments
Review thread: http://mail.openjdk.java.net/pipermail/awt-dev/2017-August/012966.html
17-08-2017

On 12/19/2016 the environment with the emulated touch screen was created. The touch screen was emulated by means of "Windows Simulator" tool from MS Visual Studio 2015 on MS Windows 10 Professional 64-bit OS. The issue could not be reproduced in Edge, IE 11, Firefox 50.1.0 browsers. Was able to reproduce the issue with JDK 9 b149, JDK 8u112 b15, JDK 7u121 b15, JDK 6u131 b14. During the research of this issue it was defined that: 1) By default, Windows 8 touch keyboard does not appear automatically, when focus is placed on an edit control in a desktop program. 2) To activate the touch keyboard from the desktop application the following 2 approaches can be used. 2.1) Approach #1. To use Windows COM object implementing the interface "IInputPanelConfiguration" with its method "EnableFocusTracking()". - Documentation on the interface: https://msdn.microsoft.com/en-us/library/windows/desktop/jj126267(v=vs.85).aspx - Article on usage of the interface: https://blogs.msdn.microsoft.com/oldnewthing/20150601-00/?p=45481/ Conclusion about the approach: - This approach is not acceptable, because according to Win32 API documentation, the interface does not work in Windows 10. Also this approach is not applicable completely for lightweight UI components - Swing components. 2.2) Approach #2. To launch the system application "TabTip.exe" which implements the touch keyboard and is located in the directory "C:\Program Files\Common Files\Microsoft Shared\Ink". Starting this application leads to raising of the touch keyboard. This approach is often reported by third-party software producers as the applied solution for this issue, also this approach was implemented in Firefox browser for resolution of the identical issue. - Microsoft documentation which mentions "TabTip.exe" application and states that starting this process is a possible way of invocation of the Text Input Panel, also known as the touch keyboard. URL: https://msdn.microsoft.com/en-us/library/windows/desktop/ms701746(v=vs.85).aspx - Article written by the Intel developer which presents a sample application, which implements this approach. URL: https://software.intel.com/en-us/blogs/2013/06/11/touch-keyboard-access-for-windows-8-desktop-apps Conclusion about the approach: - This approach looks as the only possible solution for addition of support of automatic showing of the touch keyboard on touches of both heavyweight AWT and lightweight Swing text components. However, the solution has to also implement processing of system window messages related to the touch input, for example "WM_TOUCH" message.
16-08-2017

Three following files were attached to the bug record: 1. "TouchKeyboardAutoShowTest.java" - the compilable test case. 2. "TouchKeyboardShownInEdgeOnWin10.jpg" - screenshot demonstrating the correct behaviour. 3. "TouchKeyboardNotShownInJDK9b149OnWin10.jpg" - screenshot demonstrating the issue in JDK 9 b149.
15-08-2017

Native applications support check. Firefox 47: Screen keyboard not working Firefox 50: Screen keyboard works fine Chrome 54, 55: Screen keyboard not working cmd,powershell: Screen keyboard not working notepad and gui: Screen keyboard works fine Java 8u111: Screen keyboard not working for all text inputs. Everything works fine if keyboard is set to be always visible.
19-12-2016