Switch from physical to software keyboard

10,484

Solution 1

Under setting ther will be "Language & Input" >> Keyboard Setting >> "Input method selector" >> "Always show"

after you plug in the keyboard just put on the Keyboard ICON "on the bottom right of the screen" the select "USE PHYSICAL KEYBOARD" to off

Then the Soft keyboard (on screen) will appear normally until you unplug the keyboard.

In my case i use the barcode scanner instead of keyboard so I do need some softkeyboard however I use the USB hub and connect both barcode scanner and numeric keyboard.

hope this will help you.

Solution 2

Yes, when a keyboard is connected to the device, by default the soft keyboard is disabled. To enable it, we need to turn OFF hardware keyboard via:

Settings > Language & Input > Select Input Method

The option name may differ from device to device. We will be able to use the scanner along with the soft keyboard even though we turn it OFF.

And NO, there is no way currently to programmatically accomplish this. The most we can do is detect when a keyboard/scanner is connected and redirect the user to the Input Method selection window, by overriding the onConfigurationChanged method in your Application class:

@Override
public void onConfigurationChanged(Configuration newConfig) {
  super.onConfigurationChanged(newConfig);
  if(newConfig.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO) {

    ((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE))
                                  .showInputMethodPicker();
    Toast.makeText(this, "Barcode Scanner detected. Please turn OFF Hardware/Physical keyboard to enable softkeyboard to function.", Toast.LENGTH_LONG).show();
  }
}

Solution 3

Actually we can use physical keyboard and soft keyboard simultaneously, what u have to do is that after connecting your physical keyboard, focus on any edittext, then you can see a keyboard icon on bottom right of your screen, click on it , it'll show all all available soft i/p options plus a Switch titled 'Show Virtual keyboard - keep it on screen while physical keyboard is active' - just check this option

enter image description here

Share:
10,484
Admin
Author by

Admin

Updated on June 13, 2022

Comments