Configurable keyboard shortcuts

Registered by Bogdan Marinov

At the moment, all of Stellarium's keyboard shortcuts are hard-coded. Unfortunately, this creates problems with different keyboard layouts and locales. It would be nice to have an easy and intuitive GUI for modifying keyboard shortcuts.

The solution should also provide for the fact that plug-ins can also define shortcuts.

Blueprint information

Status:
Complete
Approver:
None
Priority:
Medium
Drafter:
None
Direction:
Needs approval
Assignee:
None
Definition:
Discussion
Series goal:
None
Implementation:
Implemented
Milestone target:
None
Started by
Alexander Wolf
Completed by
Alexander Wolf

Related branches

Sprints

Whiteboard

I've created a simple example implementation as a plug-in:
http://stellarium.svn.sourceforge.net/viewvc/stellarium/trunk/extmodules/KeyBindings/
-- Bogdan Marinov

This method of changing the bindings will not work. There is no way to group the bindings by area (plugin, etc), and the bindings for the plugins are not available until the plugin is loaded (this isn't a requirement, but how most are written).

What I'd like to propose is the following:

1) each plugin (and the app itself) would create a text file that is a map of action name to keybinding. This file would get compiled into the the resource bundle. This could be in JSON format, as this is a format already supported by the app.

2) when the app starts, StelModuleMgr would load all of these files, and store them in a single, unified map-of-maps. It would make these maps available to a UI. The initial store would only be preformed once per module, with logic to determine if the module has changed their bindings. This way, when bindings are added or removed, they would be detected, and the global map would be updated with the changes.

3) a UI would be written to display the maps in a grouped fashion, and handle issues like duplicate bindings, and the like. Modifications would them be saved back to this global file.

4) when a module goes to create it's actions, it would query StelModuleMgr for it's map of bindings. This map would be used to look up the action name, and return the string that is the key binding to use.

I think this over all approach should cover about all of the issues that would arise. It allows for all actions to be handled, not just the ones that have been created by the time the mapping editor is started. It allows for grouping by module, and is extensible. It also removes from the developer the task of finding empty bindings for new actions.

-- Timothy Reaves

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.