autohotkey 一个天真的密钥重映射脚本

一个天真的密钥重映射脚本

UserShortCut.ahk

RAlt::RCtrl
RWin::RAlt
~MButton & WheelUp::
 WinGetActiveTitle, Title
 WinClose, %Title%
return
LWin & V::
 Send #n
return
#A::
 Send {Win Up}
 RUN http://www.google.com.tw/search?q=%clipboard%
return
^F12::
 SendMessage 0x112, 0xF170, 2, , Program Manager  ; Monitor off
return
!S::
 RUN C:\Program Files\Sublime Text 3\sublime_text.exe
return
~LButton & L::
  WinGetActiveTitle, Title
  WinClose, %Title%
return
~MButton & WheelDown::
 RUN ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}
return
~MButton & RButton::
 Send #n
return
~MButton & Backspace::
  Send #{F2}
return  
LAlt & ESC::
    Send #{F2}
return  
;;;push midle mouse right after expanded all windows
;~#F2::
;{
;    Sleep 50
;   Send {MButton}
;}
LAlt & L::
    If  GetKeyState("Shift", "P")
        Send ^L
    Else
        Send ^l
return
LAlt & U::
    If  GetKeyState("Shift", "P")
        Send ^U
    Else
        Send ^u
return
LAlt & '::
  Send ^'
return
LAlt & Enter::
    If  GetKeyState("Shift", "P")
        Send  ^+{Enter}
    Else
        Send ^{Enter} 
return
LAlt & A::
    If GetKeyState("Shift", "P")
     Send +^a
    Else
     Send ^a
return
LAlt & M::
 WinGetActiveTitle, Title
 WinMinimize %Title%
return
LAlt & D::
 Send ^d
return
LAlt & C::
 If  GetKeyState("Shift", "P")
        Send  ^+c
 Else
   	Send ^c
return  
LAlt & Space::
 Send {Shift down}{Shift up}
return
LAlt & Backspace::
    WinGet, Title, ProcessName,A 
    if((Title == "dopus.exe") || (Title == "Everything.exe"))
        Send {Delete}
    Else
        Send ^{Backspace}
return
LAlt & 2::
 If  GetKeyState("RAlt", "P")
     Send !+{2}
 Else
     Send ^2
return
LAlt & 1::
 If  GetKeyState("RAlt", "P")
     Send !+{1}
 Else
     Send ^1
return
LAlt & 0::
 Send ^0
return
LAlt & Delete::
 Send ^{Delete}
return
LAlt & X::
 Send ^x
return	
LAlt & V::
 If  GetKeyState("Shift", "P")
        Send  ^+v
 Else
   	Send ^v
return  
LAlt & H::
 Send ^h
return
LAlt & O::
 Send ^o::
return
LAlt & F::
    If GetKeyState("Shift", "P")
     Send +^f
    Else
     Send ^f
return
LAlt & G::
    If  GetKeyState("Capslock", "P")
    {
        Send ^{F3}
	SetCapsLockState, Off
    }
    Else If GetKeyState("Shift", "P")
        Send +{F3}
    Else If GetKeyState("RAlt", "P")
        Send !{F3}
    Else
        Send {F3} 
return
LAlt & S::
    If GetKeyState("Shift", "P")
     Send +^s
    Else
     Send ^s
return
LAlt & W::
    If GetKeyState("Shift", "P")
     Send +^w
    Else If GetKeyState("RAlt","P")
     Send aw
    Else
     Send ^w
return
LAlt & J::
    If  GetKeyState("Capslock", "P"){
        Send {LAlt up}^{F2}
	SetCapsLockState, Off
}
    Else If GetKeyState("Shift", "P")
        Send +{F2}
    Else
        Send {F2}
return
LAlt & T::
    If GetKeyState("Shift", "P")
        Send +^t
    Else
        Send ^t
return
LAlt & I::
    If GetKeyState("Shift", "P")
        Send +^i
    Else
        Send ^i
