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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user