@@ -3,7 +3,6 @@ use crate::windows::common::{get_code, get_scan_code, FALSE, TRUE};
33use crate :: windows:: keycodes:: code_from_key;
44use std:: ptr:: null_mut;
55use winapi:: shared:: minwindef:: { BYTE , HKL , LPARAM , UINT } ;
6- use winapi:: shared:: ntdef:: WCHAR ;
76use winapi:: um:: processthreadsapi:: GetCurrentThreadId ;
87use winapi:: um:: winuser;
98use winapi:: um:: winuser:: {
@@ -45,7 +44,7 @@ impl Keyboard {
4544 }
4645
4746 pub ( crate ) unsafe fn set_global_state ( & mut self ) -> Option < ( ) > {
48- let mut state = [ 0 as BYTE ; 256 ] ;
47+ let mut state = [ 0_u8 ; 256 ] ;
4948 let state_ptr = state. as_mut_ptr ( ) ;
5049
5150 let _shift = GetKeyState ( VK_SHIFT ) ;
@@ -75,7 +74,7 @@ impl Keyboard {
7574 let current_window_thread_id = GetWindowThreadProcessId ( GetForegroundWindow ( ) , null_mut ( ) ) ;
7675 let state_ptr = self . last_state . as_mut_ptr ( ) ;
7776 const BUF_LEN : i32 = 32 ;
78- let mut buff = [ 0 as WCHAR ; BUF_LEN as usize ] ;
77+ let mut buff = [ 0_u16 ; BUF_LEN as usize ] ;
7978 let buff_ptr = buff. as_mut_ptr ( ) ;
8079 let layout = GetKeyboardLayout ( current_window_thread_id) ;
8180 let len = ToUnicodeEx ( code, scan_code, state_ptr, buff_ptr, 8 - 1 , 0 , layout) ;
@@ -116,9 +115,9 @@ impl Keyboard {
116115
117116 unsafe fn clear_keyboard_buffer ( & self , code : UINT , scan_code : UINT , layout : HKL ) {
118117 const BUF_LEN : i32 = 32 ;
119- let mut buff = [ 0 as WCHAR ; BUF_LEN as usize ] ;
118+ let mut buff = [ 0_u16 ; BUF_LEN as usize ] ;
120119 let buff_ptr = buff. as_mut_ptr ( ) ;
121- let mut state = [ 0 as BYTE ; 256 ] ;
120+ let mut state = [ 0_u8 ; 256 ] ;
122121 let state_ptr = state. as_mut_ptr ( ) ;
123122
124123 let mut len = -1 ;
0 commit comments