This is most definitely an mtr topic, so if it does appear feasible, then that's one less mtr topic

This thread is in no way a commitment on my part to actually follow through and do this, so anyone that actually wants this done, don't get too excited

What is my goal?
From a functional perspective:
- make it possible to configure the keyboard, eg from an xml file
- for example:
<command name="assist" keycombo="a" />
- mousebuttons just become like any other button, they are abstracted away from their original physical source:
<command name="select" keycombo="mouseleft" />
- we could equally well tweak the configuration to be:
<command name="select" keycombo="mouseright" />
- we can have multiple combos for each command:
<command name="translate" keycombo="j" />
<command name="translate" keycombo="mousemiddle" />
- we can have multiple commands for each combo
-> because some commands are context-specific
-> this is where it starts getting very tricky
- also, another very tricky issue, do we have to support simultaneous key-pressed? ie, if a is left and s is back, should "a-s" be both left and back at the same tiime? probably. But, if alt-s is something, and ctrl-alt-s is something else, we don't want ctrl-alt-s to also call the alt-s handler. probably.
maybe we can group certain combinations in mutually exclusive groups, sort of like radio buttons for keycombos?
<command name="forward" keycombo="w" />
<command name="left" keycombo="a" />
<commandgroup type="mutuallyexclusive">
<command name="blah" keycombo="ctrl-b" />
<command name="foo" keycombo="shift-ctrl-b" />
</commandgroup>
or ... random thought, basically we find the combo match that 'eats' the most keys, and then match with all commands with that combo, then repeat for the remaining keys.
That would mean we could do:
<command name="forward" keycombo="w" />
<command name="left" keycombo="a" />
<command name="blah" keycombo="ctrl-a" />
<command name="foo" keycombo="shift-ctrl-a" />
a + w -> fires "left" and "forward"
ctrl + a + w -> fires "blah", but now "ctrl" and "a" are 'eaten', which leaves w, which fires "forward", so: "blah" and "forward"
... ok... but what if we have

