shevett / congo

CONGO Event Management System
GNU Affero General Public License v3.0
3 stars 1 forks source link

Rework the hotkeys system #329

Open shevett opened 10 years ago

shevett commented 10 years ago

Right now CONGO uses hotkeys via 'accesskey' hooks. This was a valid approach several years ago, but has become unworkable in current iterations. Change the hotkey mechanism to use a javascript hook.

This will allow consistent key access across all browsers. (question - use control? shift? raw keys? Probably control, but check compatability).

Example javascript hooks:

document.onkeydown = checkShortcuts;

function checkShortcuts(event) { switch(event.keyCode){ case 13: enterKeyPressed(); break; case 27: escKeyPressed(); break; default: break; } }

function enterKeyPressed(){ document.getElementById("action").innerHTML = "Enter Key Pressed"; }

function escKeyPressed(){ document.getElementById("action").innerHTML = "Escape Key Pressed"; }