Skip to content

Commit

Permalink
pitfall documentation for phetsims/sun#864
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Dec 19, 2023
1 parent 4f68470 commit f117aac
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions js/listeners/KeyboardListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
* By default the callback will fire when the last key is pressed down. See additional options for firing on key
* up or other press and hold behavior.
*
* **Potential Pitfall!**
* The callback is only called if exactly the keys in a group are pressed. If you need to listen to a modifier key,
* you must include it in the keys array. For example if you add a listener for 'tab', you must ALSO include
* 'shift+tab' in the array to observe 'shift+tab' presses. If you provide 'tab' alone, the callback will not fire
* if 'shift' is also pressed.
*
* @author Jesse Greenberg (PhET Interactive Simulations)
*/

Expand Down

0 comments on commit f117aac

Please sign in to comment.