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

Similar Messages

  • How to detect mouse move

    Hi Guys and Gals out there,
    Actually I've problem with mouse. I think I better explain a little bit my situation down here.
    I have an Image with a few signatures, and I want user get every signature to apply on my form then I'm going to save that signature with personal data for every signature. Normally what we did is we select the signature (image) with mouse. But the problem is I don't know how... I really hope that some what who did it before could help me in this problem..... I'm sorry because I still new in Java....
    Thanks in advance,
    -Lee-

    Hi Lee
    Look at this program, it have 2 Components on the frame, lai is the 'big Image' and t2 is the Rectangle.
    The mouseListener is added to 'lai' and the location of 't2' is changed when the mouse is dragged. when the mouse is released i create a new bufferedImage and draw a piece of the 'big Image' into it.
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.text.*;
    import java.awt.event.*;
    import java.awt.image.BufferedImage;
    public class Signi extends JFrame
         Image         map;
         TheMap        lai;
         TheSq         t2;
         BufferedImage sigB;
         Graphics      sigG; 
    public Signi() 
         getContentPane().setLayout(null);
         addWindowListener(new WindowAdapter()
        {     public void windowClosing(WindowEvent ev)
              {     dispose();
                   System.exit(0);}});
         setBounds(10,10,700,530);
         t2  = new TheSq();     
         getContentPane().add(t2);
         lai = new TheMap();      
         getContentPane().add(lai);     
         lai.addMouseListener(new MouseAdapter()     
              {     public void mouseReleased(MouseEvent m)
                        sigB = new BufferedImage(t2.getWidth(),t2.getHeight(),BufferedImage.TYPE_3BYTE_BGR);
                        sigG   = sigB.createGraphics();
                       sigG.drawImage(map,0,0,t2.getWidth(),t2.getHeight(), 
                                         t2.getX(),t2.getY(),
                                             t2.getX()+t2.getWidth(),t2.getY()+t2.getHeight(),null);
         lai.addMouseMotionListener(new MouseMotionAdapter()          
              {     public void mouseDragged(MouseEvent m)
                        t2.setLocation(m.getX(),m.getY());
         setVisible(true);
    public class TheMap extends JComponent
    public TheMap()
         map = getToolkit().getImage("map1.gif");
         MediaTracker tracker = new MediaTracker(this);
         tracker.addImage(map,0);
         try   {tracker.waitForID(0);}
         catch (InterruptedException e){}
         setBounds(2,2,map.getWidth(null),map.getHeight(null));
    public void paint(Graphics g)
         g.drawImage(map,0,0,null);
    public class TheSq extends JComponent
    public TheSq()
         setBounds(1,1,120,60);
    public void paint(Graphics g)
         g.setColor(Color.red);
         g.drawRect(0,0,getWidth()-1,getHeight()-1);
    public static void main (String[] args) throws InterruptedException
         Signi fr = new Signi();
          if you like i can email the code to you.

  • How can we trape the Keys Pressed on the Keyboard and do action depending on the keys

    I want to know how we can capture the keys pressed on the keyboard by the user and do necessary action depending on the key pressed by the user....
    For example.... If user press Alt+q the form should go in the Enter Query Mode.
    Can anyone tell me how i can do this in Form 6i....
    Please Help me out from this problem...
    Thanks in Advance
    Shan

    Can somebody point me to what I need to use to
    intercept all the 'keys' for an application.
    At the moment I have set Focus to parts of the
    application when the Mouse is over it, and then get
    the Keys with a KeyListener.
    Is there a way to get the keys, as long as the Java
    app is active.
    - Its an image display program, and I want to use keys
    for - next image , zooom etc etc.
    If soemone could just point me to the right part of
    the API to look in?java.awt.Toolkit.addAWTEventListener()
    then use the mask defined in AWTEvent.KEY_EVENT_MASK to listen to all the events.
    Steve

  • I have and apple tv,,..how do i play movies,from my apple mac,onto the apple tv..my movies are not on my itunes,but on an external hard drive...i just want to mirrow whats playing,on my mac to the tv...

    I have and apple tv,,..how do i play movies,from my apple mac,onto the apple tv..my movies are not on my itunes,but on an external hard drive...i just want to mirrow whats playing,on my mac to the tv...

    Are the movies in the correct format:
    Video formats
    H.264 video up to 720p, 30 frames per second, Main Profile level 3.1 with AAC-LC audio up to 160 Kbps per channel, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats
    MPEG-4 video, up to 2.5 Mbps, 640 by 480 pixels, 30 frames per second, Simple Profile with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats
    Motion JPEG (M-JPEG) up to 35 Mbps, 1280 by 720 pixels, 30 frames per second, audio in ulaw, PCM stereo audio in .avi file format
    Audio formats supported
    HE-AAC (V1), AAC (16 to 320 Kbps), protected AAC (from iTunes Store), MP3 (16 to 320 Kbps), MP3 VBR, Audible (formats 2, 3, and 4), Apple Lossless, AIFF, and WAV; Dolby Digital 5.1 surround sound pass-through
    When you say tit only sees your music folder, are you saying it only sees your music folder or does it see other empty folders.

  • How to detect mouse clicks on desktop?

    Hi All,
    I need to detect mouse clicks on the desktop and find out mouse position on the screen. How to listen to mouse events if I don't have any swing components like containers, panels, windows, etc? All things like "addMouseListener" are supposed to be with such components. But my program is running in the background and it doesn't have any graphical interfaces. So, I need to detect if a mouse button is pressed at any position on the screen.
    Thanks for any help!

    Why? What program feature do you intend to offer, by knowing what a user clicks on (besides the application itself).Hi, well what I have to do is to start the application minimized in the system tray. Then the application must be listening for crtl+shift+left click in any part of the desktop or an opened application, when that happens, I have to show a window asking if the user want to take a screenshot starting in the x,y point he clicked, once done, I have to take an screenshot...so on.
    How can I do that? Can anybody give me a hint? Thanks in advance.

  • How do you register multiple key presses at the same time?

    Hi. I'm trying to write a first person game in OpenGL and I'm having some trouble with key listening. Right now I just use the basic AWT KeyListener. The problem that arises is that whenever I hold down a key, such as a movement key, there is a short pause after it moves me in the appropriate direction, and only after the pause does it start continuously moving me. In addition to that, I can't press multiple keys at once to get diagonal movement (I use WASD for movement). Is there something I can do with AWT to fix both of these problems, or is there something other than AWT that I should use that would be better?

    the pause is the typomatic rate of the keyboard, you can avoid that by using the keyPressed and setting a flag then a sleep(myDelayTime).... if they keyRelease--and clearing of the flag--hasn't happened after the sleep, then you're key is still down so keep firing, moving, or what ever.

  • How to get the actual key pressed in a UITextField

    Hi all , now i develop a program on iphone SDK 3.0 GM.
    I have an UITextField (created programmatically) and I have implemented the delegate as well as the UITextFieldTextDidChangeNotification so that I can react to changes in the text values.
    However, I specifically want to know when the user presses the backspace key in the UITextField when there is currently no text in the field. I can't find where I can get a specific notification of the actual key pressed, as opposed to the resulting state of the text. I'm sure there is a way to do this...help?

    I can imagine why you want to do it. I had the same problem myself and managed to circumvent it in a slightly painful way. What I did was to subclass UITextField to create a text field that always had text in it, even when it "seemed" empty. In fact the first character of the text is a space character, and then what follows is the actual text. In this way, your delegate will always get called about a backspace (when it's an attempt to delete the leading space character, obviously you should return NO in the textField: shouldChangeCharactersInRange: replacementString: method). I won't get into the details of exactly how to set everything up, like I said it is kind of elaborate and I wouldn't really recommend it unless you are desperate to have that kind of functionality.

  • Flash video performance poor in Firefox 3 and other newer Gecko-based browsers; fails to detect mouse movement in full-s

    Regardless of configuration, I have found Flash video
    performance on Firefox 3 to be severely sub-par. Numerous visual
    lags occur throughout a typical Youtube video as it cannot seem to
    manage to maintain a steady frame rate. When in full-screen, mouse
    movement is not detected, forcing me to click in a full-screen
    Vimeo video in order to display its controls when I should have
    only needed to move the mouse. I was informed that the technical
    explanation for this is that Flash isn't triggering MouseEvents
    other than MouseEVENT.CLICK.
    In my tests, this behavior also occurred in Flashplayers 9
    and 10 as well as with recent versions of other browsers that also
    use the Gecko rendering engine, namely Camino, Flock and Songbird,
    but not in Firefox 2. I was told by a Mozilla employee that this
    issue can only be solved by Adobe.
    This has forced me to use the Safari browser as my only
    available work-around. I implore that these issues get resolved as
    quickly as possible.

    guys, im exactly experience the same issue here.. any
    solution guys? tks in advantage..

  • How to record mouse movements?

    Hello,
    I have the most updated version of Mac OS on my 2014 Macbook Air. Is there a program I can use to record my mouse strokes and clicks? I am doing a repetitive task and would like for the mouse to move on its own and make the same exact movements and clicks. Is this possible on automator and if so how? And if not, what free program is available which can achieve this?
    Thanks for the input!

    When Automator is started, it normally asks for the kind of document that you want to create. Select "work flow". Then near to the upper right corner of the automator window there will be a red button labeled "record". from that point on all the mouse movements and clicks will be stored in the workflow until you click on the stop recording button that shows on a special floating window that automator displays while your mouse actions are recorded.

  • KeyListener - how to handle series of key pressed

    Hi,
    Is there a way to handle a series of key pressed in the keyPressed(KeyEvent e) method. for instance, I want to popup a dialogbox when the user pressed: F9, 31, F9 ?
    thanks,
    chau

    Is there a way to handle a series of key pressed in
    the keyPressed(KeyEvent e) method. for instance, I
    want to popup a dialogbox when the user pressed: F9,
    31, F9 ?Look at the following.
    import java.awt.event.*;
    import javax.swing.*;
    /* http://forum.java.sun.com/thread.jspa?messageID=2900727 */
    /* http://forums.devshed.com/t218618/s.html */
    class KeyListenerDemo {
        public static void main(String[] args) {
            new KeyListenerDemo().go();
        void go() {
            JTextField field = new JTextField("Press a key, and watch the console.");
            field.setEditable(false);
            field.addKeyListener(new MyKeyListener());
            JFrame frame = new JFrame("KeyListener Demo");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.getContentPane().add(field);
            frame.pack();
            frame.setLocationRelativeTo(null);
            frame.setVisible(true);
    class MyKeyListener extends KeyAdapter {
        public void keyTyped(KeyEvent e) {
            if (e.getKeyChar() == KeyEvent.VK_ESCAPE) System.exit(0);
            System.out.println("Typed: " + e.getKeyChar());
    }It shouldn't take too much imagination to figure out how to make the listener listen for that combination....

  • How to view Slideshows/Movies created in my Mac-Mini´s iPhoto, on iPad 3

    Slideshows I have in iPhoto on my mac-mini, do not show up in the iPhoto on my iPad 3 (Just Photos, Events & Albums).
    How do I get the slideshows (Saved with music in Mac-iPhoto), to show in my iPad´s iPhoto?
    Do I need another app for this?
    By the way, the same applies to the iMovie on my iPad (Do I need to import the movies/Slideshows
    from iPhoto (Mac) into iMovie (Mac) to be able to see them on my iPad?
    All I want to do is view Slideshows/Movies created in my Mac-Mini´s iPhoto,
    on my New iPad (In iPhoto or iMovie if possible).
    Thanks in advance for any help
    AMI

    Thanks for the tip Demo!
    Sadly it is so.
    Don't know why Apple didn't include slideshows into the iPhoto for iPads!
    Solved the problem with Phtosync & Sugarsync Apps.
    Another super apps for transfering Movies/Slideshows to your iPod, is VLCstreamer.
    You can even watch movies that are on your Mac or extension drives via WiFi , streamed to the iPad
    without even having to upload them to the pad (Which you can do also !).
    Community = Comunication = Conclusion

  • How to detect Caps Lock without pressing any keys

    I am trying to make the password login and would like add this feature to my website and don't know how to do it.
    I wrote the code below to detect the Caps Lock but it couldn't detect the cap lock at start up.
    if(flash.ui.Keyboard.capsLock){trace("CAP WAS ON")}else{trace("CAP WAS OFF");};
    The result for this code is always return "false" unless I put this code in the eventlistener and have to press the keyboard

    you must wait a moment for your stage to initialize.  use a delay of 1ms or so to check for caplock.

  • How I detect mouse wheel movement?

    I never use this for now, and I want to intercept mouse wheel movement (up or down) for to change animation panels (divs) or to make another actions.
    Is not for a scroll of a large stage or div, it's only for to know when the user use the mouse wheel.
    Example: http://www.protest.eu/nl/dames/
    Thank you.

    Are you looking for this ? it may be done easily with Edge Commons
    http://www.edgedocks.com/content/2013/12/using-parallax-scrolling-animate-single-line-code

  • How to determine the exact key pressed when numlock disabled?

    Hi there,
    I am trying track the keyboardevent that triggered by pressing numpad keys as hotkey, but when the numlock is disabled, the same keycode, same keylocation was gotten as pressing in the standard keyboard. how can I determine if the numpad was pressed or the other control keys were pressed?
    Thank you!
    Andy

    Hi there,
    I am trying track the keyboardevent that triggered by pressing numpad keys as hotkey, but when the numlock is disabled, the same keycode, same keylocation was gotten as pressing in the standard keyboard. how can I determine if the numpad was pressed or the other control keys were pressed?
    Thank you!
    Andy

  • How to detect mouse click event?

    Hello,
    I would like to have a vi to detect left, right and no mouse click. I mean that in the vi attached, Button2 should be 0 (no click), 1 (left c.) or 2 (right c.) depending on the event occured in i-1. cycle. My vi is the modyfied version of the one found here:
    http://www.ni.com/example/27663/en/
    Sometimes it works fine, but another time nothing happens when I click.
    I think the main problem is with the execution times at the for loop and event structure.
    Could you help me how to deal with the problem?
    Thanks you!
    Attachments:
    mouse1.vi ‏12 KB

    Hi VampireEmpire,
    Your For loop iterates twice. If an event occures during first iteration everything is fine - Button 2 refreshes during second iteration. But what happens when an event occures during second iteration? Does Button 2 have a possibility to refresh? 
    1. Do you see the problem now?
    2. And if you do - do you really need For loop? I would suggest you trying removing it and connecting shift register to the while loop.
    Bluesheep

Maybe you are looking for

  • Discounted PO's Report

    Dear Experts, Please can suggest the transaction code for LIST OF ALL DISCOUNTED PO's report including DISCOUNT VALUE??? Its either PO's base or VENDOR wise also no problem.

  • Mail rules question on subject and sender fields are empty

    I am getting blank messages delivered to my mailbox and the subject and or sender's name are empty, how do I set up a rule to just delete them?

  • Cant update 3rd Gen Appletv to newest software, Box is 1 month old.

    Since buying this my second Appletv (old one is 2nd Gen) I have not been able to update the software version. Gets to the  1 of 2 screen and then comes back and says failed to update software after about 1.5 hours.  Tried both Ethernet and Wifi just

  • Samsung 250GB HDD HM250JI = PAIN!

    Just wanted to post this to try to save others pain with this drive. I do not recommend this drive with Leopard. Symptoms: Spotlight wont index, stuck on estimating time x hours, safari very slow to type in web forms and unstable ... crashing frequen

  • ALV   diplay

    Hello, How to color a particuler column in ALV ? I am sorry..... How to color a particuler row in ALV ? Message was edited by: Johnn Abraham