A Python program to parse a given JSON file to virtualize keyboard inputs.
Designed especially for a platformer running at 60 fps.
Also includes TAS (tool assisted speedrun) json files for various stages in Dessert Dive.
Install keyboard:
pip install keyboard
- Execute via
sudo python3 virtual_key.py [folder_name/file_name.json] - Location for TAS json should go in a user-made appropriate game folder in
games
type gives the type of data that follows. Can only be either key or comment.
cmd gives the data to be used.
commenttypes will be printed on the console. It should follow this format:
"cmd" : "[your comment goes here]"
keytype should follow this format:
"cmd" : [
{
"dur" : [number of frames out of 60],
"key" : "[key to be pressed]"
},
{ [more can be added, following the above format] }
]
If more than one pair of dur and key are added in the same cmd, they will be executed
all at once, being de-pressed according to their number of frames respectively.
num gives the number of times to execute the given list of keys.
Jacky Wong, Kaleb Chestnut