return
LAlt & P::
    If GetKeyState("Shift", "P")
        Send +^p
    Else
        Send ^p
return
LAlt & B::
 Send ^b
return
LAlt & K::
 Send ^k
return

LAlt & N::
    If GetKeyState("Shift", "P")
     Send +^n
    Else
     Send ^n
return
LAlt & R::
 If GetKeyState("Shift", "P")
     Send +^r
 Else
     Send ^r
return
LAlt & /::
 Send ^/
return
LAlt & Z::
    If  GetKeyState("Shift", "P")
        Send ^y
    Else
        Send ^z
return
Capslock & '::
  Send {Esc}
return
Capslock & w::
    If  GetKeyState("Shift", "P")
    {
        If GetKeyState("RAlt", "P")
            Send ^+{Up}
        Else
            Send  +{Up}
    }
    Else If Getkeystate("LWin","P")
    Send !{Up}
    Else If Getkeystate("LAlt","P")
    {
        If Getkeystate("RAlt","P")
            Send !^{Up}
        Else
            Send ^{Home}
    }    
    Else
        Send {Up} 
return
Capslock & d::
    If  GetKeyState("Shift", "P")
    {
        If  GetKeyState("LAlt", "P")
            Send ^+{Right}
        Else
            Send +{Right}
    }
    Else If GetKeyState("LAlt", "P")
        Send ^{Right}
    Else If GetKeyState("Ctrl", "P")
        Send !{Right}
    Else
        Send {Right} 
return
Capslock & a::
    If  GetKeyState("Shift", "P")
    {
        If  GetKeyState("LAlt", "P")
            Send ^+{Left}
        Else
            Send +{Left}
    }
    Else If GetKeyState("LAlt", "P")
        Send ^{Left}
    Else If GetKeyState("Ctrl", "P")
        Send !{Left}
    Else
        Send {Left} 
return
Capslock & s::
    If  GetKeyState("Shift", "P")
    {
        If GetKeyState("RAlt", "P")
            Send ^+{Down}
        ; Else If GetKeyState("RWin","P")
        ;     Send !^{Down}
        Else
            Send  +{Down}
    }
    Else If Getkeystate("LAlt","P")
    {
        If Getkeystate("RAlt","P")
            Send !^{Down}
        Else
            Send ^{Home}
    }    
    Else If Getkeystate("LAlt","P")
    Send ^{End}
    Else
        Send {Down} 
return
Capslock & c::
    If  GetKeyState("LAlt", "P")
        Send  ^{Delete}
    Else
        Send {Delete} 
return
Capslock & z::
    If  GetKeyState("Shift", "P")
        Send  +{End}
    Else If GetKeyState("Ctrl", "P")
        Send  ^{End}
    Else
        Send {End} 
return
Capslock & q::
    If  GetKeyState("Shift", "P")
        Send  +{Home}
    Else If GetKeyState("Ctrl", "P")
        Send  ^{Home}
    Else
        Send {Home} 
return
Capslock & e::
    If  GetKeyState("LAlt", "P")
        Send  ^{Backspace}
    Else
        Send {Backspace} 
return
Capslock & Enter:: 
    Send {Enter}
return
Capslock & F:: 
    Send {Enter}
return
Capslock & Space:: 
    Send {Space}
return
Capslock & LAlt::
    Send {Capslock}
return
LAlt & [::
    WinGet, Title, ProcessName,A 
    if(Title == "dopus.exe")
        Send ^{Left}
    else if GetKeyState("Shift", "P")
	Send +^{Tab}
    else 
        Send ^[
return
LAlt & ]::
    WinGet, Title, ProcessName,A 
    if(Title == "dopus.exe")
        Send ^{Right}
    else if GetKeyState("Shift", "P")
	Send ^{Tab}
    else 
        Send ^]
return
Capslock & I:: 
    Send {PgUp}
return
Capslock & K:: 
    Send {PgDn}
