</head> <body> <h1>KeyHistory</h1> <p>Displays script info and a history of the most recent keystrokes and mouse clicks.</p> <pre class="Syntax"><span class="func">KeyHistory</span></pre> <h2 id="Remarks">Remarks</h2> <p>This command is equivalent to selecting the "View-&gt;Key history" menu item in the main window.</p> <p>To disable key history, specify the following line anywhere in the script:</p> <pre><a href="_KeyHistory.htm">#KeyHistory</a> 0</pre> <p><a href="_KeyHistory.htm">#KeyHistory</a> can also be used to change the maximum number of events that will be displayed.</p> <p>This feature is intended to help <a href="../Scripts.htm#debug">debug scripts and hotkeys</a>. It can also be used to detect the scan code of a non-standard keyboard key using the steps described at the bottom of the <a href="../KeyList.htm#SpecialKeys">key list</a> page (knowing the scan code allows such a key to be made into a hotkey).</p> <p>The virtual key (VK) of the wheel events (WheelDown, WheelUp, WheelLeft, and WheelRight) are placeholder values that do not have any meaning outside of AutoHotkey. Also, the scan code for wheel events is actually the number of notches by which the wheel was turned (typically 1).</p> <p>If the script does not have the <a href="_InstallKeybdHook.htm">keyboard hook</a> installed, the KeyHistory window will display only the keyboard events generated by the script itself (i.e. not the user's). If the script does not have the <a href="_InstallMouseHook.htm">mouse hook</a> installed, mouse button events will not be shown. You can find out if your script uses either hook via "View-&gt;Key History" in the script's main window (accessible via "Open" in the tray icon). You can force the hooks to be installed by adding either or both of the following lines to the script:</p> <pre><a href="_InstallKeybdHook.htm">#InstallKeybdHook</a> <a href="_InstallMouseHook.htm">#InstallMouseHook</a></pre> <h2 id="Related">Tópicos relacionados</h2> <p><a href="_KeyHistory.htm">#KeyHistory</a>, <a href="_InstallKeybdHook.htm">#InstallKeybdHook</a>, <a href="_InstallMouseHook.htm">#InstallMouseHook</a>, <a href="ListHotkeys.htm">ListHotkeys</a>, <a href="ListLines.htm">ListLines</a>, <a href="ListVars.htm">ListVars</a>, <a href="GetKeyState.htm#function">GetKeyState()</a>, <a href="KeyWait.htm">KeyWait</a>, <a href="../Variables.htm#PriorKey">A_PriorKey</a></p> <h2 id="Examples">Exemplos</h2> <div class="ex" id="ExBasic"> <p><a class="ex_number" href="#ExBasic"></a> Displays the history info in a window.</p> <pre>KeyHistory</pre> </div> </body> </html>