Auto keypress on the keyboard

Is it possible to make Auto pressing a button on the keyboard? For example here

if ( data == "button1" ) then 

------------

end

Don’t think so, the closest you could get to something like this is using this native. Though I’m not 100% sure how it works as looping the “sprint” key seems to start working after a few seconds of walking, but other key’s don’t seem to have any effect.
https://runtime.fivem.net/doc/reference.html#_0xE8A25867FBA3B05E