Attention une mise à jour du serveur va être effectuée le lundi 17 mai entre 13h et 13h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit 7dabde89 authored by Marc Duez's avatar Marc Duez

shortcut.js : system shortcut (doesn't work with TRD+ IGK+ IGH+)

parent 1972bc0a
......@@ -18,17 +18,27 @@
*/
function Shortcut () {
this.init()
this.init()
}
Shortcut.prototype = {
init : function () {
var self = this
this.system_shortcuts = {}
for (var system in germline_data){
var keycode = germline_data[system].shortcut.charCodeAt(0)
this.system_shortcuts[keycode] = system
}
document.onkeydown = function (e) { self.checkKey(e); }
document.onkeyup = function (e) { sp.active_move = false; }
},
checkKey : function (e) {
e = e || window.event;
if (document.activeElement.id == ""){
......@@ -36,6 +46,7 @@ Shortcut.prototype = {
var key = e.keyCode;
if (key==0) key = e.which
switch(key) {
case 37 : //left arrow
e.preventDefault()
......@@ -61,6 +72,13 @@ Shortcut.prototype = {
}
default:
}
console.log(key)
//system shortcuts
if (typeof this.system_shortcuts[key] != "undefined") {
console.log("plopppppp : " + this.system_shortcuts[key])
m.changeGermline(this.system_shortcuts[key])
}
}
if (e.altKey && sp.reinit) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment