i want to display cursor position in real time

88 views
Skip to first unread message

matt richards

unread,
Dec 13, 2022, 3:49:11 AM12/13/22
to Ajax.org Cloud9 Editor (Ace)
im trying to display the cursor position in real time, but i cant figure out how to do this

i know to get the cursor position, im using editor.getCursorPosition();

i current have a mouse down event registered on the initial element passed to ace editor
and a keydown event registered
on each event i get the cursor position and display, it semi-works
when i use the cursor keys these events do not bubble up to my handlers, although normal keystrokes do

is there another way to go about this, is there a reason why the certain keyboard events are cancelled


matt richards

unread,
Dec 13, 2022, 3:31:29 PM12/13/22
to Ajax.org Cloud9 Editor (Ace)
as an edit, i use the keyup events and it works, it seems that just the keydown events are cancelled

Harutyun Amirjanyan

unread,
Dec 13, 2022, 4:06:29 PM12/13/22
to ace-d...@googlegroups.com
You can use changeSelection event similar to the statusbar extension in ace https://github.com/ajaxorg/ace/blob/master/src/ext/statusbar.js#L17
Reply all
Reply to author
Forward
0 new messages