KeyDown function

I understand the 'KeyDown' command behaves "Press and hold the particular key until it release by a 'KeyUp' command.

For Example, I need to apply above command for [Backspace] so here's my script.
KeyDown backspace
wait10.0
KeyUp backspace.

so when I run this, I see a single press action on [Backspace] button and then release (means If I've text "ABCDEF" and when I apply above script, only deletes last character 'F' but not whole text).

I would expect 'keydown backspace' line actually press and hold [Backspace] button, wait for 10 secs and they release [Backspace] button.

Am I correct?
Please correct me If I'm doing anything wrong.

I've also followed 'EggPlant reference Manual' but can't pick the odd one out from the above script.

Comments

  • EggplantMattEggplantMatt ForumAdmin admin
    The keyDown command is really only useful with modifier keys. When you hold the backspace key down on a physical keyboard to delete a word or string, it's the hardware in the keyboard that repeatedly sends backspace commands into the system -- it's an action that's repeated over and over. Modifier keys work differently. They are setting a state within the system, so you can hold them down and maintain that state -- there is no action associated with them.

    If you want to issue a bunch of backspace commands, you can say:
    repeat 10 
        typetext backspace
    end repeat
    
Sign In or Register to comment.