Garry's Mod Wiki

Revision Difference

input.WasKeyPressed#511708

<function name="WasKeyPressed" parent="input" type="libraryfunc">⤶ <description>⤶ Returns whether a key was initially pressed in the same frame this function was called.⤶ ⤶ This function only works in Move hooks, and will detect key presses even in main menu or when a typing in a text field.⤶ </description>⤶ <realm>Client and Menu</realm>⤶ <args>⤶ <arg name="key" type="number">The key, see &lt;page&gt;KEY&lt;/page&gt;.</arg>⤶ </args>⤶ <rets>⤶ <ret name="" type="boolean">True if the key was initially pressed the same frame that this function was called, false otherwise.</ret>⤶ </rets>⤶ </function>⤶ ⤶