Issue of thread and KeyListener

Hello

My problem is that I don't seem to get all events of all types of users what number I thread that implements KeyListener to capture key events when the user types a phone number. Any ideas on what is wrong? Is there anything else I need to listen to?

Thank you.

only the foreground application gets the key events. with the exception of green, red, menu and I think that convinience key that are broadcast.

Tags: BlackBerry Developers

Similar Questions

  • Threading and reuse of the node to call using reference of buffers (of the required adhesive tape)

    I tried to get the following information in the public domain for years and now that I have the answers, I'll share with those who might be interested.

    Caveat!

    Wrap your head in tape before reading just for the sake of security.

    My two questions were;

    (1) may LV re - use tampons of VI calling when you use VI serve call by reference?

    (2) is used when the use of call by reference UI thread?

    1 when you call a VI using the call through the reference node, the data in the pane of the copied or is node connector - this online as it would be with a Subvi properly implemented?

    Short answer: it's somewhere between the two.

    Long answer:

    The compiler does not know what will be called VI, but there a hint:

    the reference connected to the node of the call by reference. He uses to get the 'Prototype' for the call. Therefore, for optimal performance, use a prototype that has the same 'characteristics placeness' as it is called VI. That said, users don't know what are the "characteristics of the placeness.

    Before getting into the details, I will say that the overhead of these copies should not matter much unless it's a large data structure (a table with lots of items.) or a cluster/class with many fields or containing large networks etc..

    Example 1:

    If the prototype does not change the data, then the compiler assumes that the crux of the call by reference will not alter the data. However, at runtime, a check is made to see if the real called VI will modify the data. If Yes, then a copy is made and past so that the original data can be modified.

    Example 2:

    If the prototype contains an entry that is wired through an exit so that both input and output terminals can use the same buffer memory, but running an audit determines that the real called entry and exit VI do not share a buffer, then a copy will be made from output of the actual call to the original screws (combined input and output) buffer.

    I should also mention that, even with this behavior "are trying to get along with the prototype", it is not always possible to obtain good performance as a Subvi ordinary call. For example, if you have a situation where the prototype does not change the data and passes it through to an exit and then the compiler must assume that the data is changed (because, as in example 2, there are screws that may change even if the called real VI is not).

    And there are a few caveats:

    (1) this behavior "using a prototype" was new for 2009. Before that, we used a method more naïve data of passage that took all the entries will be changed and no outputs don't share a buffer with an entry.

    (2) this behavior can be changed in future versions, if we find additional optimizations.

    (3) this behavior is the same that we use for the dynamic distribution live (when you use the classes in LV)

    (4) If you want to create a VI can be used as a prototype, you can use the features of the Structure in Place to control the "characteristics of the placeness', namely the element nodes in and out of the border, the function"Mark as modifier"border nodes (note the pencil icon on the item), and the node always one copy.

    (5) the prototype is only the first reference ever connected to the node of the call by reference. So if you make a new prototype VI, you can just make a reference out of it plug into the crux of the call by reference. I suggest to remove the node from the call by reference and file a new.

    (6) for remote calls, we still "making copies" by transmitting data over a network.

    I hope that this helps, if you want information/clarification, so feel free to ask.

    2 - is the call made by the reference to run in the user interface thread node? If the call is made by a remote machine via ethernet, thread that host (the computer that makes the call by reference) runs on and thread that executes the target (the machine that contains the file VI) on?

    In the case of premises, the appeal made by the reference node does not require the user interface thread and may work in some thread the VI wants to run in.

    When you call a remote VI, the appeal made by the reference node uses the UI thread (detailed below) on both the client and the server.

    The client uses the UI thread to send the request to the server and there still when the response comes back. The user interface thread is not blocked during the time between the two.

    The server receives the TCP message in the UI thread, and then starts the call to the UI thread. The server also uses the user interface thread to send the response to the client. The user interface thread is not blocked on the server during execution of the VI.

    I hope that people find it when they need it!

    Ben


  • thread and TSVs locks

    Dear experts threads,

    are there side effects if I use the macro "GetPointerTo" and "ReleasePointerTo" inside a thread lock, which is in the code located between CmtGetLock and CmtReleaseLock?

    Phrased differently, what type of sequence is best if I need to edit a TSV in a piece of code that should be accessible only from a single thread at a time:

    1)

    CmtGetLock

    ...

    CmtReleaseLock

    GetPointerTo

    ...

    ReleasePointerTo

    CmtGetLock

    ...

    CmtReleaseLock

    OR

    2)

    CmtGetLock

    ...

    GetPointerTo

    ...

    ReleasePointerTo

    ...

    CmtReleaseLock

    Thank you!

    Wolfgang

    Hi, Wolfgang.

    GetPointerTo... will block until the thread that holds the pointer releases, then the CmtGetLock() and CmtReleaseLock() calls are not necessary, unless they protect some other variables, in which case sequence 2) is the way to go.

    Remember that if you use multiple thread safe variables or multiple locks thread, and you need to use more than one at any time, each thread must obtain and release pointers / locking in the same order. This avoids the possibility of blocking. In addition, each thread must release the resource as soon as possible.

    Example (using thread locking):

    If (!.) CmtGetLock (lock1))

    {

    If (!.) CmtGetLock (lock2)) / / Get QL2 only when you hold lock1

    {

    ...

    CmtReleaseLock (lock2);  Always communicated QL2 before lock1

    }

    CmtReleaseLock (lock1);

    }

    Kind regards

    Colin.

  • Performance issues with mmr_play() and mmr_stop()

    Hello

    I am currently working on a game for the platform BB10 and implementing audio. I use the multimedia rendering engine to play a piece of background music in the game, which works fine. My problem is when you try to switch to a music different track run game - which produces a short (but noticeable) stall.

    A little more information - my approach is currently single-threaded (I realize that a possible solution is to implement the audio on a separate thread), and when I start a new track I'll simply call mmr_input_attach(), then mmr_play(), which are so expensive that they stall the game.

    As I say, I know that a solution would be to switch the audio to another thread, but I was wondering if anyone knew another solution at all? I tried to play the tracks in a playlist and use mmr_seek to move between them, but I still get the same stall. Unfortunately, I was not able to find a lot of information about the inner workings of mmr_play() or mmr_input_attach() or find several forum posts about them, it was difficult to work on what would be my options.

    Thanks in advance for any help!

    For what it's worth, I managed to get a solution threaded work easily enough, roughly as follows:

    void* playMusicOnThread(void* args)
    {
        if(mmr_input_attach(musicContext, musicURL(), "autolist")==0)
        {
            // Successful attach, play file
            mmr_play(musicContext());
        }
        else
        {
            // Handle error
        }
        return 0;
    }
    
    void MyClass::playMusic(void)
    {
        pthread_t pt;
        pthread_attr_t attr;
        pthread_attr_init(&attr);
        pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
        pthread_create(&pt, &attr, &playMusicOnThread, NULL);
        return;
    }
    

    I was still interested if anyone knows how to run single-threaded, but this solution is sufficient for my needs anyway.

  • Thread and class with no thread

    Hi everyone , hope you can help me with this...

    I have two classes, extends a Thread and the other extends screen. My problem is that the screen needs all the information that the thread has had, but I do not know how to make the screen show upward when the thread is finished, or wait until this thread stops to see its information.

    Thanks in advance

    At the end of your thread, you can push the screen with:

    synchronized (UiApplication.getEventLock) {}

    UiApplication.getUiApplication () .pushScreen (yourMainScreen);

    }

  • problem with thread and try {} - catch () {}

    Hello

    My problem is that in the second thread of my request, there is a method (at the beginning) that connects with the server. If the connection is impossible-i try to reconnect two times. the problem is that the connection must by in a try-catch block. and when I can't connect for the first time, the program will the something something trying to reconnect. and the problem is that once my progam enters this something, the thread is dead!

    Do you have any suggestions, what can I do with it?

    concerning

    I reorganized my request. whenever I see that the thread is killed (with an exception of capture) I wait 2 seconds and start the thread. and it works like a "reconnect".

    Thank you for your time and suggestions!

    Kind regards

  • Update of the screen, threading and synchronization

    I have a game I developed that uses multiple threads to process. The game does not focus on the user by itself and seems to be accelerating when there are more items on the screen and slows down when there is less. I have four threads in use. Three of them are used to update the main (UI) thread and run continuously; two update a class watch stop custom, and the third simply disabled the screen to force a refresh. All three of the threads use locks objects synchronized; That's why I think it slows down when nothing is on the screen, because they constantly block. I do not have variables that are constantly updated by the thread and read survival gear each iteration; which I was I use locks. I use the IDE 4.7 and the simulator of the storm. Profiling code over a minute 3 period shows that almost 60% of the execution time is during one of the locked rows (block I'm of course). I was wondering what I should use locks because only the UI thread updates one of the three? If so, is there a better way. Code can be provided if necessary.

    BUDOKAI-is that they have a book of text on the famine of lock?

    http://Java.Sun.com/docs/books/tutorial/essential/concurrency/starvelive.html

    [ed, I would also like to make out this seems to be a tight loop so that it also uses time spinning CPU]

    during the liberation that briefly up to 2 locks]

    While (true) {}
    synchronized (runLock) {}
    If {(race)
    synchronized (pauseLock) {}

  • threads and processes

    What is the difference between threads and processes?

    Hi Shams,

    Process of

    A process, in simple terms, is a running program. One or more threads run in the context of the process.

    Each process provides the resources needed to run a program. A process has a virtual address space, executable code, open the handles to system objects, a security context, a process environment variables, unique identifier, a class of priority, minimum and maximum working set size and at least a thread of execution. Each process is started with a single thread, often called the main thread, but can create additional threads in any of his sons.

    Thread

    A thread is the basic unit to which the operating system allocates time processor. A thread can execute any part of the process code, including parts being run by another thread.

    A thread is the entity within a process that can be scheduled for execution. All threads in a process of shared system resources and the virtual address space. In addition, each thread manages handlers exceptions, a scheduling priority, threads local storage, a single thread identifier and a set of structures, that the system uses to save the thread context until it is scheduled.

    If you have additional questions, feel free to post. We are here to help you.

  • This is where other issues of quality and quality Plans are grown?

    This is where other issues of quality and quality Plans are grown?

    Ben

    As the quality is part of discrete manufacturing module that seems logical, but you might also find some useful discussion for the purchase or manufacturing process.

    JS.

  • messages between the main thread and the FX application thread

    I run a thread of the Application of FX for a main thread using Application.launch [described here: {: identifier of the thread = 2530636}]

    I try to have the application thread return information on the main thread, but Application.launch returns void. Is there an easy way to communicate between the main thread and the thread of the Application?

    So far, I googled and found:
    -MOM (Message Oriented Middleware)
    -Sockets

    Thoughts/ideas/examples are appreciated--especially examples ;)--now I try to use Sockets to show/hide the application and data transmission.

    What is the preferred method? Are there others that I did not find (gasp) via Google?

    Dave.

    Published by: cr0ck3t on April 30, 2013 21:04

    Published by: cr0ck3t on April 30, 2013 21:05

    Is there an easy way to get a reference to these objects to both the main thread and the thread of Application FX - called via Application.launch () since the main thread? Or what I need to use Sockets or MOM?

    Not much to do with the concurrent programming is what I would call easy. It looks easy - but it's not.
    You can do kind of what you're describing using Java concurrency constructs without using sockets or a package of Message Oriented Middleware (MOM).
    With the Java concurrency stuff you really implement your own form or MOM light.
    If you have quite an application is complex with many messages of comes and goes, then a sort of package for MOM such as the camel and ActiveMQ (http://camel.apache.org) is useful.
    ---------
    You can find a sample of the various interactions of thread with JavaFX here:
    https://gist.github.com/jewelsea/5500981 "Simulation of dwarf dragons using multiple threads to eat."
    Related code is just demo-ware to try different competitive access facilities and not necessarily a recommended strategy.
    If your curiosity, you can take a look and try to work out what it is, what it does and how it does.
    The main reason followed is that of a blocking queue:
    http://docs.Oracle.com/javase/6/docs/API/Java/util/concurrent/BlockingQueue.html
    ---------
    Note that once you call launch of the main thread, no subsequent statement in the main method will be different until the JavaFX application terminates. If you can't start from the main thread and communicate with the main thread JavaFX application. Instead, you need to spawn another thread (or a set of threads) for communication with the JavaFX application.
    ---------
    But really, in most cases, the best solution with the simultaneity is not care at all (or at least as little as possible). Write everything in JavaFX, use the animation of JavaFX framework to time related things and the simultaneity of JavaFX utilities for when you really need multiple interaction of wire.
    http://docs.Oracle.com/JavaFX/2/threads/jfxpub-threads.htm
    ----------
    For additional assistance, you may be better off describing exactly (i.e. really specific) what you're trying to make in a new question, perhaps with a solution of the sample in a http://sscce.org NBS

  • Hyper-threading and vCPUs

    A few years ago I was working with VMware Server 1.0 on Windows 2003. I had 2 servers with VMware Server, one of them has a CPU Intel Hyper-thread, and the other has the same Intel processor but with HT disabled.

    I had a VM running a 16-bit application, which took all the cycles available CPU. When this run on non-HT Server virtual computer, the Windows host reports 100% CPU usage. When the virtual machine running on the active HT server, host the CPU utilization was 50%, and the Task Manager showed the virtual machine, taking all the cycles of a demi-processeur and the other half processor almost in slow motion.

    Assuming that the processors are equal, I think I know that the virtual machine has got more CPU power running on non-HT server to run on HT-enabled server (because HT divided by 2 CPU and just one half CPU is assigned to the virtual machine).

    My question is: what happens with HT on ESX?

    When I assign a vCPU virtual machine, it will use just half a nucleus in a Hyper-Threaded Server, but a full kernel on a server of HT-people with reduced mobility? (assuming that no other virtual machines compete for resources).

    Thank you and best regards.

    With the following reflections on 2 and 3.

    (2) but do not forget hypervisor (vmkernel) provides these vcpus to the LCPU he will ensure that the vCPU is scheduled to LCPU who has cycles CPU available - if you are in the situation where all LCPUs are heavily loaded, then you need to increase the resource capacity by adding additional hosts to the cluster (if you ave a)

    (3) the virtual machine has no direct access to the LCPU but she is planned there by the vmkernel - if the virtual machine is idle, it can theoretically be used no. (or at least very few CPU cycles)

    hope this helps-

  • How killi thread and stop java.util.Timer?

    Hello

    I have table list, this list contains my objects (areas of Thread) and these threads use the Timer (java.util.Timer).

    In some time, I need to find the object in the list of tables, destroy this specific thread and immediately to stop the timer.

    I don't know what is the best way how a) destroy the thread and b) stop the timer.

    Could you tell me what technique to use?

    Thank you.

    I don't think you're catching what everyone tells you:

    Unless I missed something in your code, you do the following:

    1 create a thread that starts a timer (the thread itself dies immediately after the launch of the timer)
    2 put the dead (or soon to die) wire reference in a list of tables.

    To solve your problem, as has already been said: stop timers, they exist independently of your son now dead. Remove the reference ArrayList where you keep a list of the dead son. They will be eligible for garbage collection when you have no refrence to them any longer. Java garbare collector will not immediately work to show you got something, it is that way by their design, but ultimately it will collect your dead and not referenced objects and drop them.

  • issue with tables and clusters

    Hello

    Another issue with the tables and clusters. I have three engines thatI move on XYZ and then measure something. I need to draw on the 3D, the result of the measurement. How to draw real XYZ and not the index of the data table positions? (I can't actully how to build the matrices 2D forX, Y and Z). In the figures, I give an example of what I need.

    Concerning

    You have to break the data out of the cluster and to present them to the graph 3d to a separate bays for X, Y, Z and W where 'W' is your values measured at the locations described by X, Y, Z.

    This thread shows how trace readings in space 3. The following image shows the data that the original author wanted to draw.

    Have fun

    Ben

  • GPIB - issue VISA (LV2014 and Keysight IO libraries)

    Hello together!

    I have tried for two days to meet the LV2014 - Keysight IOLib - Agilent DSO6014L...
    And I need help.

    What I want to do

    I have a LabView VI for the osziloskop control and obtain values of. I created the VI with LV8.5.1 and it worked very well with Agilent Io Lib 14 and Windows XP. Unfortunately, I had to change to a new computer...

    And the problems started, I do not get the components together (at least, not without error messages in MAX):

    I connected an Agilent DSO6014L by a GPIB 82357 A Agilent to a Windows 7 Enterprise edition - 64-bit.

    I already posted my problem in German LabView Forum ( http://www.labviewforum.de/Thread-LV-2014-und-Keysight-IO-Libraries-Suite-17-1 )

    GerdW already replied and proposed to connect via LAN or switch to a NI GPIB.

    But maybe there's a way to solve my problem, keeping the "old" material.

    Currently, I can run my VI because I use aliasnames which I attributed to the IOLib and MAX (below I've listed the steps I did).

    But Max I still got the error "0xBFFF003A (VI_ERROR_INV_SETUP)" of viFindRsrc.

    -> More funny. If I say / activate the tulip Passport - save parameters - and restart MAX. I don't have any errors and I see my GPIB instruments... uuuuntil I refresh the view!

    Steps to make it work:

    • Installed Labview 2014 - not reboot!
    • Keysight IO libraries Suite installation (default) 17.0.19313.5, automatically as secondary VISA
    • Under Keysight connection compatible Expert maps GPIB for 488 program and set options of PXI (Resource Manager active and responsible trigger by default) of National Instruments
    • Connected the GPIB 82357 A Agilent and install the driver (windows driver update speed search to jump to the top)
    • Install the driver for the oscilloscope (in my case ag6000 for DSO6014L for LabView 2014 32) and 64-bit support
    • Restart
    • Turn on the oscilloscope
    • He searches the IOLib - here everything works fine no problem to control the oscilloscope
    • In turn MAX on NiVisaTulip.dll under passports (MAX restart, get the 0xBFFF003A error)
    • Restart

    Now, there are some steps that I could possibly do before restarting:

    • In Keysight IOLib I updated the GPIB ID 1 (VISA Interface ID and ID of Interface of CLCL) - there was a note that the Tulip Passport uses the GPIB0 and this causes connection issues
    • Max under VISA conflict Manager, I enabled Agilent VISA under implementations installed VISA
    • Max under general settings - Interfaces PXI/PCI - active option to display all devices accessible to the VISA
    • In MAX under passports disabled NiVi488.dll and NiViGpvx.dll

    Now it is running once, and I put the same alias under IOLib and MAX name for my oscilloscope.

    In addition:

    • Installed drivers IVI Keysight IOLib RPF
    • Reinstalled NIVISA1401Full with support 32 and 64 bit
    • Did all the updates of NOR

    Hello

    Thanks for your posts.

    Yes I also use Agilent GPIBs for other screws so I need a solution running.

    I found this post:
    Passport (GPIB) max

    "Agilent IO libraries Suite v 16.2.15823.0 ' works very well with all my gear in IOLib, MAX and LabView 2014.

    I also tried the ' Agilent IO libraries Suite v 16.3.17914.4 ', which also works perfectly with all.

    For my solution, I give a brief summary of my installation (GPIB Agilent GPIB 82357 A, Agilent DSO6014L):

    • Windows 7 Enterprise Edition SP1
    • LabView2014 SP1
    • MAX 14.5.0F0
    • Driver for LabView ag6000 (support 32 and 64 bit)
    • NIVISA1401Full (support 32 and 64 bit)
    • Agilent IO libraries Suite v 16.3.17914.4 (driver for Oscilloscopes 6XXX 1.3.24.0 IVI)

    and parameters:

    • Agilent IOLib - installed as secondary during custom installation VISA, I can not set the 488 (box all the time is reset), but it works fine without. And I did not change GPIB or ID of CLCL. I gave an alias to my instrument.
    • MAX - all passports are activated. I checked the show box any device accessible to VISA. I gave the same alias to my instrument, as in Agielnt IOLib. Under conflict Manager Agilent Simulation VISA is selected and Agilent VISA is disabled, all chosen VISAs are the Canadian standard.

    Best regards

    André

  • View threads AND grouped by date/conversation

    Hello

    I try to have messages see the thunderbird grouped by date (with a thread on today, yesterday, last week, etc.) and within these threads, see email conversations. A conversation that began three weeks ago, but has received a new email today is expected to manifest itself in the thread today, but from the first email of the conversation.
    I did not understand if it is possible, as grouped by (Date) and Threads are mutually exclusive. Any ideas?

    Thank you

    As you say, it is there only one group so at the time. So I guess that your out of luck.

    You could fill a better bug report and see if one of the developers interested. https://Bugzilla.Mozilla.org/

Maybe you are looking for

  • 64-bit worth it? Problems I should wait?

    I put my computer upgraded and looking to upgrade to Windows 7 - here is the specs:ATI Radeon 4870 1 GBAMD Phenom II 955 (image 3.2 mhz)3 (1066) 4 GB DDR RAM (2x2gig sticks) (was cheaper for me to get that 3 1gig sticks)320 GB hard drive - old, not u

  • Windows Xp pro activation, says my license key is not valid.

    Hello I just got my old hard drive in a 2004 hp pavilion a705w with Windows XP pro top. Then it says please activate your product, and I have put it in the activation key to the original computer back right to the device and fact ensure that it is co

  • Pavilion dv7 - 3188cl & hard dr ive upgrade

    Hello I was wondering what hard drive I should get for my laptop? I'm looking for a terabyte of 1-2, should I go Seagate, Western digital or any other good brand? any help is greatly appreciated... Thanks in advance

  • MRxDav, mrxsmb, LanmanServer errors Windows 7 Premium Home Addition

    I tried to activate my anti virus and required to receive an error cannot configure SSL connection that I took it to the geek team, but they want to pay $ 200 to look at it and fix it. They put a disc and these mistakes came MRxDav, mrxsmb, LanmanSer

  • LR plu 5.7.1no work without membership

    I bought Lightroom 5.7.1 as a stand alone, so I could make it work without the need to have a monthly account CC. I have not used for quite awhile and now I see him develop and map modules are disabled by saying: I need a subscription. How to regain