Detecting keyboard open/close

4 posts, 0 answers
  1. Kjell
    Kjell avatar
    274 posts
    Member since:
    Jun 2010

    Posted 22 Aug 2014 Link to this post

    In the past I was able to use the following code to detect the keyboard opening and closing:

    document.addEventListener("showkeyboard", function(){ keyboardOpen();}, false);
    document.addEventListener("hidekeyboard", function(){ keyboardClose();}, false);

    But this is not working since updating to the newer Kendo libraries (I was on a pretty old version before, I think around 2013 Q2 or Q3).  

    How should I go about detecting the opening/closing of the android keyboard?  I am testing on a samsung tablet.

  2. Kjell
    Kjell avatar
    274 posts
    Member since:
    Jun 2010

    Posted 22 Aug 2014 in reply to Kjell Link to this post

    Never mind, I was binding the event listeners improperly.  Please ignore or delete this thread.
  3. Pratik
    Pratik avatar
    1 posts
    Member since:
    Sep 2014

    Posted 26 Sep 2014 in reply to Kjell Link to this post

    I remove `android:theme="@android:style/Theme.Black.NoTitleBar` from AndroiedManifest.xml but still i am not getting show keyboard and hide keyboard event.

    i have set `android:windowSoftInputMode="adjustPan"` as i dont want to resize while inputting.

    i am developing hybrid application using telrik appbuilder. i want to make scroll my screen when softkeyboard is visible.

    when i set `android:windowSoftInputMode="adjustResize"` i get the keyboard hide and show event.but then my screen is resize when softkeyboard up. i dont want to do that.
    this is my code:

           document.addEventListener("showkeyboard", function() {   

           }, false);
           document.addEventListener("hidekeyboard", function() {
           }, false);

    is there any workaround or fix for this?
  4. Tsvetina
    Tsvetina avatar
    1862 posts

    Posted 29 Sep 2014 Link to this post

    Hi Pratik,

    This is a limitation specific to the Android platform when using the adjustPan mode. It has been explained by the Cordova team here:

    Cordova don't trigger hidekeyboard or showkeyboard with adjustPan in the Android Manifest

    You should rather use adjustResize mode and, if needed, control your inputs sizes using CSS with media queries or some other approach based on screen size/keyboard events.


    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

Back to Top