I just wanna know how do we simulate a keydown

ie:

if blah = 1 then
simulate_the_delete_key_press
end if