disable programatically the virtual keyboard on windows 7? - c#

How can disable programatically the virtual keyboard on windows 7 ?
I no need the keyboard on my touch appz, can someone expalin how disable and enable?
Bets regads.

When you click a Windows Phone 7 TextInput control, the Virtual Keyboard is shown!
Change the property of textbox as seen below:
IsHitTestVisible="True" (in XAML)
or
textBox1.IsHitTestVisible = false; (dynamically)

Related

How to use only NumericPin keyboard into all application? UWP

I developing an app in UWP, architecture 64x. With C#, W10 in kiosk mode.
I need to show and use only numeric keyboard for all input's into all application, but the keyboard provided by windows when i use InputScope="NumericPin" in TextBox element the NumericPin keyboard is showed, but when control lose focus for a moment the standard keyboard appears and disappears.
I already tried this, but it works just like what I have explained:
https://msdn.microsoft.com/en-us/library/windows/apps/mt280229.aspx
I also considered use an external keyboard app service and it works perfectly, but my boss say it is the last resource.
http://chessware.ch/virtual-keyboard/index.php
What i looking for is something like:
use the NumericPin keyboard as static in display every time.
the only keyboard layout available be NumericPin keyboard.
I finded this related question but says the same what me:
UWP VirtualKeyboard shows NumericPin layout in simple textbox
Thanks for everybody.
I need to show and use only numeric keyboard for all input's into all application, but the keyboard provided by windows when i use InputScope="NumericPin" in TextBox element the NumericPin keyboard is showed, but when control lose focus for a moment the standard keyboard appears and disappears.
As you said, the keyboard provided by windows and the type of keyboard is determined by InputScope property of input control. You could manually set InputScope property. However, you could not set keyboard for the input control that has not been determined InputScope property.
For your requirement, I think you could set global style for input control in Application.Resources. such as TextBox,RichEditBox etc.
<Application.Resources>
<Style TargetType="TextBox">
<Setter Property="InputScope" Value="NumericPin"/>
</Style>
</Application.Resources>

Programmatically open On-Screen Keyboard in UWP

Is it possible in UWP to force it to open the On Screen Keyboard (osk.exe)?
For example, in C# it is possible using System.Diagnostics.Process.Start("osk.exe");
Doing the above in UWP results in compile error saying there is no Process namespace.
I know that in Tablet mode, if I programmatically focus on a TextBox, it will show up the OnScreen keyboard.
But is it possible when in Desktop mode?
Is there a way for touchkeyboard to appear in desktop mode?
Ref the document in Keyboard interactions
Depending on the device, the touch keyboard appears when a text field or other editable text control gets focus, or when the user manually enables it through the Notification Center:
(source: s-msft.com)
Note The user might have to go to the Tablet mode screen in Settings > System and turn on "Make Windows more touch-friendly when using your device as a tablet" to enable the automatic appearance of the touch keyboard.
So the touch keyboard can appear automatically in tablet mode when users sets the input focus to a text control by using touch input. However, this won't happen in desktop mode and in UWP, there is no API to open it programmatically by now.
To show touch keyboard in desktop mode, we need the user manually enables it by clicking touch keyboard button and users can see this button by checking "Show touch keyboard button" in taskbar.
You are welcome to submit a request for this feature through UserVoice and Windows Feedback Hub app.
I was able to Show/Hide the On Screen Keyboard in Desktop Mode using:
CoreInputView.GetForCurrentView().TryShow(CoreInputViewKind.Keyboard)
Code Sample:
.xaml:
<TextBox GotFocus="TextBox_OnGotFocus" LostFocus="TextBox_OnLostFocus" InputScope="Number"/>
.xaml.cs:
private void TextBox_OnGotFocus(object _, RoutedEventArgs __)
{
CoreInputView.GetForCurrentView().TryShow(CoreInputViewKind.Keyboard);
}
private void TextBox_OnLostFocus(object _, RoutedEventArgs __)
{
CoreInputView.GetForCurrentView().TryHide();
}
Additionally, you can control the keyboard type by setting the InputScope with values like: Number, NumericPin, Text, or others:
https://learn.microsoft.com/en-us/uwp/api/Windows.UI.Xaml.Input.InputScopeNameValue

How to disable universal volume controls in a page

My app plays a track in the background with AudioPlayerAgent and the user can move between pages.
The problem is that I don't want the universal volume controls appear in one of those pages when the user presses the physical volume button. just like how we disable System Tray shell:SystemTray.IsVisible="False". Is it possible?
there is a way to set which controls appear when assigning the track, but this doesn't help in my case:
EnabledPlayerControls controls = EnabledPlayerControls.Pause |
EnabledPlayerControls.Rewind |
EnabledPlayerControls.FastForward;
AudioTrack track = new AudioTrack(
trackUri,
trackTitle,
trackBy,
trackAlbum,
trackAlbumArtUri,
trackTag,
controls);
The experience is intentional that the volume control display is presented in a consistent cross-application experience when the volume buttons are pressed.
There currently is no API for overriding this behavior.
The same is true for example on Windows 8+ (the Volume indicator is now system defined and cannot be overridden/hidden).
From what i found it's not so much appear but be enabled or disabled.
here is the sample code
AudioTrack track = new AudioTrack(
trackUri,
trackTitle,
trackBy,
trackAlbum,
trackAlbumArtUri,
trackTag,
EnabledPlayerControls.None);
Hope it helps

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.
When the sound is enabled there is a delay which causes problems.
I would like to disable the sound.
How can I disable the sound through my C# application code.
Any ideas ?
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.
All you have to do is click the volume icon in the task bar, click mixer and adjust the slider for "On-Screen Keyboard" or click the speaker to mute it. It has to be running in order to show in the mixer window.
All you have to do is click the volume icon in the task bar, click mixer and adjust the slider for "On-Screen Keyboard" or click the speaker to mute it. It has to be running in order to show in the mixer window.
Brother it will effect other media sound also which we don't want,
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.
this worked for me like charm thanks a lot brother

How can I disable the virtual keyboard for all my WPF apps?

I saw method to do this for current control but I need to do it for all app. I have touch scren and when i click on some textbox virtual keyboard from windows 7 shown. I don't need it because i how own keyboard in program.
Please help.
Thanks.
Not sure if you got an answer in the few months the question was online, but this worked for me.
First, you need a reference to Microsoft.Ink.dll.
var handle = new WindowInteropHelper(this).Handle;
TextInputPanel panel = new TextInputPanel(handle);
panel.InPlaceVisibleOnFocus = false;
That first line gets a Handle to the window of your app, and then you just need to create the TextInputPanel object and set it's InPlaceVisibleFocus to false. This will no longer show the TIP icon when a textbox is touched.

Categories

Resources