API

  • GetRegKey('키값')

    레지스터리 값을 읽습니다
    반환되는 값은 숫자 또는 문자 입니다.

    function this.OnStart (this)
     
        Value = this:GetRegKey("HKEY_CURRENT_USER\\Software\\Microsoft\\Notepad\\StatusBar");
        trace ("Value = "..CurrentValue);
     
        if (Value == 0) then
          this:MessageBox("0 리턴되었어요", "안내", 0);
          this:Terminate();
        end
    end
    
  • SetRegKey('키값')

    레지스터리 값을 설정합니다
    리턴값 :
    1 = 성공
    0 = 설패

    function this.OnStart (this)
     
        Value = this:SetRegKey("HKEY_CURRENT_USER\\Software\\Microsoft\\Notepad\\StatusBar", 1);
        trace ("RetValue = "..Value);
     
        this:MessageBox(Value.." 리턴되었어요", "안내", 0);
        this:Terminate();
     
    end
    end
    
  • SetHookKey('키값')

    특정 키를 훅에 등록합니다 (키값은 대문자로 등록해야 합니다)
    반환되는 값은 1 부터 시작됩니다

    ID1 = this:SetHookKey('Z');
    ID2 = this:SetHookKey('X');
     
    
  • KillHotKey(nID)

    등록된 키 훅 ID 를 삭제합니다.

    this:KillHotKey(1);
     

  • SetTimer(nID, nTime)

    nID 값으로 타이머를 등록합니다. nTime = ms 기준
    이후 OnTimer(this, ID) 로 함수가 호출됩니다.

    this:SetTimer(1, 100);
     

  • KillTimer (nID)

    등록된 타이머를 삭제합니다

     this:KillTimer(1);
     

  • KeyPress('키값')

    특정 키를 발생시킵니다

    this:KeyPress('a');
    this:KeyPress('b');
    
  • MousePress('Param')

    특정 마우스 키를 발생시킵니다
    Param : LBUTTONCLICK, RBUTTONCLICK

    this:MousePress('LBUTTONCLICK');
    this:MousePress('RBUTTONCLICK');
    

API - 이벤트 함수

  • this.OnStart(this)
    Start 버튼을 누를때 발생합니다.
    훅 키 등을 등록할때 사용하면 됩니다
     local ID1 = 0;
    local ID2 = 0;
     
    function this.OnStart (this)
       trace( "OnStart" )
     
       ID1 = this:SetHookKey('Z');
       ID2 = this:SetHookKey('X');
    end
     
  • this.OnStop(this)
    Stop 버튼을 누를때 발생합니다.
    등록한 훅 키 및 타이머 삭제시 활용합니다
    function this.OnStop(this)
       trace( "OnStop" )
     
        for i=1, 100 do
            this:KillHotKey(i)
            this:KillTimer(i)
        end
    end
    
  • this.OnHotKey(this, ID, Mode)
    등록한 훅키가 눌렸을때 발생합니다.
    ID : 등록한 훅 ID 값
    Mode : 1 = HotKey Start, 0 = HotKey Stop
    function this.OnHotKey(this, ID, Mode)
     
        trace("OnHotKey() ID = "..ID.." Mode = "..Mode);
     
        -- 기존 타이머 모두 kill
        for i=1, 100 do
            this:KillTimer(i)
        end
     
        if (Mode == 1) then
            this:Beep(2500, 100);
            this:SetTimer(ID, 100)
        else
            this:Beep(500, 100);
        end
    end
    
  • this.OnTimer(this, ID)
    등록한 타이머의 콜백 함수 입니다.
    ID : 등록한 타이머 ID 값
    function this.OnTimer(this, ID)
        this:KeyPress('A');
    end