Keyboard will be automatically invoked while you are focusing textfield, textareafield ... . So you can create listener to the focus event in javascript which is similar to listening to the keyboard open event. Also you can use the blur listener to handle the keyboard close.
大体意思是 键盘的开关跟input的focus、blur是一致的,监听这两个事件就行了。
update:安卓里测试,blur事件并不同步