iohook
iohook copied to clipboard
Get caret position on `keydown` event
trafficstars
Is it possible to get the caret (text cursor) position on a keydown event?
Right now, not that I'm aware of.
You can register a mousemove listener inside a keydown listener but that would probably only trigger on mouse move after keydown which is still not what you want. I believe you're looking for something like
ioHook.on('keydown', event => {
ioHook.getMouseLocation();
});
So an imperative API to get the current location would be necessary for that. Either that or implement the mousemove listener to fire when first registered (similar to observers).
Marking as feature request and will put on the agenda.