6fde34fafd
This PR fixes a few bugs with the "comma as pointer" feature. In tldraw, the `,` key can be used as a replacement for "pointer down" and "pointer up". This is most useful on laptops with trackpads that make dragging inconvenient. (See https://github.com/tldraw/tldraw/issues/2550). Previously, the canvas had to be focused in order for the comma key to work. If you clicked on a menu item and then pressed comma, it would not product a pointer event until you first clicked on the canvas. This is now fixed by moving the listener out of the `useDocumentEvents` and into `useKeyboardShortcuts`. ### Change Type - [x] `minor` — New feature ### Test Plan 1. Click the canvas. 2. Use the comma key to control pointer down / up. 3. Click a shape tool on the toolbar. 4. Move your mouse over the canvas. 5. Press the comma key. It should produce a dot / shape / etc ### Release Notes - Improve comma key as a replacement for pointer down / pointer up. |
||
---|---|---|
.. | ||
assets | ||
editor | ||
state | ||
store | ||
tldraw | ||
tlschema | ||
tlsync | ||
utils | ||
validate |