Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 322
  • Last Modified:

ctrl + d

is there a way to stop somebody so he couldn't use ctrl + d in my site?
0
clefairy_in_b5
Asked:
clefairy_in_b5
  • 4
  • 4
  • 2
  • +1
1 Solution
 
jbirkCommented:
I looked into it and couldn't get it to work for NN 4.7.  It would report keys like control y, it will detect the control key and the y key, however if you press something like control h, control d, control w, etc which are actions defined in the browser the web page never even gets them.  The browser eats up the event and doesn't pass it on:(

-Josh
0
 
shlomoyCommented:
Write a javascript code, which captured the CTRL+D keystroke, and does nothing.
0
 
clefairy_in_b5Author Commented:
hmm...
what are the commands? ,i could manage that netscape 4.7 could us ctrl d.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
shlomoyCommented:
I guess you'd better refer this one to the javascript area. I'm pretty sure it can be done in javascript, and quite easy.
0
 
jbirkCommented:
It works fine with IE, but since IE doesn't add a bookmark with ctrl-d I guess that's kind of useless...

Want to see my code?  OK, here it is (cross browser)

<script language="JavaScript" type="text/javascript">
<!--
if (document.layers)
 document.captureEvents(Event.KEYDOWN);
document.onkeydown = handler;

function handler(e)
{if (document.layers)
  {i = e.which;
   ctrl = (e.modifiers & Event.CONTROL_MASK)
   if ((i != 0) && ctrl) // don't know what the key code is since I can't seem to get it!
    {alert(i+" + control")
     return false;
    }
   else
    return true;
  }
 else if (document.all)
  {ctrl = event.ctrlKey;
   i = event.keyCode;
   if (i == 68 && ctrl)
    {alert("control d")
      return false;
    }
  else
   return true;
  }
}
//  -->
</script>


I tried with keypress and keydown, still no luck with NN 4.7
-Josh
0
 
freshmeatCommented:
IE can add bookmark with ctrl+D
0
 
jbirkCommented:
Really?  It wasn't doing a thing on my computer.  I don't use IE much so I'm unfamiliar with the different versions.  I'm using IE 5.0 on Win98.

-Josh
0
 
clefairy_in_b5Author Commented:
so do i
ids there  squence of keys that works with netscape to bookmark?
0
 
jbirkCommented:
Hunh?  Sorry I don't understand...  Are you asking what the keys are to do this for netscape?  It's ctrl-d like you said before...

confused....
-josh
0
 
clefairy_in_b5Author Commented:
k
0
 
clefairy_in_b5Author Commented:
acceptble :+)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 4
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now