I've been looking around for a while, and can't seem to find this answer. I am new to JQuery, and am more familiar with PHP (though am fully aware that the act is not possible in PHP, thus searching for the answer in JQuery)
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#keyboard").keyup(function(e){
var key = e.keyCode ? e.keyCode : e.which;
if (key == 87) {
alert("keyup event occured! The Ascii value of pressed key is: " + event.keyCode);
}
});
});
</script>
For starters, this is what I have as the key press. For now it's just an example, that if the 'w' key is pressed then released, it tells me basically, it's pressed.
My form looks like this:
<form action="URL">
<input type="text" id="keyboard" />
</form>
In every instance I've found, it seems that you need to have a text area or something similar. Is the text area somehow required? I am looking to have the text area removed and just have the page respond to my clicking of the W button, anywhere.
On a side note, how would I get this to submit to php if that's possible?