Implement keycode translation for windows (#54)

closes #48 
closes #16
This commit is contained in:
Ferdinand Schober
2023-12-18 18:08:10 +01:00
committed by GitHub
parent 6766886377
commit 8de6c9bb87
14 changed files with 828 additions and 42 deletions

View File

@@ -1,6 +1,6 @@
use std::io;
use std::pin::Pin;
use std::task::{Poll, Context};
use std::task::{Context, Poll};
use futures_core::Stream;
@@ -32,10 +32,7 @@ impl EventProducer for DummyProducer {
impl Stream for DummyProducer {
type Item = io::Result<(ClientHandle, Event)>;
fn poll_next(
self: Pin<&mut Self>,
_cx: &mut Context<'_>,
) -> Poll<Option<Self::Item>> {
fn poll_next(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
Poll::Pending
}
}

View File

@@ -1,7 +1,7 @@
use anyhow::{anyhow, Result};
use core::task::{Context, Poll};
use futures::Stream;
use std::io::Result;
use std::pin::Pin;
use std::{io, pin::Pin};
use crate::{
client::{ClientEvent, ClientHandle},
@@ -18,13 +18,13 @@ impl EventProducer for WindowsProducer {
}
impl WindowsProducer {
pub(crate) fn new() -> Self {
Self {}
pub(crate) fn new() -> Result<Self> {
Err(anyhow!("not implemented"))
}
}
impl Stream for WindowsProducer {
type Item = Result<(ClientHandle, Event)>;
type Item = io::Result<(ClientHandle, Event)>;
fn poll_next(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
Poll::Pending
}