Page 1 of 1

VkKeyScanEx_ and Unicode [Resolved]

Posted: Tue Nov 15, 2016 12:45 pm
by Kwai chang caine
Hello at all

Before v5.50 i use sendkey function with VkKeyScanEx_() inside and all are done
But now with UNICODE apparently VkKeyScanEx_() not have the same behavior :shock:

Code: Select all

vk$ = "5"
vk=VkKeyScanEx_(Asc(vk$),GetKeyboardLayout_(0))
keybd_event_(vk,0,0,0) 
When i send number the sendkey not use number pad key, but keys at the top of the keyboard and write
"(" instead of "5"
"é" instead of "2" :|

I have see they are a Unicode version of VkKeyScanEx_ (VkKeyScanExW_) but PB not recognize it :|
https://msdn.microsoft.com/en-us/librar ... s.85).aspx

How can i do, for be retrieve the old behavior of my ASCII sendkeys

Have a good day

Re: VkKeyScanEx_ and Unicode

Posted: Tue Nov 15, 2016 2:39 pm
by GeBonet
I think the Windows API understands only the French keyboard, trying to go under French keyboard (Belgium) and test this is perhaps only that?

Re: VkKeyScanEx_ and Unicode

Posted: Tue Nov 15, 2016 2:47 pm
by Kwai chang caine
Hello GEBONET.... 8)
They are a very long time i never read you
I believe you are died :lol:
I think the Windows API understands only the French keyboard, trying to go under French keyboard (Belgium) and test this is perhaps only that?
It's strange because the US keyboard have a numeric pad too no ??? :shock:

Re: VkKeyScanEx_ and Unicode

Posted: Tue Nov 15, 2016 2:56 pm
by GeBonet
Sorry not yet :cry: !!! Yes the keyboards are the same except that the reference table is somewhat different between the Belgian and the French or the function keys are not in the same place and there is an inversion between the figures and what accompanies it c ' Is so that the 2 becomes "é", the 5 = "(" etc ... But the test that I propose to you is simply to confirm and not to solve ... Try by setting the Belgian keyboard default and then returns To French after ... On this, I only pass ... And big kiss for all the time we have not seen :D ?

Re: VkKeyScanEx_ and Unicode

Posted: Tue Nov 15, 2016 2:59 pm
by Kwai chang caine
Thanks to your answer....at the pleasure to read you another time :wink:

Re: VkKeyScanEx_ and Unicode

Posted: Tue Nov 15, 2016 3:07 pm
by GeBonet
Avec plaisir également... Au besoin, tu sais ou j'habite (privé). :D :D

Re: VkKeyScanEx_ and Unicode

Posted: Tue Nov 15, 2016 3:18 pm
by Kwai chang caine
A pied c'est un peu loin.... :lol:
Mais grâce à la fée électricité....... les kilometres n'ont plus lieu d'être 8)
A bientôt :wink:

Re: VkKeyScanEx_ and Unicode

Posted: Tue Nov 15, 2016 4:11 pm
by Kwai chang caine
I have found that alone...that's works...but i don't know why :oops:

Code: Select all

WinLib = OpenLibrary(#PB_Any, "User32.dll")
vk$ = "5"

If GetFunction(WinLib, "VkKeyScanExA")
 Debug CallFunction(WinLib, "VkKeyScanExA", Asc(Vk$), GetKeyboardLayout_(0))
EndIf

CloseLibrary(WinLib)

Re: VkKeyScanEx_ and Unicode [Resolved]

Posted: Tue Nov 15, 2016 6:32 pm
by Kwai chang caine
Finally, i have found another solution for sendkeys, who works with UNICODE
With the EBS code 8)
http://www.purebasic.fr/english/viewtop ... 1486#31486