Ionic Keyboard disable completely on "Init"


Hey Fellas,

I have the following problem, I need to disable the native Keyboard completely. The keyboard should only show when I call the show() and hide when I call the close() function (this will be on a Button for the user to toggle the Keyboard).
The Keyboard showing on clicking the Field and on Focus needs to be completely disabled.

On Stackoverflow I found this:
InputMethodManager im = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
im.hideSoftInputFromWindow(editText.getWindowToken(), 0);

So my thought was In the “Init”(Line 52 in the I need to change it.

if ("init".equals(action)) {
            cordova.getThreadPool().execute(new Runnable() {
                public void run() {

                  //new Logic on init
                  InputMethodManager im = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
                  im.hideSoftInputFromWindow(editText.getWindowToken(), 0);
              DisplayMetrics dm = new DisplayMetrics();
                final float density = dm.density;

                // detect if keyboard is showing
                final View rootView = cordova.getActivity().getWindow().getDecorView().findViewById(;
                OnGlobalLayoutListener list = new OnGlobalLayoutListener() {
                    int previousHeightDiff = 0;
                    public void onGlobalLayout() {
                        Rect r = new Rect();
                        //r will be populated with the coordinates of your view that area still visible.
                        PluginResult result;

                        int heightDiff = rootView.getRootView().getHeight() - r.bottom;
                        int pixelHeightDiff = (int)(heightDiff / density);
                        if (pixelHeightDiff > 100 && pixelHeightDiff != previousHeightDiff) { // if more than 100 pixels, its probably a keyboard...
                        	String msg = "S" + Integer.toString(pixelHeightDiff);
                            result = new PluginResult(PluginResult.Status.OK, msg);
                        else if ( pixelHeightDiff != previousHeightDiff && ( previousHeightDiff - pixelHeightDiff ) > 100 ){
                        	String msg = "H";
                            result = new PluginResult(PluginResult.Status.OK, msg);
                        previousHeightDiff = pixelHeightDiff;

                PluginResult dataResult = new PluginResult(PluginResult.Status.OK);
        return true;
    return false;  // Returning false results in a "MethodNotFound" error.

But I think I have to change the close / show function too but I am not really sure what the correct code is, and I dont know if this change would affect other Keyboard behaviour. (But I basically need Focus without Keyboard)

I also found this Cordova Plugin

which looks very promising, but I decided to change this in the Ionic Keyboard Plugin, because I need the same behaviour in Windows too.
Very glad if someone could help me out here.

Regards Christopher