How to use screen keyboard for setting values by the mouse (touchscreen)
The program
osk.exe (
On Screen Keyboard) shows a virtual keyboard on the screen that is controlled by the mouse (
touchscreen). By this it is possible to enter and edit values in panels and in windows of the PROMOTIC application.
The keyboard is full including special keys. It allows to (except other) open help, context menu, switch the language, mark text, etc. The emulation of a key press is sent to the active window. The window with the virtual keyboard is not activated after pressing the left mouse button so that the repeated press of the keys sends particular characters always to the same window.
The program opens on the position where it was closed last time. The opening/closing the window with the virtual keyboard itself is achieved by the following script (take care the real title of the virtual keyboard window - it can be language dependent):
Opens the keyboard window in both 32 and 64-bit PROMOTIC system:
Caution! 32-bit PROMOTIC system on 64-bit Windows OS cannot by default display the osk.exe keyboard. This is caused by the fact that osk.exe is located in the "/Windows/System32" folder that uses dual view on its content: 32-bit program sees different content of this folder compared to 64-bit program. Most libraries and utilities of the Windows OS (both 64/32-bit) are stored in this folder. The osk.exe utility is an axception: it is located only in the 64-bit version, i.e. a 32-bit program cannot see this utility in 32-bit version of the System32 folder. There is a way for 32-bit program to call the 64-bit version of osk.exe via 64-bit cmd.exe (command line). 32-bit program can see 64-bit versions of utilities in the virtual folder /Windows/SysNative. The exact calling procedure together with an example testing the visibility of osk.exe is shown below.
JavaScriptVBScriptSelect and copy to clipboard
if (Pm.FileGetLength("#winsys:osk.exe") > 0)
{
Pm.ShellExecute("open", "#winsys:osk.exe", "", "", 1);
}
else
{
Pm.ShellExecute("open", "#win:SysNative\\cmd.exe", "", "", 1);
}
If Pm.FileGetLength("#winsys:osk.exe") > 0 Then
Pm.ShellExecute "open", "#winsys:osk.exe", "", "", 1
Else
Pm.ShellExecute "open", "#win:SysNative\cmd.exe", "", "", 1
End If
Opens or closes the keyboard window:
JavaScriptVBScriptSelect and copy to clipboard
if (Pm.WndOper(1, "On-Screen Keyboard", 0))
{
Pm.WndOper(1, "On-Screen Keyboard", 10);
}
else
{
Pm.ShellExecute("open", "#winsys:osk.exe", "", "", 1);
}
If Pm.WndOper(1, "On-Screen Keyboard", 0) Then
Pm.WndOper 1, "On-Screen Keyboard", 10
Else
Pm.ShellExecute "open", "#winsys:osk.exe", "", "", 1
End If
Opens or puts the keyboard window on top:
JavaScriptVBScriptSelect and copy to clipboard
if (Pm.WndOper(1, "On-Screen Keyboard", 0))
{
Pm.WndOper(1, "On-Screen Keyboard", 11);
}
else
{
Pm.ShellExecute("open", "#winsys:osk.exe", "", "", 1);
}
If Pm.WndOper(1, "On-Screen Keyboard", 0) Then
Pm.WndOper 1, "On-Screen Keyboard", 11
Else
Pm.ShellExecute "open", "#winsys:osk.exe", "", "", 1
End If
Note! There is a confirmed limitation of sending the
Windows messages (
Pm.WndOper) from 32-bit program to a window of 64-bit program. The 32-bit has to be running with higher permissions ("Run as administrator").