minecraft-access icon indicating copy to clipboard operation
minecraft-access copied to clipboard

Mouse simulation issue on macOS

Open onion108 opened this issue 1 year ago • 10 comments

I helped my blind friend to modify this mod so that he can read and operate with the history messages using LALT+UP/DOWN/RIHGT/ENTER. While I'm working with the code, I find a problem that the mouse simulation doesn't work on macOS, and that's because it only detects Windows and Linux, but macOS won't be recognized as any of them, so mouse simulation simply doesn't work without any error messages. That may confuse those blind users who uses macOS.

onion108 avatar Apr 29 '23 01:04 onion108

History messages?? Are you talking about the chat messages then I've already patched that, you can use alt + number key to speak the last 9 messages. I actually don't own a mac so I can't really work on that bit. Sorry.

khanshoaib3 avatar Apr 30 '23 08:04 khanshoaib3

@onion108 Any update??

khanshoaib3 avatar Jun 19 '23 14:06 khanshoaib3

that's because it only detects Windows and Linux, but macOS won't be recognized as any of them, so mouse simulation simply doesn't work without any error messages

Can you specify it cleanly which part of code you've found that has problem? Currently only InventoryControls has mouse key simulation and perhaps you're referring this part of code?

https://github.com/khanshoaib3/minecraft-access/blob/ee82d1ca0f9b36067e07bcf5d49c0ba9b15c6927/common/src/main/java/com/github/khanshoaib3/minecraft_access/utils/KeyBindingsHandler.java#L328-L342

boholder avatar Jun 20 '23 10:06 boholder

I'm referring to this:

https://github.com/khanshoaib3/minecraft-access/blob/ee82d1ca0f9b36067e07bcf5d49c0ba9b15c6927/common/src/main/java/com/github/khanshoaib3/minecraft_access/utils/MouseUtils.java#L42-L60

and this part as well:

https://github.com/khanshoaib3/minecraft-access/blob/ee82d1ca0f9b36067e07bcf5d49c0ba9b15c6927/common/src/main/java/com/github/khanshoaib3/minecraft_access/utils/MouseUtils.java#L84-L191

They only handle the operation for Linux and Windows, but on macOS neither OsUtils.isLinux() nor OsUtils.isWindows() returns true, resulting in doing nothing.

Another caution is that xdotools isn't available for macOS because Minecraft doesn't run under X11 on macOS, so it may be necessary to find another way to simulate mouse operations on macOS.

onion108 avatar Jun 22 '23 05:06 onion108

Yeah, we will have to look into this. Thanks for bringing this up.

khanshoaib3 avatar Jun 22 '23 06:06 khanshoaib3

There might be more things to do for compatibility with macOS. For example, I found out that the Narrator does not have a macOS version...... the Narrator calls native API so I guess currently the "interrupting narration" feature won't work on macOS.

@onion108 Would you please help us on this? I'm using Windows while Shoabi uses Linux... We don't have a device for testing... BTW, join the Discord server if you like, maybe we can find more macOS users in there...

boholder avatar Jun 22 '23 07:06 boholder

We can implement the libspeak for macos narrator. We probably should.

khanshoaib3 avatar Jun 22 '23 07:06 khanshoaib3

https://github.com/khanshoaib3/minecraft-access/issues/39#issuecomment-1602251066

Still searching for a built-in method to move the cursor (so we can get rid of OS-specific implementation).

boholder avatar Jun 22 '23 08:06 boholder

There might be more things to do for compatibility with macOS. For example, I found out that the Narrator does not have a macOS version...... the Narrator calls native API so I guess currently the "interrupting narration" feature won't work on macOS.

@onion108 Would you please help us on this? I'm using Windows while Shoabi uses Linux... We don't have a device for testing... BTW, join the Discord server if you like, maybe we can find more macOS users in there...

I'd like to help~! I've joined the server just now (with the name 27Onion Nebell or Discord Username 27onion)

onion108 avatar Jun 24 '23 12:06 onion108