return
Capslock & 1::
     Send {F1}
return
Capslock & 2::
     Send {F2}
return
Capslock & 3::
     Send {F3}
return
Capslock & 4::
     Send {F4}
return
Capslock & 5::
     Send {F5}
return
Capslock & 6::
     Send {F6}
return
Capslock & 7::
     Send {F7}
return
Capslock & 8::
     Send {F8}
return
Capslock & 9::
     Send {+}
return
Capslock & 0::
     Send {=}
return
LAlt & Q::
 Send !{F4}
return
LAlt & ,::
 Send ^,
return
;RAlt & Q::
; Send #f
;return
#Enter::AppsKey
#Space::#q

autohotkey 更新AutoHotkey的本地德语帮助文件 - *作者*:SAPlayer,Ragnar_F - http://ahkscript.org/boards/viewtopic.php?f=10&t=34

更新AutoHotkey的本地德语帮助文件 - *作者*:SAPlayer,Ragnar_F - http://ahkscript.org/boards/viewtopic.php?f=10&t=34

UpdateGermanAHKHelp.ahk
# Script to update local german help for AutoHotKey
# Authors: SAPlayer, Ragnar_F - see http://ahkscript.org/boards/viewtopic.php?f=10&t=34
#
#SingleInstance ignore
#NoEnv

TmpDir := A_Temp

if(!A_IsAdmin){
   Run *RunAs "%A_ScriptFullPath%",, UseErrorLevel
   if(ErrorLevel){
      MsgBox, 53, Administatorrechte benötigt, Du musst den Updater mit Administratorrechten starten, damit er richtig funktioniert!
      IfMsgBox, Retry
         Reload
      else
         ExitApp
   }
   return
}

Unz(sZip, sUnz){ ;http://www.autohotkey.com/board/topic/60706-native-zip-and-unzip-xpvista7-ahk-l/
    fso := ComObjCreate("Scripting.FileSystemObject")
    If Not fso.FolderExists(sUnz)  ;http://www.autohotkey.com/forum/viewtopic.php?p=402574
       fso.CreateFolder(sUnz)
    psh  := ComObjCreate("Shell.Application")
    zippedItems := psh.Namespace( sZip ).items().count
    psh.Namespace( sUnz ).CopyHere( psh.Namespace( sZip ).items, 4|16 )
    Loop {
        sleep 50
        unzippedItems := psh.Namespace( sUnz ).items().count
        IfEqual,zippedItems,%unzippedItems%
            break
    }
}

SplitPath, A_AhkPath,, AhkDir
ToolTip, Hilfe wird heruntergeladen...
UrlDownloadToFile, https://github.com/ahkde/docs/releases, %TmpDir%\latest.htm
FileRead, latest, %TmpDir%\latest.htm
if RegExMatch(latest, "/releases/download/(.*?)/", s)
    ReleaseVersion := s1
URLDownloadToFile, https://github.com/ahkde/docs/releases/download/%ReleaseVersion%/AutoHotkeyHelp_DE.zip, %TmpDir%\AutoHotkeyHelp_DE.zip
if(ErrorLevel OR !FileExist(TmpDir "\AutoHotkeyHelp_DE.zip")){
    MsgBox, 21, Fehler beim Download, Ein Fehler beim Download ist aufgetreten! %ErrorLevel%
    IfMsgBox, Retry
        Reload
    else
        ExitApp
}
ToolTip, Hilfe wird entpackt...
Unz(TmpDir "\AutoHotkeyHelp_DE.zip", TmpDir "\AHKHelpDE")
if(!FileExist(TmpDir "\AHKHelpDE\Autohotkey.chm")){
    MsgBox, 21, Fehler beim Entpacken, Ein Fehler beim Entpacken ist aufgetreten!
    IfMsgBox, Retry
        Reload
    else
        ExitApp
}
ToolTip, Hilfe wird verschoben...
FileMove, %TmpDir%\AHKHelpDE\Autohotkey.chm, % AhkDir "\Autohotkey_de.chm", 1
ToolTip, Temporäre Dateien werden gelöscht...
FileDelete, %TmpDir%\AutoHotkeyHelp_DE.zip
FileDelete, %TmpDir%\latest.htm
FileRemoveDir, %TmpDir%\AHKHelpDE, 1
ToolTip
MsgBox, Neue deutsche Hilfe kopiert!
ExitApp

