mirror of
https://github.com/KubaPro010/fm-dx-webserver.git
synced 2026-07-31 09:19:16 +02:00
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:
+14
-1
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user