|
Post by infoliner on Feb 23, 2018 16:35:35 GMT 1
I tried to use MapVirtualKey and ToAscii to translate virtual keys into ascii. It did not work, I expect an "a" but get "A" instead. Trying to directly declare instead of using built-in functions did not change anything. I do not like to make my own translation-table because its language-dependant. Anybody with a helpful idea? Yes I even tried to access the keymapping but do not think its a good idea to go to deep into that. BtW: At first I tried to use those functions within a thread. That did not work at all Thankyou! Christian
|
|
|
Post by infoliner on Mar 4, 2018 1:45:02 GMT 1
Yes I have to. I solved the problem, translation works fine now. When ready, I will post a keyboard thread here that does the job. Although others will probably never need that, it might add to the knowledge. Among other things, I need the seperate right and left shift, control and alt keys. Thankyou for answering Christian
|
|
|
Post by dragonjim on Mar 4, 2018 18:50:29 GMT 1
Hi,
A bit late in the day, but the following code is lifted from Sjouke's blog:
Debug.Show Trace Chr(VkKeyToAscii(65)) Trace Chr(VkKeyToAscii(Asc("8"))) ' –> *
Function VkKeyToAscii(keycode As Int) As Int // Sjouke Hamstra Dim sb As String * 4 Static Dim keyboardState(256) As Byte ~GetKeyboardState(ArrayAddr(keyboardState())) If ToAscii(keycode, 0, ArrayAddr(keyboardState()), sb, 0) == 1 Return Asc(sb) Else Return 0 EndIf EndFunc
|
|
|
Post by infoliner on Mar 23, 2018 20:20:35 GMT 1
Yes, actually I had to do that what Sjouke describes, creating an 256 Byte String for Keyboard State, although I have to use getasynckeystate, which means double work. Thankyou!
|
|
|
Post by scalion on Apr 12, 2018 8:14:53 GMT 1
Hello, Dont' forget you can also use Sub Win_1_KeyPress(Ascii&) That depand of your needed.
|
|
|
Post by infoliner on Apr 13, 2018 14:28:46 GMT 1
Hi Scalion, as I need keystrokes from all programs, for example to change abreviations into the proper words, this does not help. My thread for receiving the keystrokes for me works very well meanwhile Christian
|
|