Link to home
Start Free TrialLog in
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

Avatar of stergium
Flag of Greece image

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



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

Please try and help us with script.

Avatar of Rob
What are you trying to prevent the user from doing with this key combination?
There may be another way around this.
Avatar of 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 ?
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.
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.

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
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
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

Add I said you can set up this internally but you just can't do it for people outside your office
More on it
The links are old but should be valid.
I would go the group policy route for machines in house
Avatar of skullnobrains

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Can I please get the JavaScript solution for the same?

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

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