473,768 Members | 1,449 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Disabling shift click

3 New Member
I want to disable right click in my application.Her e are my requirements.

1. I don't what to turn off shift click for the page. I want to turn it off for specific links.
2. I want shift-click to be replaced with a regular click. Meaning, when the user shift-clicks the link they will be taken to the "HREF" within the current browser window and NOT open up a new window.

I did find a script that does something close to what I want, but it fails to meet all of the criteria above... I'll list it below so someone doesn't waste their time providing it as a solution....

Expand|Select|Wrap|Line Numbers
  1. function mouseDown(e) 
  2. {
  3. var shiftPressed=0;
  4. if (parseInt(navigator.appVersion)>3) 
  5. {
  6. if (navigator.appName=="Netscape")
  7. shiftPressed=(e.modifiers-0>3);
  8. else 
  9. shiftPressed=event.shiftKey;
  10.  
  11. if (shiftPressed) 
  12. {
  13. alert ('Shift-click is disabled.')
  14. return false;
  15. }
  16. }
  17.  
  18. return true;
  19. }
  20.  
  21. if (parseInt(navigator.appVersion)>3) 
  22. {
  23. document.onmousedown = mouseDown;
  24.  
  25. if (navigator.appName=="Netscape") 
  26. document.captureEvents(Event.MOUSEDOWN);
  27. }
  28.  
  29.  
Thanks in advance
Feb 8 '06 #1
3 5507
surya52
3 New Member
I want to disable right click in my application.Her e are my requirements.

1. I don't what to turn off shift click for the page. I want to turn it off for specific links.
2. I want shift-click to be replaced with a regular click. Meaning, when the user shift-clicks the link they will be taken to the "HREF" within the current browser window and NOT open up a new window.

I did find a script that does something close to what I want, but it fails to meet all of the criteria above... I'll list it below so someone doesn't waste their time providing it as a solution....

Expand|Select|Wrap|Line Numbers
  1. function mouseDown(e) 
  2. {
  3. var shiftPressed=0;
  4. if (parseInt(navigator.appVersion)>3) 
  5. {
  6. if (navigator.appName=="Netscape")
  7. shiftPressed=(e.modifiers-0>3);
  8. else 
  9. shiftPressed=event.shiftKey;
  10.  
  11. if (shiftPressed) 
  12. {
  13. alert ('Shift-click is disabled.')
  14. return false;
  15. }
  16. }
  17.  
  18. return true;
  19. }
  20.  
  21. if (parseInt(navigator.appVersion)>3) 
  22. {
  23. document.onmousedown = mouseDown;
  24.  
  25. if (navigator.appName=="Netscape") 
  26. document.captureEvents(Event.MOUSEDOWN);
  27. }
Thanks in advance
Feb 8 '06 #2
ronverdonk
4,258 Recognized Expert Specialist
Be sure that there is NO way you can hide your page from someone who is set on knowing what it is! You can only do that for the casual visitor.

Since the HTML stuff (and included Javascript) is client-side at thus running on his/her PC, he/she can always get to it.
You can try to make it very difficult, but there is no preventing a determined user from getting at client-side code. What you can do is use as much server-side code as possible.

Ronald :cool:
Jul 20 '06 #3
iam_clint
1,208 Recognized Expert Top Contributor
I do not believe are you are going to beable to do what your trying..

Shift click is a built in function in IE and other Browsers.. If i figure anything out on it though i will post but i highly doubt its going to work.
Aug 1 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

20
2147
by: dukeleto | last post by:
I know this is an annoying thing on some sites. I have set some images in an online gallery to have their own java po up window that is set to be the same size as the image. I would like to set ONLY the pop up window so it does not allow th user to right click. Now I did a search, and found some options, but when you right click it gives the user an annoying pop up saying stuff like "you cant d
7
15508
by: Paul Cooper | last post by:
Dear All, I am working on a piece of Javascript code that needs to detect a mouse-click, shift-click and control-click. The code is not my own - it is a part of a much larger suite of routines. The code as it stands does not work in Firefox, and I suspect that the task of feature detection (which currently depends on browser detection) can be carried out better. The result should be that opcode is set to 0,1 or 2 dor click,...
1
4323
by: Ghulam | last post by:
I am using an Access 2k ADP (Converted into ADE) front end and SQL 2K on the backend. Although I taught pretty much myself into these concept with the help of some publications and users group posts, some time I would like to seek some specific help from fellow members. My Question is: Is there any way I can disable Shift Bypass key for regular Network users but enable that privilege to Network Administrator Groups? Our Network...
1
1427
by: David Hearn | last post by:
I have a javascript function that is fired on the KeyDown event of a textbox. I am adding the attribute to the textbox at page load to run this javascript function. The javascript runs as expected and the text box that is specified in the javascript gets the focus set to it, but my problem is that the default button on the form is being pressed also so once the textbox gets the focus, you barely see it before the page redirects. I want...
7
6202
by: Robert | last post by:
Can I programmatically disable the right click context menu?
5
2058
by: Joja | last post by:
I have form with one submit button. All i want to create is to allow user to make JUST ONE button click. After that click, button will be still displayed but it will be disabled. How to make this ?
12
4239
Subsciber123
by: Subsciber123 | last post by:
I have a window that I have created using Python Card that contains an wx.iehtmlWindow opject inside of it. Does anyone know how to disable right click and/or cause links that would open in new windows to open in the same window? I am running Windows XP Home. I am running ActiveState Python 2.4. Anything that I have tried has done absolutely nothing, because I can't get the events from the wx.iehtmlWindow to filter them for right clicks.
15
11204
by: Dan2kx | last post by:
Hello peeps!! got another problem that is outta my league.... What i want (and can do) is to disable the DB window on startup, (what i cant do) disable the shift key load... Also i need a way to get back the DB window
3
4136
by: zandiT | last post by:
hello i have a database that ive converted to an mde because its going on the network and will be accessd by various users. on the startup option i unticked all the options available so users wouldnt tamper with the underlying functionality of the database. my problem is when i hold down the shift key and open the database it opens the database window. you can't do anything to the forms but my main problem is there is no protection for the...
0
9576
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9407
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10017
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9961
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8840
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7384
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3932
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3534
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2808
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.