Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.
This mostly works (though I confess to not understanding all of what it's doing), but when I press certain keys (e.g. Backspace consistently does it), when I append to the value to something I can display it in (using a DevExpress TcxEdit... though don't see why that would have a bearing), the characters turn to some seeming random foreign character set (often Chinese but not always).
function KeyToStr(Key: Word): string; var keyboardState: TKeyboardState; asciiResult: Integer; begin GetKeyboardState(keyboardState); SetLength(Result, 2); asciiResult := ToAscii(key, MapVirtualKey(key, 0), keyboardState, @Result, 0); case asciiResult of 1: SetLength(Result, 1); 2:; else Result := ''; end; end;
Join the community of 500,000 technology professionals and ask your questions.