how to hide ok glass label from google glass voice menu - google-glass

Hi I am developing a application fro Google glass ,I want to hide the "OK glass" command which is essential to launch the menu on voice command so is there a way in which i can launch a menu options on voice command without saying the " OK glass " keyword every time.
kindly guide me on this.

You cannot do this at the moment using Contextual voice commands. In my opinion, it was for the best, otherwise the Glass user could occasionally select a menu item unintentionally.
Maybe you can implement an alternative using SpeechRecognizer, maybe you'll find this thread a bit helpful.

Here is an example on how to use a decompiled version of the GlassVoice.apk found on Glass:
https://github.com/pscholl/glass_snippets/tree/master/voiceMenu
which allows to display a menu (or not), display "ok glass" (or not) and add hotwords dynamically (or not). Offline without using the SpeechRecognizer API.

Related

Qt Disable Windows 10 Game Bar

I have an application developed in Qt that causes Windows 10 to think it is a game, and opens a pop up box that says Press the Win-key + G to open the Game bar. This is very unhelpful as my application is not a game; and it interferes with the user experience. How can I turn this off from within my application code? I have been unable to find any documentation related to this. Thanks in advance.
It is not possible to neither capture Windows shortcuts (in order to stop propagation and disable them), nor to disable game bar in a per-app base.
Options you have are:
to disable it globally (see this post): you can do it using the Registry, so it can be included in an installation package, but you'll affect the global settings of the user,
change the shortcut used to access it in the Xbox app,
use some third-party app, such as AutoHotKey, to map keyboard sequences to an empty action (related question).
Edit:
Also you can (from user side) disable it for your app in Xbox app. (Xbox support):
Open Xbox app
In my games list select your app
Right click on it and delete it
This will delete your app from games list, so GameBar will not appear.

Override Close Box on Windows 10 Universal Apps UWP

I'm trying to prevent the app from being closed by clicking the Close box on the App Window.
For example, having a text editor with unsaved changes, upon pressing Close Box, I would first display, "Do you want to save changes before exiting?"
How can I detect app wanting to close and prevent that from happening?
I'm using C++, and this needs to be for Windows 10 Universal Apps UWP.
I already know how to do this for Win32.
The comments are correct. There is currently no way for a regular Store app to do this.
However, with the Creators Update (and corresponding SDK) we have included a preview API that you can now check out for this functionality:
The Windows.UI.Core.Preview.SystemNavigationManagerPreview class provides a CloseRequested event that an app can mark as handled. For the event to work the app will need to declare the restricted 'confirmAppClose' capability per:
https://learn.microsoft.com/en-us/windows/uwp/packaging/app-capability-declarations
Please let us know your feedback.
Thanks,
Stefan Wick - Windows Developer Platform

Google Glass voice command send activity to background

I do an example that launch the voice command on an activity, but when the "ok glass" shown on the bottom of the screen, the activity came to background ( it's looks like my activity goes more transparent ... )
There is a way that this doen't happen? I would like to made that ... transparent, but when I say "ok glass" not when the activity load that on the bottom ...
any idea?
If I understand correctly your question, you want to customize the Contextual Voice Command, by deleting the gray overlay above your activity.
If yes, I wanted to do the same thing but with XE19 we do not have this possibility yet.
I asked a question and got a respons with a custom solution if you are interested :
Custom Voice Input
EDIT: I also find another solution customizing the Voice Input From google, but it won't work when the XE will be upgraded : Another Custom Voice Input

How do you customise Glass contextual voice menu in an immersion *after* its initial setup?

I've successfully populated the contextual voice menu of my glassware immersion but I want to be able to change the menu after the initial set up in onPreparePanel() or onCreatePanelMenu() as described here: Programmatically populated contextual "ok glass" menu.
Ideally one of the callbacks would be called after receiving the 'ok, glass' voice command but as far as I can tell, none of them are. Outcome, you're stuck with the version of the voice commands menu as it was the first time you cam into the activity.
So far, the only hack that's come close was when I pulled the GlassVoice.apk off the device and set up a manual VoiceListener (as discussed here: Glass voice command nearest match from given list). When the voice command is detected an onVoiceCommand is called, I try to force a refresh of the menu by calling invalidateOptionsMenu() (no effect) or getWindow().invalidatePanelMenu(WindowUtils.FEATURE_VOICE_COMMANDS). This second one looks like it tries to pull up the menu but then instantly hides it again.
How can I dynamically change the contextual voice menu later on in the lifetime of the activity?
I actually just wrote a sample app and this is working fine for me.
Be sure to use onCreatePanelMenu() to create the voice menu and check
if (featureId == WindowUtils.FEATURE_VOICE_COMMANDS ||
featureId == Window.FEATURE_OPTIONS_PANEL) ...
to inflate the menu for both touch menu and voice menu.
To refresh both, in onMenuItemSelected(), make sure to call both invalidateOptionsMenu() to refresh the touch menu and getWindow().invalidatePanelMenu(WindowUtils.FEATURE_VOICE_COMMANDS) to refresh the voice menu. I just flipped a boolean on the first menu item selection, which I used to determine whether an old or new menu should be inflated.
What version of Glass are you running on?

Cocoa-track the menu of/inject options into itunes

Is there a way I can inject menu items into itunes or detect when menu items are pressed. I have an itunes plugin that executes code when iTunes launches, but how can I use that to detect menu item clicks or possibly inject new menu item options? For example adding a new contextual menu item when you right click on a library item, or detecting when the users clicks "Like" from the Ping menu.
Whatever functionality is not provided by an app's scripting bridge would only be accessible by hackery.
iTunes a Carbon app, not Cocoa, so that's more for you to learn about. iTunes even uses a call to ptrace(), passing PT_DENY_ATTACH to prevent you attaching a debugger to snoop around at runtime as well.
In other words, this is by no means an easy thing to do.