 return
 
 NextPage:
-    if (g_UseDisplay)
-    {
-        ControlFocus, %g_DisplayArea%
-    }
-    else
-    {
-        ControlFocus, %g_ControlArea%
-    }
+    ControlFocus, %g_DisplayArea%
 
     Send, {pgdn}
 return
 
 PrevPage:
-    if (g_UseDisplay)
-    {
-        ControlFocus, %g_DisplayArea%
-    }
-    else
-    {
-        ControlFocus, %g_ControlArea%
-    }
+    ControlFocus, %g_DisplayArea%
 
     Send, {pgup}
-return
-
-ViewControlArea:
-    g_UseDisplay := false
-    GuiControl, Show, %g_ControlArea%
-    GuiControl, Hide, %g_DisplayArea%
-return
-
-ViewDisplayArea:
-    g_UseDisplay := true
-    GuiControl, Show, %g_DisplayArea%
-    GuiControl, Hide, %g_ControlArea%
 return
 
 ActivateWindow:

; 用来显示控制界面
DisplayControlText(text)
{
    text := AlignText(text)
    GuiControl, Show, %g_ControlArea%
    GuiControl, Hide, %g_DisplayArea%
    ControlSetText, %g_ControlArea%, %text%, %g_WindowName%
    text := ""
}

; 用来显示命令结果
DisplayResult(result)
{
    GuiControl, Show, %g_DisplayArea%
    GuiControl, Hide, %g_ControlArea%
    textToDisplay := StrReplace(result, "`n", "`r`n")
    ControlSetText, %g_DisplayArea%, %textToDisplay%, %g_WindowName%
    g_UseDisplay := true

getMouseCurrentLine()
{
    MouseGetPos, , mouseY, , classnn,
    if (classnn != g_DisplayArea)
    {
        return -1
    }

    ControlGetPos, , y, , h, %g_DisplayArea%
    lineHeight := h / g_DisplayRows
    index := Ceil((mouseY - y) / lineHeight)
    return index
