- keyboard.pressed()
- keyboard.released()
- keyboard.isDown()
- keyboard.getToggleState()
- keyboard.setToggleState()
- keyboard.press()
- keyboard.hold()
- keyboard.release()
- keyboard.virtualPress()
- keyboard.virtualHold()
- keyboard.virtualRelease()
- keyboard.virtualType()
- keyboard.getKeyName()
- keyboard.setHookCallback()
Returns
Returns
Returns
Returns the toggle state (
Sets the toggle state of a key to 'status'.
Attempts to send a synthetic press for the given key. If 'async' is
This will send the key press to whichever window has input focus at the time.
In order to send a key combination such as CTRL+C, you might consider holding the modifier, sending the key press, then releasing the modifier.
@code() keyboard.hold(key.VK_LCONTROL); keyboard.press(key.VK_C); keyboard.release(key.VK_LCONTROL); @endcodeAttempts to send a synthetic hold for the given key. As there is no automatically-paired release, the async flag is not accepted in this function. The hold will remain until keyboard.release() is called on this same button.
This will send the input to whichever window has input focus at the time.
Attempts to send a synthetic release for the given key. You should typically use keyboard.hold() on the key first to give it something to release.
This will send the input to whichever window has input focus at the time.
Attempts to send a synthetic press for the given key, and sends that input directly to the given window.
If 'async' is
As virtual functions send the input directly to the specified window's input queue, this can be used to control windows that are in the background without interrupting the user.
Attempts to send a synthetic hold for the given key, and sends that input directly to the given window.
As virtual functions send the input directly to the specified window's input queue, this can be used to control windows that are in the background without interrupting the user.
Attempts to send a synthetic release for the given key, and sends that input directly to the given window.
As virtual functions send the input directly to the specified window's input queue, this can be used to control windows that are in the background without interrupting the user.
Attempts to send a synthetic message to a window, as if the user typed it.
Returns the name of a key (given by virtual key code) as a
Install or uninstall a keyboard hook callback. If 'callback' is a Lua
If 'callback' is nil, the keyboard hook will be removed.
Both your callback and main function (
NOTE: The CTRL+ALT+DELETE keyboard combo cannot be blocked by a low-level keyboard hook. That is processed at the driver-level.
@code() function hook(vk, state) -- If the user presses the Windows keys, ignore them completely -- Otherwise, let the keypress go through. if( state == "down" and (vk == key.VK_LWIN or vk == key.VK_RWIN) ) then return true; else return false; end end function macro.init() -- Once the hook is installed, our system should now stop responding to the Windows keys being pressed. keyboard.setHookCallback(hook); end @endcodePage last updated at 2018-09-25 20:47:52