File fisheye-hook.lua of Package celestia
GOTO_TIME = 20.0
ITER_START = 0.1
ITER_FINISH = 0.9
ACCEL_TIME = 0.5
function gotoobject(self)
selection = celestia:getselection()
observer = celestia:getobserver()
if selection and observer then
observer:gotoobject(selection, GOTO_TIME, ITER_START, ITER_FINISH, ACCEL_TIME)
return true
end
return false
end
keys = {
g = gotoobject,
}
hook = {
charentered = function(self, ch)
fun = keys[ch]
if fun then
return fun(self)
end
return false
end;
}
celestia:setluahook(hook)