GetKeySC() incorrect values returned with "Escape" & "Esc"
Posted: 08 May 2017, 09:12
Seems to be a bug with the Scancode returned when passing the strings "Esc" and "Escape" as the key for GetKeySC() function. Should return 1 but different results are returned. When Esc is passed it returns 0 and when Escape is passed, it returns A (i.e. 10).
Code: Select all
key := ["Escape","Esc"]
txt := ""
loop, % Round(key.MaxIndex())
{
name := GetKeyName(key[A_Index])
vk := GetKeyVK(key[A_Index])
sc := GetKeySC(key[A_Index]) ;<- bugged, When "Escape", should be 1 not a, When "Esc" should be 1 not 0
txt .= Format("Key: {}`nName: {},`tVK: {:X},`tSC: {:X}`n",key[A_Index], name, vk, sc)
txt .= "`tvkName: " GetKeyName(Format("vk{:X}",vk)) ",`tscName: "GetKeyName(Format("sc{:X}",sc)) "`n`n"
}
txt .= "sc1: " GetKeyName("sc1")
MsgBox %txt%