I would like to have a button on my site which simulates CTRL + + (zoom-in). So I need to create 2 keypresses or something. I have the folowing which fires 1 keypress:
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
<title>Stackoverflow</title>
</head>
<body>
<script type="text/javascript">
function simulateKeyPress(character) {
jQuery.event.trigger({ type: 'keypress', which: character.charCodeAt(0) });
}
function pressCtrlPlus() {
simulateKeyPress("=");
}
$(function () {
$('body').keypress(function (e) {
alert(e.which);
});
});
</script>
<input type="button" value="Ctrl +" ONCLICK="pressCtrlPlus();">
</body>
</html>
Does somebody know how to create a CTRL + + event by clicking on a button?