autohotkey Shift_CapsLock给出原始capsLock行为....重载脚本出错

Shift_CapsLock给出原始capsLock行为....重载脚本出错

CapsLockCtrlEscape.ahk
LShift & Capslock::
SetCapsLockState, % (State:=!State) ? "on" : "alwaysoff"
Return

g_AbortSendEsc := false

#InstallKeybdHook
SetCapsLockState, alwaysoff
Capslock::
g_DoNotAbortSendEsc := true
Send {LControl Down}
KeyWait, CapsLock
Send {LControl Up}
if ( A_PriorKey = "CapsLock")
{
	if(g_DoNotAbortSendEsc){
		Send {Esc}
	}
}
return

~*^a::
~*^b::
~*^c::
~*^d::
~*^e::
~*^f::
~*^g::
~*^h::
~*^i::
~*^j::
~*^k::
~*^l::
~*^m::
~*^n::
~*^o::
~*^p::
~*^q::
~*^r::
~*^s::
~*^t::
~*^u::
~*^v::
~*^w::
~*^x::
~*^y::
~*^z::
~*^1::
~*^2::
~*^3::
~*^4::
~*^5::
~*^6::
~*^7::
~*^8::
~*^9::
~*^0::
~*^Space::
~*^Backspace::
~*^Delete::
~*^Insert::
~*^Home::
~*^End::
~*^PgUp::
~*^PgDn::
~*^Tab::
~*^Return::
~*^,::
~*^.::
~*^/::
~*^;::
~*^'::
~*^[::
~*^]::
~*^\::
~*^-::
~*^=::
~*^`::
~*^F1::
~*^F2::
~*^F3::
~*^F4::
~*^F5::
~*^F6::
~*^F7::
~*^F8::
~*^F9::
~*^F10::
~*^F11::
~*^F12::
    g_DoNotAbortSendEsc := false
    return


autohotkey 在Evernote中快速粘贴

在Evernote中快速粘贴

Quick_paste_in_Evernote_Ahk.Ahk
#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.


`:: 
#IfWinExist ahk_class ENMainFrame
WinActivate   ,ahk_class ENMainFrame
send {enter}
sleep 100
send ^v
sleep 100
Send, {ALTDOWN}{TAB}ALTUP}
send, {enter}
#IfWinActive
return

~::
#IfWinExist ahk_class ENMainFrame
WinActivate   ,ahk_class ENMainFrame
send ^n
sleep 100

sleep 100
send ^v
sleep 100
Send, {ALTDOWN}{TAB}ALTUP}
send, {enter}
#IfWinActive
return

autohotkey Sublime_evernote_AHK用于从evernote windows app快速打开崇高文本中的笔记

Sublime_evernote_AHK用于从evernote windows app快速打开崇高文本中的笔记

