Key.put

From MiniScript Wiki
Jump to navigation Jump to search

key.put allows you to enqueue a string, or single character by code point, into the keyboard buffer used by both the command line and the input function.

Example

// Put MiniScript code for a countdown from 10 to 1, then print "BOOM!"
key.put "for i in range(10, 1); clear; print i; wait; end for; clear; print ""BOOM!"""
key.put 13 // carriage return

// Put MiniScript code to print "Hello, World!"
key.put "print ""Hello, World!"""
key.put 13 // carriage return

key.put 99  // c
key.put 108 // l
key.put 101 // e
key.put 97  // a
key.put 114 // r