key (former press_key_by_code before version 4.9.21)
key($code); - this function is used for full emulation of pressing and pressing a key on the keyboard (available from version 4.6.31)
the input Function accepts parameters:
$code – code of the key that should be pressed and pressed. You can find out the code from the dialog for getting key codes by pressing a key. To do this, there is a menu item Tools ->View keyboard codes with the Ctrl+Shift+K (int) hotkey.
If you press Ctrl while this function is running (or emulate pressing via the set_ctrl_prefix commands), the sent string will be interpreted as a set of hot keys for human.
After testing, the function returns the result of its work to the script:
true - successfully pressed and pressed the specified key(boolean)false - operation failed (boolean)