Using a <div> as a button is acceptable as long as you correctly specify the necessary ARIA tags, roles, and keyboard events. This is the essence of ARIA's functionality.
It is generally recommended to utilize standard HTML elements whenever possible, as outlined in the guidelines for ARIA use at http://www.w3.org/TR/aria-in-html/#notes-on-aria-use-in-html. However, there may be situations where this is not feasible.
The mention of using focus() is inaccurate. The focus() function is intended to shift focus to an object rather than handling an event. It might have been referring to onFocus(), an event triggered when an object gains focus, but this is still not the suitable event to capture. A button (whether implemented as a <div> or a <button>) should only execute its function when clicked or activated with enter/space.
Refer to the authoring practices that outline keyboard behavior for buttons at http://www.w3.org/TR/wai-aria-practices/#button, as well as the section discussing keyboard events at http://www.w3.org/TR/wai-aria-practices/#focus_tabindex. Avoid relying on keypress as it is not uniformly supported across all browsers.
When interacting with keys, remember that three potential events may occur: Keydown, keypress, and keyup. Keydown and keyup are consistent across browsers and provide access to event.keyCode, while keypress is not universally supported and offers event.charCode instead.
Understanding the distinction between keyCode and charCode is crucial, particularly for implementing shortcut keys like Ctrl+/. Different keyboards may produce varying keyCodes for special keys, which can complicate implementation and require additional considerations.