MCPcopy Create free account
hub / github.com/ChiyukiGana/Quickinput / QiState

Function QiState

source/src/trigger.cpp:161–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159#endif
160 }
161 }
162 }
163 void QiState(bool state)
164 {
165 srand(clock());
166 if (state)
167 {
168 Qi::curBlock = 0;
169 memset(Qi::keyBlock, 0, sizeof(Qi::keyBlock));
170 Qi::macroActive.clear();
171 for (auto& g : Qi::macroGroups)
172 {
173 for (auto& m : g.macros)
174 {
175 if (m.state && (m.key1 || m.key2))
176 {
177 if (m.keyBlock)
178 {
179 if (m.key1) Qi::keyBlock[m.key1] = true;
180 if (m.key2) Qi::keyBlock[m.key2] = true;
181 }
182 m.range = { 0,0,10000,10000 };
183 Qi::macroActive.append(&m);
184 }
185 }
186 }
187
188 Qi::state = true;
189 if (Qi::fun.wndActive.state) { if (!Qi::fun.wndActive.thread.active()) Qi::fun.wndActive.thread.start(); }
190 else Qi::run = true;
191 if (Qi::set.showTips && !Qi::ui.pop.qe.t.isEmpty()) QiFn::StatePop(true);
192 if (Qi::set.audFx) QiFn::SoundPlay(Qi::ui.pop.qe.s, false);
193 }
194 else
195 {
196 Qi::state = false, Qi::run = false;
197 if (Qi::fun.wndActive.state) { if (Qi::fun.wndActive.thread.active()) Qi::fun.wndActive.thread.stop(); }
198 if (Qi::set.showTips && !Qi::ui.pop.qd.t.isEmpty()) QiFn::StatePop(false);
199 if (Qi::set.audFx) QiFn::SoundPlay(Qi::ui.pop.qd.s, false);
200 QiScriptInterpreter::clearMutex();
201 }
202 }
203 void UnBlock()

Callers 4

TriggerFunction · 0.85
eventMethod · 0.85
EventMethod · 0.85
eventMethod · 0.85

Calls 7

StatePopFunction · 0.85
SoundPlayFunction · 0.85
clearMethod · 0.45
appendMethod · 0.45
activeMethod · 0.45
startMethod · 0.45
stopMethod · 0.45

Tested by

no test coverage detected