Event KeyCode for Alt-F4

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kpranjan1
    New Member
    • Jun 2007
    • 6

    Event KeyCode for Alt-F4

    Hi all,

    I want keyCode for (alt+F4). actually i want to end session whenever browser window is getting closed. it is working when we close window using close button(X).
    if any of you have this idea please provide as early as possible because its urgent.
    Thanks
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Use altKey to detect the Alt key and F4's keycode is 115.

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      Changed thread title to mention Alt-F4

      Comment

      • kpranjan1
        New Member
        • Jun 2007
        • 6

        #4
        Originally posted by acoder
        Changed thread title to mention Alt-F4
        Thanks,
        My issue is solved and i have posted those codes inside article.hope it will helpfull for people like me.

        Comment

        • mylog
          New Member
          • Sep 2007
          • 20

          #5
          Originally posted by kpranjan1
          Thanks,
          My issue is solved and i have posted those codes inside article.hope it will helpfull for people like me.

          Where is the article??

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            I'm not sure which article the OP was referring to. Are you having problems detecting the Alt-F4 combination?

            Comment

            • mylog
              New Member
              • Sep 2007
              • 20

              #7
              Originally posted by acoder
              I'm not sure which article the OP was referring to. Are you having problems detecting the Alt-F4 combination?
              Yes I want to disable the alt+F4 function for the web browsers
              Do you have any good working stuffs for this issue??

              Comment

              • acoder
                Recognized Expert MVP
                • Nov 2006
                • 16032

                #8
                Before we get started, what's the reason? Is it because you want to cancel the session, or to prevent data loss?

                Comment

                • mylog
                  New Member
                  • Sep 2007
                  • 20

                  #9
                  Originally posted by acoder
                  Before we get started, what's the reason? Is it because you want to cancel the session, or to prevent data loss?
                  First I want to end the session and then delete some files at the server end

                  Comment

                  • Frinavale
                    Recognized Expert Expert
                    • Oct 2006
                    • 9749

                    #10
                    I know it's not supported in Opera, but have you considered using the onbeforeunload event to send an Ajax request to do session/data clean up?

                    See this post for an example of how send an Ajax request to log out a user.

                    Comment

                    • mylog
                      New Member
                      • Sep 2007
                      • 20

                      #11
                      thank u it was a great help

                      Comment

                      Working...