How to make screen reader announce text when app is not active? - windows

My requirement is, I have an app that is running in the background and is not having the focus. The user might be using some other applications, and based on certain events in my app, I want the screen reader to announce the text based on my liking. I dont want my app to get the focus, user should be able to continue with the other application, I just want screen reader to announce some texts. I already tried sending QAccessibleEvent with different Events like Alert, NameChanged, ObjectShow etc. But I think since my app is not in focus, it may not be passing through. Could it be possible to achieve my requirement without my app getting focus? Thank you. I am using Qt 5.15 with Windows 10

One possible solution is to directly call screen reader specific API.
However, if you are presenting some text on screen as well, you should rather preferably use the so called toasts, or the notification system, if it's suited to your application.
QT probably provides access to them.
Just in case, I'm the author of a DLL that allows to make several screen readers speak text.
Note that it doesn't show anything on screen.
http://github.com/qtnc/UniversalSpeech

Related

Nesting an application inside OS X subview

I'm looking for a way to embed another application into my own view.
The business reason is that the company has many small Electron apps (basically a small portable web program with a self-contained browser) that the company wants to embed inside an OS X program. These Electron apps would ideally integrate and display inside a subview seamlessly, so they look like little web frames inside our larger program.
I think programatically it would be easiest to open another program as a subview, but I'll take whatever I can get. Maybe even capturing it's NSWindow somehow. (Electron source is available so it is easily discoverable.) Maybe a way to dock the other program inside mine, or (getting more desperate) finding its view and sending commands to constrain it's size and location on top of mine.
So far all I've found says it is not really possible. I've found I can take the more desperate course. I can launch a process, find its view, and position it inside a spot on my display; when the window is moved or the content is scrolled send messages to move the other window. But that isn't really integrated, the menu stays separate, etc., but I cannot incorporate it.
Any ideas or helpful implementation details?
EDIT 1: Thanks for those responses. How about if we could have the electron apps expose their NSWindow somehow? Could that be leveraged? I'm thinking the application could send messages and (somehow, not sure exactly) to set the parent window inside this one. In Windows API it is much easier since you can call SetParent on anything, even items inside different processes. But Cocoa seems more difficult.
This isn't really a thing you can do in Mac OS X. Applications are not "composable" in the way you're hoping for - while it is possible to share a view with a subprocess under certain very specific circumstances (e.g, Safari or Chrome tab renderers), this requires the subapplication to be written in a very specific way to permit that. It's not something that would be feasible in the situation you're describing.
If you have access to the source of these Electron apps, consider combining them into a single overarching Electron application. Alternatively, if it's not possible for these applications to coexist within a single Electron app, you may want to consider using something like Chromium Embedded Framework to build your wrapper application; note, however, that this may require you to implement parts of the Electron framework yourself.
You cannot do that. Cocoa requires you to have only one NSApplication instance per UI app. So you will to fork/exec out new process and launch your applications.
If you can recompile the source code then you can create custom subclass of NSApplication and use that custom class in all the applications or you can create NSthread of other applications without NSApplication instance and go from there.

How does one correctly identify IE10 Metro and IE10 Desktop from the server in order to send back a "finger friendly" or "mouse friendly" interface?

I've read that since user agent is the same between both, the recommend method is to use feature detection. That is fine and good for some situations, where you may want to display a Flash video/movie/app vs. a javascript slideshow, but my issue is to display a correct interface based on the user's input device.
The assumption I'm making is that if a user is in the "Metro" IE10 they are probably expecting to use their fingers instead of a mouse. That being the case, I'd like to give them an interface with large hit boxes.
My question: Is there a way to tell the difference and display an appropriate interface? Or am I stuck with making the user manually switch modes via links on my site that set a cookie?
Still there's no way to detect normal IE from the crippled Metro IE, but know you can know at the server if the user has a touch screen http://blogs.msdn.com/b/ie/archive/2012/07/12/ie10-user-agent-string-update.aspx
That post includes other comments about how to perform detection in javascript.
If you use the msPointerPoint interfaces, your client will receive the same messages whether they're using the mouse or touch. You can also use the gestures api - there was just a blog post on the IE blog which discusses how to use gestures from the mouse browser.
IE exposes a unified stack for messages so you can use the same input processing and your UI will work whether you're using touch/pen or mouse.

Minimize-in-place - Do I need a custom framework

