Turn virtual keyboard on / off . NET MAUI

F František Bárta 11 months ago
1067 3 1

Hello,

I am creating a .NET MAUI application for Zebra MC330L and I would like to programatically turn the Show virtual keyboard setting on or off (see picture). It is possible to hide the keyboard in .NET MAUI with KeyboardExtensions.HideKeyboardAsync, but only after it shows up. I need to prevent soft keyboard popping up after Entry (text input field) focus in some cases and allow it in other ones dynamically, when the application is running.

Is it possible to achieve this in .NET? I searched the docs, but didn't find any .NET example code, only Virtual Keyboard Show/Hide at https://techdocs.zebra.com/emdk-for-xamarin/8-0/mx/uimgr/.

Thanks, 

František

Image removed.

Please register or login to post a reply

3 Replies

R Rick Dilley

Yes, it is. 

In .NET MAUI, you can programmatically control the behavior of the virtual keyboard on the Zebra MC330L device by using the Zebra's EMDK for Xamarin library. EMDK (Enterprise Mobility Development Kit) provides APIs for interacting with Zebra devices and their specific features.

Here's a general outline of the steps you can follow to achieve this only up

1. Install the EMDK for Xamarin: Begin by installing the EMDK for Xamarin package into your .NET MAUI project. You can find the package on NuGet (search for "Zebra.EMDK") or through the Visual Studio NuGet Package Manager.

2. Initialize the EMDK: In your .NET MAUI application, initialize the EMDK by calling EMDKManager.InitializeAsync() method. This step is typically performed during application startup or when you need to access specific device features.

3. Retrieve the KeyboardManager instance: Use the EMDK's ProfileManager class to retrieve an instance of the KeyboardManager. The keyboard manager provides methods and properties to control the virtual keyboard behavior.

csharp
var emdkManager = EMDKManager.GetEMDKManager(Application.Context);
var keyboardManager = (KeyboardManager)emdkManager.GetInstance(EMDKManager.FEATURE_TYPE.Keyboard);


4. Enable or disable the virtual keyboard: You can use the EnableKeyboard() and DisableKeyboard() methods of the KeyboardManager to control the virtual keyboard's visibility.

csharp
// To enable the virtual keyboard
keyboardManager.EnableKeyboard();

// To disable the virtual keyboard
keyboardManager.DisableKeyboard();


You can call these methods based on your application's logic to dynamically show or hide the virtual keyboard.

5. Release the EMDK resources: When you're done using the EMDK functionality, make sure to release the resources by calling EMDKManager.Release().

csharp
emdkManager.Release();


It's essential to thoroughly test the functionality on the Zebra MC330L device to ensure that the virtual keyboard behavior is as desired. Additionally, consult the Zebra EMDK documentation for more detailed information on using the EMDK features and managing the virtual keyboard on Zebra devices.

N Nurdaulet Ryspay

Hello, I also has same problem but I am using zebra mc3300x and also I am creating application on android(Kotlin). Is it possible to keep hiding virtual keyboard when physical keyboard tapping on some screens and on other I need virtual keyboard, so how to reach this feature to prohibit virtual keyboard toggling in some screens and allows on other?

Thank you!

A Arthur Butler
FEATURE_TYPE.Keyboard is not in v8.0.0.9 of Symbol.XamarinEMDK.  Any ideas how to disable the virtual keyboard while my app is running?

Thanks
CONTACT
Can’t find what you’re looking for?