Author: Sander
Script Version: 1
Minimum CoyoteMIDI Build: 804
// Check if the 'keys' were specified when this script is ran from a translation.
enforcetrigger translation
if (mapkeys $parameters) !contains keys
messagebox "No keys were specified!"
return
// Get the keys to be executed out of the parameters.
$keys = (split ($parameters keys) "+")
// Add the keys to the queue.
%queued_keystrokes_queue + $keys
event uirefreshed
// This adds the 'Keys' input box to any translation that has this script selected as an output.
translationparameter keys (textbox Keys "The list of keys to be executed, separated by a +")
event scriptsloaded
// Create a new empty list to serve as the queue of keystrokes.
%queued_keystrokes_queue new list
// make a new ID for the loop that checks for keystrokes in the queue.
// This way we can stop the old loop when a new one starts.
$loop_id = (guid)
%queued_keystrokes_loop_id = $loop_id
while %queued_keystrokes_loop_id == $loop_id
// Add some delay in indefinite loops, so that they don't lock up the app.
wait 0.05
$queue = %queued_keystrokes_queue
// Check if there's any keys in the queue.
if (count $queue) > 0
// Get the first keys in the list and remove them from the list.
$keys = ($queue 1)
%queued_keystrokes_queue - $keys
// perform the key down on these first keys in the list.
foreach $key in $keys
key down $key
wait 0.05
// after a little bit of delay, perform the key up on these first keys again.
foreach $key in $keys
key up $key
2 downloads