File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -91,11 +91,11 @@ set_target_properties(dinput8_skyrim PROPERTIES
9191# Deployment for Skyrim
9292if (BIN_OUTPUT_DIR)
9393 add_custom_command (TARGET dinput8_skyrim POST_BUILD
94- COMMAND ${CMAKE_COMMAND } -E make_directory "${BIN_OUTPUT_DIR} /skyrim "
94+ COMMAND ${CMAKE_COMMAND } -E make_directory "${BIN_OUTPUT_DIR} /d3d9_skyrim "
9595 COMMAND ${CMAKE_COMMAND } -E copy_if_different
9696 "$<TARGET_FILE :dinput8_skyrim >"
97- "${BIN_OUTPUT_DIR} /skyrim /dinput8.dll"
98- COMMENT "Copying Skyrim D3D9 proxy to skyrim /dinput8.dll"
97+ "${BIN_OUTPUT_DIR} /d3d9_skyrim /dinput8.dll"
98+ COMMENT "Copying Skyrim D3D9 proxy to d3d9_skyrim /dinput8.dll"
9999 )
100100endif ()
101101
Original file line number Diff line number Diff line change @@ -120,6 +120,29 @@ void OverlayRenderer::NewFrame() {
120120
121121 ImGui_ImplDX9_NewFrame ();
122122 ImGui_ImplWin32_NewFrame ();
123+
124+ if (m_visible && m_hWnd) {
125+ POINT cursorPos;
126+ if (GetCursorPos (&cursorPos)) {
127+ ScreenToClient (m_hWnd, &cursorPos);
128+ io.AddMousePosEvent ((float )cursorPos.x , (float )cursorPos.y );
129+ }
130+ // Poll button state and feed it through the event queue
131+ io.AddMouseButtonEvent (0 , (GetAsyncKeyState (VK_LBUTTON ) & 0x8000 ) != 0 );
132+ io.AddMouseButtonEvent (1 , (GetAsyncKeyState (VK_RBUTTON ) & 0x8000 ) != 0 );
133+ io.AddMouseButtonEvent (2 , (GetAsyncKeyState (VK_MBUTTON ) & 0x8000 ) != 0 );
134+ // Draw ImGui's own cursor on top – mirrors Community Shaders behaviour.
135+ // The game cursor can be hidden in certain states (in-game, menus with
136+ // hardware cursor hidden), so ImGui's software cursor is more reliable.
137+ io.MouseDrawCursor = true ;
138+ } else {
139+ io.MouseDrawCursor = false ;
140+ }
141+
142+ if (!m_visible) {
143+ io.ClearInputKeys ();
144+ }
145+
123146 ImGui::NewFrame ();
124147}
125148
You can’t perform that action at this time.
0 commit comments