zydeco / minivmac4ios

Mini vMac for iOS
https://namedfork.net/minivmac
GNU General Public License v2.0
503 stars 53 forks source link

Apple Pencil support #27

Open vaporstack opened 6 years ago

vaporstack commented 6 years ago

Hey, it would be great to have pencil support integrated into the main branch at some point. I still use HyperCard for lifedrawing. I implemented detection in my fork, https://github.com/vaporstack/minivmac4ios

but it is a limited implementation. Basically all I do is check the bluetooth stack for a pencil, (PencilDetector.c from SO) and if it's present, ignore all non pencil touches, which most users probably don't want (but I do!)

However I couldn't figure out how to add a user toggle for it. I think this is a highly specific feature that should probably be opt-in either via settings or a pop up dialog box (or both).

Many thanks for your excellent work. :)

vaporstack commented 6 years ago

I should specify that I'm not ignoring all touches on the app level - just in TouchScreen.m. The other gestures and stuff work fine :3

zydeco commented 6 years ago

This sounds great, can't wait to borrow some hardware to try it :) Maybe if there's a pencil detected, there could be a third mouse option "Pencil only" that enables this behaviour?

vaporstack commented 6 years ago

That's exactly what I was thinking. The values that I provided probably need a bit of tweaking as well, I noticed a little bit of glitchiness while drawing with it last night.

On May 31, 2018, at 5:38 PM, Jesús A. Álvarez notifications@github.com wrote:

This sounds great, can't wait to borrow some hardware to try it :) Maybe if there's a pencil detected, there could be a third mouse option "Pencil only" that enables this behaviour?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/zydeco/minivmac4ios/issues/27#issuecomment-393688972, or mute the thread https://github.com/notifications/unsubscribe-auth/AH-n7ORErC9CFGP0BlhZHwKbwWuQe97zks5t4GLPgaJpZM4UM0gz.

gingerbeardman commented 3 years ago

If it's OK I'll take a look at this.

I have an iPad Pro with Pencil and a desire for it to ignore my palm!

If there's no problem, I'll file a PR soon.

gingerbeardman commented 1 month ago

I never got round to this, as I use BasiliskII.

In an ideal world the emulator would have access to pressure sensitive data from the Apple Pencil (could use a Wacom driver, maybe?).

I'd happily put 150EUR in the pot for this feature.

Sorry to post this issue here but there are no issues on the macemu repo.

zydeco commented 1 month ago

I played around with this a bit but detecting the pencil's Bluetooth connection didn't seem useful in this scenario, as pencil remains connected even when it's not being used (I have first generation pencil and an iPad mini, and a folding cover that holds the pencil). Maybe something time-based would be useful?

gingerbeardman commented 1 month ago

Is that how the Pencil works on smaller iPads?

On my iPad Pro I attach the pencil magnetically to the side of the device, so I guess it gets turned off at that point?

What is the problem with it remaining connected? Are you anticipating that Pencil overrides touch? And then because it remains connected it prevents the user from interacting? Just so I understand the issue.

I think a timeout is a reasonable thing to add for this, were you thinking about a configurable delay since last used?

ps: with Pencil support I would use it alone, no use for my fat finger. I would also use the on-screen keyboard (a custom one I made) or an attached bluetooth keyboard alternative (for equivalent shortcut keys). My latest drawings at the bottom of this page: https://blog.gingerbeardman.com/2024/07/14/shibuya-pixel-art-contest-2024/