I want to create a system wide minimize-in-place feature that occurs when double-clicking the title bar of any visible window in layer 0.
It seems that this would be a really simple feature to re-implement... When a title-bar is double-clicked, just draw the title bar only. That's it. The problem is implimenting it in all applications. I think it requires writting a custom framework to override the behavior in AppKit? Maybe NSApplication, NSWindow or NSView?
How can I recreate minimize-in-place?
Is a framework my only choice? If I create a framework, can I replace the behavior of minimize in 3rd party apps?
Which framework do I need to override in order to intercept and recreate the default behavior of the minimize button?
More about minimize-in-place:
I am familiar with WindowShade by Unsanity, this is exactly what I want to create. Supposedly unsanity is working on a Lion version, but their track record is bismal. Minimize-in-place was a system feature way back in the days of OS 7 or 8. I have tried other utilities that try to replace this feature, and there aren't any that do minimize-in-place at a core system level like it needs to be done. Please don't offer utitlity suggestions, I am going to build my own.
I have built an Application that recreates minimize-in-place, but it's not good enough.
My Application semi-successfully recreates minimize-in-place by putting "placeholder" windows (belonging to my app) in place of the 3rd party windows when they get minimized to dock. When my window (title bar only) gets double-clicked, I close my window and restore the real window from the dock.
My custom app works perfectly, but there is a lot of application switching going on. I have optimized the switching between apps to be nearly seamless, but the fact remains that there is application switching going on every time a window title bar is double-clicked. The result of application switching is that menu bars switch back and forth, pallets of 3rd party apps hide themselves when my app takes focus, and the list goes on.
So, although I've built a concept app, this method isn't going to work as I'd like it to. Minimize-in-place needs to be implemented using some other method than building an Application, and I need help understanding how to do it.
What I know think I need to do. Suggestions and assistance welcome.
I think I need to write a custom framework that replaces AppKit? This seems overwhelming even though I only need a super-tiny portion of the code to be overridden? i.e. the core _minimize function whatever that may be.
When a title-bar of 3rd party window is double-clicked, just clip to the title bar and let the rest of the system function as normal. On un-minimize (double click 2nd time), set clip back to full window.
Simple right?
Thanks for any assistance/suggestions,
Chris

how can you query current user activity in WP7 background agent?

WP7 mango now supports background agents (with some limitations): http://blogs.msdn.com/b/danielegan/archive/2011/10/18/background-agents-in-wp7.aspx
How can I inspect the user's current activity? specifically, here is what i'd like to determine:
what is the active application
when was the last user interaction
I think the Microsoft way of doing this would be to provide developers with an API to modify Lock Screen system settings. This is not possible at the moment, but there is a petition to enable setting the wallpaper from an app here: http://wpdev.uservoice.com/forums/110705-app-platform/suggestions/1720049-provide-a-wallpaper-api-to-enable-in-app-setting-o?ref=title
This combined with the ability to change the screen timeout (not possible yet) would achieve the desired effect.
I take it you are probably after custom screensaver with some other information on it and/or rendered/animated content. This wouldn't make sense. The whole point of the screen saver is to save the screen.
There is no better way to save the screen than to turn it off, which mobile devices handle pretty well.
You can't do either. Windows Phone does not support inspecting the users activity or anything else that goes beyond the boundary of a 3rd party application's own domain.
The background agents are limited to the application that created them, and the data related to that (in it's isolated storage).
And this is a good thing, since it means creating mal- and spyware is a lot more difficult. Also, a application like you're attempting to make, would principally be considered spyware.

Is it possible to add custom Data Detectors to OSX Cocoa applications? (such as Mail.app / Safari)

As the title suggests...
Is it possible to add custom Data Detectors to Cocoa apps?
If so, a gentle nudge in the right direction would be great.
Note: To be clear. I want to add new detectors to currents apps. I am not writing a new app.
Thankyou
W
It's not even possible to build a custom data detector on anything but iOS 4. NSDataDetector is only available on iOS 4 and above.
If they existed on OS X and were a plug-in class like Spotlight importers, that'd be a nice feature. Perhaps filing a request at bugreport.apple.com would help it along?
Later update
I think the reason this hasn't been opened up with an API is because they're only meant to find common data (contact info, dates, URLs) for which there is only one (or just a few) uses. That is, contact info can be stored or used in "the" system-designated app. URLs can be auto-highlighted so they're linkable (clicks invoke the system-designated handler - Safari, an app registered to a protocol, etc.). But there's only one direction to funnel those actions and the endpoint is always a major "convenience app" meant to manage this common information (contacts, calendar, browser, email app, phone app...)
On the other hand, consider app-specific information. Data formatted a certain way for use with one app or platform might mean something else entirely to another application. In fact, this is rather common. So what happens when a string like %%SOMESTRING%% is detected? To one app, it might be a placeholder token. To another, it might be a user name. To another still, it might be interpreted as %%USERNAME followed by %%. Suddenly the simple system-wide UI for handling basic data types has to account for multiple actions and/or multiple "data detector plugins" claiming all or part of a format.
I'm not sure we'll ever see custom data detector APIs on iOS or Mac for this reason alone.
While custom data detectors aren't available at the OS level, there is a mechanism that will get you almost there. One possibility is to create a Workflow in Automator and save it in the Services menu.
It can be configured to be active when text is highlighted. You'd either go to the current app's main menu and select the Workflow under "Services", or else right click on the text and go to the "Services" menu from there. Not as easy as clicking on the text as you would a URL, but pretty close.
Create a workflow in Automator on Mac

Resources