2 * Allows moving around inputs/select by Ctrl+arrows
4 * @param object event data
6 function onKeyDownArrowsHandler(e)
9 var o = (e.srcElement||e.target);
11 if (o.tagName != "TEXTAREA" && o.tagName != "INPUT" && o.tagName != "SELECT") return;
12 if (navigator.userAgent.toLowerCase().indexOf('applewebkit/') != -1) {
13 if (e.ctrlKey || e.shiftKey || !e.altKey) return;
15 if (!e.ctrlKey || e.shiftKey || e.altKey) return;
19 var pos = o.id.split("_");
20 if (pos[0] != "field" || typeof pos[2] == "undefined") return;
22 var x = pos[2], y=pos[1];
24 // skip non existent fields
27 if (switch_movement) {
29 case 38: x--; break; // up
30 case 40: x++; break; // down
31 case 37: y--; break; // left
32 case 39: y++; break; // right
37 case 38: y--; break; // up
38 case 40: y++; break; // down
39 case 37: x--; break; // left
40 case 39: x++; break; // right
45 var id = "field_" + y + "_" + x;
46 var nO = document.getElementById(id);
48 var id = "field_" + y + "_" + x + "_0";
49 var nO = document.getElementById(id);
56 if (nO.tagName != 'SELECT') {
59 e.returnValue = false;