Avatar of tia_kamakshi
tia_kamakshiFlag for United Arab Emirates asked on

Prevention of alt + space when pressing key from keyboard

Hi Experts,

We wanted to prevent alt+space on the browser.
Please can you advise a script. We are unable to do using keycode.
Please help

Regards,
JavaScriptAJAXHTML

Avatar of undefined
Last Comment
skullnobrains

8/22/2022 - Mon
stergium

Hello.
 How about restricting only alt (keycode 18) with a return false inside your script.
Would that suffice to your purpose?
ASKER
tia_kamakshi

Hi,

You cannot restrict the keycode 18.
If you click space after that it works.

Please try and help us with script.

Regards,
Rob

What are you trying to prevent the user from doing with this key combination?
There may be another way around this.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
skullnobrains

simple answer : you can't, or at least you definitely can't in any decent browser. it would be a huge nuisance and securty breach if a page could be open fullscreen without bars and the alt and ctrl buttons captured. users would be unable to get rid of the page without a button-reboot

what are you trying to achieve ?
Rob

That's essentially what I was getting to as well, that it can't be done but if we can understand what you're trying to stop, then we can offer alternatives.
ASKER
tia_kamakshi

Thanks for your replies.

We have site running outside where people can apply jobs.

Same site can be opened in the company for users. When users comes for interview or wants to apply for a job in the company machines.

Then we do not wanted user should be able to close full screen browsers. We have KIOS machines where user can apply for there resumes or fill in interview etc. question

In KIOS machines site opens in full screen only. But if you open site outside world or from ur PC then it is not full screen.

So, we require user should not be able to press alt+space

Please advise with solution.

Regards,
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Rob

Certainly for a kioskYou would need to control this with group/local policy on the machine. As for the world based version there's nothing you can do
Rob

You can resize the browser to fill the screen but it suggests if this is a problem then there is an issue with the way you're going about this. You can prompt the user before they close the browser. But it shouldn't impact on your process if the user closes the browser in the outside world. If it does then you need to look at your job application code
ASKER
tia_kamakshi

We never wanted to close this application by user.
User even cannot see url in the browser.
Look and feel will be different for users.
Even they cannot see scroll bar. They have the button at the bottom to scroll up and down to the browser.

Anyway, Can I have solution to disable alt+ space on IE

Regards,
Your help has saved me hundreds of hours of internet surfing.
fblack61
Rob

Add I said you can set up this internally but you just can't do it for people outside your office
Rob

Rob

More on it http://en.kioskea.net/faq/611-using-ie-kiosk-mode
The links are old but should be valid.
I would go the group policy route for machines in house
http://deployhappiness.com/group-policy-kiosk-mode-locking-down/
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER CERTIFIED SOLUTION
skullnobrains

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
tia_kamakshi

Can I please get the JavaScript solution for the same?

Regards,
Rob

There is no JavaScript solution. Can't be done. You have to use a combination of computer policies and kiosk mode for IE and that's just got the computers at your office. As for everyone else, sorry just not going to happen.
The real problem here is your job application process. If it hinges on the user closing the browser then something is very wrong and you should go back to the drawing board and rethink it's design.
skullnobrains

like everybody said. you can't, because of obvious security reasons. if this was feasible, it would be a HUGE nuisance for end-users

https://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28225740.html#a39448890

just remember that many keys or key combinations are captured by the OS before they hit the browser, so js does not even have a chance to act on those key strokes in any way. ctrl+alt+suppr on windows is an example
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck