Celestia icon indicating copy to clipboard operation
Celestia copied to clipboard

Disable Demo binding

Open eirnym opened this issue 2 years ago • 19 comments

Is your feature request related to a problem? Please describe.

Thank you for a demo mode around our Solar System. Let's say I travel through space and accidentally hit D... and you're suddenly near the Earth trying to guess a key how to stop it. This make me frustrated and could potentially turn away from using the application

Describe the solution you'd like

Demo mode is nice, and it should be a way in preferences at least to disable demo key. Placing it in Celectia menu make it unbindable even by macOS settings. I'd use this key for another more useful action.

Describe alternatives you've considered Alternatively, remove binding to demo at all. During normal operation you won't run demo for many times. If a developer actually does, macOS supplies a way to bind a menu in System Settings.app.

Additional context Add any other context or screenshots about the feature request here.

eirnym avatar Nov 19 '21 23:11 eirnym

You can disable the demo script by commenting out the DemoScript line in celestia.cfg. That is, change DemoScript "demo.cel" to # DemoScript "demo.cel"

SevenSpheres avatar Nov 19 '21 23:11 SevenSpheres

@eirnym I've also been looking into using a StreamDeck with Celestia.

This allows launching & shortcuts to be programmed into buttons with custom graphics.

So it can take away the need to remember all the key commands, and also any possibility of pressing the wrong one (not only demo).

alcomposer avatar Nov 19 '21 23:11 alcomposer

I'd prefer to have it with no binding by default or if it could be disabled in the app preferences

eirnym avatar Nov 19 '21 23:11 eirnym

@SevenSpheres In this answer I like that this app is scriptable to make it modded. But UX should be by default, not scriptable.

As a person who opens the app for the first time and wants just to have some fun and compare to other similar apps, this answer looks like "we won't do this app more user friendly just because you can write a script it".

eirnym avatar Nov 19 '21 23:11 eirnym

@alcomposer System Preferences are default macOS solution and it's better for menus, but apparently not this one

eirnym avatar Nov 19 '21 23:11 eirnym

You don't have to write a script to disable the demo, you just edit an already existing file to add one #. If this is really too hard for people to do, and if most users prefer to not have the keybinding, maybe the line could be commented by default.

SevenSpheres avatar Nov 19 '21 23:11 SevenSpheres

I think for someone that opens the app for the first time, having a demo available is actually very good.

Possibly it doesn't need a binding, being in the scripts folder would be enough I think.

But then again, having an example how to bind is useful no?

alcomposer avatar Nov 20 '21 00:11 alcomposer

@alcomposer yes, demo is very good for first impression, I agree.

And very carefully placed key binding where around you have bindings for speed and other stuff will ruin all impression, because after this 5 minute demo you'll want to dive into the GUI itself

eirnym avatar Nov 20 '21 00:11 eirnym

@SevenSpheres Yeah, I agree. It's easy for you as a developer of this application or at least a power user. It's a pretty huge gap from a first 20 minutes impression and starting to be a power user as you are. Also I suppose, that you're not working on macOS as macOS users usually don't go inside application bundle and edit resources here without a very important reason. Usually all these settings are pulled out or configured elsewhere.

eirnym avatar Nov 20 '21 00:11 eirnym

@SevenSpheres returning to your suggestion to edit a specific configuration file and all files around. There's nothing told about key bindings. Your edit suggests to make demo no-op, not disabling a key binding, which I'm not asking for.

during deeper analysis of configuration files, I suppose all bindings are located in binary nib files, which you can't change.

eirnym avatar Nov 20 '21 00:11 eirnym

Yeah, I agree. It's easy for you as a developer of this application or at least a power user. It's a pretty huge gap from a first 20 minutes impression and starting to be a power user as you are. Also I suppose, that you're not working on macOS as macOS users usually don't go inside application bundle and edit resources here without a very important reason. Usually all these settings are pulled out or configured elsewhere.

