Disable Key Board in Powerpoint slide

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nagmvs
    New Member
    • Aug 2008
    • 49

    Disable Key Board in Powerpoint slide

    Hi,
    Can any one tell me How to disable Keyboard Functions using JavaScript.If knows please tell me the code.Also tell me the code for mouse disable also.

    Thanks,
    Nagesh.
  • RamananKalirajan
    Contributor
    • Mar 2008
    • 608

    #2
    Can i know for what reason u are disabling the keyboard. for a particular field u can do that by the following method

    [HTML]function doThis()
    {
    return false;
    }[/HTML]

    [HTML]<input type="text" onkeypress="ret urn doThis();">[/HTML]

    for this particular text box u cant enter anything. the key board behaves as blocked one. Is this ur requirement. you just post with some additional information about ur requirement

    Regards
    Ramanan Kalirajan

    Comment

    • nagmvs
      New Member
      • Aug 2008
      • 49

      #3
      Originally posted by RamananKaliraja n
      Can i know for what reason u are disabling the keyboard. for a particular field u can do that by the following method

      [HTML]function doThis()
      {
      return false;
      }[/HTML]

      [HTML]<input type="text" onkeypress="ret urn doThis();">[/HTML]

      for this particular text box u cant enter anything. the key board behaves as blocked one. Is this ur requirement. you just post with some additional information about ur requirement

      Regards
      Ramanan Kalirajan

      Hello Sir,

      Thanks for ur reply.Actually my y requirement is to disable keyboard keys in a particular web page what i am having.on that webpage i don't allow anyone to copy and paste and also printing.for using some code i disable it.

      But now other requirement is to disable keyboard on powerpoint presentaion that means when a slide is playing i want to disable keyboard keys like pagedown, page up,arrow keys,Enter key,Backspace.H ome,End and also escape keys.
      If possible tell me what is the code for this ?.I am already disable right mouse click and left clicks using some code.

      So now i want to disable the above keys.If u know the Javascript code or HTML code means please tell me the code.
      It's Urgent.

      Thanks,
      Nagesh.

      Comment

      • mrcheeky
        New Member
        • Sep 2008
        • 7

        #4
        I once used this in the body to disable right-click (obviously this will need updating to the new format):

        Code:
        <script language=JavaScript>
        <!--
        
        var message="Function Disabled!";
        
        function clickIE() {if (document.all) {alert(message);return false;}}
        function clickNS(e) {if 
        (document.layers||(document.getElementById&&!document.all)) {
        if (e.which==2||e.which==3) {alert(message);return false;}}}
        if (document.layers) 
        {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
        else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
        
        document.oncontextmenu=new Function("return false")
        // --> 
        </script>
        and this to disable select with left click, in the head:
        Code:
        <script language="JavaScript1.2">
        
        function disableselect(e){
        return false
        }
        
        function reEnable(){
        return true
        }
        
        //if IE4+
        document.onselectstart=new Function ("return false")
        
        //if NS6
        if (window.sidebar){
        document.onmousedown=disableselect
        document.onclick=reEnable
        }
        </script>\
        I hope this helps.

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #5
          Originally posted by nagmvs
          But now other requirement is to disable keyboard on powerpoint presentaion that means when a slide is playing i want to disable keyboard keys like pagedown, page up,arrow keys,Enter key,Backspace.H ome,End and also escape keys.
          Get the key/char codes of the keys pressed - this link should help. If they match, cancel them with a return false.

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            Originally posted by mrcheeky
            I once used this in the body to disable right-click (obviously this will need updating to the new format):
            The code is pretty outdated. You could get rid of most of that code and it should work fine in most browsers.

            Note that all this mouse/key disabling is easy to circumvent. Don't depend on it.

            Comment

            • Markus
              Recognized Expert Expert
              • Jun 2007
              • 6092

              #7
              Whatever you do, the user will always be able to view the source of a page and, therefore, copy the content.

              Comment

              • nagmvs
                New Member
                • Aug 2008
                • 49

                #8
                Originally posted by mrcheeky
                I once used this in the body to disable right-click (obviously this will need updating to the new format):

                Code:
                <script language=JavaScript>
                <!--
                
                var message="Function Disabled!";
                
                function clickIE() {if (document.all) {alert(message);return false;}}
                function clickNS(e) {if 
                (document.layers||(document.getElementById&&!document.all)) {
                if (e.which==2||e.which==3) {alert(message);return false;}}}
                if (document.layers) 
                {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
                else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
                
                document.oncontextmenu=new Function("return false")
                // --> 
                </script>
                and this to disable select with left click, in the head:
                Code:
                <script language="JavaScript1.2">
                
                function disableselect(e){
                return false
                }
                
                function reEnable(){
                return true
                }
                
                //if IE4+
                document.onselectstart=new Function ("return false")
                
                //if NS6
                if (window.sidebar){
                document.onmousedown=disableselect
                document.onclick=reEnable
                }
                </script>\
                I hope this helps.

                Hello sir,

                Thanks for sending this code.Sir already i disable left mouse and right mouse.now i want the code to disable Pageup,pagedown ,Arrow keys and also Backspace,Enter keys in a powerpoint presentation(Ac tually i ahve a power point presentation that is converted as html page).when a slide is running i want to disable all these keys.If u know the code means please send me.

                I have some code to disable key board

                Code:
                <!-- This code is for disableing some keyboard keys-->
                
                <SCRIPT language="Javascript">
                var keyesMessage="Questa funzione non si può usare!";
                function nokeys(){
                if (document.all)
                {
                //alert(keyesMessage);
                return false;
                }
                }
                if (document.all)
                {
                document.onkeydown=nokeys;
                }
                </SCRIPT>
                This code is running successfully in a web page.But not running on a power point slide.

                so if u know the code to disable all keyboard keys( in any type of web page)
                please send me the code.

                it's urgent.

                Thanks,
                Nagesh.
                Last edited by acoder; Sep 12 '08, 11:33 AM. Reason: Added [code] tags

                Comment

                • nagmvs
                  New Member
                  • Aug 2008
                  • 49

                  #9
                  Disable keyboard in a power point slide.

                  Hello Guys,

                  I wan
                  t the code to disable keyboard in a power point slide.already i disable left mouse and right mouse.now i want the code to disable Pageup,pagedown ,Arrow keys and also Backspace,Enter keys in a powerpoint presentation(Ac tually i have a power point presentation that is converted as html page).when a slide is running i want to disable all these keys.If u know the code means please send me.



                  I have some code to disable key board :

                  Code:
                  <!-- This code is for disableing some keyboard keys-->
                  
                  <SCRIPT language="Javascript">
                  var keyesMessage="Questa funzione non si può usare!";
                  function nokeys(){
                  if (document.all)
                  {
                  //alert(keyesMessage);
                  return false;
                  }
                  }
                  if (document.all)
                  {
                  document.onkeydown=nokeys;
                  }
                  </SCRIPT>
                  This code is running successfully in a web page.But not running on a power point slide.

                  so if any one know the code to disable all keyboard keys( in any type of web page)
                  please send me the code.

                  thanks in advance,
                  Nagesh.
                  it's urgent.
                  Last edited by acoder; Sep 12 '08, 12:02 PM. Reason: Added [code] tags

                  Comment

                  • acoder
                    Recognized Expert MVP
                    • Nov 2006
                    • 16032

                    #10
                    What exactly are you trying to achieve by blocking these keys and mouse events? If you're trying to protect the content, then forget it. It's not worth the effort and will easily be bypassed by someone willing enough.

                    Comment

                    • acoder
                      Recognized Expert MVP
                      • Nov 2006
                      • 16032

                      #11
                      Merged threads. Please do not double post your questions.

                      Also remember to use code tags when posting code. See How to ask a question.

                      Moderator.

                      Comment

                      • nagmvs
                        New Member
                        • Aug 2008
                        • 49

                        #12
                        Originally posted by acoder
                        What exactly are you trying to achieve by blocking these keys and mouse events? If you're trying to protect the content, then forget it. It's not worth the effort and will easily be bypassed by someone willing enough.

                        Hello sir,

                        Thanks for ur advice. If i am not getting the exact result means what i do.so i send questions again.ok if u know the answer means answer it.why ur asking me like this sir.

                        Ok
                        u must respect the customers.ok then only ur site is big hit.if ur doing same things means -----------------------? see sir here all r posting questions ok

                        ok.

                        Comment

                        • nagmvs
                          New Member
                          • Aug 2008
                          • 49

                          #13
                          Originally posted by acoder
                          Merged threads. Please do not double post your questions.

                          Also remember to use code tags when posting code. See How to ask a question.

                          Moderator.
                          Hello sir,

                          i know the site rules and every thing,ok no need to tell me again.

                          suppose if we want to buy one product means we know all the advantages of that product then only we buy it.ok
                          so when i want to join this site first day i read all ur rules.ok
                          so no need to post ur rules for me .ok

                          bye.

                          Comment

                          • acoder
                            Recognized Expert MVP
                            • Nov 2006
                            • 16032

                            #14
                            If you're not going to abide by the rules, then the rules will be pointed out to you. It's not enough to read the rules, you also have to follow them.

                            Comment

                            • acoder
                              Recognized Expert MVP
                              • Nov 2006
                              • 16032

                              #15
                              Originally posted by nagmvs
                              Thanks for ur advice. If i am not getting the exact result means what i do.so i send questions again.ok if u know the answer means answer it.why ur asking me like this sir.

                              Ok
                              u must respect the customers.ok then only ur site is big hit.if ur doing same things means -----------------------?
                              Firstly, you're not my customer. I don't own this site and you're getting free help. Now I don't know if you took the wrong meaning from my post, but that was unintended. I was asking a genuine question and letting you know that your effort on this 'problem' might be wasted and put to better use elsewhere.

                              Let's say you got a fabulous script that does all the blocking. I can disable JavaScript and get all the content anyway. If not, I could view the source to see the content. All this mouse/key disabling/blocking will do is annoy your users.

                              Do you see where I'm coming from?

                              Comment

                              Working...