From d5363e2cf35d69215904b1c899e4cafd0f1c632f Mon Sep 17 00:00:00 2001 From: Gubolin Date: Sun, 7 Sep 2014 09:12:00 +0200 Subject: show virtual keyboard in Android (offline app only) (fix #81) --- mobile.sh | 1 + morphic.js | 5 +++++ snap.html | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/mobile.sh b/mobile.sh index b1fb9de..212f711 100755 --- a/mobile.sh +++ b/mobile.sh @@ -13,5 +13,6 @@ git clone https://github.com/Gubolin/snap.git www cd www git checkout mobileapp cordova platform add android +cordova plugin add org.apache.cordova.plugin.softkeyboard cordova plugin add org.apache.cordova.vibration cordova build android diff --git a/morphic.js b/morphic.js index 2a242f2..efdf139 100644 --- a/morphic.js +++ b/morphic.js @@ -10778,6 +10778,11 @@ WorldMorph.prototype.edit = function (aStringOrTextMorph) { this.virtualKeyboard.style.top = this.cursor.top() + pos.y + "px"; this.virtualKeyboard.style.left = this.cursor.left() + pos.x + "px"; this.virtualKeyboard.focus(); + if (cordova) { + if (cordova.plugins.SoftKeyboard) { // Android only + cordova.plugins.SoftKeyboard.show(); // Issue #81 + } + } } if (MorphicPreferences.useSliderForInput) { diff --git a/snap.html b/snap.html index 904aba8..8e8e919 100755 --- a/snap.html +++ b/snap.html @@ -18,6 +18,10 @@ + + + +