-
Notifications
You must be signed in to change notification settings - Fork 635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Composed binds: the fix broke +toggle binds; some improvements #1827
Comments
I think we should simply
instead of doing teeworlds/src/game/client/components/binds.cpp Lines 39 to 41 in c4fbceb
Am I oversighting anything? |
You're not supposed to use composed binds for +xxx binds. |
Well then, I guess that closes the issue. Otherwise:
My bad, it should stop after triggering a no-modifer +xxx bind, like this: for(int m = 0; m < MODIFIER_COUNT; m++)
{
if(m == 0 && m_aaaKeyBindings[Event.m_Key][0][0] == '+')
{
if(Event.m_Flags&IInput::FLAG_PRESS)
Console()->ExecuteLineStroked(1, m_aaaKeyBindings[Event.m_Key][m]);
if(Event.m_Flags&IInput::FLAG_RELEASE)
Console()->ExecuteLineStroked(0, m_aaaKeyBindings[Event.m_Key][m]);
return true; // always stop after triggering a +xxx bind
}
if(((Mask&(1 << m)) && m_aaaKeyBindings[Event.m_Key][m][0] != 0)
{
// ... |
Reopened the issue - will improve it for the next version. |
How about removing the restriction that pressing a modifier and a bind key don't trigger a bind that isn't bound by a modifier? Cause for modifiers there currently is no such restriction: |
That doesn't sound very good to me. In that case, all keys that are mapped to basic actions (chat, movements, firing, scoreboard, ...) cannot be used in composed binds. In any game I know, binding Ctrl+X does not trigger X, that is not intuitive. What is the benefit?
Yeah, that is not great. That comes from the fact that triple binds like |
You could use basic actions with composed binds. There's no restriction regarding this if it would trigger non and composed binds. |
The code snippet I proposed earlier would fix this by allowing to use composed binds for these actions. You could have some odd case such as:
and it should work properly, without breaking the "you can use composed binds on already single-bound keys" concept. Am I missing something? |
But composed binds wouldn't trigger, even "+" ones, when there's a non-composed "+" one for that key. |
Note: In the controls menus, binding e.g. I have also encountered two people who believed |
Should probably gather all possible bugs/down sides and pick the smallest problem. |
If we don't restrict anything (0.7.1-rc before c4fbceb)
The current approach (0.7.2, strictly no + for composed binds) // skip modifiers for +xxx binds
if(pStr[0] == '+')
Modifier = 0; teeworlds/src/game/client/components/binds.cpp Lines 138 to 148 in 899f9f0
My proposal (#1827 (comment)) for(int m = 0; m < MODIFIER_COUNT; m++)
{
if(m == 0 && m_aaaKeyBindings[Event.m_Key][0][0] == '+')
{
if(Event.m_Flags&IInput::FLAG_PRESS)
Console()->ExecuteLineStroked(1, m_aaaKeyBindings[Event.m_Key][m]);
if(Event.m_Flags&IInput::FLAG_RELEASE)
Console()->ExecuteLineStroked(0, m_aaaKeyBindings[Event.m_Key][m]);
return true; // always stop after triggering a +xxx bind
}
if(((Mask&(1 << m)) && m_aaaKeyBindings[Event.m_Key][m][0] != 0)
{
if(Event.m_Flags&IInput::FLAG_PRESS)
Console()->ExecuteLineStroked(1, m_aaaKeyBindings[Event.m_Key][m]);
if(Event.m_Flags&IInput::FLAG_RELEASE)
Console()->ExecuteLineStroked(0, m_aaaKeyBindings[Event.m_Key][m]);
rtn = true;
}
}
Oy's proposal
The issue I have with this is that composed binds currently expand the range of keys that can be bound, and this kills it. Example: I have soI may be missing something, need to complete. |
The downside is that the composed binds won't trigger like in your examples. Feels like a bug.
|
Ah, I forgot. There is a reason why non-composed
This was an issue in 0.7.1-rc. Another problem:
Doesn't that mean that I'm trying to make a summary/checklist: "bind x +left" and "bind shift+x say hi":
x MUST DO "+left" # standard stuff
"bind x +left" and "bind shift+x say hi":
shift+x BETTER DO "say hi" #but must not interrupt x if x is held down!
"bind shift+q +left":
release shift MUST NOT DO "+left"
"bind shift+k say yes" and "bind k say no":
shift+k MUST DO "say yes"
shift+k MUST NOT DO "say no"
"bind shift+d +toggle cl_dynamic_camera":
shift+d BETTER DO "+toggle cl_dynamic_camera"
"bind q +left" and "unbind shift+q" and "bind lshift emote":
shift+q BETTER DO "+left; emote"
"bind lshift +emote" and "bind shift+x say hi": ? |
bind shift+s +toggle cl_dynamic_camera
no longer works after c4fbceb
Also, I believe we could allow for
bind shift+s +fire
if nothing is bound tos
, only make sure thats
binds that start with+
are always triggered:teeworlds/src/game/client/components/binds.cpp
Lines 138 to 140 in 899f9f0
The text was updated successfully, but these errors were encountered: