From 945b3c5640b18dc24f66cf619a84e79b7d8f551e Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Sun, 30 Mar 2025 09:31:09 -0400 Subject: [PATCH] Use ANSI codes for enhanced keyboard and theme mode commands Executing these through winapi doesn't make sense - instead we should enforce the use of ANSI codes. --- src/event.rs | 36 ++++++++---------------------------- 1 file changed, 8 insertions(+), 28 deletions(-) diff --git a/src/event.rs b/src/event.rs index 6d7ecdc..2d2a1e7 100644 --- a/src/event.rs +++ b/src/event.rs @@ -521,17 +521,12 @@ impl Command for PushKeyboardEnhancementFlags { #[cfg(windows)] fn execute_winapi(&self) -> std::io::Result<()> { - use std::io; - - Err(io::Error::new( - io::ErrorKind::Unsupported, - "Keyboard progressive enhancement not implemented for the legacy Windows API.", - )) + Ok(()) } #[cfg(windows)] fn is_ansi_code_supported(&self) -> bool { - false + true } } @@ -550,17 +545,12 @@ impl Command for PopKeyboardEnhancementFlags { #[cfg(windows)] fn execute_winapi(&self) -> std::io::Result<()> { - use std::io; - - Err(io::Error::new( - io::ErrorKind::Unsupported, - "Keyboard progressive enhancement not implemented for the legacy Windows API.", - )) + Ok(()) } #[cfg(windows)] fn is_ansi_code_supported(&self) -> bool { - false + true } } @@ -577,17 +567,12 @@ impl Command for EnableThemeModeUpdates { #[cfg(windows)] fn execute_winapi(&self) -> std::io::Result<()> { - use std::io; - - Err(io::Error::new( - io::ErrorKind::Unsupported, - "Theme mode updates are not implemented for the legacy Windows API", - )) + Ok(()) } #[cfg(windows)] fn is_ansi_code_supported(&self) -> bool { - false + true } } @@ -604,17 +589,12 @@ impl Command for DisableThemeModeUpdates { #[cfg(windows)] fn execute_winapi(&self) -> std::io::Result<()> { - use std::io; - - Err(io::Error::new( - io::ErrorKind::Unsupported, - "Theme mode updates are not implemented for the legacy Windows API", - )) + Ok(()) } #[cfg(windows)] fn is_ansi_code_supported(&self) -> bool { - false + true } }