manas_sharma86
asked on
On screen keyboard with Display
I need to create an on screen keyboard with display using HTML and Java Script only. This on screen keyboard will be displayed on an emulator. I'm a beginner and have no clue on how to make it. So can you please provide me the code and directions on this subject.
Simple Virtual Keyboard
http://www.greywyvern.com/code/js/keyboard.html
Source to use it below.
You will want to download the files and use it for your own sites.
http://www.greywyvern.com/code/js/keyboard.html
Source to use it below.
You will want to download the files and use it for your own sites.
<script type="text/javascript" src="http://www.greywyvern.com/code/js/keyboard.js" charset="UTF-8"></script>
<link rel="stylesheet" type="text/css" href="http://www.greywyvern.com/code/js/keyboard.css">
<input type="text" value="" class="keyboardInput"/> <br/>
<input type="password" class="keyboardInput"/> <br/>
<textarea rows="3" cols="20" class="keyboardInput"></textarea>
ASKER
Please guys i need a sloution as soon as possible... An on screen keyboard which shows the input text on display as well. The keyboard needs to have the arrow keys as well because i need to run it on an emulator which requires a remote to access it. Hope you guys have the clear picture now.
What do you mean by "emulator"?
Not quite sure what it is you need.
Not quite sure what it is you need.
ASKER
Just think of it as a TV.....emulator is similar to a TV...where it is accessed by a remote and i need the on screen keyboard for that purpose....i hope i'm clear now?
Unfortunately there is need for more information.
You are saying you want to emulate the left and right arrow keys in a browser.
But left and right arrow keys are special within the browser. As is sending keys in general.
There is no "send keypress x", all simulation will have to involve inserting text.
And then you mention showing input text on display, where display could be any number of things.
Then you mention remote access, which could be anything.
And an emulator, from what I understand in technical terms, is any device that simulates the functions of another device.
What exactly do you want these sent keys to do? The left and right arrow buttons don't send text, they have special functions depending on what object is in focus.
You are saying you want to emulate the left and right arrow keys in a browser.
But left and right arrow keys are special within the browser. As is sending keys in general.
There is no "send keypress x", all simulation will have to involve inserting text.
And then you mention showing input text on display, where display could be any number of things.
Then you mention remote access, which could be anything.
And an emulator, from what I understand in technical terms, is any device that simulates the functions of another device.
What exactly do you want these sent keys to do? The left and right arrow buttons don't send text, they have special functions depending on what object is in focus.
ASKER
All right.. Lets start from the scratch and lets leave out the emulator from the discussion. I want an on screen keyboard in HTML and Java script which can work on any browser and if i press 'A' for example on that keyboard then 'A' should be displayed over the on screen keyboard. But i need one thing extra in that keyboard and that is if i press the arrow keys on the on screen keyboard then it should react according to the direction of the arrow.
Hope i'm clear now. Sorry but all this is new for me as well. Struts was my thing till now.
Hope i'm clear now. Sorry but all this is new for me as well. Struts was my thing till now.
Something like this?
<script>
function nkey(k){
if(k=='uc')
document.getElementById('disp').innerHTML = 'shift';
else if(k=='bs')
document.getElementById('disp').innerHTML = 'backspace';
else if(k=='caps')
document.getElementById('disp').innerHTML = 'caps lock';
else if(k=='larr')
document.getElementById('disp').innerHTML = 'left arrow';
else if(k=='rarr')
document.getElementById('disp').innerHTML = 'right arrow';
else if(k=='uarr')
document.getElementById('disp').innerHTML = 'up arrow';
else if(k=='darr')
document.getElementById('disp').innerHTML = 'down arrow';
else if(k=='enter')
document.getElementById('disp').innerHTML = 'enter';
else
document.getElementById('disp').innerHTML = k;
}
</script>
<table border="0" cellspacing="0" cellpadding="1">
<tr>
<td colspan=12>
<center>
<span id="disp"></span>
</center>
</td>
</tr>
<tr>
<td colspan=12>
</td>
</tr>
<tr>
<td>
<input class="cabutt" type=button value=" 1 " onClick="nkey(1)">
</td>
<td >
<input class="cabutt" type=button value=" 2 " onClick="nkey(2)">
</td>
<td >
<input class="cabutt" type=button value=" 3 " onClick="nkey(3)">
</td>
<td >
<input class="cabutt" type=button value=" 4 " onClick="nkey(4)">
</td>
<td >
<input class="cabutt" type=button value=" 5 " onClick="nkey(5)">
</td>
<td >
<input class="cabutt" type=button value=" 6 " onClick="nkey(6)">
</td>
<td >
<input class="cabutt" type=button value=" 7 " onClick="nkey(7)">
</td>
<td >
<input class="cabutt" type=button value=" 8 " onClick="nkey(8)">
</td>
<td >
<input class="cabutt" type=button value=" 9 " onClick="nkey(9)">
</td>
<td >
<input class="cabutt" type=button value=" 0 " onClick="nkey(0)">
</td>
<td colspan=2>
<input class="cabutt" type=button value=" backspace " onClick="nkey('bs')">
</td>
</tr>
<tr>
<td>
<input class="cabutt" type=button value=" Q " onClick="nkey('q')">
</td>
<td >
<input class="cabutt" type=button value=" W " onClick="nkey('w')">
</td>
<td >
<input class="cabutt" type=button value=" E " onClick="nkey('e')">
</td>
<td >
<input class="cabutt" type=button value=" R " onClick="nkey('r')">
</td>
<td >
<input class="cabutt" type=button value=" T " onClick="nkey('t')">
</td>
<td >
<input class="cabutt" type=button value=" Z " onClick="nkey('z')">
</td>
<td >
<input class="cabutt" type=button value=" U " onClick="nkey('u')">
</td>
<td >
<input class="cabutt" type=button value=" I " onClick="nkey('i')">
</td>
<td >
<input class="cabutt" type=button value=" O " onClick="nkey('o')">
</td>
<td >
<input class="cabutt" type=button value=" P " onClick="nkey('p')">
</td>
<td >
<input class="cabutt" type=button value=" Ü " onClick="nkey('ü')">
</td>
<td >
<input class="cabutt" type=button value=" + " onClick="nkey('+')">
</td>
</tr>
<tr>
<td >
<input class="cabutt" type=button value="Caps" onClick="nkey('caps')">
</td>
<td>
<input class="cabutt" type=button value=" A " onClick="nkey('a')">
</td>
<td >
<input class="cabutt" type=button value=" S " onClick="nkey('s')">
</td>
<td >
<input class="cabutt" type=button value=" D " onClick="nkey('d')">
</td>
<td >
<input class="cabutt" type=button value=" F " onClick="nkey('f')">
</td>
<td >
<input class="cabutt" type=button value=" G " onClick="nkey('g')">
</td>
<td >
<input class="cabutt" type=button value=" H " onClick="nkey('h')">
</td>
<td >
<input class="cabutt" type=button value=" J " onClick="nkey('j')">
</td>
<td >
<input class="cabutt" type=button value=" K " onClick="nkey('k')">
</td>
<td >
<input class="cabutt" type=button value=" L " onClick="nkey('l')">
</td>
<td >
<input class="cabutt" type=button value=" Ö " onClick="nkey('ö')">
</td>
<td >
<input class="cabutt" type=button value=" Ä " onClick="nkey('ä')">
</td>
</tr>
<tr>
<td colspan=2>
<input class="cabutt" type=button value=" shift " onClick="nkey('uc')">
</td>
<td>
<input class="cabutt" type=button value=" Y " onClick="nkey('y')">
</td>
<td >
<input class="cabutt" type=button value=" X " onClick="nkey('x')">
</td>
<td >
<input class="cabutt" type=button value=" C " onClick="nkey('c')">
</td>
<td >
<input class="cabutt" type=button value=" V " onClick="nkey('v')">
</td>
<td >
<input class="cabutt" type=button value=" B " onClick="nkey('b')">
</td>
<td >
<input class="cabutt" type=button value=" N " onClick="nkey('n')">
</td>
<td >
<input class="cabutt" type=button value=" M " onClick="nkey('m')">
</td>
<td >
<input class="cabutt" type=button value=" , " onClick="nkey(',')">
</td>
<td >
<input class="cabutt" type=button value=" . " onClick="nkey('.')">
</td>
<td >
<input class="cabutt" type=button value=" - " onClick="nkey('-')">
</td>
</tr>
<tr>
<td>
<center>
<input type="text" name="capsdisp" size="3" maxlength="4" value="">
</center>
</td>
<td>
<center>
<input type="text" name="lockdisp" size="3" maxlength="4" value=" ">
</center>
</td>
<td colspan=8>
<input class="cabutt" type=button value="space" onClick="nkey(' ')">
</td>
<td colspan=2>
<input class="cabutt" type=button value="Enter" onClick="nkey('enter')">
</td>
</tr>
</table>
<table>
<tr>
<td>
<input class="cabutt" type=button value="←" onClick="nkey('left')"/>
</td>
<td>
<input class="cabutt" type=button value="↑" onClick="nkey('up')"/><br/>
<input class="cabutt" type=button value="↓" onClick="nkey('down')"/>
</td>
<td>
<input class="cabutt" type=button value="→" onClick="nkey('right')"/>
</td>
</tr>
</table>
ASKER
No....But I worked on it yesterday night and I'm done with it.
Thanks for the response.
Thanks for the response.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Guys....Need a favor...I need an on screen keyboard which is similar to say the iPhone but only in HTML and Java Script...Please help on this asap.
javascript.internet.com/mi
www.march-of-faces.org/resources/vkt.html
webscripts.softpedia.com/s
http://www.google.com/search?num=30&q=HTML+on-screen+keyboard