The PUT KEY
command allows you to simulate pressing a key on your computer
keyboard. Basically, you enter a string of characters and ugBASIC will use
it as if they were typed one after the other. This can be very useful for
automating certain actions, such as automatically entering your password
or emulating keystrokes.
This can be used to automatically enters a password into a game or application,
or to simulate an user interaction with the program itself, such as pressing a
button or selecting a menu. It can help to create sequences of commands that
are executed automatically, such as a macro.
The maximum length of the string you can enter depends on the keyboard buffer,
but normally is up to 10 characters.
Please note that this feature is available with the "asynchronous" keyboard
reading mechanism or in some specific, selected targets. To enable this
keyboard reading mode you must use the DEFINE KEYBOARD ASYNC
.
PUT KEY string
PUT KEY "yes"
Join BASIC 10Liner Contest with ugBASIC!
An interesting competition is held at the beginning of each year: the
BASIC 10Liner Contest.
It is possible to use ugBASIC to participate in the next
"BASIC10Liner" competition, in the following categories:
PUT KEY ↔ PuKy
If you have found a problem with this keyword, if you think there is a bug or, more
simply, you would like it to be improved, open an issue for this example on GitHub.
Thank you!
open an issue
BACK TO KEYWORDS