Open geoff-harper opened 4 years ago
The event handlers are properties of the Tool object. If you're defining those in some kind of constructor function, I expect that you'd want to bind to this.onKeyUp
instead, since this
would already refer to the Tool object in that context. Of course, I could be misunderstanding you entirely, so more context would be helpful.
Sorry I should have included more, this.tool
is definitely the right instance: protected tool: paper.Tool;
. My code is unchanged from 0.12.3 so I don't think it's me but I am not certain
Hi, could you try to provide us a way to reproduce your issue so that we can look at it closer ?
The best way is to reproduce it in a sketch, please try to extend this one which demonstrate a working keyboard event listener.
That sketch doesn't appear to have the version that it failed on, 0.12.11
. My setup is also fairly deeply integrated with other libs so while that could be the cause, the integration also hadn't changed. This also makes it difficult to get into the sketch sandbox. I can take another look at this to see if anything has changed since I've just left the keyboard handlers disabled thus far
Ok, otherwise, you could also provide us a link to a reproduction repository or another online sandbox with which we can work.
I'm not seeing keyboard events firing. It's worth noting that I just updated from 0.12.3, where this was working fine, to 0.12.11. The tool's mouse events are working as expected. My code is as follows
My tool class' constructor
and the handler
It appears that the canvas element is missing many of the event listeners that it had in 0.12.3, the most relevant listeners being keyup, keypress, etc. The
contextmenu
andwheel
events were added by myself beforepaper.setup
is calledI don't see anything regarding events in the changelogs, please advise if I'm missing something silly. Thanks