HTML/JS: Capturing mouse events while Air is out of focus

Hi,
I've been trying to determine if it is possible to receive mouse events (like MOUSE_WHEEL) if the Air window does not currently have focus. I'd like my application to support the mouse wheel for scrolling while the cursor is over the application, without requiring the user to click the application and gain focus. My application uses JavaScript to scroll an unordered list within a DIV set to overflow:hidden (to prevent the native scrollbar from appearing).
Thanks for your help!
Andrew

I doubt that AIR would pick up events fired while not having focus. Perhaps you could fake it by creating an AIR project that runs "fullscreen", but has a smaller active window. Anywhere your mouse went it would still capture the scrolling event, but you could conditionalize it so that it only worked in certain areas.

Similar Messages

  • [svn:fx-3.x] 9228: Fix off-screen mouse events in AIR.

    Revision: 9228
    Author:   [email protected]
    Date:     2009-08-11 11:59:47 -0700 (Tue, 11 Aug 2009)
    Log Message:
    Fix off-screen mouse events in AIR.
    QE Notes: None
    Doc Notes: None
    Bugs: SDK-21453
    Reviewer: darrell
    tests: checkintests
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-21453
    Modified Paths:
        flex/sdk/branches/3.x/frameworks/projects/airframework/src/mx/managers/WindowedSystemMana ger.as

    now I have this and it still doesn't work.
    Section "ServerLayout"
    Identifier "Simple Layout"
    Screen "Screen 1" 0 0
    InputDevice "Mouse1" "CorePointer"
    InputDevice "Touchpad" "SendCoreEvents"
    InputDevice "Keyboard1" "CoreKeyboard"
    Option "OffTime" "1"
    EndSection
    Section "ServerFlags"
    Option "AutoAddDevices" "False"
    Option "DontZap" "false"
    EndSection

  • Capturing Mouse Events On MediaPlayer

    Hi,
    I have created a video conference application based on JMF. In this application I am using MediaPlayer control to play the rtp stream. Now I want to capture Mouse Events like MouseClick and MouseMove. But sorry to say that I am not getting any event on MediaPlayer control. I have tried this on other controls and successful. Can anybody tells me how to capture mouse events on MediaPlayer.
    --ibrar                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Mouse Events may only be capture INSIDE the java application frame. SO, if your desktop is not a java component, you will not be able to capture the events.
    However, you could maybe use JNI to use native methods so as to get the location of the mouse...
    vincent

  • Capturing Mouse Events on Desktop??

    Is there a way to capture mouse events on the Desktop. I would like to be notified of the Mouse Location and Click Events for the entire Desktop.

    Mouse Events may only be capture INSIDE the java application frame. SO, if your desktop is not a java component, you will not be able to capture the events.
    However, you could maybe use JNI to use native methods so as to get the location of the mouse...
    vincent

  • Capture mouse events

    Hi all,
    i want to capture mouse events like mousedown, mouseup and mousemove by clicking on the tree node of <htmlb:tree>.
    Have any one some Idee?
    Greeting,
    ag

    Hi all,  
    i solved with your help the problem as follows:
    thank you all.
    PS: how can i Reward and close this topic?
    <%data l_replace type string.%>
    <%concatenate 'onSubmit(' '''' 'OnInputProcessing(this.id)' '''' ',this.id' ')' into l_replace.%>
    <bsp:findAndReplace find = 'onclick="' replace = 'onMouseDown="<%=l_replace%>;' >
    <bsp:findAndReplace find1 = "<td" replace1 = "<td bgcolor=green" >
          <htmlb:tree id     = "HDrag"
                      table  = "<%=p_0costtree %>"
                      title  = "Tree Left"
                      width  = "100%"
                      height = "100%"
                      onTreeClick = "TreeClicked"/>
        </bsp:findAndReplace>
        </bsp:findAndReplace>

  • Capturing mouse events from a loaded module.

    I've defined a module and have it to were the mouse
    coordinates (through mouse events) are updating bindable, public
    variables in the module itself.
    In the app parent app (that's loaded the module), i want to
    display the coordinates from the loaded module as it moves around.
    Like I said, I'm close, to where I capture and handle the
    move event in the module itself, I just need to access that info
    from the parent app, etc...
    Any help is appreciated.
    -fd

    not that it matters now, but i figured it out.
    thanks anyway...
    -fd

  • Ignore Mouse-Events while being in screensaver

    Hi,
    i am wondering if it is possible to "somehow" ignore Mouse-Input/Events while a screensaver (maybe a special one which offers that as option) is running.
    So basically that you can stop the screensaver only using your keyboard.
    Any idea is appreciated
    Best regards
    fidel

    Why? Maybe so it doesn't kick out of the screen saver when the mouse gets bumped?
    Anyway, you said any idea is appreciated, so the only way I can think of is if the screen saver is the Slideshow screen saver using iPhoto photos. Launch iPhoto, select an event and click on Slideshow. The photos will play like the Slideshow screen saver and moving the mouse will only bring up a small control window, which goes away in about a second after the mouse stops moving.
    A low tech option would be to disconnect the mouse.

  • How can I disable any mouse event while is another is processing?

    Hi!
    I've a problem and I need some help.
    I'm downloading an image in the MouseAdapter's mouseClicked method. So I need to disable any other mouse events produced durring this download. These events can be removed from the queue or is there is any way to disable entering mouse events to the queue while another one is processing?
    If anyone can halp me, thanks a lot.

    Interesting situation. I would suggest that the downloading be done on another thread; long processes shouldn't be handled on the swing thread in most situations. Then to stop the mouse events you'd simply disable the component that has the mouse listener until the image has finished loading. That way these events will be processed and discarded while the image is loading.
    ie,
    public void mouseClicked(MouseEvent e)
      final Component source =  (Component)e.getSource;
      source.setEnabled(false); //stop further mouse events.
      new Thread()
          public void run()
             loadImage(); //should not return until image is loaded
             source.setEnabled(true);
    }Hope that helps. :)

  • OnMouseDown event? + Capture mouse location while click&drag?

    Hello,
    I'm new to Photoshop plug ins. Actually, I'm still elaborating
    if I will be able to write a plug in from what I intend to do.
    I have the following question:
    In JavaScript I can capture a onMouseDown event and I can
    also capture the mouse location (?) while I click&drag
    within a rectangle (div..).
    Is this possible in a photoshop plugin?
    Thank You, John

    In a plugin, you provide the UI code.
    So you can capture whatever you want within your own dialog/window.

  • Capture mouse event(s) on XYgraph plot legend

    I notice that when I move the mouse over the plot name portion of the plot legend, the mouse icon changes.  If I left-click in this portion, the entire plot name region is highlighted. What event(s) and/or properties do I use to capture this behavior.  I would like to know the size and/or location of the plot name region highlighted.  I'm using LV 2010.  I know about the Legend.Size and Legend.Position properties. 

    Faustina:
    Unfortunately, there isn't an event we can latch onto when the plot within the legend is clicked on. As a workaround, we can add a radio button control beside the legend to select various plots. The radio button indices match up to the plot indices, so we can still select the active plot and rename it.
    I've attached a small example that allows the user to select a plot, and rename it from a menu of presets. You'll probably want to adapt it to run in a state machine or event structure, but the logic for changing plot names is there.
    Caleb Harris
    National Instruments | Mechanical Engineer | http://www.ni.com/support
    Attachments:
    change plot names.vi ‏19 KB

  • Capturing desktop mouse events in java

    hi,
    i want to capture mouse events running outside JVM,how do i get
    it.example if click on some application for opening it.how will i get it in my java prog.
    bye

    There is an example,it works well .
    import java.awt.*;
    public class CatchMouse {
         public static void main(String[] args) {
              int limit=10;
              Point mp=null;
              for(int i=0;i<limit;i++){
                   mp=MouseInfo.getPointerInfo().getLocation();
                   System.out.println(mp.x+","+mp.y);
                   try{
                        Thread.sleep(500);
                   }catch(InterruptedException ie){
    }I hope it can help you.

  • Capturing global mouse events ?

    Is it possible to capture mouse event generated outside the application as well, as if the java app is running and the user opens a explorer and clicks at something, how can i capture that action ?

    not with pure Java. JNI with native code

  • Need More Mouse Events

    [http://forums.sun.com/thread.jspa?messageID=10811388|http://forums.sun.com/thread.jspa?messageID=10811388]
    During search over net I found the above thread and it seems to be describing the same problem which I am also facing. For my application also I need to capture all the mouse events while dragging. I tried the soluiotn mentioned at this thread to solve this problem by overrinding the below method in several ways:
    protected AWTEvent coalesceEvents(AWTEvent existingEvent,AWTEvent newEvent);
    Even after several attempts, I could not succeed. Can you please suggest how to do that. I was not able to reply to above thread so creating this new thread.
    Thanks

    I wanted to see if a timer based approach does indeed produce a smoother curve than just simply listening for mouse drag events. What I came up with below was the resulting test code. Lo and behold, using a timer does indeed produce a smoother curve. But it wasn't because it was capturing more mouse positions, it was because it was capturing less. Ain't that a kicker? Another interesting thing is that according to the source code, coalesceEvents is a no-op. The documentation, however, would have you believe that it coalesces mouse events as I thought it did.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.GeneralPath;
    import javax.swing.SwingUtilities;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.Timer;
    import javax.swing.BorderFactory;
    public class Test {
        private static class TimerBasedPanel extends JPanel implements MouseListener {
            private GeneralPath line;
            private Timer mousePosQuerier;
            private Component mouseEvtSource;
            private int pointCount;
            public TimerBasedPanel(Component mouseEventSource) {
                mousePosQuerier = new Timer(15, new ActionListener() {
                    Point lastMousePoint = new Point(-1, -1);
                    public void actionPerformed(ActionEvent e) {
                        Point p = MouseInfo.getPointerInfo().getLocation();
                        if (p.x != lastMousePoint.x || p.y != lastMousePoint.y) {
                            lastMousePoint.setLocation(p);
                            SwingUtilities.convertPointFromScreen(p, mouseEvtSource);
                            line.lineTo(p.x, p.y);
                            pointCount++;
                            repaint();
                mouseEvtSource = mouseEventSource;
            public void paintComponent(Graphics g) {
                super.paintComponent(g);
                if(line != null) {
                    ((Graphics2D) g).draw(line);
            public void mousePressed(MouseEvent e) {
                line = new GeneralPath();
                line.moveTo(e.getX(), e.getY());
                pointCount = 1;
                mousePosQuerier.start();
            public void mouseReleased(MouseEvent e) {
                mousePosQuerier.stop();
                repaint();
                System.out.println("Timer Based, Points Captured: " + pointCount);
            public void mouseEntered(MouseEvent e){}
            public void mouseExited(MouseEvent e){}
            public void mouseClicked(MouseEvent e){}
        private static class DragEventsPanel extends JPanel
                implements MouseListener, MouseMotionListener{
            private GeneralPath line;
            private int pointCount;
            public void paintComponent(Graphics g) {
                super.paintComponent(g);
                if(line != null) {
                    ((Graphics2D) g).draw(line);
            public void mousePressed(MouseEvent e) {
                line = new GeneralPath();
                line.moveTo(e.getX(), e.getY());
                pointCount = 1;
            public void mouseDragged(MouseEvent e) {
                pointCount++;
                line.lineTo(e.getX(),e.getY());
                repaint();
            public void mouseReleased(MouseEvent e){
                System.out.println("DragEvent Based, Points Captured: " + pointCount);
            public void mouseEntered(MouseEvent e){}
            public void mouseExited(MouseEvent e){}
            public void mouseClicked(MouseEvent e){}
            public void mouseMoved(MouseEvent e) {}
        public static void main(String args[]) {
            JFrame frame = new JFrame();
            JPanel drawPanel = new JPanel() {
                @Override
                protected AWTEvent coalesceEvents(AWTEvent existingEvent,
                                                  AWTEvent newEvent) {
                    if(newEvent.getID() == MouseEvent.MOUSE_DRAGGED) {
                        return null;
                    }else {
                        return super.coalesceEvents(existingEvent, newEvent);
            TimerBasedPanel timerPanel = new TimerBasedPanel(drawPanel);
            DragEventsPanel dragPanel = new DragEventsPanel();
            drawPanel.setBorder(BorderFactory.createTitledBorder("Draw here"));
            timerPanel.setBorder(BorderFactory.createTitledBorder("Uses a timer"));
            dragPanel.setBorder(BorderFactory.createTitledBorder("Listens for drag events."));
            drawPanel.addMouseListener(timerPanel);
            drawPanel.addMouseListener(dragPanel);
            drawPanel.addMouseMotionListener(dragPanel);
            frame.setLayout(new java.awt.GridLayout(0,3));
            frame.add(drawPanel);
            frame.add(timerPanel);
            frame.add(dragPanel);
            frame.setSize(600,200);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);
    }Edited by: Maxideon on Sep 16, 2009 9:56 PM
    Minor error, but now fixed.

  • DISABLE MOUSE EVENT on jlabel

    Dear all,
    I have a jlabel on which i perform a click and the embbeded image switch between start and stop image.
    My problem consists in preventing from performing multiples click/or disabling mouse event while the application starts loading some parameters.
    switchViewLabel.addMouseListener(new MouseAdapter() {
                   public void mouseClicked(MouseEvent e) {
                        //it takes a long time
                                   onSwitchViewButtonClick();
    protected void onSwitchViewButtonClick() {
              System.out.println("onSwitchViewButtonClick");
              if (canGo) {
                   System.out.println("canGo");
                   canGo = false;
                   MainWindowPeer.getInstance().setCursorToWait();
                         //this action load parameter
                            CommandWindow.getInstance().switchView();
                         refreshSwitchViewButton();
                   MainWindowPeer.getInstance().setCursorToDefault();
                   canGo = true;
         } But on my console i have noticed :
    canGo
    onSwitchViewButtonClick
    canGo
    onSwitchViewButtonClick
    canGo.....
    It looks like we store mouse event anywhere and for each event we execute onSwitchViewButtonClick code and consume event.(it seems to not be asynchronous)....
    How to do ???
    Thanks for any helps..

    Dear all,
    yes i want to ignore mouse events until the processing is done.But how to perform process in separate thread and what is a semaphore.Is it possible to have much more explanation...
    Shall i do following code..
    mouseAdapter = new MouseAdapter() {
                   public void mouseClicked(MouseEvent e) {
                        SwingUtilities.invokeLater(new Runnable(){
                             public void run() {
                                  //switchViewLabel.removeMouseListener(mouseAdapter);
                                  onSwitchViewButtonClick();
                                  //switchViewLabel.addMouseListener(mouseAdapter);
              };Thanks you in advance...

  • How can I capture mouse click events on BSP or Web Dynpro ABAP Screen

    hi Guys,
    Currently we have a user inactivity problem,
    the requirement is: if user is clicking on BSP/Web Dynpro ABAP screen, he/she is considered active. so we need an mechanism to capture the mouse click event.
    Using Firebug, we found that this js is in the iframe which contains BSP/web dynpro scrren: /sap/public/bc/ur/nw5/js/languages/urMessageBundle_en.js
    we want to find this js file & put in some javascript code to track user's mouse click, but i cannot find it on server.
    while in ie if we type http://host:port/sap/public/bc/ur/nw5/js/languages/urMessageBundle_en.js
    this file can be downloaded, means this file is there.
    Any one can help on this issue? find the js file or another way to capture the mouse click event.
    Thanks a lot with points!

    Hi  Feng Guo,
                        We can not capture mouse click events on Web Dynpro ABAP Screen . I am not sure about BSP. But as for as I know the portal keep active the iViews until unless mouse clicks happens.
    But for your problem I think you can get solution by setting iView Expiration to some more time period.
    Regards,
    Siva

Maybe you are looking for

  • Retrieving data from a MATLAB script node

    I am creating a VI that imports and manipulates arrays of data points and then plots them in Labview. When I run my Matlab script in Matlab there are no errors and all the assigned variables exist in the form that they should exist but for some reaso

  • After startup my iMac's screen turns black

    My iMac start ups normal. I hear the chime, followed by the apple logo and gears. Then the screen goes black but you can still see the cursor clear as day. I can also turn the brightness up and down, but it is still black. Is there anything I can do

  • How can I use stored music on my iphone 6 as a ringtone?

    How can I use stored music on my iphone 6 as a ringtone?

  • Error 500 calling an ES from a BPM

    Hi experts, I have a BPM in XI that calls an ES many times. The standard ESs called are the Create Project Create Network an Create Activity. The BPM calls first of all the create project, then calls the create network, once for each network realted

  • Setting text to overflow into another text component in flex

    This was pretty easy when I've done it in html but I can't find any info on how to incorporate this into flex. I want to get this sort of thing into my app where once the text reaches the bottom it wraps underneath the bottom of the left hand image t