Automatically pop up tablet touch keyboard on WinForms input focus

前端 未结 5 1535
南旧
南旧 2020-12-24 01:11

When I run a WinForms (or Delphi, see at the end) application on Windows 10 in a tablet mode, a touch keyboard does not pop up automatically, when an input box is focused.

5条回答
  •  隐瞒了意图╮
    2020-12-24 01:46

    I've been down this road a few times and have only ever been able to implement the taptip.exe option. And in turn close the window by killing the process. I also found out that with some registry hacks you can get the keyboard to default to the handwriting panel if you so choose. But then that only works in Win8 and fails in Win10. Here is what I've done in case anyone else finds this useful:

    RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("Software\\Microsoft\\TabletTip\\1.7");
    
    registryKey?.SetValue("KeyboardLayoutPreference", 0, RegistryValueKind.DWord);
    registryKey?.SetValue("LastUsedModalityWasHandwriting", 1, RegistryValueKind.DWord);
    
    Process.Start(@"C:\Program Files\Common Files\Microsoft Shared\ink\TabTip.exe");
    

    I need to give credit to this post for the registry idea: Windows 8 Desktop App: Open tabtip.exe to secondary keyboard (for numeric textbox)

提交回复
热议问题