I'm sure virtually all Celestia users, on any system, have edited the resources. It's how you add objects, textures, etc (usually by simply moving files into the extras folder). If you want to be able to modify and customize Celestia without ever editing the resources at all, that would require some pretty massive changes which are out of the scope of this issue.

returning to your suggestion to edit a specific configuration file and all files around. There's nothing told about key bindings. Your edit suggests to make demo no-op, not disabling a key binding, which I'm not asking for.

Commenting out the DemoScript line does disable the keybinding, at least on Windows. I checked to make sure. I suppose it's possible that it doesn't work on macOS - @alcomposer @levinli303 @LukeCEL could you test this?

SevenSpheres avatar Nov 20 '21 00:11 SevenSpheres

It's worth noting that a large amount of Celestia's user base uses it for fictional worldbuilding, which necessarily involves modifying the resources. Without being able to do so, things like these wouldn't exist. What you see as a bug is actually a feature for many people.

SevenSpheres avatar Nov 20 '21 01:11 SevenSpheres

@SevenSpheres maybe you're right about editing files for many users, but it's still a gap between power users who edit scrips, add data and textures and users who just want to use the app as it is. I downloaded this app to compare, not to be a power user from minute 0.

Returning to your suggestion, yes, it disables the demo entirely, which I don't want to. As you see in https://github.com/CelestiaProject/Celestia/blob/master/demo.cel or https://github.com/CelestiaProject/Celestia/blob/master/celestia.cfg theres' no bindings specified there. So I'm not sure that this suggestion of yours is actually working.

BTW, bindings are specified in code itself here

eirnym avatar Nov 20 '21 01:11 eirnym

I'm not against demo as I see you perceive this. I'm against binding and disability to disable this binding

eirnym avatar Nov 20 '21 01:11 eirnym

There are two ways to run the demo script: pressing the D key or running it from the "Open Script" menu. As far as I know, you want to disable the former (so nothing happens on pressing D) while keeping the latter. At least on Windows, commenting out the DemoScript line does do this.

SevenSpheres avatar Nov 20 '21 01:11 SevenSpheres

When you disable line as per suggestion, Demo will be entirely disabled, and this is not a good thing.

BTW, I'm ok even with config like configuration like vim, mpv, or kitty. preferably inside my $XDG_CONFIG folder. I'm not a fan to go to /usr/share in linux or Celestia.app or C:\Program Files and edit internal staff without urgent need

eirnym avatar Nov 20 '21 01:11 eirnym

also I'm against your solution

eirnym avatar Nov 20 '21 01:11 eirnym

Oh, there's also a "Run Demo" menu option that I had forgotten about... Okay, so you want to disable the keybinding without disabling this menu option. I guess that's reasonable.

SevenSpheres avatar Nov 20 '21 01:11 SevenSpheres

@eirnym you haven't written what Celestia version you use. As you're talking about a bundle I assume it's 1.6.2. This version provides a dialog for choosing celestia.cfg (don't ask me to tell how to invoke it as i'm not a apple user). The way suggested by @SevenSpheres is not the best workaround. I can suggest better one with a LUA hook.

  1. Create a file "hook.lua" with the following content:
function unbind(self)
    return true
end

keys = {
    d = unbind,
    D = unbind,
}

hook = {
    charentered = function(self, ch)
        fun = keys[ch]
        if fun then
            return fun(self)
        end
        return false
    end,
}

celestia:setluahook(hook)
  1. Copy default celestia.cfg somewhere.
  2. Edit the copy: find LuaHook option in it and update it into LuaHook "~/my/Celestia/hook.lua". Of course, use your path to hook.lua.
  3. Update the celestia.cfg location using aforementioned dialog.

If you decide to use version 1.7 then instead of copying and editing default celestia.cfg you can create a dotfile inside your home directory (.celestia.cfg) with the following content:

Configuration
{
LuaHook "~/my/Celestia/hook.lua"
}

375gnu avatar Nov 24 '21 21:11 375gnu