b1scoito / clicker

Advanced Minecraft auto-clicker made in C++
https://github.com/b1scoito/clicker
GNU General Public License v3.0
131 stars 12 forks source link

Is it possible to use this on a mac? #50

Closed ttuleyb closed 5 months ago

ttuleyb commented 1 year ago

As title suggests, I'm trying to use this on a mac. I think the only changes that have to be done are to the mouse API (which is probably most of the program), I'm going to look into it, appreciate if anyone else has info on this.

ttuleyb commented 1 year ago

Upon further consideration, also need to change keyboard APIs and find a way to grab keyboard input while the window isn't focused, which is possible because programs like https://www.murgaa.com/auto-clicker-mac/ exist and works on my mac.

b1scoito commented 1 year ago

First, we would need to port the project to either CMake or Meson, for it to be more flexible on the cross-compilation, alongside with that, use Clang with LLVM, then we would need to change all the functions that use WinAPI functions to a custom macro? that gives the correct function depending on the operating system. This includes to_unicode, send_input, convert_wm_to_mouseeventf, active_window_title, is_self_focused, is_cursor_visible, window_think, https://github.com/b1scoito/clicker/blob/master/clicker/main.cpp#L16, we'd also need to change how ImGui gets initialized, for macOS, for example, we would use Metal ideally or OpenGL for cross-compatibility between *nix and Windows. https://github.com/b1scoito/clicker/blob/master/clicker/menu.cpp#L592, the logger needs to be changed to support that too. Third-party libraries can be used. https://github.com/b1scoito/clicker/blob/master/clicker/console.hpp#L55, The config system still uses an Windows API call: https://github.com/b1scoito/clicker/blob/master/clicker/config.cpp#L6, and the clicker function uses GetAsyncKeyState.

In the end, we just need to wrap all functions around an universal function that executes a certain syscall for each operating system, and change ImGui to support OpenGL in a cross-platform way.

I have thought about making it cross-platform, but I think it would be way easier by rewriting it in Rust.