Have encountered a strange behavior when using GetKey... , that seems very much like a bug
*** Hopefully this time it's a real bug, tried my best to make sure (long thread on discord)
https://discord.com/channels/115993023636176902/743668704054607893/848262692326080513
Code: Select all
9::
key := "ы"
name := GetKeyName(key)
vk := GetKeyVK(key)
sc := GetKeySC(key)
MsgBox, % Format("Name:`t{}`nVK:`t{:X}`nSC:`t{:X}", name, vk, sc)
Return
Run your script with the English keyboard layout then press 9
1st press 9 key - English layout --> 0
2nd press 9 key - English layout --> 0
---- switched to Russian
3rd press 9 key - Russian layout --> 0
4th press 9 key - Russian layout --> 53 1f
Notice that only in the second try in the Russian layout Does the call produce a result, although this example is with the Russian layout it's the same with other languages even English
for some reason the first attempt to call the function after changing a keyboard layout produces the previous attempt result, while they second attempt produces the current key result
Even if you change the character to an English character such as "a"
Code: Select all
key := "a"
1 - English layout --> works
2 - English layout --> works
switched to Russian
3 - Russian layout --> works but retrieves the previously layout code
4 - Russian layout --> new code
switched to English
5 - English layout --> works but retrieves the previously layout code
6 - English layout --> works
Link to a short video showing the problem
https://discord.com/channels/115993023636176902/743668704054607893/848268008741011466