diff --git a/BH/Modules/ScreenInfo/ScreenInfo.cpp b/BH/Modules/ScreenInfo/ScreenInfo.cpp index 4c8b464c..d4e6cede 100644 --- a/BH/Modules/ScreenInfo/ScreenInfo.cpp +++ b/BH/Modules/ScreenInfo/ScreenInfo.cpp @@ -41,6 +41,20 @@ void ScreenInfo::OnGameJoin(const string& name, const string& pass, int diff) { startLevel = (int)D2COMMON_GetUnitStat(pUnit, STAT_LEVEL, 0); } +void ScreenInfo::OnKey(bool up, BYTE key, LPARAM lParam, bool* block) { + for (map::iterator it = Toggles.begin(); it != Toggles.end(); it++) { + if (key == (*it).second.toggle) { + *block = true; + if (up) { + (*it).second.state = !(*it).second.state; + } + return; + } + } + return; +} + + // Right-clicking in the chat console pastes from the clipboard void ScreenInfo::OnRightClick(bool up, int x, int y, bool* block) { if (up) diff --git a/BH/Modules/ScreenInfo/ScreenInfo.h b/BH/Modules/ScreenInfo/ScreenInfo.h index cf029901..68154036 100644 --- a/BH/Modules/ScreenInfo/ScreenInfo.h +++ b/BH/Modules/ScreenInfo/ScreenInfo.h @@ -50,6 +50,7 @@ class ScreenInfo : public Module { startExperience(0), startLevel(0) {}; void OnLoad(); + void OnKey(bool up, BYTE key, LPARAM lParam, bool* block); void OnGameJoin(const string& name, const string& pass, int diff); void OnGameExit();