From 7295a38386d9c06b209cc2d763eb783b0db114c3 Mon Sep 17 00:00:00 2001 From: Bartek Bok Date: Tue, 28 Feb 2012 00:19:24 +0100 Subject: [PATCH] We now filter WM_CHARs containing control codes, so ignoring them in gui code is useless (even harmful) --- .../FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.cpp | 15 --------------- .../FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.h | 2 +- .../pfGameGUIMgr/pfGUIMultiLineEditCtrl.cpp | 14 -------------- .../pfGameGUIMgr/pfGUIMultiLineEditCtrl.h | 2 +- 4 files changed, 2 insertions(+), 31 deletions(-) diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.cpp b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.cpp index ea225a10..b87da3e2 100644 --- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.cpp +++ b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.cpp @@ -72,7 +72,6 @@ pfGUIEditBoxMod::pfGUIEditBoxMod() { SetFlag( kWantsInterest ); SetFlag( kTakesSpecialKeys ); - fIgnoreNextKey = false; fEscapedFlag = false; fFirstHalfExitKeyPushed = false; fSpecialCaptureKeyEventMode = false; @@ -241,13 +240,6 @@ hsBool pfGUIEditBoxMod::HandleKeyPress( wchar_t key, uint8_t modifiers ) if( fBuffer == nil ) return false; - if( fIgnoreNextKey ) - { - // So we don't process keys that already got handled by HandleKeyEvent() - fIgnoreNextKey = false; - return true; - } - int i = wcslen( fBuffer ); // Insert character at the current cursor position, then inc the cursor by one @@ -330,7 +322,6 @@ hsBool pfGUIEditBoxMod::HandleKeyEvent( pfGameGUIMgr::EventType event, plKeyDef // done capturing... tell the handler DoSomething(); } - fIgnoreNextKey = true; fFirstHalfExitKeyPushed = false; return true; } @@ -412,13 +403,7 @@ hsBool pfGUIEditBoxMod::HandleKeyEvent( pfGameGUIMgr::EventType event, plKeyDef } } } - else - { - fIgnoreNextKey = false; - return true; - } - fIgnoreNextKey = true; IUpdate(); return true; } diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.h b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.h index d0f1e609..4da5ba9a 100644 --- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.h +++ b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.h @@ -66,7 +66,7 @@ class pfGUIEditBoxMod : public pfGUIControlMod wchar_t *fBuffer; uint32_t fBufferSize, fCursorPos; int32_t fScrollPos; - hsBool fIgnoreNextKey, fEscapedFlag; + hsBool fEscapedFlag; hsBool fFirstHalfExitKeyPushed; hsBool fSpecialCaptureKeyEventMode; diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIMultiLineEditCtrl.cpp b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIMultiLineEditCtrl.cpp index 959b7d6d..34de5b6e 100644 --- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIMultiLineEditCtrl.cpp +++ b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIMultiLineEditCtrl.cpp @@ -151,7 +151,6 @@ pfGUIMultiLineEditCtrl::pfGUIMultiLineEditCtrl() fLastCursorLine = 0; fBuffer.Append( 0L ); fBufferLimit = -1; - fIgnoreNextKey = false; fScrollControl = nil; fScrollProc = nil; fScrollPos = 0; @@ -1036,13 +1035,6 @@ hsBool pfGUIMultiLineEditCtrl::HandleKeyPress( wchar_t key, uint8_t modifiers ) if ((fPrevCtrl || fNextCtrl) && (fLineStarts.GetCount() <= GetFirstVisibleLine())) return true; // we're ignoring if we can't actually edit our visible frame (and we're linked) - if( fIgnoreNextKey ) - { - // So we don't process keys that already got handled by HandleKeyEvent() - fIgnoreNextKey = false; - return true; - } - // Store info for the event we're about to send out fLastKeyModifiers = modifiers; fLastKeyPressed = key; @@ -1134,13 +1126,7 @@ hsBool pfGUIMultiLineEditCtrl::HandleKeyEvent( pfGameGUIMgr::EventType event, p // fEscapedFlag = true; DoSomething(); // Query WasEscaped() to see if it was escape vs enter } - else - { - fIgnoreNextKey = false; - return true; - } - fIgnoreNextKey = true; return true; } else diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIMultiLineEditCtrl.h b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIMultiLineEditCtrl.h index c73f5f85..9bf81757 100644 --- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIMultiLineEditCtrl.h +++ b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIMultiLineEditCtrl.h @@ -100,7 +100,7 @@ class pfGUIMultiLineEditCtrl : public pfGUIControlMod hsTArray fLineStarts; uint16_t fLineHeight, fCurrCursorX, fCurrCursorY; int32_t fCursorPos, fLastCursorLine; - hsBool fIgnoreNextKey, fReadyToRender; + hsBool fReadyToRender; hsBounds3Ext fLastP2PArea; int8_t fLockCount; uint8_t fCalcedFontSize; // The font size that we calced our line height at