; move_cursor_to : move the mouse cursor to a point
; version : 1.0
; author : ZouJunlin
; date : 20150319
procedure( move_cursor() ;; display the move_cursor_to gui
coordinateField = hiCreateStringField(
?name 'coordinateField
?prompt "Enter the coordinate: X Y"
?editable t
);end hiCreateStringField
moveCursorForm. = hiCreateAppForm(
?name 'moveCursorForm
?formTitle "move cursor to ..."
?callback 'move_cursor_to
?fields list(coordinateField)
?unmapAfterCB nil
);end hiCreateAppForm
hiDisplayForm(moveCursorForm)
);end procedure
procedure( move_cursor_to(callForm)
cv = geGetEditCellView()
coordinateXY = parseString(callForm~>coordinateField~>value)
x = evalstring(car(coordinateXY))
y = evalstring(cadr(coordinateXY))
leSetRefPoint(cv x:y)
leMoveCursorToRefPoint()
);end procedure
printf("move_cursor_to loaded!\n");
;change the bindkey as you wish
hiSetBindKey("
layout" "<Key>[" "move_cursor()")