Skip to content

Commit

Permalink
more concise code, fixed spelling error
Browse files Browse the repository at this point in the history
  • Loading branch information
Fish-Sticks committed Sep 5, 2023
1 parent 21db14f commit 3993c0c
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions WheresMyKeyboard/WheresMyKeyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ void updating_thread()

if (MOVE_X || MOVE_Y)
mouse_event(MOUSEEVENTF_MOVE, MOVE_X, MOVE_Y, 0, GetMessageExtraInfo());
if (IS_SCROLL_UP_DOWN)
mouse_event(MOUSEEVENTF_WHEEL, 0, 0, SCROLL_SPEED + SCROLL_OFFSET, GetMessageExtraInfo());
if (IS_SCROLL_DOWN_DOWN)
mouse_event(MOUSEEVENTF_WHEEL, 0, 0, -(SCROLL_SPEED + SCROLL_OFFSET), GetMessageExtraInfo());

if (IS_LEFT_CLICKING == 3)
{
Expand All @@ -168,17 +172,6 @@ void updating_thread()
mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, GetMessageExtraInfo());
}

if (IS_SCROLL_UP_DOWN)
{
// 6 portions of wheel delta to make a full rotate
mouse_event(MOUSEEVENTF_WHEEL, 0, 0, SCROLL_SPEED + SCROLL_OFFSET, GetMessageExtraInfo());
}

if (IS_SCROLL_DOWN_DOWN)
{
mouse_event(MOUSEEVENTF_WHEEL, 0, 0, -(SCROLL_SPEED + SCROLL_OFFSET), GetMessageExtraInfo());
}

MOVE_X = 0;
MOVE_Y = 0;

Expand All @@ -195,7 +188,7 @@ __declspec(dllexport) void setup_hook()
std::printf("Setup global keyboard hook!\n");
}
else
std::printf("Failed to setup keyboard hook! Input may be annoying as arrow keys will trigger actions in the app.\n");
std::printf("Failed to setup keyboard hook! Input may be annoying as movement keys will trigger actions in the app.\n");
}

__declspec(dllexport) void remove_hook()
Expand Down

0 comments on commit 3993c0c

Please sign in to comment.