mirror of
https://github.com/KubaPro010/fm-dx-webserver.git
synced 2026-07-31 01:09:18 +02:00
Fix checkKey function conflict
Merge in changes accidentally reverted by modifications
This commit is contained in:
+26
-16
@@ -316,25 +316,35 @@ function getCurrentFreq() {
|
|||||||
function checkKey(e) {
|
function checkKey(e) {
|
||||||
e = e || window.event;
|
e = e || window.event;
|
||||||
|
|
||||||
|
// Check if any input element is focused using jQuery
|
||||||
|
if ($('input:focus').length > 0) {
|
||||||
|
return; // Do nothing if an input is focused
|
||||||
|
}
|
||||||
|
|
||||||
getCurrentFreq();
|
getCurrentFreq();
|
||||||
|
|
||||||
if (socket.readyState === WebSocket.OPEN) {
|
if (socket.readyState === WebSocket.OPEN) {
|
||||||
if (e.keyCode == '82') { // RDS Reset (R key)
|
switch (e.keyCode) {
|
||||||
socket.send("T" + (currentFreq.toFixed(1) * 1000));
|
case 82: // RDS Reset (R key)
|
||||||
}
|
socket.send("T" + (currentFreq.toFixed(1) * 1000));
|
||||||
if (e.keyCode == '38') {
|
break;
|
||||||
let smallStep = (currentFreq > 30) ? 10 : 1;
|
case 38:
|
||||||
socket.send("T" + (Math.round(currentFreq*1000) + smallStep));
|
let smallStep = (currentFreq > 30) ? 10 : 1;
|
||||||
}
|
socket.send("T" + (Math.round(currentFreq*1000) + smallStep));
|
||||||
else if (e.keyCode == '40') {
|
break;
|
||||||
let smallStep = (currentFreq > 30) ? 10 : 1;
|
case 40:
|
||||||
socket.send("T" + (Math.round(currentFreq*1000) - smallStep));
|
let smallStep = (currentFreq > 30) ? 10 : 1;
|
||||||
}
|
socket.send("T" + (Math.round(currentFreq*1000) - smallStep));
|
||||||
else if (e.keyCode == '37') {
|
break;
|
||||||
tuneDown();
|
case 37:
|
||||||
}
|
tuneDown();
|
||||||
else if (e.keyCode == '39') {
|
break;
|
||||||
tuneUp();
|
case 39:
|
||||||
|
tuneUp();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// Handle default case if needed
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user