Re-Mapping the "H" key.

Have a question about using Celestia? Check here first for FAQs and helpful advice.

Moderator: selden

Forum rules
Please help to make this forum more useful by checking the FAQs before posting! Keep it clean, keep it civil, keep it truthful, stay on topic, be responsible, share your knowledge.

Re-Mapping the "H" key.

Postby daerokos » Tue Oct 18, 2011 9:32 pm

i recently created a new fictional star system and whenever i load celestia i'm instantly going there to work on it and such. i don't mind starting at earth, or typing in the new star's name to get there. not a big deal. just wondering if i could get celestia to either start in/at my new system, or if i could remap the "H" key to center/follow my new star instead of Sol. does anyone know if this is possible?
daerokos
 
Posts: 32
Joined: Sun Sep 25, 2011 1:56 am

Re: Re-Mapping the "H" key.

Postby selden » Wed Oct 19, 2011 3:30 am

You can use a CelX script to remap just about any key.

I prefer to create a .HTML file containing URLs of several favorite viewpoints. Clicking on a Cel:// URL will take Celestia to that viewpoint immediately. If Celestia isn't running, it'll start Celestia, too. (Type a Ctrl-C while Celestia is running to capture a Cel:// URL to the clipboard. Then, in your favorite editor, type its "paste" command to put that URL into a document.)

The .HTML file might contain something like this for each of its entries:
Code: Select all
<li>
<a href="
...Cel:// url here...
"> Text describing URL</a>
</li>


For example, a file named GLIESE.HTML might contain this:
Code: Select all
<li>
<a href="
cel://Follow/Gliese%20777%20A:b/2011-10-19T10:18:38.01967?x=AEEp8LH3MRY&y=gNzs5IwP8fn//////////w&z=gHTNuHyugAg&ow=0.277978&ox=-0.433997&oy=-0.0627024&oz=-0.85466&select=Gliese%20777%20A:b&fov=36.5328&ts=1&ltd=0&p=0&rf=6657975&lm=516&tsrc=0&ver=3
">Gliese 777 A planetary system</a>
</li>

The .HTML file doesn't have to include all of the usual html boilerplate, although it can if you want.
Selden
User avatar
selden
 
Posts: 9902
Joined: Tue Sep 03, 2002 7:21 pm
Location: NY, USA

Re: Re-Mapping the "H" key.

Postby daerokos » Thu Oct 20, 2011 3:07 am

selden wrote:You can use a CelX script to remap just about any key.

I prefer to create a .HTML file containing URLs of several favorite viewpoints. Clicking on a Cel:// URL will take Celestia to that viewpoint immediately. If Celestia isn't running, it'll start Celestia, too. (Type a Ctrl-C while Celestia is running to capture a Cel:// URL to the clipboard. Then, in your favorite editor, type its "paste" command to put that URL into a document.)

The .HTML file might contain something like this for each of its entries:
Code: Select all
<li>
<a href="
...Cel:// url here...
"> Text describing URL</a>
</li>


For example, a file named GLIESE.HTML might contain this:
Code: Select all
<li>
<a href="
cel://Follow/Gliese%20777%20A:b/2011-10-19T10:18:38.01967?x=AEEp8LH3MRY&y=gNzs5IwP8fn//////////w&z=gHTNuHyugAg&ow=0.277978&ox=-0.433997&oy=-0.0627024&oz=-0.85466&select=Gliese%20777%20A:b&fov=36.5328&ts=1&ltd=0&p=0&rf=6657975&lm=516&tsrc=0&ver=3
">Gliese 777 A planetary system</a>
</li>

The .HTML file doesn't have to include all of the usual html boilerplate, although it can if you want.




hmmmmm

ok so i go into celestia, type in "Odin" to go to my star, then while its centered on odin, type "CTRL-C", and this will copy my cel url. then paste it into... wordpad? then what do i do?

sorry i got lost in your description i don't know much about html. should i save the wordpad file as like "Odin.html"? then... double-click it and it opens celestia?
daerokos
 
Posts: 32
Joined: Sun Sep 25, 2011 1:56 am

Re: Re-Mapping the "H" key.

Postby selden » Thu Oct 20, 2011 5:12 am

Use Notepad. Wordpad will probably insert binary formatting codes, which will confuse things.

I usually use this procedure:

run Celestia
goto viewpoint
Type Ctrl-C

open the addon's folder
right click in an empty area
in the popup menu select New > Text Document
change the file's name name to be addon.html
answer "yes" when it complains that you're changing the file extension
right-click on the new file
select Open With... (if you select Open, it would run the Web browser)
in the popup menu select Notepad (or other text editor)
Notepad opens showing an empty document

To add a url:
type Ctrl-V (this command inserts the contents of the clipboard into the document)
A long cryptic Cel URL appears in the document
Above the url, insert the text
Code: Select all
 <li> <a href="


Below the url, insert the text
Code: Select all
 "> My Url </a> </li>


type Ctrl-S (this command saves the contents of the document to the file on disk)
don't exit from Notepad yet (you may want to insert more urls)

