diff options
author | Florian <stayawake@lavabit.com> | 2014-02-14 19:32:28 +0100 |
---|---|---|
committer | Florian <stayawake@lavabit.com> | 2014-02-14 19:32:28 +0100 |
commit | f51686fe129649a524d839f27d6b3dd5d0e80fda (patch) | |
tree | 71e1f8a98e7422078f10fb07580ccd068102eb8a /js | |
parent | 4c64de261cf9e70e6bd32e6e6072f8e82c528336 (diff) |
camera change not possible, when form is active
Diffstat (limited to 'js')
-rw-r--r-- | js/cctv-control.js | 107 |
1 files changed, 58 insertions, 49 deletions
diff --git a/js/cctv-control.js b/js/cctv-control.js index c0318a0..75dc5cf 100644 --- a/js/cctv-control.js +++ b/js/cctv-control.js @@ -15,6 +15,7 @@ var cam = 0; var camHost = "127.0.0.1:8080"; var controlHost = "127.0.0.1:8080"; +var formActive = false; //create event which is triggered when DOM is ready window.onDomReady = initReady; @@ -110,59 +111,67 @@ function showImage() { //make form visible document.getElementById("form").style.visibility = 'visible'; + formActive = true; } +function printForm() { + document.getElementById("form").style.visibility = 'hidden'; + formActive = false; +} + function keyDown(event) { - switch(event.keyCode) { - case 49: // 1 - cam = 0; - changeCam(); - break; - case 50: // 2 - cam = 1; - changeCam(); - break; - case 51: // 3 - cam = 2; - changeCam(); - break; - case 52: // 4 - cam = 3; - changeCam(); - break; - case 53: // 5 - cam = 4; - changeCam(); - break; - case 54: // 6 - cam = 5; - changeCam(); - break; - case 55: // 7 - cam = 6; - changeCam(); - break; - case 56: // 8 - cam = 7; - changeCam(); - break; - case 37: // arrow left - controlCam("left"); - break; - case 38: // arrow up - controlCam("up"); - break; - case 39: // arrow right - controlCam("right"); - break; - case 40: // arrow down - controlCam("down"); - break; - case 13: //enter - saveImage(); - break; - } + if (formActive == false) { + switch(event.keyCode) { + case 49: // 1 + cam = 0; + changeCam(); + break; + case 50: // 2 + cam = 1; + changeCam(); + break; + case 51: // 3 + cam = 2; + changeCam(); + break; + case 52: // 4 + cam = 3; + changeCam(); + break; + case 53: // 5 + cam = 4; + changeCam(); + break; + case 54: // 6 + cam = 5; + changeCam(); + break; + case 55: // 7 + cam = 6; + changeCam(); + break; + case 56: // 8 + cam = 7; + changeCam(); + break; + case 37: // arrow left + controlCam("left"); + break; + case 38: // arrow up + controlCam("up"); + break; + case 39: // arrow right + controlCam("right"); + break; + case 40: // arrow down + controlCam("down"); + break; + case 13: //enter + saveImage(); + break; + } + } } |