Files
lan-mouse/input-capture/src/macos.rs
Ferdinand Schober 266ad28c6b track pressed keys in input-capture (#170)
move pressed key tracking to input capture
2024-08-09 13:18:23 +02:00

44 lines
1.1 KiB
Rust

use crate::{
error::MacOSInputCaptureCreationError, Capture, CaptureError, CaptureHandle, Position,
};
use async_trait::async_trait;
use futures_core::Stream;
use input_event::Event;
use std::pin::Pin;
use std::task::{Context, Poll};
pub struct MacOSInputCapture;
impl MacOSInputCapture {
pub fn new() -> std::result::Result<Self, MacOSInputCaptureCreationError> {
Err(MacOSInputCaptureCreationError::NotImplemented)
}
}
impl Stream for MacOSInputCapture {
type Item = Result<(CaptureHandle, Event), CaptureError>;
fn poll_next(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
Poll::Pending
}
}
#[async_trait]
impl Capture for MacOSInputCapture {
async fn create(&mut self, _id: CaptureHandle, _pos: Position) -> Result<(), CaptureError> {
Ok(())
}
async fn destroy(&mut self, _id: CaptureHandle) -> Result<(), CaptureError> {
Ok(())
}
async fn release(&mut self) -> Result<(), CaptureError> {
Ok(())
}
async fn terminate(&mut self) -> Result<(), CaptureError> {
Ok(())
}
}