User Tools

Site Tools


ugbasic:user:kw:put_key
Translations of this page:


ugBASIC User Manual

PUT KEY

SYNTAX

   PUT KEY string

PURPOSE

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.

EXAMPLE

  PUT KEY "yes"

ABBREVIATION

 PuKy

AVAILABLE ON

  • Atari (400/800)
  • Atari XL/XE
  • Commodore 128 (MOS 8502)
  • Commodore 64
  • Commodore 64+REU
  • TRS-80 Color Computer
  • TRS-80 Color Computer 3
  • Amstrad CPC 664
  • Dragon 32
  • Dragon 64
  • Thomson MO5
  • MSX
  • Olivetti Prodest PC128
  • Commodore PLUS/4
  • SEGA SG-1000
  • Commodore VIC-20

ANY PROBLEM?

If you have encountered a problem using this command, if you think there is a bug or the explanation is unclear, please open an issue for this keyword on GitHub. Thank you!

POWERED BY