Merge pull request #24 from bkram/Bkram/enhance-mousewheel-tuning

Allow mouse-wheel tuning in steps of 1 Mhz with CTRL key pressed, 0.01 Mhz with SHIFT key pressed.
This commit is contained in:
Marek Farkaš
2024-02-11 14:52:34 +01:00
committed by GitHub
+14 -1
View File
@@ -100,14 +100,27 @@ $(document).ready(function() {
document.onkeydown = checkKey;
$('#freq-container').on('wheel', function(e) {
$('#freq-container').on('wheel keypress', function (e) {
getCurrentFreq();
var delta = e.originalEvent.deltaY;
var adjustment = 0;
if (e.shiftKey) {
adjustment = e.altKey ? 1 : 0.01;
} else if (e.ctrlKey) {
adjustment = 1;
} else {
if (delta > 0) {
tuneDown();
} else {
tuneUp();
}
return false;
}
var newFreq = currentFreq + (delta > 0 ? -adjustment : adjustment);
socket.send("T" + (Math.round(newFreq * 1000)));
return false;
});
var freqUpButton = $('#freq-up')[0];