mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-04-14 02:41:29 +03:00
fix pressed key tracking
accidentally broke this in 8f7890c
closes #174
This commit is contained in:
@@ -155,6 +155,7 @@ impl InputEmulation {
|
|||||||
|
|
||||||
pub async fn create(&mut self, handle: EmulationHandle) -> bool {
|
pub async fn create(&mut self, handle: EmulationHandle) -> bool {
|
||||||
if self.handles.insert(handle) {
|
if self.handles.insert(handle) {
|
||||||
|
self.pressed_keys.insert(handle, HashSet::new());
|
||||||
self.emulation.create(handle).await;
|
self.emulation.create(handle).await;
|
||||||
true
|
true
|
||||||
} else {
|
} else {
|
||||||
@@ -165,6 +166,7 @@ impl InputEmulation {
|
|||||||
pub async fn destroy(&mut self, handle: EmulationHandle) {
|
pub async fn destroy(&mut self, handle: EmulationHandle) {
|
||||||
let _ = self.release_keys(handle).await;
|
let _ = self.release_keys(handle).await;
|
||||||
if self.handles.remove(&handle) {
|
if self.handles.remove(&handle) {
|
||||||
|
self.pressed_keys.remove(&handle);
|
||||||
self.emulation.destroy(handle).await
|
self.emulation.destroy(handle).await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user