Dynamicall​y register event mouse move

I try to understand dynamically register for events.
In this NI example of "Dynamically register for events.vi",  the first register events (outside the while loop), if I change the top item "mouse move" to something else, I cannot select "mouse move" event anymore, in the pull down arrow, there is not a "mouse move" as a selectable item. 
Can anybody explain this?  I have to close VI without saving.
When I make change to the event, in the event structure, there will be a case "unknown event" displayed.
My other question is: how does the program knows the difference between mouse outside the picture control?
I know that when I press the mouse button down on the picture then the iteration starts to count,  I just don't understand how the program knows the difference, it is not obvious to me.
regards

You should try working with standard events before using dynamic events.
As for your questions:
The dynamic events available in the event structure are determined by the dynamic event terminal (inside the right red square in the image below). When you change the Mouse Move event, it is no longer available and you have to configure the event structure to use another event.
The Mouse Up and Mouse Down? events are registered for all the controls (left red square), so clicking on any control would generate those events.
There should be a tutorial on this site about using dynamic events. You can use the search engine to find it. Also, reading the LabVIEW help on this is a good idea.
To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here, here, here, here and here are a few you can start with and here are some tutorial videos. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).
Try to take over the world!
Attachments:
Dynamically Register for Events.png ‏6 KB

Similar Messages

  • Dynamically register "mouse move" event for a VI

    Just as in the example ”Dynamically Register for Events.vi” I want to dynamically register a “Mouse Move” event. I use the “Open VI Reference” to get the reference to the VI and I connect it to the “Register For Events” block just as in the example. When I click the block I get a list of events to choose from, but the “mouse move” event is not one of them. How do I select this event?
    I have got the program running by copying the “Register For Events” block from the example and into my program, but I’m interested to know how this should have been done.
    I use LabView 8.0

    I've had the same problem in LV 8.2.1 and 8.5. I found that NI changed how to access the mouse move... it's now available under "Pane." See my attached example, a modified NI Example.
    Derek
    Attachments:
    Dynamically Register for Events - 8X.vi ‏44 KB

  • How can I stop coalescing of mouse move/drag events in jdk1.6 ?

    Hello all,
    My application uses a [pen-based tablet|http://en.wikipedia.org/wiki/Graphics_tablet] to draw lines/curves. But the problem is: when I run my application, due to java’s default behavior of discarding the mouse events which occurs during the repaint call, the curves results in the set of joined straight lines.
    To overcome this problem, when searched over net, came across below link:
    [http://forums.sun.com/thread.jspa?messageID=10811388]
    I tried the option provided at the above URL i.e. overriding the below method of Component.java file:
    protected AWTEvent coalesceEvents(AWTEvent existingEvent,AWTEvent newEvent);
    But later found that, overriding this method worked fine for me for jdk1.5 but this solution did not work in case of jdk1.6. When reviewed the source of Component.java and EventQueue.java files in jdk1.6, found that this method is not having any implementation and simply returns “null” and the complete handling of coalescing of events occurs within EventQueue.java file’s local method which is mentioned below:
    private boolean coalesceEvent(AWTEvent e, int priority);
    As this method is part of EventQueue.java and also it is a private method, I am not finding any way to stop the coalescing of mouse move/drag events in jdk1.6.
    The main problem is that my application is purely based on jdk1.6 only.
    Can anybody help me out to solve this problem by providing any option of preventing the coalescing of mouse move/drag events in case of jdk1.6.
    Thank you.

    Look at the link I posted, you aren't double buffering correctly.
    I saw the other post you mistakenly made before you edited it. Not really a big deal, I was just wondering why you did that.

  • XY graph "mouse move" event stops generating when click on cursor

    Hello All
    When the mouse is moving freelly inside the XY graph control, the "mouse movement" event is fired.
    The same happens when muse clicks anywhere in the graph with the exception of cursors.
    hen mouse clicks on cursors the "mouse move" event is NOT generated even though the mouse is phisically moved.
    Is there any explanation to this.
    I enclose the example.
    regards
    Pawel

    Just today I had the same problem -> my solution:
    set event timeOut to some value(I have it at 1ms) then
    add to globalVariables some BOOL variable that will signal if mouse is down or up (set the flag in appropriate event),
    then add a case in the timeOut event which will read this
    global variable(flag) -> if it's TRUE then change the needed parameter.
    So even if the mouse move event isn't fired the main timeout event is.
    Not a perfect solution, but better than nothing.
    Peace
    Waldemar

  • Event Precedence - Mouse Move or Cursor Move on Graph?

    Since LabVIEW 8+ introduced cursor events (grab, move, release), is there a conflict that would occur between a mouse move event and cursor move event since a cursor move involves a mouse move?  Or, since the cursor move requires the left mouse button to be down, does that allow LabVIEW to differentiate which event is occurring?  I have some code I am writing to draw a box on an intensity graph (using the new plot.images property for graphs) so as to extract a region of interest.  At first, I want a cursor to follow the mouse as it moves over the graph.  Then, I want to draw the box region when I grab the cursor (with left mouse key down) and drag it.  Differentiation of these two event types will allow me to unambiguously accomplish this task.
    Thanks,
    Don

    Moving a cursor will interleave mouse move and cursor move events.
    However, you can easily keep state of mouse up/down to distinguish what to do in this particular case. See attached draft (8.20).
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    eventqueue1.vi ‏29 KB

  • How to execute a method on mouse move event on an Image

    Hi All,
    I want to execute a method on mouse move event or mouse click event to an image.
    how can i achieve this?
    TIA,
    Vishal

    I am not sure if commandImageLink or goImageLink solve your requirement.
    But as a workaround you can use set of ClientListener and ServerListener with af:image to achieve what you need.
    using then you can capture client event and convert that into server event which you can use to call a bean method.
    Inside this bean you can call a web service or method binding.
    My first link in previous post shows that very well....
    OR
    http://naive-amseth.blogspot.com/2011/02/calling-methodbindingwebservice-on.html
    Amit
    Edited by: amseth on Feb 15, 2011 12:25 AM

  • Image control mouse move event updates

    I would like to drag the ROI around in the Image control (holding down the left mouse button) and continually read out the ROI coordinates. I can't find a way to do this: the mouse move event does not seem to fire if I hold the left mouse button down. I assumed that I would have
    1. Mouse down when I click and hold.
    2. Mouse move when I move the ROI around.
    3. Mouse up when I release the left mouse button.
    This does not seem to be the case.
    I've done a simple workaround which is
    1. Use the key up event to check that the space bar has been pressed.
    2. Use this to toggle a "lock" boolean which locks the target to the mouse coordinates.
    3. Use the mouse move event to return the Image Control Mouse Coordinates property.
    4. Unlcok the target from the mouse coordinates by pressing the space bar again.
    This kind of works, but it is much less intuitive than the standard windows "click and drag".
    Any comments appreciated.
    Thanks.
    PS The Image Control is excellent, it has saved me lots of development time. Also, the ROI tools are hugely useful.

    If you filter the mouse down event (MOUSE DOWN?) then the coordinated are always returned on mouse move event weather the mouse is down or not.  I did get the coordinates when the left button was down anyway it was just when the right button was down which the move event was not handled (due to the popup menu consuming the event first?)  I thing there is a good way to do this with dynamic event registration, and NI has a similar example of drag and drop of controls, but I am not at my LV machine to look for it right now.  If I am wrong I am sorry it is early and my coffee is not brewed yet.
    Paul
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

  • Right-click down mouse-move gives no onMouseMove event in Safari on  Mac

    I am trying to detect on-mouse-event in JavaScript, when the mouse is moving while the right-button is down in Safari on Mac. But it seems the onmousemove event is not fired.
    Note: I am able to detect the mouse move combined with right mouse down on windows event FF on Mac.
    To see also the following links to test:
    http://www.codelifter.com/main/javascript/capturemouseposition1.html
    http://www.webreference.com/programming/javascript/mk/column2/
    Thanks.
    Laine

    I figured that the form wasn't public, but I asked just in case.
    Yahoo in general is not very Mac-friendly, but still, what you are experiencing is not normal and must be very frustrating, especially when someone is looking over your shoulder (isn't that when computers act up the most?).
    Because the form works in Internet Explorer, the problem is not a general OS X problem, but if this is the only form that you have problems with in Safari, then my first guess is that the page the form is on is not written to the accepted standards for writing web pages. Safari is one of the least forgiving when it comes to bad or incorrect coding of web pages.
    If you have this problem on all or most forms, but things continue to work in Internet Explorer, then one thing I would try is to delete Safari's Preference file. I have seen all sorts of seemingly unrelated but Safari-specific problems arise when this file gets corrupted (which isn't often). The file is named com.apple.Safari.plist. Not all problems are caused by a bad preference file, so this procedure may not work.
    First quit Safari. You can copy the file name (com.apple.Safari.plist), click on the Spotlight icon in the upper right of your screen, and paste it in the search box. One entry should be found. If you click on "Show All" in the results window, a larger Spotlight window will appear and you can drag com.apple.Safari.plist to the Trash from that window. You will loose any changes you have made in Safari's Preferences and a new one will be created when you restart Safari.
    You might want to consider Firefox as an alternate browser. Internet Explorer is now longer being updated or developed and is now behind the times and renders many pages poorly.

  • Mimicking mouse move event

    Hi,
    I'm using flex through a plugin, and not though a browser (like most people do). For some strange reason my flex SWF doesn't receives mouse move events. I can get the mouse move events in the application that contains the SWF, and I can tell the SWF that the events has occured, using the externalInterface API.
    Once I received a call that indicates a new mouse position, I want to mimick it as a normal mouse move event. Any ideas on a simple way to do this?
    thanks in advance,
    Vince

    If you have the stage coordinates of the mouse, you can get pretty far by calling getObjectsUnderPoint and dispatching a MouseEvent from the last element in the array (converting the stage coordinates to local).
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • Mouse move event when mouse out of stage.

    Hi
      I'm wondering how is this task done that listen to mouse move event when user cursor is out of stage?

    Hi, kennethkawamoto2
        I've tried in this way: use "stage.mouseX, stage.mouseY" these two values when cursor is out of stage, and it worked quite well till now,
    If you mind discribe the issue that you've metion that " Flash does not report mouse location correctly beyond stage.." more in detail, I think I should avoid this. Thank you very much!

  • Acquiring High resolution data from usb mouse movement

    Is there a way of acquiring high resolution data from the movement of a usb mouse?  I have a NI PCI 6221 daq card to use. I have a Pentium 4 PC with 1 Gb of RAM. I need to get the position, velocity and acceleration of the mouse.
    Is there a way to do it with the above hardware.
    Thanks in advance

    I don't see how you could use a PCI-6221 to get high resolution mouse movement measurements. The PCI-6221 can acquire voltages at up to 250kS/s, but what voltage would you measure? It could also read in digital data at 1MHz, but you would have to be able to understand the USB communication protocol your mouse uses, and I doubt that your mouse vendor will give out that information. You might be able to take your mouse apart and hook up leads to the sensors around the trackball and do a sort of quadrature encoder application, but there's no guarantee we're dealing with TTL digital signals here (you might even be using an optical mouse!).
    Your best option - and I have no idea how good this option is - is to use the driver already installed for your usb mouse. What software application are you going to use to program your application that will measure the mouse movements?
    If you would consider using LabVIEW, you could set up an event structure to capture mouse movements across the front panel. Each event registered includes a timestamp from the CPU's millisecond clock as well as the coordinates of the mouse. If you stored up a buffer of previous mouse positions and times, you could infer a velocity, perhaps with the help of interpolation functions.
    All of this would have somewhere on the level of millisecond timing accuracy. Were you envisioning something else?
    Jarrod S.
    National Instruments

  • How to change the mouse cursor icon type when mouse moves out of client area ( propertysheet) WTL?

    I got stuck with an issue in property sheet .I want to load different cursor when the mouse position is within the client area and load another when moves out of the client area.
    In the porpetysheet I added four page. In the first page when I click next I am loading cursor of IDC_WAIT type and loading IDC_ARROW when the mouse moves out of the client area.
    In the page class I triggered the event for WM_MOUSEMOVE as follow:
        MESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove)
    LRESULT OnMouseMove(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
    if(TRUE == m_bIsNextBtnClicked)
    ::SetCursor(LoadCursor(NULL, IDC_WAIT));
    else
    ::SetCursor(LoadCursor(NULL, IDC_ARROW));
    return TRUE;
    This event is getting triggered and absolutely had no issue with this. Similarly I tried adding `MESSAGE_HANDLER(WM_MOUSELEAVE, OnMouseLeave)` this event making an assumption that this will get triggered if the mouse moves out of the client area,  but
    this event did not get triggered at all.If this is not the mouse event to be triggered for mouseleave which event should I trigger?
    LRESULT OnMouseLeave(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
    ::SetCursor(LoadCursor(NULL, IDC_ARROW));
    return TRUE;
    Now when I click Next button , **I was actually calling a function which is taking sometime to return** . Before to this function I am loading IDC_WAIT cursor i.e., 
     `::SetCursor(LoadCursor(NULL, IDC_WAIT));` . 
    Now when move the mouse cursor on to the non-client area I want to load IDC_ARROW cursor i.e., 
        ::SetCursor(LoadCursor(NULL, IDC_ARROW)); 
    When the moves on to the non-client area I am handling the mouse event in sheet derived class as follows,
    MESSAGE_HANDLER(WM_NCMOUSEMOVE, OnNCMouseMove)
    LRESULT OnNCMouseMove(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
    ::SetCursor(LoadCursor(NULL, IDC_ARROW));
    return 0;
    This event is not getting triggered until unless the function in the Next button event is executed.
    I want both of them to be done in parallel i.e, click Next button now hover mouse on the client area, Busy icon should come and when mouse moves out of the client area then IDC_ARROW icon should come.
    LRESULT OnWizardNext()
    ::SetCursor(LoadCursor(NULL, IDC_WAIT));
    m_bIsNextBtnIsClicked = TRUE;
    BOOL bRet = MyFun();
    m_bIsNextBtnIsClicked = FALSE;
    //Until this function(MyFun()) is executed **WM_NCMOUSEMOVE**
    //event is not getting triggered.But this event should get triggered and I
    //should be able to see the change of cursor within and out of client area.
    Can anyone kindly help me to solve this issue.
    SivaV

    Hello
    sivavuyyuru,
    For this issue, I am trying to involve someone to help look into, it might take some time and as soon as we get any result, we will tell you.
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to use touch start, touch move, mouse down, mouse move to move elements in edge

    How to use touch move and mouse move events events to move elements n edge?

    Here is my code for a vertical carousel for mouse and touch interaction.  it's not perfect, but it does the job.  change from Y to X for horizontal path.  past at Stage.compositionready event.
    // these are my elemens
    var temp1 = sym.getSymbol("vmenu2").$("tvchannels").position().top;
    var temp2 = sym.getSymbol("vmenu2").$("videosondemand").position().top;
    var temp3 = sym.getSymbol("vmenu2").$("radiochannels").position().top;
    var temp4 = sym.getSymbol("vmenu2").$("music2").position().top;
    var temp5 = sym.getSymbol("vmenu2").$("info").position().top;
    var temp6 = sym.getSymbol("vmenu2").$("vrtour").position().top;
    var temp7 = sym.getSymbol("vmenu2").$("weather").position().top;
    var temp8 = sym.getSymbol("vmenu2").$("clock").position().top;
    var temp9 = sym.getSymbol("vmenu2").$("settings").position().top;
    var tempa = sym.getSymbol("vmenu2").$("tvchannels").height();
    var tempb = 200;
    var tempdiff = temp2 - temp1;
    var y1=0;
    var y2=0;
    var t = 0;
    $(document).bind("touchstart", function(e) { 
      e.preventDefault(); 
      y1 = e.originalEvent.touches[0].pageY;
      temp1 = sym.getSymbol("vmenu2").$("tvchannels").position().top;
      temp2 = sym.getSymbol("vmenu2").$("videosondemand").position().top;
      temp3 = sym.getSymbol("vmenu2").$("radiochannels").position().top;
      temp4 = sym.getSymbol("vmenu2").$("music2").position().top;
      temp5 = sym.getSymbol("vmenu2").$("info").position().top;
      temp6 = sym.getSymbol("vmenu2").$("vrtour").position().top;
      temp7 = sym.getSymbol("vmenu2").$("weather").position().top;
      temp8 = sym.getSymbol("vmenu2").$("clock").position().top;
      temp9 = sym.getSymbol("vmenu2").$("settings").position().top;
      t = 1;
    $(document).bind("touchend", function(e) { 
      e.preventDefault(); 
      t = 0;
    $(document).bind("touchmove", function(e) { 
      e.preventDefault(); 
      //var x = e.originalEvent.touches[0].pageX;
      y2 = e.originalEvent.touches[0].pageY;
      //sym.getSymbol("vmenu2").$("tvchannels").css({top: y, left: x}); 
      if (t==1) {
        var y = y2 - y1; 
        var top1 = temp1 + y + tempdiff;
        var top2 = temp2 + y + tempdiff;
        var top3 = temp3 + y + tempdiff;
        var top4 = temp4 + y + tempdiff;
        var top5 = temp5 + y + tempdiff;
        var top6 = temp6 + y + tempdiff;
        var top7 = temp7 + y + tempdiff;
        var top8 = temp8 + y + tempdiff;
        var top9 = temp9 + y + tempdiff;
        if (top1<10) {
          if (top9>250) {
            sym.getSymbol("vmenu2").$("tvchannels").css({top: top1}); 
            sym.getSymbol("vmenu2").$("videosondemand").css(); 
            sym.getSymbol("vmenu2").$("radiochannels").css();
            sym.getSymbol("vmenu2").$("music2").css();
            sym.getSymbol("vmenu2").$("info").css();
            sym.getSymbol("vmenu2").$("vrtour").css();
            sym.getSymbol("vmenu2").$("weather").css();
            sym.getSymbol("vmenu2").$("clock").css();
            sym.getSymbol("vmenu2").$("settings").css();
    var d = 0;
    $(document).bind("mousedown", function(e) { 
      e.preventDefault(); 
      y1 = e.pageY;
      temp1 = sym.getSymbol("vmenu2").$("tvchannels").position().top;
      temp2 = sym.getSymbol("vmenu2").$("videosondemand").position().top;
      temp3 = sym.getSymbol("vmenu2").$("radiochannels").position().top;
      temp4 = sym.getSymbol("vmenu2").$("music2").position().top;
      temp5 = sym.getSymbol("vmenu2").$("info").position().top;
      temp6 = sym.getSymbol("vmenu2").$("vrtour").position().top;
      temp7 = sym.getSymbol("vmenu2").$("weather").position().top;
      temp8 = sym.getSymbol("vmenu2").$("clock").position().top;
      temp9 = sym.getSymbol("vmenu2").$("settings").position().top;
      d = 1;
    $(document).bind("mouseup", function(e) { 
      e.preventDefault(); 
      d = 0;
    $(document).bind("mousemove", function(e) { 
      e.preventDefault(); 
      //var x = e.originalEvent.touches[0].pageX;
      y2 = e.pageY;
      //sym.getSymbol("vmenu2").$("tvchannels").css({top: y, left: x}); 
      if (d==1) {
        var y = y2 - y1; 
        var top1 = temp1 + y + tempdiff;
        var top2 = temp2 + y + tempdiff;
        var top3 = temp3 + y + tempdiff;
        var top4 = temp4 + y + tempdiff;
        var top5 = temp5 + y + tempdiff;
        var top6 = temp6 + y + tempdiff;
        var top7 = temp7 + y + tempdiff;
        var top8 = temp8 + y + tempdiff;
        var top9 = temp9 + y + tempdiff;
        if (top1<10) {
          if (top9>250) {
            sym.getSymbol("vmenu2").$("tvchannels").css({top: top1}); 
            sym.getSymbol("vmenu2").$("videosondemand").css(); 
            sym.getSymbol("vmenu2").$("radiochannels").css();
            sym.getSymbol("vmenu2").$("music2").css();
            sym.getSymbol("vmenu2").$("info").css();
            sym.getSymbol("vmenu2").$("vrtour").css();
            sym.getSymbol("vmenu2").$("weather").css();
            sym.getSymbol("vmenu2").$("clock").css();
            sym.getSymbol("vmenu2").$("settings").css();

  • How to detect mouse movement/key press on Mac?

    Need to write a VI that will detect/report mouse movement (ie. returns it's location) and any key (or key combinations) pressed. And, to send the mouse pointer to any location on screen. Using Labview 6i on Mac.

    The event structure is new to LabVIEW 6.1. I could post 6.1 code but I cannot save the structure for previous and LabVIEW will not open a VI from a newer version. The best place to learn about the event structure is on the What's new in LabVIEW 6.1 page.
    http://amp.ni.com/niwc/labview/lv.jsp?node=1381

  • Mouse Down and Mouse Move  and scroll ?

    Hi,
    Here is what I want to do:
    Whenever a user presses the mouse down and the moves the mouse, I want to synchronize the scrollbar thumb and the mouse. How is it possible?
    thanks.

    hi,
    there are 2 ways to do this depending on what you need from the mouse move
    1. To get the difference from when the mouse is pressed
    on the mousedown event your store the mouse coordinates -
    myX=   stageX   or LocalX    myY=  stageY  or LocalY 
    on the mousemove event you subtract the current co-ordinates from the saved cordinates
    myXDif = myX-currentX
    myYDif = myY-currentY
    the difference will be negative or positive you can use that figure to calculate the percentage of range and then set the scrollposition
    2. Just track the mouse
    on the mouse move calculate the percentage position of the mouse to set the scrollbars
    HorizontalScrollPostion= the Max horizontal value * (LocalX /Width)
    VerticalScrollPosition= the max vertical value * (LocalY/Height)
    David

Maybe you are looking for