UWP TimedMetadataTrack Events are not firing - events

I can not seem to get the a TimedMetadataTrack object to fire the events CueEntered or CueExited for SpeechCue events.
Any thoughts?

So, apparently this line is needed when registering for IMediaCue.CueEntered and IMedia.CueExited events (at least the SpeechCue implementation of the interface):
((Windows.Media.Playback.MediaPlaybackItem)item).TimedMetadataTracks.SetPresentationMode((uint)index, Windows.Media.Playback.TimedMetadataTrackPresentationMode.ApplicationPresented);
This line is required to exactly allow the system to send the CueEntered and CueExited events that are being listened for.
Yet again, another case of Microsoft not fully documenting things in their API Documentation or Code Examples.

Related

Capturing and reacting to custom windows events in wxPython

I'm in the process of writing an app to interface with a service running on another machine. When I ask this service for some information, this service adds the requested information to a separate queue, and sends a windows message to the calling application (my application) indicating there is a message waiting in this separate queue which needs to be decoded.
The windows message this service sends is a custom message, defined in the service code as having some constant int value. I've found examples of creating custom events in wxpython, and using TryBefore() and TryAfter() to react to these events in specific ways, but I haven't found any way to associate this NewEvent() with an int value so I can identify it when it comes in, much less any way to determine what an int value of an incoming event is.
Has anyone done this before or know of any functions I'm not aware of? I'm using python 3.6 and wxpython 4.0.
Thanks for your help, everyone.
I think this is what you are looking for: https://wiki.wxpython.org/HookingTheWndProc
When you get the custom message from the hooked WndProc you can either react to it there, or you can turn it into a wx event and send it so it can be caught by binding an event handler like normal. The wx.lib.newevent module has some helpers for creating a custom event class and an event binder. Its use is demonstrated in some of the demo samples and library modules.

Is it possible to chain commands via FormFlow?

Dialog can do almost everything according to the bot framework documentation, but it will take a lot more time to investigate than FormFlow. I failed to find a place that have lots of samples of bot framework yet. At the moment, before I spend a lot of time to try dialog, anyone know if it's possible to chain commands using FormFlow.
The work I am trying to do is to code a chain of commands:
query records
select a record from the results
actions/operations on the record
etc...
Really appreciate if anyone familiar with Bot Framework can help me on this.
Use the IDialogStack.Call method in your FormFlow handlers to call another dialog and push it on the stack.
Then use the IDialogStack.Done method to pop it off the stack. Both described here.

Stop event propagation in Meteor

I've hooked up some basic click events using Meteor's event maps.
How do I stop the event from propagating after being handled?
Meteor's docs state that
Right now, the event handlers are wired up with jQuery, and the event
object you receive is a jQuery event object.
However, neither return false nor e.stopPropagation() seem to work.
Currently, stopPropagation works in a limited set of circumstances. For propagation to stop between two handlers, the handlers must be specified on different templates, and there has to be an intervening DOM node container between the inner and outer template. A fix is under development right now and will go into an upcoming release.
Can you post a gist of your code so I can make sure your particular case will be addresed?
As a workaround, you might try e.stopImmediatePropagation(), which is supplied by jQuery and should keep any other handlers from running.
I ran across this question while researching this myself. The documentation for Blaze Event Maps is here.
For this problem in meteor you need to consider 2 functions depending upon what you want:
stopPropagation()
Prevent the event from propagating (bubbling) up to other elements. Other event handlers matching the same element are still fired, in this and other event maps.
stopImmediatePropagation()
Prevent all additional event handlers from being run on this event, including other handlers in this event map, handlers reached by bubbling, and handlers in other event maps.
What I wanted was to stop bubbling and stop propagating to other Meteor event handlers. So event.stopImmediatePropagation() did the trick and it is not really a workaround as advised above.

Altering Qt Application keyboard events

I'm trying to do the following - given an keypress event in an QT Application, I want to intercept it, modify it (for instance, replacing Qt::Key_Up with 0x81001310), and send it into the app again.
Ideas?
Does overriding the event method work? If you do get all of the keypresses there, just consume the events you wish to replace and send new events that you want.
Might not work, just an idea that should be easy to test.
Be careful to not cause infinite recursions or loops :)
Edit:
If this doesn't work, you can always create an eventFilter and modify the events that way. However, if you do this, you might have to install the event filter for many things.

Is there an API event for when person changes clock on Windows?

I was wondering if there's some sort of system event that gets fired every time a user changes the time in Windows. I know there's a way to enable this in Windows' EventLog, but I was looking for a way to respond to this event programatically (like using the Windows API).
A WM_TIMECHANGE message is sent whenever there is a change in the system time
I'm not sure from your question if you're working in managed or native code. But if you're working in managed code you can use the TimeChanged event on the SystemEvents class.
Microsoft.Win32.SystemEvents.TimeChanged

Resources