Watch face and user action - wear-os

Is it possible to add any user action to a watch face application?
I'd like to add a button on a watch face that triggers some logic.
When I deploy the watch face application for the first time, the touch events are routed to the button and I can do fun stuff.
Once the clock goes to sleep, then Google takes over, and all my touches trigger the default google voice search.
I assume that the google voice takes over the whole surface, as a layer, and my button never receives the button pressed events.
Is there a work around like, I can swipe from right-to-left to get an action button?
Is there a way to disable the google voice search from a watch face?
Thanks in advance,
-Jukka

Related

How to prevent mouse click event on Windows

I record the mouse events on windows by using robotgo package. Package provides to get bitmap of clicked area but the latency of having bitmap is super sensitive situation here.
For example:
If I click any checkbox which is unchecked on the screen, provided bitmap must contains the state of unchecked but it provides me checked state and cannot simulate it with robotgo or cannot trigger click by using bitmap.
Solution to this scenario is that I need to prevent windows mouse click event until bitmap provided by the package (or adding some delay for click event) then trigger the click event on windows.
I made some research online but couldn't find a proper solution. How prevent click event on Windows in Go? Is it possible or is there any other way to make it happen?
A low-level mouse hook can eat mouse events. SendInput can generate mouse input events.
You would have to set a flag somewhere so you don't eat your own fake input events.
Keep in mind that SendInput is not perfect (can be detected by other hooks) and playing with the input system like this is usually not the best solution. Adding 500ms (or some other delay) to every mouse click is going to be very annoying for your users.
It is better to use UI Automation to get information about UI element states in other applications...

What is the jquery mobile event for when the user holds down a button?

I have a popup that I want to make transparent when and for as long as the user presses and holds a button. And when they release, I'd like the popup to become opaque again.
What events should I be capturing to do this?
Currently, I'm using vmousedown and vmouseup events. They work, but once in awhile, when I press and then let go of the button, the vmouseup event seems to get fired. So when they let go, the popup remains transparent.
I've only experienced this on chrome on my iphone, never on the desktop.
First, am I using the event? Or is something better (like tap vs click) in the mobile world?
If I am using the right events, any idea why I have that odd behavior on mobile?
try the $("...").on("taphold", function (event) {...}); event binding.

Windowsphone Start button handler

Well, I’m developing a small game for Windowsphone (with Silverlight). That way, I’d like how could I handle the Start button event?
Apparently, is not possible to override the Application_Deactivated method, right? Hence, even if I create a method and call it inside Apllication_Deactivated, the game would be finished anyways.
I’d like to show a Canvas, like: Are you show you want to leave the Game. Pretty basic. I’ve done that on return button. So, how could I make the same on Start button?
Cheers,
Short answer: You can't.
Microsoft states that it is not the developers choice to handle what happens when the start button is pressed. What you should do is handle the event and save user state, then reload the state when the user navigates back to the application.

wp7-how to make a thread navigate pages

I want to check for changes in the aplication state every time interval, and if it has changed, to open a window, and give the user 10 seconds to press on the window, if he does press on the window, then to allow him to navigate freely in the window, and if he doesn't press, to return back to the window before. I thought to implement it with a thread running in the background and waking up every time interval I want. Maybe there is a better way?
This strikes me as a scenario with lots of potential issues.
How do you stop the "window" appearing at an inconvenient time to the user? (e.g. when they were just about to tap on som.ething)
Why not just raise the notification when the state actually changes? This way you wouldn't need to poll.
What is the "Window" you are displaying? How does it differ from the page it is replacing? Is this a popup or are you actually navigating to a different page?
What is the state that's changing? How is it changing without user interaction?
Can't you notify the user of the state change without a potentially intrusive display of a new "window"?
I agree with #matt-lacey, this could be dangerous and might result in a bad user experience.
With that said, this might work
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
//navigation code here
});
I didn't know you could do a pop-up window, could you elaborate?
I've made a thread that is running at the background and making some work, if it decides that a change is necessary, I want to give the user a chance to react to it, or ignore it.
I'm pretty new to this, so if there is a better way than to navigate to a different page i would love to hear it.
Thanks.
It sounds to me like you want to notify the user that something has happened/changed and give them the option to do something about it, which is exactly what "toast" notifcations are all about. They pop up at the top of the screen to inform the user, and then the user can tap that toast to do something, e.g. when WiFi networks are available, you tap the toast to select an available network.
The Silverlight Windows Phone Toolkit includes the ToastRequestTrigger that you use to display toast notifications. The Windows Phone Developer Guide from the patterns & practices team gives examples of using the ToastRequestTrigger. You will need to implement the tap handling yourself in the toast content, but this should be simple enough.

VC++ mouse events

I want to write a console program for mouse events (Only mouse scroll). How do I do it in VC++? The application will listen only to scroll events.
Description: If the user scrolls down, the Desktop window fades down, and fades-in when user scrolls up.
Here I just need to know to to listen to mouse events in console app.
Note: I am developing using win32 API, and for development environment I am using VS2010.
I've never actually done this myself. It seems that a console application responding to mouse events almost belies its nature and intended purpose. Generally, you would only need to respond to keyboard input from a console app and leave the mouse stuff to a GUI app.
That being said, this tutorial indicates that it is in fact possible to capture these mouse events from a Win32 console application. Generally, the suggestion is to use the ReadConsoleInput function and extract the information of interest from the INPUT_RECORD structure that it fills. The only tricky thing is that the call to ReadConsoleInput is a blocking call, which means it will not return until there is an input event fired. You'll need to structure your application's code accordingly. Mouse events are covered in detail about 3/4 of the way down the page.

Resources