I'm trying to create a on screen keyboard.  

I have already added buttons and bound those buttons with keyboard keys. Therefore user can click on a button on the page to type or use actual physical keyboard.  

 JavaScript :

```
 document.onkeydown = function (e) {
        e = e || window.event;
        switch (e.which || e.keyCode) {
            case 65: document.getElementById("A").click();  break;
            case 83: document.getElementById("S").click();  break;
            case 68: document.getElementById("D").click();  break;
        }
 }

```

 HTML :

```
<button class="button" type="button" onclick="Print('A')" id="A">A</button>
<button class="button" type="button" onclick="Print('S')" id="S">S</button>
<button class="button" type="button" onclick="Print('D')" id="D">D</button>

```

Everything is working fine, The problem is when i type using physical keyboard the keypress effect is not displayed. The document.getElementById("something").click() doesn't seem to play the keypress effect. The button on screen remains static. And if i press the button using mouse the button press effect works perfectly.  

Look at the below images :

[When the button 'S' is clicked using mouse](http://i.stack.imgur.com/WvLb9.jpg)

[When i press the key 'S' on my physical keyboard](http://i.stack.imgur.com/4G1A8.jpg)