Forum Discussion

Colin_McCrae's avatar
Colin_McCrae
Community Hero
12 years ago

Long Keypresses?

Hi



I have a website (IE being the browser in use) which uses long keypresses to trigger certain actions.



I can't seem to find an easy way to send long (half a second plus) keypresses to the browser object. KeyUp and KeyDown are only applicable to the desktop. Repeat instances of "Keys" doesn't work. It's interpreted (rightly so) as multiple fast individual keypresses, not a long single one.



Note - I have several instances of the IE open, each with a different "version" (for want of a better description) of the site. Controlling the individual browsers using identication by URL is fine. Not sure if this may influence any potential answer here.



I'd rather not rely on methods like "focus" when using multiple bowsers as I've found them to be very unreliable.
  • Sorry, should have said in the original post ...



    I'm using VB for scripting.
  • Well, I've managed to fudge it through by clicking on the web page in the relevant browser and then using keyup/keydown via LLPlayer.



    It works. But I don't really like the solution. I'd rather send a specific event to the browser page directly ..... but unless someone can come up with a better way, it looks like I'm stuck with it.
  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi Colin,



    I think that the LLPlayer is correct and the only possible solution.

    I think so, because there is no 'long' or 'short' key- or mouse presses in Windows, but instead, OS just sends standard events to the window procedure while the key/mouse button is keeping pressed.
    • finae's avatar
      finae
      Contributor

      what about using LLPlayer.Keydown and delay(xxxx)

      the key will continue to be down and the delay is the ... wait for however long and then release it after (?)