Skip to content

Commit 181f337

Browse files
authored
Initial commit
1 parent 8d0b703 commit 181f337

File tree

3 files changed

+5
-17
lines changed

3 files changed

+5
-17
lines changed

server/CMakeLists.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
55

66
# If find_package doesn't find wxWidgets, try settings the LIB_DIR or (and) the ROOT_DIR manually
77
if(WIN32)
8-
set(wxWidgets_LIB_DIR $ENV{WXWIN}/lib/gcc_dll)
8+
# set(wxWidgets_LIB_DIR $ENV{WXWIN}/lib/gcc_dll)
99
# set(wxWidgets_ROOT_DIR $ENV{WXWIN})
1010
endif()
1111

@@ -25,6 +25,9 @@ if(WIN32)
2525
else()
2626

2727
set(SRC_FILES ${SRC_FILES} src/input/LinuxInputManager.cpp)
28+
29+
# Set this if you downloaded the asio library
30+
# set(ASIO_PATH <path_to_your_asio>)
2831

2932
endif()
3033

server/include/input/LinuxInputManager.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ namespace InputManager
9696
uinput_setup usetup;
9797

9898
/**
99-
* Transforms a char to a win32 keycode
99+
* Transforms a char to a unix keycode
100100
* https://github.com/torvalds/linux/blob/master/include/uapi/linux/input-event-codes.h
101101
*/
102102
int parse_char(char c, bool &shiftPressed);

server/src/input/WindowsInputManager.cpp

-15
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ namespace InputManager
5252
input.mi.dwFlags = MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP;
5353

5454
SendInput(1, &input, sizeof(INPUT));
55-
56-
//mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
5755
}
5856

5957
void Windows::right_click()
@@ -67,11 +65,6 @@ namespace InputManager
6765

6866
void Windows::move(int dx, int dy)
6967
{
70-
/*GetCursorPos(&pCursor);
71-
SetCursorPos(pCursor.x + dx, pCursor.y + dy);*/
72-
73-
//mouse_event(MOUSEEVENTF_MOVE, dx, dy, 0, 0);
74-
7568
INPUT input = {};
7669
input.type = INPUT_MOUSE;
7770
input.mi.dwFlags = MOUSEEVENTF_MOVE;
@@ -89,8 +82,6 @@ namespace InputManager
8982
input.mi.mouseData = (int)(10 * (scroll_amount * (SCROLL_SENSITIVITY / 10.0)));
9083

9184
SendInput(1, &input, sizeof(INPUT));
92-
93-
//mouse_event(MOUSEEVENTF_WHEEL, 0, 0, scroll_amount * 10, 0);
9485
}
9586

9687
void Windows::down()
@@ -100,8 +91,6 @@ namespace InputManager
10091
input.mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
10192

10293
SendInput(1, &input, sizeof(INPUT));
103-
104-
//mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
10594
}
10695

10796
void Windows::up()
@@ -112,14 +101,10 @@ namespace InputManager
112101
input.mi.dwFlags = MOUSEEVENTF_LEFTUP;
113102

114103
SendInput(1, &input, sizeof(INPUT));
115-
116-
//mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
117104
}
118105

119106
void Windows::send_key(char c)
120107
{
121-
std::cout << c << "\n";
122-
123108
INPUT inputs[4] = {};
124109
ZeroMemory(inputs, sizeof(inputs));
125110

0 commit comments

Comments
 (0)