double click on the file's icon.
It opens in a browser
The words "My Url" should be visible, highlighted as if they are a Web link (they are)

click on the URL
Celestia should come to the foreground showing the same viewpoint as before
change Celestia's viewpoint to look elsewhere
click on the URL
Celestia's viewpoint should return to the same viewpoint as before

The very first time you click on a Cel URL in a browser, it'll complain and ask if you really want to have it run a program. Answer yes.

Whenever you save new URLs to the HTML file, be sure to click on the browser's "refresh" button so it'll read the updated version of the file.
Selden
User avatar
selden
 
Posts: 9902
Joined: Tue Sep 03, 2002 7:21 pm
Location: NY, USA

Re: Re-Mapping the "H" key.

Postby daerokos » Thu Oct 20, 2011 6:20 am

wow dude you're awesome thank you very much for clarifying that for me. every time i have a problem you're helpin me out!

awesome instructions thank you very much i'm going to pass out now and get some sleep as soon as i wake up i will try this out and let you know how it worked!
daerokos
 
Posts: 32
Joined: Sun Sep 25, 2011 1:56 am

Re: Re-Mapping the "H" key.

Postby john Van Vliet » Fri Oct 21, 2011 6:36 pm

why not just temporarily edit the "start.cel"

that is what i do
change
-----
select {object "Sol/Earth"}
----
to the new location
example for my Gliese 876
Code: Select all
 preloadtex { object "Sol/Earth" }
  preloadtex { object "Sol/Earth/Moon" }

  select {object "Sol"}
  goto   {time 3.0 distance 30}
  wait   {duration 3.0}

  select {object "Sol/Earth"}
  follow {}
  goto   {time 3.0  distance 6.0}
  wait   {duration 2.0}

  print  {text "Welcome to Celestia!"  row -3  column 1  duration 3}
  wait   {duration 3.0}

change to
Code: Select all
  #preloadtex { object "Sol/Earth" }
  #preloadtex { object "Sol/Earth/Moon" }

  select {object "Gliese 876"}
  goto   {time 3.0 distance 30}
  wait   {duration 3.0}

  #select {object "Sol/Earth"}
  #follow {}
  #goto   {time 3.0  distance 3.0}
  #wait   {duration 2.0}

  print  {text "Welcome to Celestia!"  row -3  column 1  duration 3}
  wait   {duration 3.0}
OpenSUSE 12.2 x86_64 & ScientificLinux 6.4 x86_64
Celestia SVN 5217
User avatar
john Van Vliet
 
Posts: 2354
Joined: Wed Aug 28, 2002 3:08 pm

Re: Re-Mapping the "H" key.

Postby daerokos » Sat Oct 22, 2011 12:43 am

john Van Vliet wrote:why not just temporarily edit the "start.cel"

that is what i do


so just edit it with a notepad app? then save it as .cel file extension right.? alright i'll try that thanks.
daerokos
 
Posts: 32
Joined: Sun Sep 25, 2011 1:56 am

Re: Re-Mapping the "H" key.

Postby john Van Vliet » Sat Oct 22, 2011 1:35 am

when i test something i open the start.cel edit it save
then i can go right to it

now a cell url is VERY precise
go to a specific location at a specific time with a specific field of view ... and so on

the start.cel is mostly a "rough " setting


but if all you need is to go to that star ,then it is just fine
OpenSUSE 12.2 x86_64 & ScientificLinux 6.4 x86_64
Celestia SVN 5217
User avatar
john Van Vliet
 
Posts: 2354
Joined: Wed Aug 28, 2002 3:08 pm

Re: Re-Mapping the "H" key.

Postby daerokos » Sat Oct 22, 2011 2:34 am

john Van Vliet wrote:when i test something i open the start.cel edit it save
then i can go right to it

now a cell url is VERY precise
go to a specific location at a specific time with a specific field of view ... and so on

the start.cel is mostly a "rough " setting


but if all you need is to go to that star ,then it is just fine

ok cool thanks alot i'll try creating a cel url like selden said and i'll try editing the start.cel file like you suggested! i'll let you guys know if i have any problems thank you for your help
daerokos
 
Posts: 32
Joined: Sun Sep 25, 2011 1:56 am

Re: Re-Mapping the "H" key.

Postby daerokos » Sat Oct 22, 2011 3:47 pm

i edited my start.cel and oddly enought it makes my celestia load like a million times faster. that's weird. but im not complaining lol
daerokos
 
Posts: 32
Joined: Sun Sep 25, 2011 1:56 am

Re: Re-Mapping the "H" key.

Postby john Van Vliet » Sat Oct 22, 2011 4:56 pm

the default start.cel preloads ALL the Earth and Moon maps during boot
OpenSUSE 12.2 x86_64 & ScientificLinux 6.4 x86_64
Celestia SVN 5217
User avatar
john Van Vliet
 
Posts: 2354
Joined: Wed Aug 28, 2002 3:08 pm


Return to Help Central

Who is online

Users browsing this forum: No registered users and 1 guest