Closed jessegreenberg closed 6 months ago
Giving medium priority to match #1053.
This can be closed and replaced with https://github.com/phetsims/scenery/issues/1570. We don't want to use KeyStateTracker in KeyboardDragListener, we want to use KeyboardListener.
Reopening because there is a TODO marked for this issue.
KeyStateTracker was created to manage the state of the keyboard generally, but it was never applied to KeyboardDragListener. We should do that now.
We discussed using the global KeyStateTracker (currently on the Display), but decided against that because there is no guarantee that it will be up to date by the time we receive keyboard events in that listener. So KeyboardDragListener should have its own KeyStateTracker that it updates at the beginning of its
keydown
andkeyup
listeners so that the KeyStateTracker is up to date.We also mentioned that AccessibleValueHandler could benefit form using KeyStateTracker, but not sure if it is worthwhile (time, and KeyStateTracker is heavy for what what it would provide). After this issue we can decide if it should be used there.
I am going to work on this as part of #1053. Also, this issue came from work in https://github.com/phetsims/scenery/issues/850 (it initial creation), https://github.com/phetsims/scenery/issues/913 (its movement to scenery) https://github.com/phetsims/scenery/issues/909 (used in scenery PDOMPointer).