?
Solved

ctrl + d

Posted on 2000-05-09
11
Medium Priority
?
312 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 2
  • +1
11 Comments
 
LVL 8

Expert Comment

by:jbirk
ID: 2792257
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
ID: 2792358
Write a javascript code, which captured the CTRL+D keystroke, and does nothing.
0
 

Author Comment

by:clefairy_in_b5
ID: 2792372
hmm...
what are the commands? ,i could manage that netscape 4.7 could us ctrl d.
0
WordPress Tutorial 2: Terminology

An important part of learning any new piece of software is understanding the terminology it uses. Thankfully WordPress uses fairly simple names for everything that make it easy to start using the software.

 
LVL 8

Expert Comment

by:shlomoy
ID: 2792399
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 40 total points
ID: 2792517
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
 
LVL 2

Expert Comment

by:freshmeat
ID: 2794996
IE can add bookmark with ctrl+D
0
 
LVL 8

Expert Comment

by:jbirk
ID: 2795174
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
ID: 2795841
so do i
ids there  squence of keys that works with netscape to bookmark?
0
 
LVL 8

Expert Comment

by:jbirk
ID: 2795994
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
ID: 2797244
k
0
 

Author Comment

by:clefairy_in_b5
ID: 2798670
acceptble :+)
0

Featured Post

Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

752 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