Skip to content

Commit

Permalink
always add to click log
Browse files Browse the repository at this point in the history
  • Loading branch information
GameParrot committed Dec 25, 2024
1 parent 502a95d commit b779f74
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 2 additions & 6 deletions src/dcblock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ int32_t DCBlock::getButtonState(const AInputEvent* t) {
if(Conf::enabled) {
if(i & 1) {
if(!leftPrevious) {
if(Conf::showLogWindow) {
gui.addClick(1, currentEpochTime - omsLeft <= Conf::threshold);
}
gui.addClick(1, currentEpochTime - omsLeft <= Conf::threshold);
if(currentEpochTime - omsLeft > Conf::threshold) {
if(Conf::logClicks) {
__android_log_print(0, "DCBlock", "[■ ] Mouse down");
Expand All @@ -47,9 +45,7 @@ int32_t DCBlock::getButtonState(const AInputEvent* t) {
}
if(i & 2) {
if(!rightPrevious && Conf::blockRightDc) {
if(Conf::showLogWindow) {
gui.addClick(2, currentEpochTime - omsRight <= Conf::threshold);
}
gui.addClick(2, currentEpochTime - omsRight <= Conf::threshold);
if(currentEpochTime - omsRight > Conf::threshold) {
if(Conf::logClicks) {
__android_log_print(0, "DCBlock", "[ ■] Mouse down");
Expand Down
4 changes: 3 additions & 1 deletion src/imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ void ImGUIOptions::initImgui() {
void ImGUIOptions::addClick(int button, bool supressed) {
std::string newStr = (button == 1 ? "[Left] " : "[Right] ") + std::string((supressed ? "Supressed a DC" : "Mouse down"));
clickLog = newStr + "\n" + clickLog;
updateLogWindow();
if(Conf::showLogWindow) {
updateLogWindow();
}
}

void ImGUIOptions::updateLogWindow() {
Expand Down

0 comments on commit b779f74

Please sign in to comment.