Sublime_evernote.ahk
#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.
;this ahkscript open an evernote in sublime_text for quick editing in markdown
;define the hotkey here
^m::
clipboard=
;copying the shared url
sendInput {ctrl Down}{Alt Down}l{Alt Up}{ctrl up}
clipwait,3
;finding noteid and notebookid
Pos := RegExMatch(clipboard, "\Qevernote:///view/\E(\d+)/(.*)/(.*)/(.*)/", Var)
if(Pos==1)
	{
	;converting into GUID format that sublime_evernote plugin accepts
	newurl= https://www.evernote.com/shard/%var2%/nl/%var1%/%var3%
	clipboard:=newurl
	SetTitleMatchMode, 2
	IfWinExist,ahk_exe sublime_text.exe
		{
		WinActivate
		WinMaximize 
		sleep 300
		; we setup these keybinds in Sublime Settings.Download at
		;https://gist.github.com/44568b64c7cac5a729ea12b8eb78f7fe
		;and paste in preferences, key bindings
		sendinput ^e
		sendInput ^w
		return
	}
	else
		{
			;open sublime text
		run, %ProgramFiles%\Sublime Text 3\sublime_text.exe
		
		WinWaitActive, ahk_exe sublime_text.exe, , 6
		if ErrorLevel
		{
			MsgBox, Cant activate sublime text
			return
		}
		else
		{
		sleep 5000
		;sometimes sublime text doesnot open keybinding due to some delay
		sendinput ^e
		sendInput ^w
		return
		}

				
			}
	
		}	

else
	{
	msgbox, Err in copying the url. Try Again
	}

autohotkey Chrome_address_bar_hide.ahk

Chrome_address_bar_hide.ahk
CoordMode, Mouse, Screen
;This script hides the chrome address bar by displaying a fake address bar image (png) on the top of google chrome
; Useful trick to have more privacy
;overlays on chrome and minimize itself if chrome is minimized
; Has transparent area where google chrome back, next button are to make it work with other script which use those button images
; still to do is is to make it resize according to google chrome window's size.
;demo is at https://github.com/1nsp1r3rnzt/Autohotkey-scripts/blob/master/Autohotkey-scripts/chrome%20demo.gif?raw=true
Gui, Color, CABAFF
Gui +LastFound
winset,transcolor,CABAFF
gui,-caption +alwaysontop
Gui -border -caption +AlwaysOnTop +ToolWindow
;; how often to get the mouse position in milliseconds
UPDATE_INTERVAL := 10
;; make the script run forever
#Persistent
SetTimer, WatchCursor, %UPDATE_INTERVAL%
return

WatchCursor:
MouseGetPos, x, y
	If ( y > 124) { ;if cursors in top right region ;change this area accordingly

	IfWinActive, ahk_class Chrome_WidgetWin_1
{

	WinGetPos, XWin, YWin,width,height, ahk_class Chrome_WidgetWin_1 
	
	Gui, add, picture,, d:\fake.png          ; this is the location of the image
Gui, Show,x-10 y-10 NoActivate
}
sleep 100
return
    }
    else
	{
	
	Gui, Hide ;hide it
	return
	}

#IfWinActive

autohotkey 单身类机智AutoHotkey的食谱

单身类机智AutoHotkey的食谱

Singleton_Test.ahk
#Include %A_ScriptDir%
#Include Singleton.ahk

MsgBox % "**** The first run should use the New function."
testFunc()
MsgBox % "**** The second run should not use the New function."
testFunc()
MsgBox % "**** The third run should not use the New function."
testFunc()
ExitApp

testFunc()
{
  objA := Singleton.getInstance()
  MsgBox % "myVar: " ObjA.myVar "`ninstantiation times: "  objA._instanceCount
} 
Singleton.ahk
;~ This is a singleton class - taken from: http://www.programering.com/a/MDN4YDMwATU.html
class Singleton
{
  ;~ Single cases registered property
  static _myInstance := 0
    
  ;~ Instantiation counts
  static _instanceCount := 0
    
  ;~ test property
  _myVar := 0
    
  __New() {
    MsgBox % "step2: <new> to create a new instance"
    if IsObject( this._myInstance ) {
      MsgBox % "Singleton class is already instantiated, use the <getInstance> method to obtain the existing singleton instance"
      return this._myInstance
    }
  }
    
  getInstance() {
    MsgBox % "step1: <getInstance> to get the singleton"
    if ( IsObject( this._myInstance ) = 0 ) {
      this._instanceCount++
      this._myInstance := new Singleton()
    }
    return this._myInstance
  }
    
