Not exactly a perfect solution, but you can use a CELX-script to intercept the "g" and "c" keys and perform the necessary commands with a longer duration instead. This looks like this:
Code: Select all
function celestia_keyboard_callback(key)
local script = nil
if key == "g" or key == "G" then
script = celestia:createcelscript("{ goto { time 10.0 } }")
end
if key == "c" or key == "C" then
script = celestia:createcelscript("{ center { time 5.0 } }")
end
if script then
while script:tick() do end
return true
end
return false
end
celestia:requestkeyboard(true)
while true do
wait(10)
end
There is an ugly problem: the "special keys" stop working: everything which is used for speed-control (a,z,q, f-keys) and cursor keys. a,z and q could be reimplemented in the script, but everything else doesn't work with the current key-handling code.
Note that the CELX-script uses embedded CEL-scritps to execute the goto, simply because this was easier as CEL uses the current selection, while CELX doesn't.
Harald