Re-Mapping the "H" key.

Have a question about using Celestia? Check here first for FAQs and helpful advice.
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.
Topic author
daerokos
Posts: 32
Joined: 25.09.2011
With us: 13 years 2 months

Re-Mapping the "H" key.

Post #1by daerokos » 19.10.2011, 04:32

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?

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Re: Re-Mapping the "H" key.

Post #2by selden » 19.10.2011, 10:30

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

Topic author
daerokos
Posts: 32
Joined: 25.09.2011
With us: 13 years 2 months

Re: Re-Mapping the "H" key.

Post #3by daerokos » 20.10.2011, 10:07

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?

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Re: Re-Mapping the "H" key.

Post #4by selden » 20.10.2011, 12:12

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

Topic author
daerokos
Posts: 32
Joined: 25.09.2011
With us: 13 years 2 months

Re: Re-Mapping the "H" key.

Post #5by daerokos » 20.10.2011, 13:20

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!

Avatar
John Van Vliet
Posts: 2944
Joined: 28.08.2002
With us: 22 years 3 months

Re: Re-Mapping the "H" key.

Post #6by John Van Vliet » 22.10.2011, 01:36

--- edit ---
Last edited by John Van Vliet on 19.10.2013, 06:34, edited 1 time in total.

Topic author
daerokos
Posts: 32
Joined: 25.09.2011
With us: 13 years 2 months

Re: Re-Mapping the "H" key.

Post #7by daerokos » 22.10.2011, 07:43

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.

Avatar
John Van Vliet
Posts: 2944
Joined: 28.08.2002
With us: 22 years 3 months

Re: Re-Mapping the "H" key.

Post #8by John Van Vliet » 22.10.2011, 08:35

--- edit ---
Last edited by John Van Vliet on 19.10.2013, 06:32, edited 1 time in total.

Topic author
daerokos
Posts: 32
Joined: 25.09.2011
With us: 13 years 2 months

Re: Re-Mapping the "H" key.

Post #9by daerokos » 22.10.2011, 09:34

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

Topic author
daerokos
Posts: 32
Joined: 25.09.2011
With us: 13 years 2 months

Re: Re-Mapping the "H" key.

Post #10by daerokos » 22.10.2011, 22:47

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

Avatar
John Van Vliet
Posts: 2944
Joined: 28.08.2002
With us: 22 years 3 months

Re: Re-Mapping the "H" key.

Post #11by John Van Vliet » 22.10.2011, 23:56

--- edit ---


Return to “Help Central”