Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# how to disable on-screen keyboard sound in windows xp/7

I have a C# application running on windows xp/7 where I'm using onscreen keyboard.

enter image description here

When the sound is enabled there is a delay which causes problems. I would like to disable the sound.

enter image description here

How can I disable the sound through my C# application code. Any ideas ?

like image 434
Ami DATA Avatar asked Oct 05 '22 11:10

Ami DATA


1 Answers

You can disable it from registry

[HKEY_CURRENT_USER\Software\Microsoft\Osk] 
"ClickSound"=dword:00000001 // Related Registry Key 

You can use this code to change it

RegistryKey key = Registry.CurrentUser; //key gets the value = "HKEY_CURRENT_USER"
RegistryKey oskKey = key.CreateSubKey(@"Software\Microsoft\Osk");// This line opens the "HKEY_CURRENT_USER\Software\Microsoft\Osk" 
oskKey.SetValue("ClickSound", 0); // Set the value of ClickSound to 0(disable) which is 1(enabled) by default.

I haven't tested it yet but you may have to restart osk.exe after this.

like image 125
Yakup Ünyılmaz Avatar answered Oct 10 '22 03:10

Yakup Ünyılmaz