fix some sticky input bugs hopefully without creating anymore

This commit is contained in:
zeromus 2011-09-11 18:05:49 +00:00
parent 9196e5d1ec
commit 4acbf1e584
1 changed files with 24 additions and 22 deletions

View File

@ -137,28 +137,30 @@ namespace BizHawk.MultiClient
_NewEvents.Add(ie); _NewEvents.Add(ie);
LastState[button] = newState; LastState[button] = newState;
////track the pressed events with modifiers that we send so that we can send corresponding unpresses with modifiers //track the pressed events with modifiers that we send so that we can send corresponding unpresses with modifiers
////this is an interesting idea, which we may need later, but not yet. //this is an interesting idea, which we may need later, but not yet.
////for example, you may see this series of events: press:ctrl+c, release:ctrl, release:c //for example, you may see this series of events: press:ctrl+c, release:ctrl, release:c
////but you might would rather have press:ctr+c, release:ctrl+c //but you might would rather have press:ctr+c, release:ctrl+c
////this code relates the releases to the original presses. //this code relates the releases to the original presses.
//if (newState) //UPDATE - this is necessary for the frame advance key, which has a special meaning when it gets stuck down
//{ //so, i am adding it as of 11-sep-2011
// ModifierState[button] = ie.LogicalButton; if (newState)
//} {
//else ModifierState[button] = ie.LogicalButton;
//{ }
// if (ModifierState[button] != null) else
// { {
// LogicalButton alreadyReleased = ie.LogicalButton; if (ModifierState[button] != null)
// ie = new InputEvent(); {
// ie.LogicalButton = (LogicalButton)ModifierState[button]; LogicalButton alreadyReleased = ie.LogicalButton;
// ie.EventType = InputEventType.Release; ie = new InputEvent();
// if(ie.LogicalButton != alreadyReleased) ie.LogicalButton = (LogicalButton)ModifierState[button];
// _NewEvents.Add(ie); ie.EventType = InputEventType.Release;
// } if(ie.LogicalButton != alreadyReleased)
// ModifierState[button] = null; _NewEvents.Add(ie);
//} }
ModifierState[button] = null;
}
} }
ModifierKey _Modifiers; ModifierKey _Modifiers;