RapsFan1981
RapsFan1981

Reputation: 1197

How can I disable Tablet Mode programmatically?

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?

Upvotes: 2

Views: 2057

Answers (1)

Sean
Sean

Reputation: 442

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();
   }

Upvotes: 1

Related Questions