is it possible to capture control+alt+<an y key> in javascript
is it possible to capture control+alt+<any key>
Collapse
X
-
Tags: None
-
Originally posted by gitsthat should be possible ... have a look here ... and come back in case you have problems with implementing it ... post the code you have tried ...
kind regardsComment
-
Hi,
Plz check the below link and try to check the demo and then download the example
Despite the many JavaScript libraries that are available today, I cannot find one that makes it easy to add keyboard shortcuts(or accelerators) to your javascript app. This is because keyboard shortcuts where only used in JavaScript games - no serious web application used keyboard shortcuts to navigate around its interface. But Google apps like Google Reader and Gmail changed that. So, I have created a function to make adding shortcuts to your application much easier.Comment
-
hi ...
simply combine the events ... let me give you an example for alt+ctrl+tab ... tested on FF Mac, may be it will not work with IE without adaptions, since IE uses a global event object ... but have a look at the example first:
[HTML]<html>
<head>
<script type="text/javascript">
function handle_keypress (e) {
var codes = { 9: 'TAB' };
if (e.altKey && e.ctrlKey && e.keyCode in codes) {
alert('pressed ALT + CTRL + ' + codes[e.keyCode]);
}
}
</script>
</head>
<body onkeydown="hand le_keypress(eve nt);">
testpage
</body>
</html>
[/HTML]
kind regardsComment
-
Originally posted by gitshi ...
simply combine the events ... let me give you an example for alt+ctrl+tab ... tested on FF Mac, may be it will not work with IE without adaptions, since IE uses a global event object ... but have a look at the example first:
[HTML]<html>
<head>
<script type="text/javascript">
function handle_keypress (e) {
var codes = { 9: 'TAB' };
if (e.altKey && e.ctrlKey && e.keyCode in codes) {
alert('pressed ALT + CTRL + ' + codes[e.keyCode]);
}
}
</script>
</head>
<body onkeydown="hand le_keypress(eve nt);">
testpage
</body>
</html>
[/HTML]
kind regardsComment
Comment