Added support for native iOS and Android keyboards.
Tested with Safari on iPad for iOS and Asus Transformer for Android.
This commit is contained in:
parent
46c621175c
commit
7825b9ee9f
|
|
@ -64,6 +64,7 @@ load: function(target) {
|
||||||
html += ' id="VNC_mouse_button2" value="M" onclick="UI.setMouseButton(2);"';
|
html += ' id="VNC_mouse_button2" value="M" onclick="UI.setMouseButton(2);"';
|
||||||
html += ' ><input type="button" class="VNC_status_button"';
|
html += ' ><input type="button" class="VNC_status_button"';
|
||||||
html += ' id="VNC_mouse_button4" value="R" onclick="UI.setMouseButton(4);">';
|
html += ' id="VNC_mouse_button4" value="R" onclick="UI.setMouseButton(4);">';
|
||||||
|
html += ' <input type="button" id="showKeyboard" onclick="showkeyboard()" value="Keyboard" />';
|
||||||
html += ' </span></nobr></div></td>';
|
html += ' </span></nobr></div></td>';
|
||||||
|
|
||||||
// Settings drop-down menu
|
// Settings drop-down menu
|
||||||
|
|
@ -122,6 +123,7 @@ load: function(target) {
|
||||||
html += ' <canvas id="VNC_canvas" width="640px" height="20px">';
|
html += ' <canvas id="VNC_canvas" width="640px" height="20px">';
|
||||||
html += ' Canvas not supported.';
|
html += ' Canvas not supported.';
|
||||||
html += ' </canvas>';
|
html += ' </canvas>';
|
||||||
|
html += '<input id="keyboardinput" style="border:none;" type="text" onKeyDown="onKeyDown(event);"/>';
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
html += '<br><br>';
|
html += '<br><br>';
|
||||||
html += '<div id="VNC_clipboard">';
|
html += '<div id="VNC_clipboard">';
|
||||||
|
|
@ -472,3 +474,40 @@ clipSend: function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
Functions for use of mobile devices native keyboards
|
||||||
|
Added by Chris Gordon
|
||||||
|
http://www.chrisgordon.com.au
|
||||||
|
Date: 23/08/2011
|
||||||
|
*/
|
||||||
|
|
||||||
|
function showkeyboard(){
|
||||||
|
//Get Current Scroll Position of Browser
|
||||||
|
var scrollx = (document.all)?document.body.scrollLeft:window.pageXOffset;
|
||||||
|
var scrolly = (document.all)?document.body.scrollTop:window.pageYOffset;
|
||||||
|
|
||||||
|
//Stop browser zooming on textbox when focus is set.
|
||||||
|
zoomDisable();
|
||||||
|
|
||||||
|
//Focus on hidden textbox to bring up native keyboard.
|
||||||
|
document.getElementById('keyboardinput').focus();
|
||||||
|
|
||||||
|
//Set scroll position of browser to the same position it was prior to focus.
|
||||||
|
scroll(scrollx,scrolly);
|
||||||
|
|
||||||
|
//Renable user zooming.
|
||||||
|
zoomEnable();
|
||||||
|
}
|
||||||
|
|
||||||
|
function zoomDisable(){
|
||||||
|
//Change viewport meta data to disable zooming.
|
||||||
|
$('head meta[name=viewport]').remove();
|
||||||
|
$('head').prepend('<meta name="viewport" content="user-scalable=0" />');
|
||||||
|
}
|
||||||
|
|
||||||
|
function zoomEnable(){
|
||||||
|
//Change viewport meta data to enable user zooming.
|
||||||
|
$('head meta[name=viewport]').remove();
|
||||||
|
$('head').prepend('<meta name="viewport" content="user-scalable=1" />');
|
||||||
|
}
|
||||||
|
|
|
||||||
3
vnc.html
3
vnc.html
|
|
@ -10,6 +10,7 @@
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<link rel="stylesheet" href="include/plain.css">
|
<link rel="stylesheet" href="include/plain.css">
|
||||||
<link rel="alternate stylesheet" href="include/black.css" TITLE="Black">
|
<link rel="alternate stylesheet" href="include/black.css" TITLE="Black">
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
<script type='text/javascript'
|
<script type='text/javascript'
|
||||||
src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'></script>
|
src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'></script>
|
||||||
|
|
@ -18,7 +19,7 @@
|
||||||
<script src="include/ui.js"></script>
|
<script src="include/ui.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body onKeyDown="onKeyDown(event);">
|
||||||
<div id='vnc'>Loading</div>
|
<div id='vnc'>Loading</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
<script src="include/vnc.js"></script>
|
<script src="include/vnc.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body style="margin: 0px;">
|
<body style="margin: 0px;" onKeyDown="onKeyDown(event);">
|
||||||
<div id="VNC_screen">
|
<div id="VNC_screen">
|
||||||
<div id="VNC_status_bar" class="VNC_status_bar" style="margin-top: 0px;">
|
<div id="VNC_status_bar" class="VNC_status_bar" style="margin-top: 0px;">
|
||||||
<table border=0 width="100%"><tr>
|
<table border=0 width="100%"><tr>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue