ToAscii function Null safety user32

int ToAscii(
  1. int uVirtKey,
  2. int uScanCode,
  3. Pointer<Uint8> lpKeyState,
  4. Pointer<Uint16> lpChar,
  5. int uFlags
)

Translates the specified virtual-key code and keyboard state to the corresponding character or characters. The function translates the code using the input language and physical keyboard layout identified by the keyboard layout handle.

int ToAscii(
  UINT       uVirtKey,
  UINT       uScanCode,
  const BYTE *lpKeyState,
  LPWORD     lpChar,
  UINT       uFlags
);

Implementation

int ToAscii(int uVirtKey, int uScanCode, Pointer<Uint8> lpKeyState,
    Pointer<Uint16> lpChar, int uFlags) {
  final _ToAscii = _user32.lookupFunction<
      Int32 Function(Uint32 uVirtKey, Uint32 uScanCode,
          Pointer<Uint8> lpKeyState, Pointer<Uint16> lpChar, Uint32 uFlags),
      int Function(int uVirtKey, int uScanCode, Pointer<Uint8> lpKeyState,
          Pointer<Uint16> lpChar, int uFlags)>('ToAscii');
  return _ToAscii(uVirtKey, uScanCode, lpKeyState, lpChar, uFlags);
}