Euyao Replayer Lua Application Interface Version 1.0
====================================================

----------------
For Lua Beginner
----------------

1. Lua online manual: http://www.lua.org/manual/5.1/
2. There are two ways to call a member function, one is like "class.member (class,...)", the other is like "class:member (...)".
3. Table index begins from 1, not 0 like C language.
4. Need not to define variable before using it.
5. Only nil is false, number 0 is true.

------
Legend
------

  :::       class name or global function
  ---       introduction
  ::.       class member function
  $input$   input parameter
  $return1$ output parameter 1
  <referto> reference

-------
Key Map
-------

  LBUTTON RBUTTON CANCEL MBUTTON BACK TAB CLEAR RETURN SHIFT CONTROL MENU PAUSE CAPITAL KANA JUNJA FINAL KANJI ESCAPE SPACE PRIOR NEXT END HOME LEFT UP RIGHT DOWN SELECT PRINT EXECUTE SNAPSHOT INSERT DEL HELP LWIN RWIN APPS SLEEP NUM0 NUM1 NUM2 NUM3 NUM4 NUM5 NUM6 NUM7 NUM8 NUM9 MUL ADD SEPARATOR SUB DECIMAL DIV F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12	

---------------------
Application Interface
---------------------

1 ::: euyao_replayer

  --- The main entrance class of Euyao Replayer.

 1.1 ::. get_current ()

     --- Get current Euyao Replayer instance.
     --- $return$ : <euyao_replayer> type.

 1.2 ::. load_actions ()

     --- Load table from current record file, this function can only call once.
     --- $return$ : <table> type, with dimisions as:
     ---
     --- <integer>            : action index
     --- <eu_replayer_action> : one action data.

 1.3 ::. get_current_window ()

     --- Get current window description while replaying.
     --- $return$ : <table> type with dimisions as:
     ---
     --- "title"   : window title, <string> type.
     --- "clsname" : window class name, <string> type.
     --- "hwnd"    : window handle, <integer> type.
     --- "left"    : window left position, <integer> type.
     --- "top"     : window top position, <integer> type.
     --- "width"   : window width, <integer> type.
     --- "height"  : window height, <integer> type.

 1.4 ::. do_action (action)

     --- Replay one action.
     --- $action$ : <eu_replayer_action> type.

 1.5 ::. set_mouse_offset (x, y)

     --- Set global mouse offset while replaying.
     --- $x$ : <integer> type.
     --- $y$ : <integer> type.

 1.6 ::. register_key_callback (c, func_name)

     --- Register global function called when $c$ key pressed.
     --- $c$         : <string> type, the first character in the string is the key pressed, the other characters ignored.
     --- $func_name$ : <string> type, you must define the global function in advance, this input parameter must write as string type, can't as function pointer.

 1.7 ::. wait ()

     --- Wait for registered callback send stop instruction, for example, "ESC" key pressed.

 1.8 ::. is_repeat ()

     --- If "repeat replaying" check box in main UI is checked, then this function return true.

2 ::: eu_replayer_action

  --- Action object in Euyao Replayer.

 2.1 ::. new_keyboard_action (pre_action, interval, is_down, c)

     --- Create a keyboard action in the next of $pre_action$.
     --- $pre_action$ : <eu_replayer_action> type, if previous action is not existed, this paramter must set NULL.
     --- $interval$   : milliseconds before this action to take place.
     --- $is_down$    : the key if down.
     --- $c$          : which key to invoke, see <key map> definition.

 2.2 ::. new_mouse_click_action (pre_action, interval, is_down, which_button, x, y)

     --- Create a mouse click action in the next of $pre_action$.
     --- $pre_action$   : <eu_replayer_action> type, if previous action is not existed, this paramter must set NULL.
     --- $interval$     : <integer> type, milliseconds before this action to take place.
     --- $is_down$      : <boolean> type, the mouse button if down.
     --- $which_button$ : <integer> type, which mouse button to invoke.
     --- $x$            : <integer> type, mouse cursor x position.
     --- $y$            : <integer> type, mouse cursor y position.

3 ::: eu_msgbox (str)

  --- Wrap MessageBox in Windows.
  --- $str$ : <string> type.

4 ::: eu_execute (str)

  --- execute a external program.

5 ::: eu_sleep (interval)

  --- sleep $interval$ milliseconds.
  --- $interval$ : <integer> type.

6 ::: eu_keyboard_hit (is_down, key)

  --- Keyboard stroke.
  --- $is_down$ : <boolean> type, the key if down.
  --- $key$     : <string> type, see <key map> definition.

7 ::: eu_cursor_get_position ()

  --- Get mouse cursor position.
  --- $return1$ : <integer> type, return x position.
  --- $return2$ : <integer> type, return y position.

8 ::: eu_cursor_set_position (x, y)

  --- Set mouse cursor position.
  --- $x$ : <integer> type, x position.
  --- $y$ : <integer> type, y position.

9 ::: eu_mouse_button_hit (is_down, which)

  --- Mouse button stroke.
  --- $is_down$ : <boolean> type, the button if down.
  --- $which$   : <integer> type, which button to hit, 1 is left, 2 is middle, 3 is right.

5 ::: eu_phase_play (replayer, actions, from, to, times)

  --- Play actions.
  --- $replayer$ : <euyao_replayer> type.
  --- $actions$  : <table> type, with dimisions as:
     --- <integer>            : action index
     --- <eu_replayer_action> : one action data.
  --- $from$     : <integer> type, start index.
  --- $to$       : <integer> type, end index.
  --- $times$    : <integer> type, repeat times.
