Ask a Question

Long Keypresses?

Colin_McCrae
Community Hero

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.
4 REPLIES 4
Colin_McCrae
Community Hero

Sorry, should have said in the original post ...



I'm using VB for scripting.
Colin_McCrae
Community Hero

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
Community Hero

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.
Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

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 (?)

 

cancel
Showing results for 
Search instead for 
Did you mean: