• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to support dictionary service in a custom text view?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to support dictionary service in a custom text view?


  • Subject: Re: How to support dictionary service in a custom text view?
  • From: Evan Gross <email@hidden>
  • Date: Tue, 08 Jul 2008 03:06:53 -0400
  • Thread-topic: How to support dictionary service in a custom text view?

On 08/07/08 12:16 AM, "Charles Srstka" <email@hidden> wrote:

>
> Yes, but I think this check box is not relevant to this functionality.
> At any rate, my accessibility methods get called when I type command-
> control-D, whether the check box is turned on or not. If I comment out
> my Accessibility support, the dictionary service fails to work whether
> the check box is on or not.
>

But VoiceOver is a trusted app, and (I'm guessing) that the Dictionary
Service might use a trusted app to obtain info via accessibility, or its
component makes the process it's loaded into trusted (temporarily). So they
will always get results, whether access is enabled or not.

> My understanding is that the check box only enables certain advanced
> parts of the Accessibility API which allow the user to manipulate the
> UI. The basic accessibility stuff, just to read the screen and such,
> doesn't require that check box to be on. I think that VoiceOver uses
> the Accessibility API to read text on the screen, and it doesn't need
> that check box to be enabled in order to work.
>

I just commented out all the AXAPIEnabled() tests in my app (actually, it's
an input method component, much like the Dictionary service), then disabled
access, and got nowhere. The only calls that succeeded were
AXUIElementCreateApplication() and AXObserverCreate(). But any attempt to
actually obtain anything via accessibility
(AXUIElementCopyAttributeValue...) failed with kAXErrorAPIDisabled.

So for untrusted apps (anything not from Apple, for the most part),
disabling access for assistive devices, well, really does disable it!

> It doesn't unless my Accessibility code is there.

It probably should, though - otherwise all you're seeing is the Dictionary
service taking advantage of it's "power" to get something it needs via
accessibility. It tries a number of things to both succeed and get the best
attribute and positioning information it can from the underlying app. If
accessibility fails, it tries TSM, and vice-versa.

But it definitely doesn't *require* that the app implement the various
text-related accessibility support. For example, it works fine in BBEdit (a
Carbon app), access enabled or not, as BBEdit does not support access to its
document's textual contents via accessibility at all. But it's got great
support for text input via TSM/TSM DocAccess CarbonEvents.

Anyway, what you've got now is perfectly fine if you're only concerned with
the Dictionary service working. AFAIK, other than my app, there's nothing
untrusted out there that makes use of the same TSM/NSTextInput and
accessibility APIs to do something similar to what the Dictionary does.

If you'd like a copy of my product to test with, I'd be happy to oblige
(off-list). It's in my interest (even more so) to make sure it works with
custom text editing views, especially if it will be used in a
publicly-available product. My product works best with access enabled, but
will work fine if all that's available to is the necessary TSM/NSTextInput
support

Thanks,
Evan


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: How to support dictionary service in a custom text view?
      • From: Charles Srstka <email@hidden>
References: 
 >Re: How to support dictionary service in a custom text view? (From: Charles Srstka <email@hidden>)

  • Prev by Date: CoreData, failed to process pending changes before save.
  • Next by Date: Proposal for metadata interoperability on OS X
  • Previous by thread: Re: How to support dictionary service in a custom text view?
  • Next by thread: Re: How to support dictionary service in a custom text view?
  • Index(es):
    • Date
    • Thread