Disconnect the global hardware keyboard (key.disconnect_global_keyboard)
This function is available in versions after 20260805
Declaration
success, err = key.disconnect_global_keyboard()
Returns
- success
Boolean. Returns
trueafter disconnection or when no global hardware keyboard is connected, andfalseon failure. - err String. Error message returned when disconnection fails.
Description
Releases all keys and disconnects the current global hardware keyboard. The existing key APIs resume their previous behavior afterwards.
- This function may be called repeatedly. It also returns success when no global hardware keyboard is connected.
- If the global hardware keyboard is running a
:pressor:send_textsequence, disconnection returnsfalse, "hardware keyboard is busy". - Keys already held by
key.downare released during disconnection. A later matchingkey.updoes not send the input again.
Example
local success, err = key.disconnect_global_keyboard()
assert(success, err)