We already have two people asking for a feature to change the keyboard controls:
https://github.com/NagyD/SDLPoP/issues/180
https://github.com/NagyD/SDLPoP/issues/138
Currently the only way to change controls is to edit the source: https://github.com/NagyD/SDLPoP/blob/ma ... 00.c#L1523
The key assignments could be moved to SDLPoP.ini, but then we'd be expecting people to know the codes for each key. Not good.
To avert this, SDLPoP could ask the user to press the key they want to use, but SDLPoP can write only to SDLPoP.cfg, not SDLPoP.ini.
This is better, but SDLPoP.cfg is reset everytime SDLPoP.ini changes.
What do you think?
Support for remapping the controls?
Re: Support for remapping the controls?
Hm, SDLPoP.ini is human-friendly but maybe not so machine-friendly (for writing/editing), while the cfg file is the reverse... To make the configuration written by SDLPoP persistent, saving it in a text format is probably better than binary, so it doesn't break when there is a new version... But then, if we do that, there are two human-readable configuration files, which makes it even more confusing than it is now (which one should you edit?) But then, maybe the explanation texts in SDLPoP.ini are no longer really necessary anyway, because SDLPoP's menu system already gives explanation on what each of the options do, right? So, we might as well end up with a system where there is no SDLPoP.cfg, and SDLPoP instead rewrites SDLPoP.ini from scratch (without comments?) every time a setting gets changed. And key mappings could just be stored as (hex?) numbers.
Re: Support for remapping the controls?
Working with just SDLPoP.ini and rewriting it from scratch (with comments) would be good.
As a general comment on this subject: SDLPoP.ini should be more aesthetically pleasing and easier to read. Sections could be more clearly marked (for instance with horizontal lines), and IMO each section should start with a single block that contains all comment lines, then an empty line, and then the listing of all (<key> = <value>) settings without comments.
As a general comment on this subject: SDLPoP.ini should be more aesthetically pleasing and easier to read. Sections could be more clearly marked (for instance with horizontal lines), and IMO each section should start with a single block that contains all comment lines, then an empty line, and then the listing of all (<key> = <value>) settings without comments.
Re: Support for remapping the controls?
Maybe in the first step it would be enough to add the remapping functionality first, without any way to save it.
Like in the BBC Master version: viewtopic.php?p=22717#p22717
Next question:
Every control is assigned to at least two keys: arrows and numpad, two shift keys, etc.
Should the user-defined keys replace both of these, or only one of them, or should the user-defined keys behave as an additional set while also keeping the original keysets?
(Another option is to have two keyboard modes, one with the original controls, one with the custom ones. But that might be terribly confusing to the users.)
Anyway, here is my attempt in a new branch: https://github.com/NagyD/SDLPoP/commit/ ... 4e7dda7864
Like in the BBC Master version: viewtopic.php?p=22717#p22717
Next question:
Every control is assigned to at least two keys: arrows and numpad, two shift keys, etc.
Should the user-defined keys replace both of these, or only one of them, or should the user-defined keys behave as an additional set while also keeping the original keysets?
(Another option is to have two keyboard modes, one with the original controls, one with the custom ones. But that might be terribly confusing to the users.)
Anyway, here is my attempt in a new branch: https://github.com/NagyD/SDLPoP/commit/ ... 4e7dda7864