Fix Windows crate 0.58 API compatibility

- Define XBUTTON1/XBUTTON2 constants (removed from windows crate)
- Update D3D11_CPU_ACCESS_FLAG usage
- Fix CreateTexture2D output parameter
- Fix BitBlt/EnumDisplayMonitors return type handling
- Fix encode_utf16 iterator usage
This commit is contained in:
AZ Computer Guru
2025-12-28 12:39:33 -07:00
parent 33893ea73b
commit 09223cf97a
5 changed files with 29 additions and 17 deletions

View File

@@ -81,9 +81,11 @@ impl KeyboardController {
#[cfg(windows)]
pub fn type_char(&mut self, ch: char) -> Result<()> {
let mut inputs = Vec::new();
let mut buf = [0u16; 2];
let encoded = ch.encode_utf16(&mut buf);
// For characters that fit in a single u16
for code_unit in ch.encode_utf16(&mut [0; 2]) {
for &code_unit in encoded {
// Key down
inputs.push(INPUT {
r#type: INPUT_KEYBOARD,