akoumjian / nativescript-keyboardshowing

Find out via events when the keyboard changes visibility

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

npm npm npm

nativescript-keyboardShowing

A NativeScript plugin to deal knowing if the keyboard is showing or hiding.

License

This is released under the MIT License, meaning you are free to include this in any type of program -- However for entities that need a support contract, changes, enhancements and/or a commercial license please contact me at http://nativescript.tools.

I also do contract work; so if you have a module you want built for NativeScript (or any other software projects) feel free to contact me nathan@master-technology.com.

Donate Patreon

Sample Snapshot

Installation

tns plugin add nativescript-keyboardshowing

Usage

To use the module you just require() it:

var keyboard = require( "nativescript-keyboardshowing" );
console.log("keyboard is", keyboard.isShowing() ? "showing" : "hidden");

exports.onKeyboard = function (evt) {
    console.log("Keyboard is now", evt.showing ? 'showing' : 'hidden');
};

You ask, how exactly does this help?

Have you ever needed to know if the Soft-keyboard is showing? This plugin gives you that information via a event or a function call.

You can add to any page you need it the following Function:

exports.onKeyboard = function(args) { }

args.showing = true | false
args.object = the current page

Additional Helper Method

var keyboard = require('nativescript-keyboardshowing');

keyboard.isShowing()

returns: true or false
var keyboard = require( "nativescript-keyboardshowing" );
console.log("keyboard is", keyboard.isShowing() ? "showing" : "hidden");

About

Find out via events when the keyboard changes visibility

License:Other


Languages

Language:JavaScript 100.0%