  ; accessor to test property  
  myVar[] {
    get {
      this._myVar := this._myvar + 1
      return this._myvar
    }
  }
}

autohotkey https://autohotkey.com/boards/viewtopic.php?f=6&t=225

https://autohotkey.com/boards/viewtopic.php?f=6&t=225

KeypressOSD.ahk
; KeypressOSD.ahk
;----------------------------------------------------------
; ChangeLog : v2.05 (2016-10-01) - Fixed not detecting "Ctrl + ScrollLock/NumLock/Pause"
;             v2.04 (2016-10-01) - Added NumpadDot and AppsKey
;             v2.03 (2016-09-17) - Added displaying "Double-Click" of the left mouse button.
;             v2.02 (2016-09-16) - Added displaying mouse button, and 3 settings (ShowMouseButton, FontSize, GuiHeight)
;             v2.01 (2016-09-11) - Display non english keyboard layout characters when combine with modifer keys.
;             v2.00 (2016-09-01) - Removed the "Fade out" effect because of its buggy.
;                                - Added support for non english keyboard layout.
;                                - Added GuiPosition setting.
;             v1.00 (2013-10-11) - First release.
;----------------------------------------------------------

#SingleInstance force
#NoEnv
SetBatchLines, -1
ListLines, Off

; Settings
	global TransN          := 200      ; 0~255
	global ShowSingleKey   := True     ; True or False
	global ShowMouseButton := True     ; True or False
	global DisplayTime     := 2000     ; In milliseconds
	global GuiPosition     := "Bottom" ; Top or Bottom
	global FontSize        := 50
	global GuiHeight       := 115

CreateGUI()
CreateHotkey()
return

OnKeyPressed:
	try {
		key := GetKeyStr()
		ShowHotkey(key)
		SetTimer, HideGUI, % -1 * DisplayTime
	}
return

; ===================================================================================
CreateGUI() {
	global

	Gui, +AlwaysOnTop -Caption +Owner +LastFound +E0x20
	Gui, Margin, 0, 0
	Gui, Color, Red
	Gui, Font, cYellow s%FontSize% bold, Arial
	Gui, Add, Text, vHotkeyText Center y20

	WinSet, Transparent, %TransN%
}

CreateHotkey() {
	Loop, 95
		Hotkey, % "~*" Chr(A_Index + 31), OnKeyPressed

	Loop, 24 ; F1-F24
		Hotkey, % "~*F" A_Index, OnKeyPressed

	Loop, 10 ; Numpad0 - Numpad9
		Hotkey, % "~*Numpad" A_Index - 1, OnKeyPressed

	Otherkeys := "WheelDown|WheelUp|WheelLeft|WheelRight|XButton1|XButton2|Browser_Forward|Browser_Back|Browser_Refresh|Browser_Stop|Browser_Search|Browser_Favorites|Browser_Home|Volume_Mute|Volume_Down|Volume_Up|Media_Next|Media_Prev|Media_Stop|Media_Play_Pause|Launch_Mail|Launch_Media|Launch_App1|Launch_App2|Help|Sleep|PrintScreen|CtrlBreak|Break|AppsKey|NumpadDot|NumpadDiv|NumpadMult|NumpadAdd|NumpadSub|NumpadEnter|Tab|Enter|Esc|BackSpace"
	           . "|Del|Insert|Home|End|PgUp|PgDn|Up|Down|Left|Right|ScrollLock|CapsLock|NumLock|Pause|sc145|sc146|sc046|sc123"
	Loop, parse, Otherkeys, |
		Hotkey, % "~*" A_LoopField, OnKeyPressed

	If ShowMouseButton {
		Loop, Parse, % "LButton|MButton|RButton", |
			Hotkey, % "~*" A_LoopField, OnKeyPressed
	}
}

