mirror of
https://github.com/AkiChase/scrcpy-mask
synced 2024-11-14 05:21:42 +08:00
feat(hotkey): change the mouse wheel to no up and down state
This commit is contained in:
parent
da8d7f2858
commit
6a395b9c58
@ -846,28 +846,14 @@ function handleMouseWheel(event: WheelEvent) {
|
||||
if (event.deltaY > 0 && event.timeStamp - lastWheelDownTime > 50) {
|
||||
lastWheelDownTime = event.timeStamp;
|
||||
// WheelDown
|
||||
if (downKeyMap.has("WheelDown")) {
|
||||
if (!downKeyMap.get("WheelDown")) {
|
||||
downKeyMap.set("WheelDown", true);
|
||||
downKeyCBMap.get("WheelDown")?.();
|
||||
} else {
|
||||
downKeyMap.set("WheelDown", false);
|
||||
upKeyCBMap.get("WheelDown")?.();
|
||||
}
|
||||
}
|
||||
} else if (event.deltaY < 0 && event.timeStamp - lastWheelUpTime > 50) {
|
||||
lastWheelUpTime = event.timeStamp;
|
||||
// WheelUp
|
||||
if (downKeyMap.has("WheelUp")) {
|
||||
if (!downKeyMap.get("WheelUp")) {
|
||||
downKeyMap.set("WheelUp", true);
|
||||
downKeyCBMap.get("WheelUp")?.();
|
||||
} else {
|
||||
downKeyMap.set("WheelUp", false);
|
||||
upKeyCBMap.get("WheelUp")?.();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function addShortcut(
|
||||
|
Loading…
Reference in New Issue
Block a user