- Discussions
- 4 649
- Messages
- 12 075
- Solutions
- 81
- J'aime
- 7 620
- Points
- 198
Easily create shortcuts on your forum.
Create a new template (keybord_shortcuts) and enter the code for the desired shortcuts.
Example with 3 shortcuts :
add to the end of template PAGE_CONTAINER :
If necessary, create a page with the shortcuts :
Demo : Sneltoetsen
Create a new template (keybord_shortcuts) and enter the code for the desired shortcuts.
Example with 3 shortcuts :
JavaScript:
<script>
document.addEventListener('keydown', function(event) {
// Check if the pressed key is the 'A' key and both the Ctrl and Alt keys are pressed
if ((event.key === 'a' || event.key === 'A') && event.ctrlKey && event.altKey) {
// Define the URL you want to navigate to
let newUrl = '/index.php?account/account-details'; // Change this URL as needed
// Navigate to the new URL
window.location.href = newUrl;
}
});
document.addEventListener('keydown', function(event) {
// Check if the pressed key is the 'F' key and both the Ctrl and Alt keys are pressed
if ((event.key === 'f' || event.key === 'F') && event.ctrlKey && event.altKey) {
// Define the URL you want to navigate to
let newUrl = '/index.php?'; // Change this URL as needed
// Navigate to the new URL
window.location.href = newUrl;
}
});
document.addEventListener('keydown', function(event) {
// Check if the pressed key is the 'H' key and both the Ctrl and Alt keys are pressed
if ((event.key === 'h' || event.key === 'H') && event.ctrlKey && event.altKey) {
// Define the URL you want to navigate to
let newUrl = '/index.php?pages/home/'; // Change this URL as needed
// Navigate to the new URL
window.location.href = newUrl;
}
});
</script>
add to the end of template PAGE_CONTAINER :
PHP:
<xf:include template="keybord_shortcuts" />
If necessary, create a page with the shortcuts :
HTML:
.shortcuts {
a:link {
text-decoration: none;
}
u {
color: #000;
}
</style>
<h2>Forum sneltoetsen</h2>.
<p>On this forum it is possible to use certain keyboard shortcuts. In combination with the [ctrl] key and the [alt] key, it is possible to go to a specific page with a third key. For this you have to press 3 keys at the same time. The overview:</p>
<ul class="shortcuts">
<li><button>ctrl</button> + <button>alt</button> + <button>a</button> = <a href="/index.php?account/account-details"><u>A</u>ccount settings</a></li>
<li><button>ctrl</button> + <button>alt</button> + <button>f</button> = <a href="/index.php"><u>F</u>orum index</a></li>
<li><button>ctrl</button> + <button>alt</button> + <button>h</button> = <a href="/index.php?pages/home/"><u>H</u>omepage</a></li>
Demo : Sneltoetsen