C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\C:\ProgramData\Microsoft\Windows\Start Menu\#Requires AutoHotkey v2.0
;Alt+UniCode.ahk version 202312141918
;May contain bugs, use with caution!
;
;Synopsis:
; Works exactly like the MicroSoft utility
; but works for any program and any time.
; Inserts any Unicode character at current
; cursor position based upon hex code point
; commonly designated as for eg: U+20ac
;
;Installation:
; Download and install AutoHotKey-2
; from https://www.autohotkey.com/
; Put this script into shell:startup
; or for all users shell:common startup
; Put shortcut to script in shell:start menu
; or for all users shell:common start menu
;
;Usage:
; Cursor to insertion point.
; Hold down Alt key.
; Punch + key.
; Type 1~5 digit hex code eg: 3a9
; Release Alt key.
; Unicode character is now inserted.
; Hit Esc key at any point to cancel out.
; Hit Backspace to delete last typed digit.
; Times out after 9s to prevent confusion.
;
;Bugs:
; InputHook() fails alongside Microsoft MouseKeys.
; https://www.autohotkey.com/boards/viewtopic.php?f=14&t=123357
;
;Debug:
; Documentation https://www.autohotkey.com/docs/v2/lib/
; ToolTip GetKeyName(Format("vk{:x}sc{:x}", vk, sc)) " vk" vk " sc" sc
; MsgBox GetKeyName(Format("vk{:x}sc{:x}", vk, sc)) " vk" vk " sc" sc
; NumLock On: 0vk96sc82 1vk97sc79 2vk98sc80 3vk99sc81 4vk100sc75 5vk101sc76 6vk102sc77 7vk103sc71 8vk104sc72 9vk105sc73 +vk107sc78 Entervk13sc284
; NumLock Off: 0vk45sc82 1vk35sc79 2vk40sc80 3vk34sc81 4vk37sc75 5vk12sc76 6vk39sc77 7vk36sc71 8vk38sc72 9vk33sc73 +vk107sc78 Entervk13sc284
; Main keys: 0vk48sc11 1vk49sc2 2vk50sc3 3vk51sc4 4vk52sc5 5vk53sc6 6vk54sc7 7vk55sc8 8vk56sc9 9vk57sc10
; Main keys: aAvk65sc30 bBvk66sc48 cCvk67sc46 dDvk68sc32 eEvk69sc18 fFvk70sc33 Spacevk32sc57 =+vk187sc13
; Main keys: AltRvk165sc312 AltLvk164sc56 Escvk27sc1 Entervk13sc28 Backspacevk8sc14
!NumpadAdd::
!+::
!=:: {
ih := InputHook("L0 T9","{Space}{Enter}{Escape}")
ih.VisibleNonText := False
ih.KeyOpt("{All}", "+I +N")
ih.OnKeyDown := KeyDown
ih.OnKeyUp := KeyUp
buffer := ""
ToolTip "{U+" buffer "}"
ih.Start()
ih.Wait()
SetTimer ToolTip, -3000
if ih.EndReason = "Timeout" || ih.EndKey = "Escape" || buffer = ""
return
Send "{U+" buffer "}"
return
KeyDown(ih, vk, sc) {
if vk > 47 && vk < 58 ; Numbers
buffer .= vk-48
else if vk > 64 && vk < 71 ; Letters
buffer .= GetKeyName(Format("vk{:x}sc{:x}", vk, sc))
else if vk > 95 && vk < 106 ; NumLock 0~9
buffer .= vk-96
else if vk = 45 ; NumPad Ins
buffer .= 0
else if vk = 35 ; NumPad End
buffer .= 1
else if vk = 40 ; NumPad Down
buffer .= 2
else if vk = 34 ; NumPad PgDn
buffer .= 3
else if vk = 37 ; NumPad Left
buffer .= 4
else if vk = 12 ; NumPad "5"
buffer .= 5
else if vk = 39 ; NumPad Right
buffer .= 6
else if vk = 36 ; NumPad Home
buffer .= 7
else if vk = 38 ; NumPad Up
buffer .= 8
else if vk = 33 ; NumPad PgUp
buffer .= 9
else if vk = 8 ; Backspace
buffer := SubStr(buffer, 1, StrLen(buffer)-1)
else {
MsgBox "Illegal Keystroke.`nAllowed entries are: `n`n0 1 2 3 4 5 6 7 8 9`nA B C D E F`na b c d e f"
Return
}
ToolTip "U+" buffer
if StrLen(buffer) > 4
ih.Stop()
}
KeyUp(ih, vk, sc) {
if (vk = 164 || vk = 165)
ih.Stop() ; Alt key released
}
}
Safety, accuracy and completeness of information provided herein is not
guaranteed,
so be inspired by it but do not use it as a basis for experimentation or
other actions.
![]() |
TOP | ©™ |
|
|