1
wcrwcr
javaScript - desabling keyEvents
  • 2005/5/21 3:09

  • wcrwcr

  • Home away from home

  • Posts: 1114

  • Since: 2003/12/12


Hi all
A little bit off topic but anyway........

I?ve been looking aorund for a javascript function that could desable some keyEvents, specially the "Ctrl+N" but till now I haven?t any luck.

Any tip?
Thanks

2
wcrwcr
Re: javaScript - desabling keyEvents
  • 2005/5/21 17:44

  • wcrwcr

  • Home away from home

  • Posts: 1114

  • Since: 2003/12/12


A bit of light.....???
Thanks

3
Mithrandir
Re: javaScript - desabling keyEvents

Sorry.

My knowledge about JavaScript is marginally smaller than my knowledge about women - and since I am almost 27, single and my key interest in the past 2½ years has been PHP and XOOPS programming, you can imagine how much that is

4
wcrwcr
Re: javaScript - desabling keyEvents
  • 2005/5/21 18:24

  • wcrwcr

  • Home away from home

  • Posts: 1114

  • Since: 2003/12/12


Hi

Quote:
My knowledge about JavaScript is marginally smaller than my knowledge about women

Mith

Hehehe, I don?t think so with all those copenhagen girl?s around, wow.......

well getting back to the topic....

What I?m trying to do is customize the popup window present on debaser module to avoid some people opening It on a new browser?s window, you know?

I?ve mentioned javascript cauz of the populariry of the language, but feel free to point some cool php script to do the same

Thanks

5
Mithrandir
Re: javaScript - desabling keyEvents

What would be the problem of people opening it in a new window?
When it comes to changing the user's browser behaviour, it cannot be done with PHP, since all PHP does is construct the HTML that is sent to the browser. Javascript is your best bet here - but I don't know if/how it can be done.

6
wcrwcr
Re: javaScript - desabling keyEvents
  • 2005/5/21 18:44

  • wcrwcr

  • Home away from home

  • Posts: 1114

  • Since: 2003/12/12


Quote:
Mith wrote:
What would be the problem of people opening it in a new window?


In order to avoid direct download instead of streaming the media and messing the window?s layout.

Although to prevent the "direct download" I?ve implemented the well known "No rightclick script."

function click(e) {
if (
document.all) {
if (
event.button == 2) {
alert(message);
return 
false;
}
}
if (
document.layers) {
if (
e.which == 3) {
alert(message);
return 
false;
}
}
}
if (
document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
// -->


Fo instance on the example we can see a (event.button) and event.mousedown.

I was wondering about some "event.keydown" to construct something like that:

if (event.keydown=="ctrl+n" {
return false;
=========================

7
Mithrandir
Re: javaScript - desabling keyEvents

ok. It's probably because I don't know the debaser module's inner workings that it is a bit lost on me, this.

8
wcrwcr
Re: javaScript - desabling keyEvents
  • 2005/5/21 18:56

  • wcrwcr

  • Home away from home

  • Posts: 1114

  • Since: 2003/12/12


OK

It?s a nice mod I love the players support and configs.

I?ll continue to dig a bit and let you know about......

thanks

9
wcrwcr
Re: javaScript - desabling keyEvents
  • 2005/5/22 4:24

  • wcrwcr

  • Home away from home

  • Posts: 1114

  • Since: 2003/12/12


Well, after a lot of diging I found a very close to what I need function.

I?ll post It here just for "scientific curiosity", since the function could not trap the combination "Ctrl+n" cauz It seems to be a kind of reserved combination.

======================================================
<HTML>
<
HEAD>
<
SCRIPT LANGUAGE="JavaScript1.2">

HEAD>

<
BODY onKeyPress="microsoftKeyPress()">

BODY>
HTML>



Regards

Login

Who's Online

182 user(s) are online (74 user(s) are browsing Support Forums)


Members: 0


Guests: 182


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits