Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I'm using the Google maps API to place a map onto a web page.

As the Computer with the map has not a keyboard, I simulate a javascript "onscreen" keyboard. My problem is that I don't know how to generate the "Enter" key.

My map has a searchbox (libraries=places), where the user input his choice. On a normal computer I press enter to "search", how can I do that with my onscreen keyboard?

Thank you!

share|improve this question
 
can you use jquery? @Perocat –  SamDroid Jun 12 at 15:32
 
Yes, the keyboard is jQuery! –  Perocat Jun 12 at 15:33
 
So, you can use the trigger event to simulate the enter key press! $("input").blur(function() { var e = jQuery.Event("keydown"); e.which = 15; // Enter $("input").trigger(e); }); –  SamDroid Jun 12 at 15:34
 
doesn't work... I already tried that... Enter is not 13? –  Perocat Jun 12 at 15:39
1  
Please provide a jsfiddle code example to make it easier for us to help –  AlfaTeK Jun 12 at 17:45
show 3 more comments

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.