07-13-2016 05:42 AM
Hi,
I'm looking for a way to mix the mouse-down?(Filter) event with a user-defined event.
For this I need the events to have the same event data type.
I thought I could obtain that - using a Register Event Callback to obtain a reference constant to a potential callback vi, and call by reference to then extract the datatype.
The data type I obtain like this is almost correct - unfortunately the entire event datatype seems to be a bit muddled (see discussion here: https://lavag.org/topic/7759-user-event-datatype-propagation/) , so I assume that is what is destroying my behaviour.
But in the end I was able to obtain what seems to be a matching datatype.. the "structure" now seems to be happy with the data type but the configuration window isn't.
Question 1: Why is this not working? How can I make it work? Can you ever match user events with dynamic events?
Question 2: Is there any nicer way I can simulate (target/OS-independend) a mouse-click on a button?
(I am not looking for a workaround on a specific vi. I'm working on manipulating arbitrary / unknown vis and simulating mouse-clicks there. I am currently using scripting to duplicate the code inside the diagram frame and execute it, but that's adding unnecessary code duplicity and not something I want to support-long time)
Birgit
07-13-2016 08:21 AM
I think the final issue is the "post event data". User Events do not have the ability to discard, etc like the filter events do. If you are not actually filtering the event, try using the non-filtered mouse-down event.
07-13-2016 08:30 AM - edited 07-13-2016 08:31 AM
The problem is that I actually deal with arbitrary VIs, which means I have no influence over what kind of events are being used.
(I write software that modifies other users' software..)
I can, of course, use scripting... and "fake" the filter behaviour
- remove everything from "Mouse Down?" and put it inside "Mouse Down"
- execute the original "Mouse Down" only if there is no discard.
But that is ugly. And causes code duplication. And I don't like it at all.