<command name="forward" keycombo="w" />
<command name="left" keycombo="a" />
<command name="foo" keycombo="ctrl-b" />
<command name="blah" keycombo="ctrl-a" />
... and ctrl, a and b are down. Should we eat ctrl and b, firing "foo", leaving a, which fires "forward"? :-O
Surely, there are people who have done this before? There must be articles about this on the internet?
From a technical perspective:
- make the input model eventdriven (maybe this is already the case, I haven't looked in any detail yet (or at all, like I say, this thread in no way implies a commitment to do this...)
- the actual mouse position is harder to abstract, and I'm not going to attempt that, it is out of scope for this potential-project
Next steps
- get a list of all current spring keyboard and mouse commands, and to what extent they can be combined.
- add to the list additional desired possible keyboard and mouse commands.
- try to find a configuration file format and combo detecting heuristic which is consistent with these various command combinations.
Edit/update: ok, so it seems that keyboard mappings themselves are already configurable via uikeys.txt, so that solves most of the potential issues, so now all that's left is figuring out how to integrate mouse buttons into the same, or a similar framework. To do: what the issues making this tricky?
Edit: right, looking at uikeys.txt:
- keys are bound to events/actions
- however, some of the actions are called 'mouse1', 'mouse2', ...

- to abstract the mouse away, we'd need to go through each mouse1, mouse2 and mouse3 event and make invidiaul event /actions for each one.
So, the next thing to do is to detail each possible use of a mouse button, which I will attempt to do here:
The actiosn depend on the camera:
Classic Overhead(TA) Style camera:
- left click on unit, main terrain -> select unit
- left click on main terrain -> unselect all units
- right click on main terrain, unit already selected -> give move order to selected units
- left click on unit, minimap -> select unit
- left click on minimap terrain -> unselect all units
- middleclick on minimap terrain -> recentre main terrain on miinimap mouse pos
- middleclick and hold, on minimap terrain -> recentre main terrain on miinimap mouse pos, and continue to recentre as mouse moves
- middleclick, short, on main terrani -> change cursor mode to translate mode (my terminology, maybe a specific spring term for this?)
- middleclick, short, on unit, on main terrani -> change cursor mode to translate mode (my terminology, maybe a specific spring term for this?) (does same thing as clicking on main terrain itself)
- middleclick and hold, on main terrain -> drag main terrain around as mouse moves
- right click on main terrain, no units selected -> does nothiing
- left click on main terrain, no units selected -> does nothing
- right click on minimap, no units selected -> does nothiing
- left click on minimap, no units selected -> does nothing
- drag click on main terrain with left mouse button -> creates a drag rectangle -> on releasing button all units in rectangle are selected
- drag click on minimap with left mouse button -> creates a drag rectangle -> on releasing button all units in rectangle are selected
- left click on unit, main terrain, whilst unit already selected -> unit stays selected, but selection noise recurs
- dragselect on unit, main terrain, whilst unit already selected -> unit stays selected, but selection noise recurs
- ctrl + click on unit, unit not selected -> unit becomes selected
- ctrl + click on unit, unit selected -> unit becomes unselected
- ctrl + click on unit, unit not selected, other units selectd -> unit becomes selected, other units stay selected
- ctrl + click on unit, unit selected, other units selectd -> unit becomes unselected, other units stay selected
- click on unit, other units already seelcted -> unit selected, other units deselected
- unit selected, right click on other unit -> 'guard order' issued to selected unit (mouse cursor was showing 'guard' symbol')
- unit selected (=commander), with constructionorderbox, left click constructionorderbox -> mouse cursor cahnges to a poitner, with the target building hovering underneath the cursor, lets call that 'placement' mode
- unit selected, cursor in 'placement' mode, right-click main terrain -> nothing happens
- unit selected, cursor in 'placement' mode, left-click main terrain -> 'build' order for target building issued to selected units
- unit selected, cursor in 'placement' mode, shift + left-click main terrain -> 'build' order for target building added to build queue of selected units
- unit selected, cursor in 'placement' mode, shift + drag left button over terrain -> 'build' order for target building for all positions along the line (contiguous line of buildings), appended to end of unit's build queue ("line")
- 'placement' mode, shift ctl + drag left button over terrain ->("gridline")
- 'placement' mode, shift ctl alt + drag left button over terrain -> ("pereimter")
- 'placement' mode, shift alt + drag left button over terrain -> ("block")
- 'placement' mode, ctrl shift + left mouse button on unit -> ("wall")
- 'placement' mode, mouse 4 -> 'increasespacing'
- 'placement' mode, mouse 5 -> 'increasespacing'
- unit selected ,cursor in 'placement' mode, left-click constructionorderbox, cursor remains in placement mode, target building changes to newly clickc target building
- unit selected, cursor in 'placement' mode, left-click on illegal build location -> cursor switches away from 'placement' mode (to 'default' mode?), unit remains selected
- factory construction unit selected, left-click constructionorderbox -> 'build' order added to factory's bild queue, cursor stays in 'default'(?) mode
- factory construction unit selected, shift + left-click constructionorderbox -> 5 'build' orders added to factories bulid queue, cursor stays in 'default'(?) mode
- factory construction unit selected, ctrl + left-click constructionorderbox -> 20 'build' orders added to factories bulid queue, cursor stays in 'default'(?) mode
- factory construction unit selected, ctrl shift + left-click constructionorderbox -> 100 'build' orders added to factories bulid queue, cursor stays in 'default'(?) mode
- factory construction unit selected, alt + [ctrl][shift] + left-click constructionorderbox -> 'build' orders added to head of factories bulid queue, cursor stays in 'default'(?) mode
- factory construction unit selected, [ctrl][shift] + right-click constructionorderbox -> 'build' orders removed from head of factories bulid queue, cursor stays in 'default'(?) mode
- factory construction unit selected, right-click other unit -> 'guard' order sent to factory construction unit
- passive unit (solar cell) selected, right-click oother unit -> nothing happens
- mobile attack unit(tank) selected, right-clickc friendly unit -> 'guard' order sent to mobile attack unit
- passive unit (armrad) selected, right-click enemy unit -> nothing happens, also cursor stays a poniter over all units
- mobile attack unit(tank) selected, right-click enemy unit ->'attack' order given to selected units to attack target enemy unit
- factory unit selected, right click enemy unit -> 'moveto' order given to factory (and presumably to constructed units)
- factory unit selected, right click terrain -> 'moveto' order given to factory (and presumably to constructed units)
- ctrl + left click a selectedunit, other units selected -> other units stay selected, selected unit unselected
- ctrl + left click an unselectedunit, other units selected -> other units stay selected, unselected unit selected
- shift + left click a selectedunit, other units selected -> other units stay selected, selected unit stays selected
- shift + left click an unselectedunit, other units selected -> other units stay selected, unselected unit selected
- shift + control + left click units -> works same as control + left click units
- multiple units selected, ctrl + rright click terrain -> issue move order to all units, in such a way that all targets move at the same anglle for the same distance. the reference unit seems to be mobile units at priority.
- multiple units selected, shift + right click terrain -> adds 'moveto' order to order queue
- multiple units selected, drag right mouse button over the terrain -> draws a path along the terrain, issues a 'moveto' order to each unit to go to a different location along the path (wow! :-O )
- mutliple units slected, ctrl + drag right mouse button over the terrain -> does same as for without 'ctrl'
- mutliple untis selcted, shift +drag right mosue button over the terrain -> as for without 'shift', but adds the orders to the end of each unit's order queue
- multiple units sselected, drag left mouse button over the terrain -> creates a selection box, and unselects all units outside of box / selects all inside it
fps camera ('c' mode):
- left mouse button = fire
other cameras:
- left and right mouse button as for ota mode, but middle button effect is different