Skip to content

Commit

Permalink
Rework of Key Select dialog to clarify what's possible.
Browse files Browse the repository at this point in the history
Partially because of my misunderstanding of what's possible in-game, and
partially because of the way I implemented it, the Key Select dialog has
up until now been capable of creating keybinds that don't work as
intended in the game.  This release addresses this problem.

-- The game simply does not honor multiple "chord" keys in a bind, so
eg "SHIFT+CTRL+R" would be bound as "SHIFT+CTRL" instead.  Only two keys
can be used in a bind, and any bind attempting to do more will only bind
the first two in the keybind string.

-- The split of, for instance, "LSHIFT" and "RSHIFT" only work in
isolation or on the right-hand side of a keybind.  That is to say,
"LCTRL+R" will bind "CTRL+R" and fire no matter which Control key is
used, since the "LCTRL" is on the left-hand side of the bindstring.
Binds like "LSHIFT" or "ALT+RCTRL" work as expected.

This release updates the logic of the keybind dialog so that it makes
every effort to honor these limitations.  It's been pretty rigorously
tested, but it's probably possible to fool it into something strange
with enough fiddling.  If you manage to get a weird string into the
keybind window (I've seen, for instance, "ALT+ALT"), BindControl will
happily write it to the bindfiles and you may have weirdness in-game.
Don't do that.  If this proves to be an ongoing problem, I might
implement sanity-checking at write-binds time.

In general, if you're just mashing "CTRL+5" or something, it should work
flawlessly.

If you're trying to make a controller bind, and the dialog gets its
state stuck, just tap a key on the keyboard and then try the controller
bind again.

I realize this release note is a small novel, but there's a lot going on
under the hood here.  Please file issues for any problems you find.
  • Loading branch information
emersonrp committed Jun 16, 2024
2 parents b3781a4 + 3f35ea1 commit 1a4f928
Show file tree
Hide file tree
Showing 4 changed files with 182 additions and 115 deletions.
5 changes: 3 additions & 2 deletions Help/Manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ <h3>Preferences</h3>
<p>Various of the keybind systems generated by BindControl, most especially the Speed on Demand binds, load other bindfiles with every keystroke. Depending on CPU usage and server lag, it's theoretically possible to get binds stuck in a strange state, leading to behavior like powers not turning off or movement continuing after a key is released. This happens less in the 2020s than it did when the game was new, but just in case, the Binds Reset Key will reset all BindControl binds to their initially-loaded state and stop all movement.</p>

<p><u>Bind left and right modifier keys separately</u></p>
<p>While typically keybinds with modifier keys are of the form <code>SHIFT+R</code>, for instance, City of Heroes supports separate binds for the left and right modifier keys, ie, making <code>LSHIFT+R</code> a different keybind than <code>RSHIFT+R</code>. This historically can work a little strangely, or not at all, inside City of Heroes, so the feature is considered experimental and is off by default.</p>

<p>City of Heroes supports separate binds for the left and right modifier keys (SHIFT, ALT, and CTRL) when they are used alone or in the "right-hand" position with another modifier key, eg, just "LSHIFT" or "ALT+RCTRL."</p>
<p>Binding "LCTRL+R" does not work, and doing so manually in-game will simply bind "CTRL+R" -- this is how the game is implemented and is out of BindControl's influence. The left versus right modifier keys are only treated separately on the "right-hand" side of a bind.</p>
<p>This is a fiddly scheme but BindControl attempts to support it, so this preference is here, and sets up the Key Binder dialog to honor left versus right modifier keys in the "right-hand" position of a keybind.</p>
<p>It can also be toggled on or off when binding a key, if you want to mix and match your side-specific and side-agnostic keybinds. This is not super recommended, but you do you.</p>

<p><u>Set all binds to default before reapplying</u></p>
Expand Down
16 changes: 8 additions & 8 deletions Page/InspirationPopper.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ def __init__(self, parent):
'SingleBreakFreeKey' : "SHIFT+E",
'SingleResistDamageKey' : "SHIFT+SPACE",
'SingleResurrectionKey' : "SHIFT+TILDE",
'SingleRevAccuracyKey' : "SHIFT+CTRL+A",
'SingleRevHealthKey' : "SHIFT+CTRL+S",
'SingleRevDamageKey' : "SHIFT+CTRL+D",
'SingleRevEnduranceKey' : "SHIFT+CTRL+Q",
'SingleRevDefenseKey' : "SHIFT+CTRL+W",
'SingleRevBreakFreeKey' : "SHIFT+CTRL+E",
'SingleRevResistDamageKey' : "SHIFT+CTRL+SPACE",
'SingleRevResurrectionKey' : "SHIFT+CTRL+TILDE",
'SingleRevAccuracyKey' : "",
'SingleRevHealthKey' : "",
'SingleRevDamageKey' : "",
'SingleRevEnduranceKey' : "",
'SingleRevDefenseKey' : "",
'SingleRevBreakFreeKey' : "",
'SingleRevResistDamageKey' : "",
'SingleRevResurrectionKey' : "",
})

def BuildPage(self):
Expand Down
Loading

0 comments on commit 1a4f928

Please sign in to comment.