I had a crazy idea but I don't know if it can be done. I would like to know if it is possible to program that a user being on a website can open a private section only with the combination of two keys, for example: ctrl+a
. So, for example, my clients could open a login without it being specified on the web in a visible way.
It would then be that what is opened is a file named, for example, loginclients.php or an html or a path of the type http://etc
You could use the jQuery.Hotkeys library which allows capturing keyboard events.
You could do something like this:
Execute the code and click on the region where the script is executed, then press
ctrl+a
octrl+l
and a message will be launchedalert()
saying what key you pressed, it is a basic example but I hope it helps you.To see the script that opens a new tab, working correctly, I leave you a jsbin in the following Link http://jsbin.com/fetedifune/edit?html,js,output
What you mention can be achieved with JavaScript, (although I haven't tried it) maybe something like this will work for you:
In any case there are some libraries for it, I leave you some links:
I think you can get what you want to do from here: http://www.aprenderaprogramar.es/index.php?option=com_content&view=article&id=844:capturar-eventos-de-teclado-javascript-tecla-pulsada-fromcharcode- keycode-wich-alt-examples-cu01161e&catid=78:basic-tutorial-web-javascript-programmer-from-&Itemid=206
1-first you should capture the keys that the user presses and then with an if you control that it does what you want it to show, (you can achieve this with the hidden property of javascript if I remember correctly).
2-the idea is not bad but do not make the user learn strange keys to log in because one never knows what kind of knowledge their users have and if it is difficult for them they go to another website.
I hope it helps you.
A few years ago, there was an easter egg on many websites, which activated a series of keys by pressing. Maybe you could follow that same strategy for what you want to do.
Check out konami-js to reuse what's there and don't reinvent the wheel :-D