Go to overview: Test development & standards
Acknowledgement: The bookmarklet was developed for BITV-Test Prüfverbund by T-Systems Multimedia Solutions GmbH - Test and Integration Center
Bookmarklet Trigger character key shortcuts (drag to bookmarklets menu)
This is the script used on this page to add two single key shortcuts: key P (p with SHIFT key) and key p:
document.addEventListener("keydown", function(evt) {
var key = evt.key;
if (key === "p") {
alert("Key p was pressed via the bookmarklet script!");
}
if (key === "P") {
alert("Key P (capital P) was pressed via the bookmarklet script!");
}
});