By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,750 Members | 1,367 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,750 IT Pros & Developers. It's quick & easy.

is it possible to capture control+alt+<any key>

pankajkmeena
P: 5
is it possible to capture control+alt+<any key> in javascript
Dec 28 '07 #1
Share this Question
Share on Google+
6 Replies


gits
Expert Mod 5K+
P: 5,369
that 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 regards
Dec 28 '07 #2

pankajkmeena
P: 5
that 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 regards
thankx for ur help but i want ot capture all three keys at a time like in VB not indvidually. for example i want ot show alert box whe a user press CTRL+ALT+Z key (all 3 key) at a time.
Dec 29 '07 #3

100+
P: 141
Hi,

Plz check the below link and try to check the demo and then download the example

http://www.openjs.com/scripts/events...ard_shortcuts/
Dec 29 '07 #4

gits
Expert Mod 5K+
P: 5,369
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="handle_keypress(event);">
testpage
</body>
</html>
[/HTML]
kind regards
Dec 29 '07 #5

pankajkmeena
P: 5
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="handle_keypress(event);">
testpage
</body>
</html>
[/HTML]
kind regards
thankx solution provided by u works
Jan 11 '08 #6

gits
Expert Mod 5K+
P: 5,369
hi :) ... glad to hear that ... post back to the forum anytime you have more questions

kind regards
Jan 12 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.