The below method returns any key from A-Z and 0-9 and when I pressed shift key + 4 its returns the same code 52.
function keyUpEvent(e)//onkeyup event
{
var chr = String.fromCharCode(e.keyCode);//converts the keycode into a character
alert(chr);//alerts the character
}
But I need to show the $ or % when the respective key with combination of shift key is pressed.
i'd go with something like this:
$(function () {
$(document).on('keyup keydown keypress', function (event) {
if (event.keyCode == 52 && event.shiftKey) {
alert('foo');
}
});
});