Closed Thread Icon

Preserved Topic: Disabling Shift key ? Pages that link to <a href="https://ozoneasylum.com/backlink?for=18330" title="Pages that link to Preserved Topic: Disabling Shift key ?" rel="nofollow" >Preserved Topic: Disabling Shift key ?\

 
Author Thread
Ultra
Nervous Wreck (II) Inmate

From:
Insane since: Jan 2002

posted posted 01-21-2002 14:16

Does anyone know how can i disable visitors from using the SHIFT KEY?
I have hundreds of different script for disabling left, right , center and the all keyboard but nothing about Shift key.

If you know how please let me know

thank you

Ultra

::UltrA::

Perfect Thunder
Paranoid (IV) Inmate

From: Milwaukee
Insane since: Oct 2001

posted posted 01-21-2002 14:54

Why?

GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 01-21-2002 15:12

tell me how you disable the other keys. maybe there is a similar approach.
afaik, every key has a special number ...

Ultra
Nervous Wreck (II) Inmate

From:
Insane since: Jan 2002

posted posted 01-21-2002 16:33
quote:
Why?



Because if you press on a link holding the SHIFT KEY the link will open in a new page and i'd like to keep everything under a frame

quote:
tell me how you disable the other keys. maybe there is a similar approach.
afaik, every key has a special number ...



examples:

code:
[b]<SCRIPT LANGUAGE="JavaScript">

function key()
{
alert('keyboard disabled')
}

document.onkeydown=key;

</SCRIPT>[/b]




another way is to simply ad oncontextmenu="return false" to the body tag.


any idea on how to block the Shift key ?

I think i have to find the way to get the onkeydown function to work with the shiftKey......

I will keep trying

Ultra

::UltrA::

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 01-21-2002 20:52

That has got to be one of the most annoying things that could possibly be done on a web page.

They're my keys, dammit, leave 'em alone!



Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 01-21-2002 21:05

A) You can't block the shift key.

B) If i'm viewing your page,and I want to view one of the pages in a new window, it's my own business. Don't control how people view your page.

Ultra
Nervous Wreck (II) Inmate

From:
Insane since: Jan 2002

posted posted 01-22-2002 06:06

well i would never do that on my page but i needed to help a friend that is building a not so legal mp3 site and he wanted to prevent user from using the shiftkey with the mouse click....
anyhow after working on it i finally found how to do it.

code:
[b]<script language="JavaScript">
<!--
function mouseDown(e) {
var shiftPressed=0;
if (parseInt(navigator.appVersion)>3) {
if (navigator.appName=="Netscape")
shiftPressed=(e.modifiers-0>3);
else shiftPressed=event.shiftKey;
if (shiftPressed) {
alert ('Shift-click is disabled.')
return false;
}
}
return true;
}
if (parseInt(navigator.appVersion)>3) {
document.onmousedown = mouseDown;
if (navigator.appName=="Netscape")
document.captureEvents(Event.MOUSEDOWN);
}
//-->
</script>[/b]



Ultra

::UltrA::

Ultra
Nervous Wreck (II) Inmate

From:
Insane since: Jan 2002

posted posted 01-22-2002 06:09

I'm going crazy now the script work to disable a user from pressing the shiftkey and then click but how can i
make it so it work if the user press the mouse and then the shiftkey?



::UltrA::

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 01-22-2002 06:44

Hmm, that's a clever way of doing it.

But, this is much like the "no right click script" - it's a hack, and it's easy to get around, as you've discovered. I would say, in the onload event of the target page, do a test to see if it's the top level page, and if it is, quickly go to a different page or something.

Jestah
Maniac (V) Mad Scientist

From: Long Island, NY
Insane since: Jun 2000

posted posted 01-22-2002 07:11

Ultra,

Off the top of my head, what your asking is nearly impossible. Using JavaScript to turn off the functions of certain keys is silly. As you probably know with your no right mouse click scripts, there very easy to get around. Simply not supporting JavaScript is an easy way to get around it. Why waste the time on a hacks hack when you could spend it on something more useful and legal?

--------------
cheers.jay

Perfect Thunder
Paranoid (IV) Inmate

From: Milwaukee
Insane since: Oct 2001

posted posted 01-22-2002 14:57

I think you'd get more respect if you made a semilegal site that didn't have a lot of offensive JavaScript on it. Most warez sites mount a full-on offensive against the visitor's browser. Why not rise above the pack?

Ultra
Nervous Wreck (II) Inmate

From:
Insane since: Jan 2002

posted posted 01-22-2002 15:03

One more time i'm not making a warez site !
A friend of mine asked me if i could help i'm avoiding the use of Shift click function for his mp3 site

I DON"T THINK disabling the use of the shift click function is suach a big offensive nasty sript !

I'm not crashing a browser or blocking the use of your mouse or keyboard

Come on guys is just the shift key !



::UltrA::

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 01-22-2002 15:11

Ultra: You aren't going to win with that approach - it will only annoy casual users and anyone who wanted to get around it could (an vast number of ways). Its also very poor ettiquette. If you really want to keep something inside a frame then I'd use this kind of approach (which is also a good example of what can be done):
www.xs4all.nl/~ppk/js/index.html?/~ppk/js/framecustom.html
www.xs4all.nl/~ppk/js/framecustom.html

The script will need some work to get it to do what you want but its a better approach.

Its not foolproof (nothing is I'm afraid) but it means you won't spend days trying to work out the various ways people might access the framed page and disabling them.

Emps


With patience and saliva the ant swallows the elephant - Colombian proverb

Petskull
Maniac (V) Mad Scientist

From: 127 Halcyon Road, Marenia, Atlantis
Insane since: Aug 2000

posted posted 01-22-2002 21:15

I'm not sure I want to support this site.... but look at how http://www.bratta.com keeps it's tutorial pages within a frame...


Harmonizing new illusions...
ICQ: 67751342

[This message has been edited by Petskull (edited 01-22-2002).]

« BackwardsOnwards »

Show Forum Drop Down Menu