-
🚵 @paulmcAuthor OwnerAs of FSLeyes 0.20.0, it is no longer necessary to create a
Profile
sub-class in order to be notified of mouse/keyboard events. Instead, you can use theProfile.registerHandler
method like so:ortho = frame.viewPanels[0] profile = ortho.getCurrentProfile() displayCtx = ortho.displayCtx def onmouse(ev, canvas, mousePos, canvasPos): overlay = displayCtx.getSelectedOverlay() opts = displayCtx.getOpts(overlay) worldLoc = displayCtx.location voxelLoc = opts.getVoxel(worldLoc) print('Location changed: {}'.format(voxelLoc)) print(canvasPos) profile.registerHandler('LeftMouseDown', 'mylistenername', onmouse)
Please register or sign in to comment