/RestoreSlash.ahk Secret
Created
May 11, 2020 04:17
让斜杠不再被微软输入法2004版本之后转换成顿号
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | |
; #Warn ; Enable warnings to assist with detecting common errors. | |
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | |
;说明 在QQ聊天窗口中是乱码,需要发送UTF-16BE编码 | |
ascinput(string){ | |
u := A_IsUnicode ? 2 : 1 ;Unicode版ahk字符长度是2 | |
length:=StrPut(string,"CP0") | |
if(A_IsUnicode) | |
{ | |
VarSetCapacity(address,length),StrPut(string,&address,"CP0") | |
} | |
else | |
address:=string | |
VarSetCapacity(out,2*length*u) | |
index =0 | |
Loop | |
{ | |
index += 1 | |
if (index>length-1) | |
Break | |
asc := NumGet(address,index-1,"UChar") | |
if asc > 126 | |
{ | |
index += 1 | |
asc2 := NumGet(address,index-1,"UChar") | |
asc := asc*256+asc2 | |
} | |
Send, % "{ASC " asc "}" | |
} | |
} | |
ascaltinput(string){ | |
u := A_IsUnicode ? 2 : 1 ;Unicode版ahk字符长度是2 | |
length:=StrPut(string,"CP0") | |
if(A_IsUnicode) | |
{ | |
VarSetCapacity(address,length),StrPut(string,&address,"CP0") | |
} | |
else | |
address:=string | |
VarSetCapacity(out,2*length*u) | |
index =0 | |
Loop | |
{ | |
index += 1 | |
if (index>length-1) | |
Break | |
asc := NumGet(address,index-1,"UChar") | |
if asc > 126 | |
{ | |
index += 1 | |
asc2 := NumGet(address,index-1,"UChar") | |
asc := asc*256+asc2 | |
} | |
StringSplit, var, asc, | |
Loop % var0 | |
{ | |
str .= "{Numpad" var%A_index% "}" | |
} | |
send, {AltDown}%str%{Altup} | |
str = | |
} | |
} | |
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | |
; #Warn ; Enable warnings to assist with detecting common errors. | |
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | |
;说明 在QQ聊天窗口中是乱码,需要发送UTF-16BE编码 | |
ascinput(string){ | |
u := A_IsUnicode ? 2 : 1 ;Unicode版ahk字符长度是2 | |
length:=StrPut(string,"CP0") | |
if(A_IsUnicode) | |
{ | |
VarSetCapacity(address,length),StrPut(string,&address,"CP0") | |
} | |
else | |
address:=string | |
VarSetCapacity(out,2*length*u) | |
index =0 | |
Loop | |
{ | |
index += 1 | |
if (index>length-1) | |
Break | |
asc := NumGet(address,index-1,"UChar") | |
if asc > 126 | |
{ | |
index += 1 | |
asc2 := NumGet(address,index-1,"UChar") | |
asc := asc*256+asc2 | |
} | |
Send, % "{ASC " asc "}" | |
} | |
} | |
ascaltinput(string){ | |
u := A_IsUnicode ? 2 : 1 ;Unicode版ahk字符长度是2 | |
length:=StrPut(string,"CP0") | |
if(A_IsUnicode) | |
{ | |
VarSetCapacity(address,length),StrPut(string,&address,"CP0") | |
} | |
else | |
address:=string | |
VarSetCapacity(out,2*length*u) | |
index =0 | |
Loop | |
{ | |
index += 1 | |
if (index>length-1) | |
Break | |
asc := NumGet(address,index-1,"UChar") | |
if asc > 126 | |
{ | |
index += 1 | |
asc2 := NumGet(address,index-1,"UChar") | |
asc := asc*256+asc2 | |
} | |
StringSplit, var, asc, | |
Loop % var0 | |
{ | |
str .= "{Numpad" var%A_index% "}" | |
} | |
send, {AltDown}%str%{Altup} | |
str = | |
} | |
} | |
/:: ;让斜杠不再被微软输入法2004版本之后转换成顿号 | |
ascinput("/") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment