Skip to content

Commit 945b3c5

Browse files
committed
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.
1 parent f49f44b commit 945b3c5

File tree

1 file changed

+8
-28
lines changed

1 file changed

+8
-28
lines changed

src/event.rs

+8-28
Original file line numberDiff line numberDiff line change
@@ -521,17 +521,12 @@ impl Command for PushKeyboardEnhancementFlags {
521521

522522
#[cfg(windows)]
523523
fn execute_winapi(&self) -> std::io::Result<()> {
524-
use std::io;
525-
526-
Err(io::Error::new(
527-
io::ErrorKind::Unsupported,
528-
"Keyboard progressive enhancement not implemented for the legacy Windows API.",
529-
))
524+
Ok(())
530525
}
531526

532527
#[cfg(windows)]
533528
fn is_ansi_code_supported(&self) -> bool {
534-
false
529+
true
535530
}
536531
}
537532

@@ -550,17 +545,12 @@ impl Command for PopKeyboardEnhancementFlags {
550545

551546
#[cfg(windows)]
552547
fn execute_winapi(&self) -> std::io::Result<()> {
553-
use std::io;
554-
555-
Err(io::Error::new(
556-
io::ErrorKind::Unsupported,
557-
"Keyboard progressive enhancement not implemented for the legacy Windows API.",
558-
))
548+
Ok(())
559549
}
560550

561551
#[cfg(windows)]
562552
fn is_ansi_code_supported(&self) -> bool {
563-
false
553+
true
564554
}
565555
}
566556

@@ -577,17 +567,12 @@ impl Command for EnableThemeModeUpdates {
577567

578568
#[cfg(windows)]
579569
fn execute_winapi(&self) -> std::io::Result<()> {
580-
use std::io;
581-
582-
Err(io::Error::new(
583-
io::ErrorKind::Unsupported,
584-
"Theme mode updates are not implemented for the legacy Windows API",
585-
))
570+
Ok(())
586571
}
587572

588573
#[cfg(windows)]
589574
fn is_ansi_code_supported(&self) -> bool {
590-
false
575+
true
591576
}
592577
}
593578

@@ -604,17 +589,12 @@ impl Command for DisableThemeModeUpdates {
604589

605590
#[cfg(windows)]
606591
fn execute_winapi(&self) -> std::io::Result<()> {
607-
use std::io;
608-
609-
Err(io::Error::new(
610-
io::ErrorKind::Unsupported,
611-
"Theme mode updates are not implemented for the legacy Windows API",
612-
))
592+
Ok(())
613593
}
614594

615595
#[cfg(windows)]
616596
fn is_ansi_code_supported(&self) -> bool {
617-
false
597+
true
618598
}
619599
}
620600

0 commit comments

Comments
 (0)