1234567890 -> !"£$%^&*()
- I was wondering if there was any way to obtain this information programmatically. I don't especially need this information, however, it can be useful when comparing keyboards.
- (Actually, the information could be useful when trying to identify what keys are available for hotkeys.)
- One possible idea would be to send key presses using ControlSend to a hidden Edit control, demonstrated below.
- For reference, I also provide a script that lists all of the keys that AutoHotkey's GetKeyName function identifies.
Code: Select all
q:: ;list keys and their shift equivalents
;1234567890 -> !"£$%^&*()
vDHW := A_DetectHiddenWindows
DetectHiddenWindows, On
hWnd := DllCall("user32\CreateWindowEx", UInt,0, Str,"Edit", Str,"`r`n", UInt,0, Int,0, Int,0, Int,0, Int,0, Ptr,0, Ptr,0, Ptr,0, Ptr,0, Ptr)
ControlSend,, {Shift Down}1234567890{Shift Up}, % "ahk_id " hWnd
ControlGetText, vText,, % "ahk_id " hWnd
DllCall("user32\DestroyWindow", Ptr,hWnd)
DetectHiddenWindows, % vDHW
Clipboard := vText
MsgBox, % vText
return
w:: ;get key names
vOutput .= "SC:`r`n"
Loop, 256
{
vNum := A_Index-1
vKey := GetKeyName(Format("sc{:x}", vNum))
if !(vKey = "")
vOutput .= vNum "`t" vKey "`r`n"
}
vOutput .= "`r`n" "VK:`r`n"
Loop, 256
{
vNum := A_Index-1
vKey := GetKeyName(Format("vk{:x}", vNum))
if !(vKey = "")
vOutput .= vNum "`t" vKey "`r`n"
}
Clipboard := vOutput
MsgBox, % "done"
return
GET LETTERS IN KEYBOARD ORDER (E.G. 'QWERTY' ORDER)
jeeswg's characters tutorial - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=7&t=26486