Keyboard Shortcuts for your application |
11/6/2021 10:37:50 AM |
PHPRunner Tips and Tricks | |
mbintex author
If you ever thought of keyboard shortcuts in your application, let´s for a quick jump to a help screen or for quickly moving around the moduls, here is the solution: Download or link to this small Javascript: https://wangchujiang.com/hotkeys/ and then add some javascript like this to your headers.htm file - you find that unter templates in the Editor-Screen. <script src="https://unpkg.com/hotkeys-js/dist/hotkeys.min.js"></script> With the first part "event.preventDefault" you forbid the browser to use it´s own shortcuts in case you want to use a key combination that is already in use. In the handler-part you say, what should happen, for example a location change to a different page of your PHPRunner solution. Of course it could be anything else - own Javascript or some call to the Javascript API of PHPRunner. Show a dialog with the Dialog API for example. Should work with all current main browsers. |
|