作者UndeadSion (UndeadSion)
看板EZsoft
标题[免费] AutoHotkey 特殊符号快速键
时间Tue Sep 25 03:32:13 2007
软体名称:AutoHotkey 特殊符号快速键
官方网站:http://www.autohotkey.com/
软体分类:键盘快速键
执行平台:MS-Windows
软体特色:详见程式码说明
推荐原因:取代萤幕小键盘的特殊符号输入
谁适合用:传统注音输入法使用者
附注:
将以下程式码剪下来存成 .ahk 用 AutoHotkey 执行就可以了
; --------------------------------------------------------------------
;
; 《特殊符号快速键》
;
; 【功能说明】
;
; 使用经由剪贴簿送出字串的方式,在指定的应用程式中以快速键输入特殊符号
;
; --------------------------------------------------------------------
; --------------------------------------------------------------------
; 指定使用特殊符号快速键的应用程式 (可依需要自行增减或修改)
;
; * 指定应用程式的目的是为了避免切换应用程式时,必须经常 [开启/关闭]
; 特殊符号快速键的麻烦 (特殊符号快速键开关:Win + P)
;
; * App1~App5 是应用程式的视窗标题或 ahk_class 属性
; (ahk_class 请用 AutoHotkey 的 Window Spy 工具查看)
;
; * AppCount 是应用程式的总数
; --------------------------------------------------------------------
App1 := "ahk_class Notepad" ; 记事本
App2 := "ahk_class OpusApp" ; Word 2000
App3 := "ahk_class rctrl_renwnd32" ; Outlook 2000
App4 := "ahk_class ATH_Note" ; Outlook Express
App5 := "ahk_class IMWindowClass" ; Windows Live Messenger
AppCount = 5
; --------------------------------------------------------------------
; 设定特殊符号快速键 (可依需要自行修改)
;
; * 设定以 Alt + <按键> 来输入特殊符号
; 按键值请参考 AutoHotkey 的说明文件
; --------------------------------------------------------------------
SetHotkey:
SetKeyLabel("!1", "Alt1")
SetKeyLabel("!2", "Alt2")
SetKeyLabel("!3", "Alt3")
SetKeyLabel("!4", "Alt4")
SetKeyLabel("!5", "Alt5")
SetKeyLabel("!6", "Alt6")
SetKeyLabel("!7", "Alt7")
SetKeyLabel("!8", "Alt8")
SetKeyLabel("!9", "Alt9")
SetKeyLabel("!0", "Alt0")
SetKeyLabel("!-", "Alt-")
SetKeyLabel("!=", "Alt=")
SetKeyLabel("!\", "Alt\")
SetKeyLabel("!Q", "AltQ")
SetKeyLabel("!W", "AltW")
SetKeyLabel("!E", "AltE")
SetKeyLabel("!R", "AltR")
SetKeyLabel("!T", "AltT")
SetKeyLabel("!Y", "AltY")
SetKeyLabel("!U", "AltU")
SetKeyLabel("!I", "AltI")
SetKeyLabel("!O", "AltO")
SetKeyLabel("!P", "AltP")
SetKeyLabel("![", "Alt[")
SetKeyLabel("!]", "Alt]")
SetKeyLabel("!A", "AltA")
SetKeyLabel("!S", "AltS")
SetKeyLabel("!D", "AltD")
SetKeyLabel("!F", "AltF")
SetKeyLabel("!G", "AltG")
SetKeyLabel("!H", "AltH")
SetKeyLabel("!J", "AltJ")
SetKeyLabel("!K", "AltK")
SetKeyLabel("!L", "AltL")
SetKeyLabel("!;", "Alt;")
SetKeyLabel("!'", "Alt'")
SetKeyLabel("!Z", "AltZ")
SetKeyLabel("!X", "AltX")
SetKeyLabel("!C", "AltC")
SetKeyLabel("!V", "AltV")
SetKeyLabel("!B", "AltB")
SetKeyLabel("!N", "AltN")
SetKeyLabel("!M", "AltM")
SetKeyLabel("!,", "AltComma")
SetKeyLabel("!.", "Alt.")
SetKeyLabel("!/", "Alt/")
SetKeyLabel("!Ins", "AltIns")
SetKeyLabel("!Del", "AltDel")
SetKeyLabel("!Home", "AltHome")
SetKeyLabel("!End", "AltEnd")
Return
; --------------------------------------------------------------------
; 定义快速键输出的特殊符号 (可依需要自行修改)
;
; * 特殊符号键位跟萤幕小键盘一样,如果忘记了直接开萤幕小键盘看比较快
;
; * 另外新增四个萤幕小键盘没有对应的特殊符号
; Alt + Ins ↖
; Alt + Del ↙
; Alt + Home ↗
; Alt + End ↘
; --------------------------------------------------------------------
Alt1:
SendString("┌")
Return
Alt2:
SendString("┬")
Return
Alt3:
SendString("┐")
Return
Alt4:
SendString("〝")
Return
Alt5:
SendString("〞")
Return
Alt6:
SendString("‘")
Return
Alt7:
SendString("’")
Return
Alt8:
SendString("“")
Return
Alt9:
SendString("”")
Return
Alt0:
SendString("『")
Return
Alt-:
SendString("』")
Return
Alt=:
SendString("「")
Return
Alt\:
SendString("」")
Return
AltQ:
SendString("├")
Return
AltW:
SendString("┼")
Return
AltE:
SendString("┤")
Return
AltR:
SendString("※")
Return
AltT:
SendString("〈")
Return
AltY:
SendString("〉")
Return
AltU:
SendString("《")
Return
AltI:
SendString("》")
Return
AltO:
SendString("【")
Return
AltP:
SendString("】")
Return
Alt[:
SendString("﹝")
Return
Alt]:
SendString("﹞")
Return
AltA:
SendString("└")
Return
AltS:
SendString("┴")
Return
AltD:
SendString("┘")
Return
AltF:
SendString("○")
Return
AltG:
SendString("●")
Return
AltH:
SendString("↑")
Return
AltJ:
SendString("↓")
Return
AltK:
SendString("!")
Return
AltL:
SendString(":")
Return
Alt;:
SendString(";")
Return
Alt':
SendString("、")
Return
AltZ:
SendString("─")
Return
AltX:
SendString("│")
Return
AltC:
SendString("◎")
Return
AltV:
SendString("§")
Return
AltB:
SendString("←")
Return
AltN:
SendString("→")
Return
AltM:
SendString("。")
Return
AltComma:
SendString(",")
Return
Alt.:
SendString("‧")
Return
Alt/:
SendString("?")
Return
AltIns:
SendString("↖")
Return
AltDel:
SendString("↙")
Return
AltHome:
SendString("↗")
Return
AltEnd:
SendString("↘")
Return
; --------------------------------------------------------------------
; 特殊符号快速键开关:Win + P
; --------------------------------------------------------------------
#P::Suspend
; --------------------------------------------------------------------
; 设定特殊符号快速键执行区段标签
; --------------------------------------------------------------------
SetKeyLabel(key_press, key_label)
{
global AppCount
Loop, %AppCount%
{
AppActive := App%A_Index%
Hotkey, IfWinActive, %AppActive%
Hotkey, %key_press%, %key_label%
}
}
; --------------------------------------------------------------------
; 经由剪贴簿送出字串
; --------------------------------------------------------------------
SendString(string)
{
Clipboard := string
SendInput ^V
}
----------------------------------------------------------------------
已知的问题:
* 因为是经由剪贴簿送出字串,剪贴簿原本的资料会被覆盖过去,[复制/贴上]
资料时要留意一下
* 连续输入同一特殊符号时,请不要压住快速键不放,以免 AutoHotkey 来不及
处理,建议先输入一个特殊符号,再用贴上 (Ctrl + V) 来连续输入
如有其它问题,欢迎指教 囧>
本着作依据 Creative Commons 姓名标示-非商业性-相同方式分享 授权条款为授权
http://creativecommons.org/licenses/by-nc-sa/2.0/tw/
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 60.248.159.124
1F:推 accordingto:新酷音的 ~按钮会不会好记些.. @@a anyway,辛苦了... 09/25 11:06
2F:→ UndeadSion:所以说是推荐给传统注音输入法使用者罗 (我就是) 囧rz 09/25 11:50
3F:推 ateclean:ㄅ半的话.... Ctrl+Alt+, 可以叫出符号小键盘 09/25 22:55
4F:→ ateclean:不过推你的用心XD 09/25 22:55