How can I disable Tablet Mode programmatically?

元气小坏坏 提交于 2021-02-08 07:34:19

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!