If you were willing to forego just the one modifier key and instead use CMD-§ (or any other combination), then the following would be a work-around. As always, there are probably more elegant solutions!
Two Macros.
1st Macro Hotkey (F20) with just the Search the web with keyword action.
2nd Macro Hotkey (CMD-F20) Load google homepage
If you hit F20 and then decide you want the homepage, CMD-F20 will cancel that macro and load google homepage.
The attached macro has some unnecessary cancel action steps and different hotkeys. Hope that helps. I think the issue is that once you have executed the macro, it is done, it's not sitting there waiting for another keystroke. That would take something more complicated. My solution, while not elegant, does what you ask I think at the expense of an extra keystroke.
I hope you don't mind that I have revised your topic title to better reflect the question you have asked.
FROM: Sometimes I don't want to type keyword search, I want to exit the search box and jump to the home page, but why is my macro not working?
TO: How Do I Cancel Web Search and Display Home Page?
This will greatly help you attract more experienced users to help solve your problem, and will help future readers find your question, and the solution.
Possible Solution
You might try this macro.
If you press ESC instead of RETURN in the Search box, it will cancel the search and display the Google home page. You might need to hold down the ESC key for 0.5 sec or so.
Thanks, not only Google, but also a lot of websites need to be set up like Quora.com and keyboardmaestro.com, sometimes keyword search, sometimes open the home page to see new posts. thank you very much!
Great, my problem is solved, the Esc key works. Thank you so much. I don't mind if you change the question, because my English is not very good, I have always used Google Translate to post.