我有一台平板电脑,必须使用数字输入字段运行应用程序。但是,我无法使Windows键盘(TabTip.exe)在默认情况下弹出显示数字键盘。Tabtip和InputScope - 显示数字键盘
当文本框被点击时,键盘需要自动弹出。
我设法让它通过在TextBox事件处理程序中运行TabTip.exe来显示每个字段上的键盘,但它显示正常的键盘布局。这是利用这个问题的答案:Show & hiding the Windows 8 on screen keyboard from WPF
protected override void OnStartup(StartupEventArgs eventArgs)
{
// Popup keyboard, Select All on getting focus.
EventManager.RegisterClassHandler(typeof(TextBox), UIElement.GotFocusEvent,
new RoutedEventHandler(GotFocus_Event), true);
EventManager.RegisterClassHandler(typeof(TextBox), UIElement.LostFocusEvent,
new RoutedEventHandler(LostFocus_Event), true);
}
private static void GotFocus_Event(object sender, RoutedEventArgs e)
{
// The popup keyboard.
OpenTouchKeyboard(sender, e);
}
private static void OpenTouchKeyboard(object sender, RoutedEventArgs e)
{
var textBox = e.OriginalSource as TextBox;
if (textBox != null && IsSurfaceKeyboardAttached())
{
var path = @"C:\Program Files\Common Files\Microsoft Shared\ink\TabTip.exe";
Process.Start(path);
textBox.BringIntoView();
}
}
我在以下页面,您可以使用文本框的“InputScope”属性决定了它应该是一个数字键盘读取。
因此,像<TextBox Header="Name" InputScope="Number"/>
然而,这没有任何影响,但它仍然与常规布局弹出。另外,我发现很难相信InputScope只是将自己传递给TabTip.exe进程的执行,而没有以某种方式将它们连接起来。
我也碰到过这样的:Start TabTip with numpad view open这表明编辑每次调用TabTip.exe注册表之前,但这似乎很凌乱,并且在Windows显然是不可靠的10
是不是有一个命令行参数还是可以传递给它的东西?
这是在Windows 10上工作吗? – walteronassis