Solved

ctrl + d

Posted on 2000-05-09
11
274 Views
Last Modified: 2010-04-09
is there a way to stop somebody so he couldn't use ctrl + d in my site?
0
Comment
Question by:clefairy_in_b5
  • 4
  • 4
  • 2
  • +1
11 Comments
 
LVL 8

Expert Comment

by:jbirk
Comment Utility
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
 
LVL 8

Expert Comment

by:shlomoy
Comment Utility
Write a javascript code, which captured the CTRL+D keystroke, and does nothing.
0
 

Author Comment

by:clefairy_in_b5
Comment Utility
hmm...
what are the commands? ,i could manage that netscape 4.7 could us ctrl d.
0
 
LVL 8

Expert Comment

by:shlomoy
Comment Utility
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
 
LVL 8

Accepted Solution

by:
jbirk earned 10 total points
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 2

Expert Comment

by:freshmeat
Comment Utility
IE can add bookmark with ctrl+D
0
 
LVL 8

Expert Comment

by:jbirk
Comment Utility
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
 

Author Comment

by:clefairy_in_b5
Comment Utility
so do i
ids there  squence of keys that works with netscape to bookmark?
0
 
LVL 8

Expert Comment

by:jbirk
Comment Utility
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
 

Author Comment

by:clefairy_in_b5
Comment Utility
k
0
 

Author Comment

by:clefairy_in_b5
Comment Utility
acceptble :+)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now