问题
I have a Surface Pro that I use for sketching with my stylus. I want to be able to quickly enable/disable tablet mode without going into Device Manager.
I've been searching for ways to do this: by disabling drivers, disabling by HID but everything I've found seems overly complicated for what I need. I'm creating just a form with a CheckBox. What's the simplest way to achieve this?
回答1:
You could try something like setting the Registry Key to 0
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\ImmersiveShell]
"TabletMode"=dword:00000000
If TabletMode = 1 then it'll be enabled.
RegistryKey myKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\ImmersiveShell", true);
if(myKey != null)
{
myKey.SetValue("TabletMode", "0", RegistryValueKind.dWord);
myKey.Close();
}
来源:https://stackoverflow.com/questions/32481916/how-can-i-disable-tablet-mode-programmatically