iohook icon indicating copy to clipboard operation
iohook copied to clipboard

Get caret position on `keydown` event

Open dhruvramani opened this issue 4 years ago • 1 comments
trafficstars

Is it possible to get the caret (text cursor) position on a keydown event?

dhruvramani avatar Jan 16 '21 06:01 dhruvramani

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.

ash0x0 avatar Jun 11 '21 18:06 ash0x0