There is a way by which you can do this. All you need to do is in sendkeys you need to send a keystroke enter.
So normally what you do is that you type for a keyword and press enter. Similar will be the scenario here.
Here is the code for doing this :-
driver.findElement(By.name("q")).sendKeys("Your keyword",Keys.ENTER);
Hope this helps.