I have two cases where I want something to happen which is equivalent to a key press, without that key being pressed.
In the case of the code I've written, I'd like to make it so that pressing 'Space' runs the same code as pressing 'R'.
Secondly, I have a problem wherein I'd like to initiate the equivalent of a key press after a certain amount of time has elapsed. Something like:
if(elapsedtime % 5 != 0)
{
Tell the program to run the code where the "S" key was pressed
}
I know I could just copy and paste the code blocks into the area they're needed, but I still wonder if there's another way to do this. Having two huge chunks of the same code feels a bit messy.
Many thanks.