Answer the question
In order to leave comments, you need to log in
What is the difference in the behavior of the "ToAscii" function on windows 7 and windows 10?
I get the code of the pressed virtual key from the lowlevelkeyboardproc procedure (via SetWindowsHookExA). When trying to translate it into a readable form, I use “ToAscii(info.vkCode, info.scanCode, keyboardState, ascii, 0)”
I also tried:
“ToAscii(info.vkCode, MapVirtualKey!!(info.vkCode, 0.toUInt( )), keyboardState, ascii, 0)” and this gave the same result:
In windows 10, all English letters and other characters are detected correctly, but running on windows 7 displays unreadable characters.
It must be an encoding issue, but Windows-1251 is used in both cases.
I looked in the KN standard library, there is no way to work with encodings, and from the “C” world “ToAscii”, as you can see from the problem, behaves strangely.
Also, an interesting point, if I write system("cmd /c programm.exe") at the beginning, then the resulting characters become illegible on both versions of windows.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question