Dialog not on display list getting key down events

Hi all,
I have a listener on the stage listening for KEY_DOWN events.
I show a dialog (MovieClip containing a TextField). Click a button
on the dialog to close the dialog. ("close the dialog" == remove
the MovieClip from the display list - the dialog instance is still
around, which I think is part of the issue)
Now, the stage's listener no longer gets KEY_DOWN events
until I click somewhere on the stage. The dialog's text field is
getting the key events. (I don't normally add a KEY_DOWN listener
to this dialog, but I did as a test to see if it was indeed getting
the events.)
How can I get the stage to get KEY_DOWN events again without
clicking it first? There seems to be no way to explictly set
keyboard focus that I can find.

Hi. What happens if you simply request focus to the
MainTimeline? That should seem to do the trick. If focus is on a
removed element (but it still has focus, which seems weird), the
the stage won't get any events.
( 'i' before 'e', except after 'w')

Similar Messages

  • How to separate "Key down" event from panel and numerical control

    Hi, All
    I have a vi proecess key down events for panel and  a numerical control in this panel. the application will do: 
    1. when panel is focused, user can use "up" and "down" key to driver some hardware.
    2. when the numerical control has the focus, "up" and "down" key will change it's value as usual.
    somehow the second one did not work, because the panel "key down" event was trigger as well when I use "up' "down" key inise the numerical control. 
    then I used "Key down?" of numerical control to block the "up/down" key. But the first time when I run the Vi, the panel still got triggered one time. 
    any suggestions on this? test code attached  in this post too. 
    thanks
    CQ
    Solved!
    Go to Solution.
    Attachments:
    KeyDown_Up_valuechange.vi ‏16 KB

    This works for me in 2014.  In short, you just need to check to see if your numeric has the focus.  If it doesn't, then you process the key value.  No need for any other event here except for the stop button.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    KeyDown_Up_valuechange_BD.png ‏32 KB

  • Key down event in background

    Is there a way to make the key down event in the wait event structure run in the background when labview is not the focus? Also what is the difference between the "key down? event" and the "key down event"? I couldn't find a good answer in the LabVIEW help.

    tst wrote:
    To expand a bit on RF's answer, while you can't use the event structure to register for key down events in other windows, there are some potential options:
    You could use the input VIs to poll the keyboard (and you can have a loop which will use a user event to send each new key to an event structure). The main problem with this (and it's a big one) is that it is unreliable. You would have to poll quickly enough (probably at ~20-50 Hz) to have a decent chance of being sure that you're not missing keys and even then it's not guaranteed. The other problem is that you don't know which window was actually in focus.
    You could try getting the window messages from the other window. I have no real experience with Windows messaging, but my understanding is that this will probably require you to write a custom hook in C to get it, but it's possible that this is also possible with the standard Win32 API functions. Even if it is, this is probably not something you want to get into to, but you could try looking it up.
    Actually this Windows Messaging already exists in LabVIEW:
    http://zone.ni.com/devzone/cda/epd/p/id/4394
    However there is a few issues.  It only partially works in Windows 64-bit, and you have to know the handle to the application that you want to intercept key downs for.  I did a quick test and I was able to detect the KEYDOWN event in another VI that was running for for some reason got an error when I tried to get keydown on notepad.  This method would eliminate polling if you can get it to work, and because of this you shouldn't miss any key presses.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • Key down events

    Hi,
    I've been working on code for handling a flash-plugin inside an existing application, and have been looking at getting the flash player working with the Cocoa/CoreGraphics API.
    Thus far, I have plugin loading, focus, mouse handling events all working. But then key events don't work consistently - on some flash applications, the key down events work, but on most they return a '1' but the flash app doesn't respond.
    This is most odd, and a pretty esoteric type of work - I don't know many people who get this kind of work, and it's hard finding people who can share their experiences of this.
    I've been going through the NPAPI docs on the mozilla website and copying a lot of the handling code in WebKit, Chromium and Firefox, but none of it seems to help any more - my handling code works the same way as that does, but the responses for key down events are different.
    So, this is just a last try before I go crazy - has anyone ever seen anything like this before?
    Thanks,
    Tom.

    Well, it is a problem with Flash Player and not Flash. I don't need an experienced Flash developer.
    Seriously though, the nature of the question is so esoteric that I doubt there are many developers anywhere who could give much advice.
    Thanks anyway.

  • InsertionPalette activex control key down event

    Hi,
    Can any one know how to get the key down event of InsertionPalette activex control.
    I have handled the KeyDownEvent but it is not fired while the control is active and key is pressed.
    regards,
    Ceaser

    Ceaser,
    what is the application developement environment you are working with?
    Norbert 
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Key down event handeling when the VI isn't active

    Hi
      I've written a simplel VI that increases or decreases a numerical indicator depending on which key is pressed on the keyboard. But this only works when the VI window is active (the titlebar is blue and not gray). Is there anyway to listen for the key-down event even though the VI is not active?
    In advance thanks
    Georg

    I recently ran into a problem with the Acquire Data.
    See http://forums.ni.com/ni/board/message?board.id=170&message.id=147363
    Just in case....

  • Detecting external keyboard Key Down Events in Ipad2 without EditText Field.

    I am trying to detect key pressed for an external keyboard (bluetooth) in IPad2 , I was only able to do so when the focus is on EditText Field.
    Without the edit text field , the key down events are not captured by the program . Is there any work around for this issue .

    I am trying to detect key pressed for an external keyboard (bluetooth) in IPad2 , I was only able to do so when the focus is on EditText Field.
    Without the edit text field , the key down events are not captured by the program . Is there any work around for this issue .

  • CS3/MAC key down events

    I have a plugin which presents a dialog and does some keyboard input,
    and under mac/cs3 ONLY, indesign is capturing and acting upon key
    down events before the plugin sees them.
    Oddly, key UP events are being passed through normally.
    These events are being delivered to the plugin by the
    mac toolbox function WaitNextEvent.
    Is this a known problem?

    The last time I read about the Mac event manager, WaitNextEvent was deprecated in favour of carbon events. Maybe InDesign now also follows this path.
    http://developer.apple.com/documentation/Carbon/Conceptual/Carbon_Event_Manager/Concept/ch apter_2_section_4.html
    Anyway, bypassing InDesign in order to invoke WNE is bad style. Make yourself familiar with IEventHandler and alike.
    > Is this a known problem?
    If you're working at Extensis then at least one of your users now has found the problem ... . Could be a different reason though, I just saw this post:
    Jeremy Paine, "ID CS3 Control Palette Oddity" #10, 17 Sep 2007 8:33 pm
    Dirk

  • When is Key down event case triggered

    Hi all,
    In event structure there is an event <this VI> key Down? 
    When will this event be triggered... i.e will this event be triggered only in case of a keyboard entry... ?
    Or in case i use a barcode reader, if data gets populated in a control on the Front panel through the barcode reader will this trigger this event...?
    Thanks

    The Key Down event will only be fired when a key is pressed on the keyboard.  If you want to fire an event off of a Front panel control, you can either use a User Event or a property node called Value (Signaling).  This property node will cause a Value Change event to trigger when the value of the Front panel control changes.
    Cheers

  • Weird Digital Display Key Down events

    (Using LV 8.51)
    I have a slider with the digital display shown.  The slider is restricted to 0-50 (I32)  I want the user to be able to type 0-50 in the digital display only.  I have formated the display as %2d and set all limits.  The display allows the user to type any arbitrary number of characters as well an many letters.  I figured out the random letters are the allowable numeric prefixas such as k (for kilo).  I need to not allow the user to type anything in the numeric display except [0-9][0-9].  I figured that I could filter the key down? event.  This did not work.  I placed the key down? event and the key down immediatly restricted the typing to a single character.  What did I do wrong or is this a bug.  Is thare a simpler way of restrictin g the imput (NOT Coersing which is done on the data but limit the input characters).  Thanks I am stuck on this one.
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

    I hope I am doing something wrong but I dont see it.  It seems that independent of registering for the keydown event the action of the slider changes.  I have attached an example.
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA
    Attachments:
    Silder with event filter.vi ‏19 KB

  • Key down event to start something an stop arbirtrary

    hallo,
    what I'm trying to do is to start an event on key down an do a loop , something like move an axis for CNC , and this until i press an arbitrary key again.
    i have already a while loop an an event structure so it would be good just to add something withtout large modifications.
    have anyone an example code for me , please.
    i've looked already in a lots of posts but i can't find anything usefull for me.
    many thanks in advance

    again - lots of ways to do this.
    The attached example is just the fastest I could modify the previous version
    2006 Ultimate LabVIEW G-eek.
    Attachments:
    keydownvi3.vi ‏53 KB

  • How do I remove email address not in contact list.they drop down when in the "to"field trying to either fwd ,send or reply. How did they get there in the first place. And the edit key does not show in my contacts

    When sending email wether reply or fwd or new addresses drop down that not show in my contacts. How do,I remove them and how did they get there?  And the edit key notmshowing in my contacts.
    Someone else's reply  nothing that could be done short of clearing out all contacts and starting over. But these are not in my contacts!!!!!!!!!! So,that is not an answer

    So are you telling me that anyone I ever send n email to will appear in the drop down list but not in contacts? I don't have that many contacts on list so are younsayingmi would have to remove them all to remove the unwanted address in the drop down to go away? If that is not  please explain

  • Configure Formula dialog not being displayed

    I have just installed LabVIEW and I am working thru the tutorials in the Getting Started Manual.  I am at the point where I am adding a Formula to the Generate and Display example VI.  When I place the Formula Express VI on the block diagram I expect to see the Configure Formula dialog box.  No such dialog is displayed.  There is a grey box with no other information placed on the block diagram.  Also, the run buton is shown as 'broken" such that I cannot 'Run" the VI.  I do not have a clue what could be going on here and I am wondering if there was a problem during installation that leaves me without Formula support.  I have not had any problems with placing and configuring any other VI's.
    Please offer any thoughts or suggestions on how to solve this! 
    Thanks,
    Mike

    This is a know issue in LabVIEW 8.5, for more information and a workaround, see:
    http://forums.ni.com/ni/board/message?board.id=170​&message.id=290157
    LabVIEW Champion . Do more with less code and in less time .

  • Custom Component Not Updating Display List

    Hi all... I've created a component which is basically a meter (extends skinnable container). The skin to the component contains two rectangles (background and the actual meter).  This component receives an arraycollection with the following fields value, max and min(the arraycollection I am passing is Bindable). When I initialize and pass the data to be used to draw It works great (keep in mind - only works the first time).  I've created a button that changes the data array and shows the current meter value.  Apparently the meter's value is changing everytime I modify the ArrayCollection I've set to be used for rendering.(dont want to say "dataProvider" because it is not a Flex dataprovider, just a variable )... here is the code...
       public class meter extends SkinnableContainer {
            [SkinPart( required = "true" )]
            public var meter:spark.primitives.Rect;
            [SkinPart( required = "true" )]
            public var meterBackground:spark.primitives.Rect;
            private var _dataProvider:ArrayCollection;
            private var _renderDirty:Boolean = false;
            public function Meter() {
                super();
            public function set dataProvider( value:Object ):void {
                if ( value )
                    if(value is ArrayCollection)
                           _renderDirty = true;
                        _dataProvider = value as ArrayCollection;
                    if(_dataProvider)
                        _dataProvider.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE, propertyChanged);//used both eventlisteners but none actually ever fire off
                        _dataProvider.addEventListener(CollectionEvent.COLLECTION_CHANGE,collectionChanged);
                    invalidateDisplayList();//only happens the first time
            private function collectionChanged(event:CollectionEvent):void
                Alert.show("In collection Change");//this never goes off when I change the "dataProvider"
                _renderDirty = true;
                invalidateDisplayList();
            private function propertyChanged(event:PropertyChangeEvent):void
                Alert.show("In property Change");//this never goes off when I change the "dataProvider"
                _renderDirty=true;
                 invalidateDisplayList();
            public function get dataProvider():Object {
                return _dataProvider;
            override protected function updateDisplayList( unscaledWidth:Number, unscaledHeight:Number ):void {
                if(_dataProvider))
                var span:Number = unscaledWidth / _dataProvider[0].max;
                var meterWidth:Number = _dataProvider[0].value * span;
                meter.width = meterWidth;
                _renderDirty = false;
    And this is the mxml code where I change the "value" field....
    <fx:Script>
    <![CDATA[
    [Bindable]
                private var meterData:ArrayCollection = new ArrayCollection([               
                    {value:80, max:100, min:0}
                protected function mySlider_changeHandler(event:Event):void
                    meterData[0].value = Math.round(mySlider.value)*10;               
                protected function button1_clickHandler(event:MouseEvent):void
                    // TODO Auto-generated method stub
                    var array:ArrayCollection = testMeter.dataProvider as ArrayCollection;
                    var value:Number = array[0].value as Number;
                    Alert.show(value.toString());
                   // testMeter.meter.width= Math.random()*100;
            ]]>//initial value in "meterData" does get drawn...but when it's changed with the slider..nothing happens..
           <custom:Meter id="testMeter" dataProvider="{meterData}" />
            <s:HSlider id="mySlider"
                       liveDragging="true"
                       dataTipPrecision="0"
                       change="mySlider_changeHandler(event)"
                       value="3"/>
            <s:Button click="button1_clickHandler(event)"/>
    Can you help me figure out what's going on??Thanks guys!!!

    Hi.
    Now there are some serious bugs in your code:
    Put a call to super.updateDisplayList(unscaledWidth, unscaledHeight) in your overriden method (or some funky things will start happening or it won't work at all).
    Why don't you check your _renderDirty flag in the updateDisplayList() method? You should do that (personally I would go with commitProperties() instead but it's not much of a difference I guess)
    And now the reason why your events don't fire is that because you use plain objects (just generic istances of Object). Those are not IEventDispatchers and therefore do not fire any events when you change any of the properties (which are all dynamic by the way). You have to define a custom value object class which extends the EventDispatcher (or you can implement IEventDispatcher on your own). So instead of this:[Bindable]
    private var meterData:ArrayCollection = new ArrayCollection([
       {value:80, max:100, min:0}
    You should do something like this:[Bindable]
    private var meterData:ArrayCollection = new ArrayCollection([
       new MyValueObject(80, 100, 0)
    Where MyValueObject could look like this:// this instructs MXML compiler to automaticly implement IEventDispatcher
    // and make all public properties bindable
    [Bindable]
    public class MyValueObject
       public function MyValueObject(value:Number, max:Number, min:Number) {
          this.value = value;
          this.max = max;
          this.min = min;
       public var value:Number;
       public var max:Number;
       public var min:Number;

  • MBP 15" late 2011 VGA 6750m not on display list

    i've upgraded my MAC OS into mountain lion.
    since that time my "about mac" only displaying 1 graphic card (intel hd 3000)
    how to solve the problem to use the 6750m graphic card?

    "About This Mac" "More Info..." will only display the GPU that is in use at the time. If you'd like more control of changing how you graphics cards operate, download Cody Krieger's gfxCardStatus. You can switch from Integrated Only, Discrete Only or use Dynamic Switching. Pretty nifty little tool. Please donate if you find it useful.
    Clinton

Maybe you are looking for