litchie / dospad

iDOS - DOSBox port on iOS
https://litchie.com/dospad
GNU General Public License v2.0
619 stars 133 forks source link

Magic Keyboard on iPad #85

Closed ecstaticax closed 4 years ago

ecstaticax commented 4 years ago

Hi, is there any possibility that Magic Keyboard (or external mouse support) will be supported in the next updates? Regards.

WeedyWeedSmoker commented 4 years ago

@litchie That would be great!

That would mean external mouse support too thanks to a Bluetooth mouse or via a cable with iOS USB Camera Adapter…

Mini vMac already have this and it's really great! Here is the commit that made it work there : https://github.com/zydeco/minivmac4ios/pull/35

Thanks

litchie commented 4 years ago

@WeedyWeedSmoker Thanks for the link. That sounds promising!

moromarino commented 4 years ago

Please litchie, also don't forget the Smart Keyboard Folio! :)

litchie commented 4 years ago

Implemented bluetooth mouse support 1fd56ef, I am afraid it's not perfect due to the reasons listed in commit message. Current keyboard support relies on private api, so it's not available in TestFlight. I'll enable it in github IPA release.

gilnoh commented 4 years ago

Hey all, I've been playing with my own implementation of bluetooth / hw mouse support for some time. Now I have a working version that enables me to play DOS games with full mouse support. I think this can be a candidate, or a base for feature-complete mouse support.

It does not have two limitations of commit 1fd56ef of master branch. Mouse position is passed to Dos (screenView) exactly on the position where you put the iPadOs pointer on screen, and there is no capture issue. It also support primary / secondary mouse click. Since it basically passes the location of iPadOs pointer location to screen, small setups like mouse speed changes, or primary / secondary button changes are done by changing iPadOs pointer setup, which I think makes more sense for usage.

The branch is here (https://github.com/gilnoh/dospad/tree/feature/pointersupport), and I also made a pull request. @litchie please consider it to take some part of the implementations! (I am very willing to re-implementing it on your current upstream master, on the new SDL_UIKitView) --- I've written more details in the pull request #87

EDIT: (Added next day) -- due to scale issue, I guess that the above tried absolute mouse approach part won't work automatically. Currently this scale (mouse coordinate resolution / screen resolution, used in game) is hard coded in the pull_request, and I was thinking about adding this in the setup; where user can manually mark 1x, 2x, or 4x. So well, it is n't feature complete at all.

But well :-) I guess litchie can take at least the code block for right mouse click.

gilnoh commented 4 years ago

I've submitted a pull request for bluetooth mouse right click support (#88), which is simpler, and actually ready to be merged.

I am closing the above mentioned older pull request #87, mainly due to the scale issue. If the scale issue (mouse coordinate - game coordinate differs) can be resolved, the mouse tracking of #87 is actually smoother. But currently scale issue cannot be resolved easily.

I will try to revisit this in conjunction with direct touch mode. Hopefully I would be able to suggest another discussion / pull request in the coming weekend...

litchie commented 4 years ago

@gilnoh Thank you very much for the great work! #88 looks good enough, I will merge after I test it later.

litchie commented 4 years ago

Closing because the original issue should have been fixed.