Is there a way to detect keypress only when the Google Maps canvas is in focus?
The Maps API V3 JavaScript API has built-in keyboard shortcuts. When a user clicks or drags a map, the map becomes in focus and responds to keyboard shortcuts. If you click anywhere outside the map canvas, these shortcuts will no longer work.
I would like to expand some of these shortcuts (in particular, the arrow keys) to perform additional actions.
source
share