-
Notifications
You must be signed in to change notification settings - Fork 5
/
fs.php
45 lines (44 loc) · 1.15 KB
/
fs.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<html>
<head>
<title>FlightSim w/ ATC</title>
<script>
(function(){
var ctrl = false;
var atc;
var TALK = false;
//var htmltoadd = '<iframe src="pg.html" style="display: none" id="webATC" onload=\'window.atc = document.getElementById("webATC");\'></iframe>';
//document.documentElement.innerHTML += htmltoadd;
document.addEventListener("keydown", function(e) {
if (e.keyCode == 81) {
if (ctrl) {
ctrl = false;
var freq = prompt("Enter frequency:");
atc = window.open("https://geofs-atc.appspot.com/pg.html?" + freq,'_blank', 'toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,left=10000, top=10000, width=10, height=10, visible=none', '');
}
else {
// Push to talk TRUE
if (TALK) return;
TALK = true;
atc.contentWindow.postMessage("talk", "*");
}
}
if (e.keyCode == 17) {
ctrl = true;
}
}, false);
document.addEventListener("keyup", function(e) {
if (e.keyCode == 81) {
// Push to talk FALSE
TALK = false;
atc.contentWindow.postMessage("notalk", "*");
}
if (e.keyCode == 17) {
ctrl = false;
}
}, false);
})();
</script>
</head>
<body>
</body>
</html>