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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pankajkmeena
    New Member
    • Dec 2007
    • 5

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

    is it possible to capture control+alt+<an y key> in javascript
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5388

    #2
    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

    Comment

    • pankajkmeena
      New Member
      • Dec 2007
      • 5

      #3
      Originally posted by gits
      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.

      Comment

      • vee10
        New Member
        • Oct 2006
        • 141

        #4
        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

        • gits
          Recognized Expert Moderator Expert
          • May 2007
          • 5388

          #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="hand le_keypress(eve nt);">
          testpage
          </body>
          </html>
          [/HTML]
          kind regards

          Comment

          • pankajkmeena
            New Member
            • Dec 2007
            • 5

            #6
            Originally posted by gits
            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 regards
            thankx solution provided by u works

            Comment

            • gits
              Recognized Expert Moderator Expert
              • May 2007
              • 5388

              #7
              hi :) ... glad to hear that ... post back to the forum anytime you have more questions

              kind regards

              Comment

              Working...