Is it possible in UWP to force it to open the On Screen Keyboard (osk.exe)?
For example, in C# it is possible using System.Diagnostics.Process.Start("osk.exe");
Doing the above in UWP results in compile error saying there is no Process namespace.
I know that in Tablet mode, if I programmatically focus on a TextBox, it will show up the OnScreen keyboard.
But is it possible when in Desktop mode?
Is there a way for touchkeyboard to appear in desktop mode?
Ref the document in Keyboard interactions
Depending on the device, the touch keyboard appears when a text field or other editable text control gets focus, or when the user manually enables it through the Notification Center:
(source: s-msft.com)
Note The user might have to go to the Tablet mode screen in Settings > System and turn on "Make Windows more touch-friendly when using your device as a tablet" to enable the automatic appearance of the touch keyboard.
So the touch keyboard can appear automatically in tablet mode when users sets the input focus to a text control by using touch input. However, this won't happen in desktop mode and in UWP, there is no API to open it programmatically by now.
To show touch keyboard in desktop mode, we need the user manually enables it by clicking touch keyboard button and users can see this button by checking "Show touch keyboard button" in taskbar.
You are welcome to submit a request for this feature through UserVoice and Windows Feedback Hub app.
I was able to Show/Hide the On Screen Keyboard in Desktop Mode using:
CoreInputView.GetForCurrentView().TryShow(CoreInputViewKind.Keyboard)
Code Sample:
.xaml:
<TextBox GotFocus="TextBox_OnGotFocus" LostFocus="TextBox_OnLostFocus" InputScope="Number"/>
.xaml.cs:
private void TextBox_OnGotFocus(object _, RoutedEventArgs __)
{
CoreInputView.GetForCurrentView().TryShow(CoreInputViewKind.Keyboard);
}
private void TextBox_OnLostFocus(object _, RoutedEventArgs __)
{
CoreInputView.GetForCurrentView().TryHide();
}
Additionally, you can control the keyboard type by setting the InputScope with values like: Number, NumericPin, Text, or others:
https://learn.microsoft.com/en-us/uwp/api/Windows.UI.Xaml.Input.InputScopeNameValue
Related
The websites are MVC C# with kendo UI. It is no problem with the computer and ios phone(iphone) devices.But on Android, if the user clicked the website's textbox, the keyboard shows up and the websites scrolls, the user can not see the focus of the textbox. On the computer and ios phone, the user clicks the textbox,the view stands still and does not scroll. So I use the following CSS code on javascript of cshtml to fix:
#media screen and (max-width: 580px) and (max-height: 350px)and (min-height: 200px){
html {
display:block!important;
overflow:hidden!important;
}
}
If the textbox has clicked, the keyboard shows up and makes view smaller. While the view is smaller, the view can't scroll and it reveals the same correct view with a computer device and ios phone. But, it is only correct on some Android devices.So how can I use CSS to make the view of the website does not scroll when the keyboard shows up on Android phone device? Thanks!
The following is success case in ios phone device:
1.website
2.select event and open event window
3.Scroll down to the textbox
4.scroll down the textbox and focus the the end part of the text in textbox ,then keyboard shows up.It's no problem on this ios phone case ,but on android phone case,it will scroll up to wrong place.
I am facing an unexpected behavior of Keyboard showing and hiding in UWP app working on tablet with windows 10.
After carefully testing again and again i noticed that this issue comes when you have focus on input box and keyboard is opened for it. Now focusing next input needs layout adjustment so that it should not be hidden by keyboard. When you try to focus next element, by default previously opened keyboard hides and now i'm not able to open keyboard un till this new input box lose focus and manually gain focus again.
So for controlling this issue i want to prevent automatic hide and show of keyboard every time i switch focus to new textbox. It should open keyboard once the page load (already found solution using InputPane) and hiding should only be by clicking cancel (x) button.
Please check this video for clearly understanding the issue.
https://www.dropbox.com/s/1c876uwytywio1t/Soft%20Keyboard%20Issue.mp4?dl=0
Please vote this suggestion if anyone else is also facing this issue.
https://wpdev.uservoice.com/forums/110705-universal-windows-platform/suggestions/34170142-inputpane-does-not-open-when-focus-is-shifted-to-n
This issue has been partially resolved in windows 10 version 1803 released on 30th April, 2018. In this version InputPane does not hide and show again and again when focus is shifted from one input element to other.
You may try to put a horizontal-stretched placeholder control (let say, StackPanel) at the bottom of your page, then let it the same size the on-screen keyboard does. That could prevent uncontrolled auto-hide trigger being fired (at least I did that trick on UWP mobile app):
// on the window initialization, remember the input pane
this._inputPane = InputPane.GetForCurrentView()
// then, subscribe to the events
_inputPane.Showing = (sender, args) =>
{
args.EnsuredFocusedElementInView = true; // skip default vertical-shift behavior
this._placeholderPane.Height = args.OccludedRect.Height;
}
_inputPane.Hiding = (sender, args) =>
{
this._placeholderPane.Height = 0;
}
Hope it helps on the Win10 desktop same way as it was on mobile one.
P.S. Yes, initially the placeholder pane is zero-height and collapsed.
I developing an app in UWP, architecture 64x. With C#, W10 in kiosk mode.
I need to show and use only numeric keyboard for all input's into all application, but the keyboard provided by windows when i use InputScope="NumericPin" in TextBox element the NumericPin keyboard is showed, but when control lose focus for a moment the standard keyboard appears and disappears.
I already tried this, but it works just like what I have explained:
https://msdn.microsoft.com/en-us/library/windows/apps/mt280229.aspx
I also considered use an external keyboard app service and it works perfectly, but my boss say it is the last resource.
http://chessware.ch/virtual-keyboard/index.php
What i looking for is something like:
use the NumericPin keyboard as static in display every time.
the only keyboard layout available be NumericPin keyboard.
I finded this related question but says the same what me:
UWP VirtualKeyboard shows NumericPin layout in simple textbox
Thanks for everybody.
I need to show and use only numeric keyboard for all input's into all application, but the keyboard provided by windows when i use InputScope="NumericPin" in TextBox element the NumericPin keyboard is showed, but when control lose focus for a moment the standard keyboard appears and disappears.
As you said, the keyboard provided by windows and the type of keyboard is determined by InputScope property of input control. You could manually set InputScope property. However, you could not set keyboard for the input control that has not been determined InputScope property.
For your requirement, I think you could set global style for input control in Application.Resources. such as TextBox,RichEditBox etc.
<Application.Resources>
<Style TargetType="TextBox">
<Setter Property="InputScope" Value="NumericPin"/>
</Style>
</Application.Resources>
How can disable programatically the virtual keyboard on windows 7 ?
I no need the keyboard on my touch appz, can someone expalin how disable and enable?
Bets regads.
When you click a Windows Phone 7 TextInput control, the Virtual Keyboard is shown!
Change the property of textbox as seen below:
IsHitTestVisible="True" (in XAML)
or
textBox1.IsHitTestVisible = false; (dynamically)
im writing a C# program for a Windowsce 5.0 Device (PSION Teklogix Workabout Pro G2).
The taskbar is set to autohide.
I can't disable it completely, because the user sometimes needs to access the start menu or may like to manually show or hide the SIP. And it should not be displayed all the time, because i'd like to use as much of the small display as possible.
My problem is: When the taskbar is minimized at the bottom of the screen and a user clicks somewhere on it (not the startmenu button), it will slide in and is shown correctly.
But if the user does not activate the startmenu (by clicking on the windows-Logo), the taskbar won't slide out again, unless the startmenu was opened once.
Is there something like an event or so, that i could send to the taskbar, so it hides again, without the user beginning to access the startmenu ?
The way I have done this in the past assuming you mean vanilla ce (standard shell) is to grab the handle of HHTaskBar and simply hide it ;)
I also disable the SipWndClass (just in case the keyboard is left open).
Where iEnabled = true (enter fullscreen), or false to show HHTaskBar: -
HWND hWndToHide = FindWindow(_T("HHTaskBar"), NULL);
if(hWndToHide) {
if(iEnabled) {
// Disable VanillaCE TaskBar
if(IsWindowVisible(hWndToHide))
ShowWindow(hWndToHide, SW_HIDE);
// Disable SIPWnd (On Screen Keyboard).
hWndToHide = FindWindow(_T("SipWndClass"), NULL);
if(hWndToHide && IsWindowVisible(hWndToHide))
ShowWindow(hWndToHide, SW_HIDE);
}
else {
// Enable VanillaCE TaskBar
if(!IsWindowVisible(hWndToHide))
ShowWindow(hWndToHide, SW_SHOW);
}
}
It shouldn't be too hard to translate this to .NET ;)