ShowHotkey(HotkeyStr) {
	WinGetPos, ActWin_X, ActWin_Y, ActWin_W, ActWin_H, A
	if !ActWin_W
		throw

	text_w := ActWin_W
	GuiControl,     , HotkeyText, %HotkeyStr%
	GuiControl, Move, HotkeyText, w%text_w% Center

	if (GuiPosition = "Top")
		gui_y := ActWin_Y
	else
		gui_y := (ActWin_Y+ActWin_H) - 115 - 50

	Gui, Show, NoActivate x%ActWin_X% y%gui_y% h%GuiHeight% w%text_w%
}

GetKeyStr() {
	static modifiers := ["Ctrl", "Shift", "Alt", "LWin", "RWin"]

	for i, mod in modifiers {
		if GetKeyState(mod)
			prefix .= mod " + "
	}

	if (!prefix && !ShowSingleKey)
		throw

	key := SubStr(A_ThisHotkey, 3)
	if (key = " ") {
		key := "Space"
	} else if ( StrLen(key) = 1 ) {
		key := GetKeyChar(key, "A")
	} else if ( SubStr(key, 1, 2) = "sc" ) {
		key := SpecialSC(key)
	} else if (key = "LButton") && IsDoubleClick() {
		key := "Double-Click"
	}

	return prefix . key
}

SpecialSC(sc) {
	static k := {sc046: "ScrollLock", sc145: "NumLock", sc146: "Pause", sc123: "Genius LuxeMate Scroll" }
	return k[sc]
}

; by Lexikos -- https://autohotkey.com/board/topic/110808-getkeyname-for-other-languages/#entry682236
GetKeyChar(Key, WinTitle:=0) {
	thread := WinTitle=0 ? 0
		: DllCall("GetWindowThreadProcessId", "ptr", WinExist(WinTitle), "ptr", 0)
	hkl := DllCall("GetKeyboardLayout", "uint", thread, "ptr")
	vk := GetKeyVK(Key), sc := GetKeySC(Key)
	VarSetCapacity(state, 256, 0)
	VarSetCapacity(char, 4, 0)
	n := DllCall("ToUnicodeEx", "uint", vk, "uint", sc
		, "ptr", &state, "ptr", &char, "int", 2, "uint", 0, "ptr", hkl)
	return StrGet(&char, n, "utf-16")
}

IsDoubleClick(MSec = 300) {
	Return (A_ThisHotKey = A_PriorHotKey) && (A_TimeSincePriorHotkey < MSec)
}

HideGUI() {
	Gui, Hide
}

autohotkey AutoHotkey进入课程CRN

AutoHotkey进入课程CRN

register.ahk
^!a::
  Send, 12708{Tab}12714{Tab}14039{Tab}14216{Tab}14217{Tab}11800{enter}
Return

autohotkey AutoHotkey脚本:使用Notepad ++在资源管理器中打开,Keep Window始终位于顶部

AutoHotkey脚本:使用Notepad ++在资源管理器中打开,Keep Window始终位于顶部

MyScript.ahk
; AutoExecute Section must be on the top of the script
#NoEnv
SetWorkingDir %A_ScriptDir%
GroupAdd, Explore, ahk_class CabinetWClass         ; Add a class to the group
GroupAdd, Explore, ahk_class ExploreWClass         ; Add a other class to the group


; Always on Top CTRL+SPACE on current window
; http://www.labnol.org/software/tutorials/keep-window-always-on-top/5213/
^SPACE::  Winset, Alwaysontop, , A


; Open file With Notepad++ from Explorer using Alt+N hotkey
; https://autohotkey.com/board/topic/77665-open-files-with-portable-notepad/

#ifWinActive,ahk_group Explore              ; Set hotkeys to work in explorer only
; Alt+N
!n::
   ClipSaved := ClipboardAll
   Clipboard := ""
   Send ^c
   ClipWait, 0.5
   file := Clipboard
   Clipboard := ClipSaved
   Run D:\DSUsers\uid41890\PortableApps\Notepad++Portable\Notepad++Portable.exe "%file%"
return