/    Sign up×
Community /Pin to ProfileBookmark

How to disable F8 key across windows

I have a coe to disable F8 key, but it only applies to the particular page. And within the page, I had embeded a pdf file, the problem now is when I highlight on the pdf file within the page, the F8 is not disabled. It only applies outside the embeded pdf but within the page.

So, I was thinking is there a way to disable F8 across windows with code, I do not want to use any software.

[CODE]document.attachEvent(“onkeydown”, my_onkeydown_handler);
function my_onkeydown_handler()
{
switch (event.keyCode)
{
case 119 : // ‘F5’
event.returnValue = false;
event.keyCode = 0;
window.status = “F8 is disabled”;
break;
}
}[/CODE]

Thanks.

to post a comment
JavaScript

8 Comments(s)

Copy linkTweet thisAlerts:
@bathurst_guyApr 17.2008 — Firstly, why F8?

Secondly, disabling JavaScript will still allow me to press any key I wish

Thirdly, it's my computer, my browser, your website. I should be able to do what I like with my computer and my browser, don't touch it.
Copy linkTweet thisAlerts:
@mrhooApr 17.2008 — Don't worry, bathurst_guy, he's only messing with IE.
Copy linkTweet thisAlerts:
@bathurst_guyApr 17.2008 — IE is already messed up ?
Copy linkTweet thisAlerts:
@ryanlcsauthorApr 17.2008 — I only want to disable F8 when my Application is access by users. I not really care the rest. I am aware about the consequences like what I had done to disable the Clipboard. But F8 key in my application will allow users to retrieve information, in which I do not want this to happen.
Copy linkTweet thisAlerts:
@mrhooApr 17.2008 — If your pdf file is being run by an adobe module or executable, the application is using f8, not the browser. You may be barking at the wrong tree.
Copy linkTweet thisAlerts:
@ryanlcsauthorApr 17.2008 — Yes. Is the application that is using f8, so my script only disable the button at browser level, that's why I wanted to disable the button across windows, so that no f8 is enable one they access my application.
Copy linkTweet thisAlerts:
@felgallApr 17.2008 — The whole idea of function keys is that the computer owner can override them to do whatever they want them to do. How do you know what your visitors have their F8 key to do and what is there to stop anyone using any of the other ways of achieving the same result.
Copy linkTweet thisAlerts:
@ryanlcsauthorApr 18.2008 — The whole is idea is that whenever the user access to the application, they had to "follow the rules set under the application", because this key is the only way to achieve that, so I want to prevent that to happen. Actually, I dont really like to do so much restriction to the web application, but come to this stage when prevention is needed, I just have to do it.
×

Success!

Help @ryanlcs spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.23,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...