#include <GUIConstants.au3>
#Include <Misc.au3>
Global $CodeGUI,$dll
$GUI=GUICreate("魔兽改键",250,130)
GUICtrlCreateLabel("小键盘7:",10,13,50,20)
GUICtrlCreateLabel("小键盘8:",125,13,50,20)
GUICtrlCreateLabel("小键盘4:",10,43,50,20)
GUICtrlCreateLabel("小键盘5:",125,43,50,20)
GUICtrlCreateLabel("小键盘1:",10,73,50,20)
GUICtrlCreateLabel("小键盘2:",125,73,50,20)
$Input7=GUICtrlCreateInput("",60,10,60,20)
$Input8=GUICtrlCreateInput("",175,10,60,20)
$Input4=GUICtrlCreateInput("",60,40,60,20)
$Input5=GUICtrlCreateInput("",175,40,60,20)
$Input1=GUICtrlCreateInput("",60,70,60,20)
$Input2=GUICtrlCreateInput("",175,70,60,20)
$Confirm=GUICtrlCreateButton("确定设置",30,100,80,20)
$Code=GUICtrlCreateButton("按键代码",140,100,80,20)
GUISwitch($GUI)
GUISetState(@SW_SHOW)
While 1
If GUICtrlRead($Input7)<>"" And _IsPressed(GUICtrlRead($Input7),$dll) Then Send("{NUMPAD7}")
If GUICtrlRead($Input8)<>"" And _IsPressed(GUICtrlRead($Input8),$dll) Then Send("{NUMPAD8}")
If GUICtrlRead($Input4)<>"" And _IsPressed(GUICtrlRead($Input4),$dll) Then Send("{NUMPAD4}")
If GUICtrlRead($Input5)<>"" And _IsPressed(GUICtrlRead($Input5),$dll) Then Send("{NUMPAD5}")
If GUICtrlRead($Input1)<>"" And _IsPressed(GUICtrlRead($Input1),$dll) Then Send("{NUMPAD1}")
If GUICtrlRead($Input2)<>"" And _IsPressed(GUICtrlRead($Input2),$dll) Then Send("{NUMPAD2}")
$nMsg=GUIGetMsg(1)
Switch $nMsg[0]
Case $GUI_EVENT_CLOSE
Switch $nMsg[1]
Case $GUI
DllClose($dll)
Exit
Case $CodeGUI
GUIDelete($CodeGUI)
EndSwitch
Case $Code
CreateCodeGUI()
Case $Confirm
$dll = DllOpen("user32.dll")
GUISwitch($GUI)
GUISetState(@SW_MINIMIZE)
EndSwitch
WEnd
Func CreateCodeGUI()
$CodeGUI=GUICreate("键盘代码",200,400)
GUISetState(@SW_SHOW)
EndFunc