I am trying to find out the character pressed with ctrl key using jQuery but I am not able to figure out the code.
e.g: If I press ctrl+a then it should alert me that ctrl+a is pressed.
I am using below code
$(document).keypress(function(e) {
if(e.ctrlKey){
var ch = String.fromCharCode(e.keyCode);
alert("key pressed ctrl+"+ch); //gives blank value in ch here, I need to know the character pressed
alert("key pressed ctrl+"+e.keyCode); //this works but gives me ASCII value of the key
}
});