Obsolete
Status Update
Comments
[Deleted User] <[Deleted User]> #2
I would love this feature.
mo...@gmail.com <mo...@gmail.com> #3
I am having the exact same issue,with the devices mentioned above.
Is there any fix or work around for this issue ?
Is there any fix or work around for this issue ?
[Deleted User] <[Deleted User]> #4
I got a solution. its working fine.
<input type="text" id="char" size="15" onblur="showKeyCode()" value="a">
<input type="button" value="Show Key Code" onclick="showKeyCode();">
<script>
function showKeyCode()
{
var character = document.getElementById ( "char" ).value.substr(this.length - 1);
var code = character.charCodeAt();
var stringall = document.getElementById ( "char" ).value;
var msg = "The Key Code for the \""+character+"\" character is "+code+".";
alert(msg);
}
</script>
<input type="text" id="char" size="15" onblur="showKeyCode()" value="a">
<input type="button" value="Show Key Code" onclick="showKeyCode();">
<script>
function showKeyCode()
{
var character = document.getElementById ( "char" ).value.substr(this.length - 1);
var code = character.charCodeAt();
var stringall = document.getElementById ( "char" ).value;
var msg = "The Key Code for the \""+character+"\" character is "+code+".";
alert(msg);
}
</script>
sk...@gmail.com <sk...@gmail.com> #5
I am also facing the same issue, I have to remove "space" from a input field where ever user put space. I tried to get the keyCode, it is working fine everywhere but not on Nexus5n S4 etc.(the devices having android 4.4.x)
The solution
var character = document.getElementById ( "char" ).value.substr(this.length - 1);
var code = character.charCodeAt();
also is not working fine, basically it will give the first key code, suppose in the input field if I enter 3 then it will give keyCode 51 and after that whatever I am entering there, it is always giving me 51.
Please suggest some solution. I am stucked here very badly and urgently.
The solution
var character = document.getElementById ( "char" ).value.substr(this.length - 1);
var code = character.charCodeAt();
also is not working fine, basically it will give the first key code, suppose in the input field if I enter 3 then it will give keyCode 51 and after that whatever I am entering there, it is always giving me 51.
Please suggest some solution. I am stucked here very badly and urgently.
ri...@gmail.com <ri...@gmail.com> #6
would love it
en...@google.com <en...@google.com>
em...@gmail.com <em...@gmail.com> #7
Just got first Android 2 days ago (Sony Xperia Z Ultra), and this already bothers the hell out of me. It seems like it would be a no brainer to include this as an option.
Description
When running an html5 application in a WebView, trying to access the keypad input events via jQuery or raw javascript, the key codes for most keys return "0". The only reliable key codes we are able to get from the keyup or keydown events are number keys. Numbers and special characters all return a "0" for the "keyCode" and "which" events. The backspace key doesnt even register a keycode at all, so trying to detect its input is near impossible (without some sort of hack using the "input" event and comparing the current and previous input lengths).
We are utilizing cordova for a series of large applications for one of the largest home improvement retailers in the US, which led to the discovery of this defect. I was able to replicate the problem by creating a basic native android application that contains a webview and a simple local HTML page with raw javascript (and a second test utilizing jQuery), then try to use
I have attached a simple Android project, created in Android Studio, that utilizes a Web View, a local html file with an input element, and the JQuery CDN to capture key events, then output them to elements on the page. This project should illustrate the defect.
Grant Stevens
Software Developer
Blue Fletch Mobile