How to listen a key event without having any window component

Hi all,
I would like to know how can I listen key events from an application that doesn't use windows
Thanks

yoiu can make a Thread run inside your application. This will listen for inputs in the command line. For examplethis is part of a chat server (on the console) with let the server manager to enter messages or commands.
The message or command entered on the console by the user is catched and processed as a String. The string is passed to the processConsole() method, you must define yourself.
Th Thread is never stopped, so the user may enter any message at any time
The core of you application should also be a Thread for better performance, but maybe it will also work without. Jst try and provide needed importstatements.
Runnable runInput = new Runnable() {
        public void run() {
          while(true) {
            try {
              byte buffer[] = new byte[255];
              System.out.print(prompt);
              System.in.read(buffer);//, 0, 255);
              String inputString = new String(buffer, "Default");
              processConsole(inputString);
            catch(NullPointerException npe) {
              System.out.println("Syntax error");
            catch(Exception e) {e.printStackTrace(); }
      Thread inputThread = new Thread(runInput);
      inputThread.start();

Similar Messages

  • HOW CAN I DELETE AN EVENT WITHOUT  HAVING TO SELECTING IT FROM THE LIBRARY?

    I have a big problem.
    I want to delete an entire event from my library because everytime I select it imovie freezes and then close itself up. So I have to re-open imovie again. And when I want to select that particular event again the same problem occures. So I can not select that particular event. Therefore I can take NO action on this event.
    HOW CAN I DELETE AN EVENT WITHOUT HAVING TO SELECTING IT FROM THE LIBRARY?
    (Everytime I select it imovie closes itself up)
    All other events work fine. I believe The footage had a problem from capturing. but now it's in my computer and i can't open it.
    Please help me, I don't need this event, I can't open it therefore I can't use it and it takes place on my hardrive for nothing.
    Thank you

    One can delete it from one's computer. In the finder go to homeuser, movies, imovie events, delete the footage.
    Then reopen iMovie and see if that helps.
    Hugh

  • How to create a time event without having user interface freeze

    Hi,
    I am new to labwindows and i am trying to create a time event where every hour for 24 hours i want my program to write somethign in excel. 
    I tried using function Delay and SyncWait and those functions freezes up the user interface.
    Any tips/help will be appreciated.
    Thank You
    Solved!
    Go to Solution.

    Many, if not most, CVI developers wind up implementing a delay function for themselves that periodically, during the delay, wakes up and processes events so that the GUI isn't frozen.
    The idea is to break the wait or delay up into pieces, and process system events in between each piece.
    A timer works too, you can try the async timer that Wolfgang mentioned, it runs a bit better and on a separate thread, so it lets you do what you normally would with the main thread and the GUI, yet still get timer function.   If you use a smart delay, you still wind up doing nothing a great deal of the time, and events are only processed periodically.

  • Getting key events without a jcomponent...

    Is it possible to get key events without adding a keylistener to a jpanel? I want a class of mine to manage input of it's own, but it has no reference to a jpanel. They don't necessarily have to be KeyEvents, but just some way to detect if a key has been pressed (like the arrow keys). How can I do this? Thanks.

    Lots of components can listen for key events.
    What does your class subclass?It doesn't subclass anything. I am creating a custom menu system for my game using images I have made for the tileset. I would like it to handle some keyboard events of its own. (Like if the down arrow is pressed, it will move the focus down to the next component on its own). Right now I am currently passing the key events from my fullscreen jpanel to the menu class and it is handling them that way. Thanks.

  • Call an event without having a subscription!!!

    Hi !!!
    Can i call an event without having a subscription to it???
    If i can, how , please show me an example!!!
    How can i pass data between processes, and how can i access data of the events and puting them in atributes without using a XML function, please show me how!!!
    Can i have more than one subscription "LOCAL" to the same ITem type????
    What4s the use of "External" subscriptions???
    thanks!!

    Hi Nuno
    We actually ship a buisness event system demonstration with the Oracle Workflow product, called the Buyer-Supplier Demonstartion. You can get details of this demo - including the names of the PL/SQL files, from the Getting Started Whitepaper and from the Sample Process chapter in the Workflow Guide.
    You should go to the Workflow 2.6 Technical Information section of the 9iAS Integration website. There are Development Standards - including sample code - and whitepapers for you to look at.
    If you are still having issues, you could contact Oracle Consulting Services for further assistance (see http://otn.oracle.com/consulting/)
    Cheers
    Mark
    Hi !!!
    Can i call an event without having a subscription to it???
    If i can, how , please show me an example!!!
    How can i pass data between processes, and how can i access data of the events and puting them in atributes without using a XML function, please show me how!!!
    Can i have more than one subscription "LOCAL" to the same ITem type????
    What4s the use of "External" subscriptions???
    thanks!!

  • HT201240 I've forgotten my administrator password and can't download software. can anyone advise how to reset a new password without having the original?

    I've forgotten my administrator password and can't download software. can anyone advise how to reset a new password without having the original?

    Forgot Your Account Password
    For Snow Leopard and earlier
         Mac OS X 10.6- If you forget your administrator password
    For Lion/Mountain Lion
        Boot to the Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
         When the menubar appears select Terminal from the Utilities menu.
         Enter resetpassword at the prompt and press RETURN. Follow
         instructions in the dialog window that will appear.
         Or see Reset a Mac OS X 10.7 Lion Password and
         OS X Lion- Apple ID can be used to reset your user account password.
    If you are unable to boot from an installer DVD:
    (these will only work on Leopard or earlier)
      1. Boot to Safe Mode by restarting and after the chime press and hold down
          the COMMAND-S keys until a black screen with white type appears.
      2. At the prompt, type the following commands pressing return after each
          command line:
         /sbin/fsck -yf
         If you do not receive a "Filesystem OK" message then repeat this command
         until you do.  If after seven tries you still do not receive a "Filesystem OK"
         message, then the system is corrupted and needs to be reinstalled.
         mount -uw /
         cd /private/var/db/netinfo
         mv local.nidb local.old
         rm ../.AppleSetupDone
         shutdown -r now
    The second-to-last command above will cause OS X to think that the operating system is newly installed, and when the new owner starts up the computer it will send him/her to the startup wizard where he/she can start a new user without reinstalling.
    This last method does not actually change a password. It simply removes the user accounts and lets you create an initial admin account as if the computer were new out of the box.
    Reset Admin Password Using The Terminal
    You can reset the password by printing out (or writing down) and carefully following these steps.
    First, find the short name of the admin user on the machine. The easiest way of doing this is by looking at what the directory is called in the Users folder.
    Now, start in Single-user Mode. It should boot into a command line.
    Enter these exact lines. Press RETURN after each.
    mount -uw /
    ifconfig lo0 up
    cd /var/db/netinfo
    netinfod -s local
    Now you'll need that short name. Enter "passwd", a space, and the short name of the admin. For example, if the admin was rather prosaically called "imadmin", you would enter "passwd imadmin".
    The computer will now prompt you to change the password for "lmadmin" (or whatever the short name was). Go ahead and enter a new password.
    Now, enter:
    sync
    reboot
    and the machine will reboot. The admin password should now be changed.

  • Recently got a new computer and downloaded iTunes.  All of my music has downloaded from the cloud witht the exception of one song.  I have tried transferring from my phone, but it won't work.  How do I get it back without having to download again?

    Recently got a new computer and downloaded iTunes.  All of my music has downloaded from the cloud witht the exception of one song.  I have tried transferring from my phone, but it won't work.  How do I get it back without having to download again?
    Thanks.

    If you do not have access to the iTunes Library on your Old computer... or its Backup...
    See these 2 Links...
    Syncing to a New Computer...
    https://discussions.apple.com/docs/DOC-3141
    Recovering your iTunes library from your iPod or iOS device
    https://discussions.apple.com/docs/DOC-3991
    If you do have access... See Here...
    iTunes: How to move your music to a new computer
    Or...
    From your OLD computer...
    Copy your ENTIRE iTunes FOLDER to an External Drive... and then from the External Drive to your New Computer..
    Full Details Here  >  http://support.apple.com/kb/HT1751
    An Added Bonus is that you will have a Backup of iTunes.

  • HT1727 i bought some ringtones on my iPhone, later on i sync my iphone to my old computer now i have a new mac pro desktop and i only have 2 ringtones on my phone but not the rest of them how can i get them back without having to pay for them again?

    i bought some ringtones on my iPhone, later on i sync my iphone to my old computer now i have a new mac pro desktop and i only have 2 ringtones on my phone but not the rest of them how can i get them back without having to pay for them again?

    If you bought them on your iPad then you will need to connect your iPad to your computer's iTunes and do File > Devices > Transfer Purchases to copy them over to the Tones part of your computer's iTunes library and you can then sync them to your iPhone - ringtones are a one-time only download, so you won't be able to redownload them directly on your phone.

  • How can I import a folder without having to import one photo at a time?  I have many folders and thousands of pictures!

    I have thousands of pictures in various folders on my computer. How do I import the "folders" without having to import one photo at a time?

    garyt28874359 a écrit:
    I have thousands of pictures in various folders on my computer. How do I import the "folders" without having to import one photo at a time?
    Where is the problem?
    You simply select the folder and check the option to import subfolders if you want. Then use the 'get media' button.

  • How to restore a control file without having its backup

    Hi,
    Can any one please suggest me how to restore a control file without having its backup.
    Thanks

    To add to what SB said, in years past the instructions for re-creating the control file manually were contained in the DBA Administration manual. It used to be and may still be common to be taking and saving a "backup control file to trace" for this purpose.
    If you lost only the primary copy of the control file and it is an OS file then while the database is shutdown you can copy the secondary over the primary and then use if to start the database. If the control file is stored in ASM then there should be a way to perform the copy via ASM.
    If you use rman for backups then a copy of the control file should be part of the backup process and you can retrieve it from the backup set then perform recovery using the backup control file though I do note the OP said something to the effect no backup exists. Still, I have knows of instances where the DBA did not realize that the backup set contained the control file and the spfile so I think this is worth mentioning just in case.
    HTH -- Mark D Powell --

  • How do I add a submenu without having to add a page?

    I have a "Services" page created for our customer.  There are currently two sub-pages from the Services page each having their own SubMenu button.  On the services page are two types of services that DO NOT need their own pages (which is why they are on the root of Services).
    The customer wants submenus for the two services that are on the root of the services page.  Currently when you hover your mouse arrow over the "Services" button, the submenues with pages only appear.
    How do you create a submenu without having to create a page?

    Hello,
    In case you are looking for a customized Menu then I would suggest you to use Manual Menu. Using Manual Menu you will be able to create your own Menu and will be able to link each Menu to the desired pages/files/URLs.
    The only thiinh that will be a task would be creating the whole Menu again (as it is not created automatically). Please refer to screenshot below on how to create Manual Menu :
    Hope this helps.
    Regards,
    Sachin

  • All of my purchased ringtones and songs dissapeared out of the blue. How do I get them back without having to buy them all over again?

    Out of the blue, all of my purchased ringtones and music aren't displayed anymore on my iPhone.
    I went to iTunes to see if they were stored there, but the downloads folder also appears to be empty. If I try to select a ringtone I've downloaded before, a popup appears saying that I've already purchased that item and asking if I want to cancel or buy. If I click on buy, then I pay for the item again even if I already have it! The only place I can still see my purchased items is in the iTunes application on my computer, but even though I've already selected sync, the ringtones and songs still won't appear on my iPhone.
    What happeneded and how can I get them back without having to pay for them all over again?
    Thank you!

    I'm having the same problem on an iphone 4s running iOS8; when i updated to iOS8, all my ringtones went missing, and when i got a £50 gift card for christmas (2014), I purchased some songs from the iTunes store on my iPhone. i downloaded songs from paramore, panic! at the disco, coldplay, and imagine dragons, over wi-fi, and they went into my iphone music library; but when i re-opened the music app a few days later, in a place where i had no wi-fi, except for my 3G phone signal, some cloud icons appeared next to my newly purchased songs, telling me to re-download them from the cloud, when i haven't even deleted them. this has happened twice now, and i had to use up some of my 5GB data allowance to redownload them from the cloud. This is annoying and i need to fix this issue ASAP.

  • How to open adobe acrobat reader without having to open photoshop?

    how to open adobe acrobat reader without having to open photoshop? i keep getting this message when opening pdf files. "adobe acrobat was installed as part of a suite. to enable adobe acrobat, please start another component of this suite(such as photoshop)

    Are you mixing Adobe Acrobat with the Adobe Reader?
    If you have Acrobat on your computer you need to associate PDFs with Reader to open in it.
    You also need to get the latest security patches for Reader.

  • How we can show the xml data without any attribute in a flex tree (without having any label field) ?

    how we can show the following data in a flex tree (without having any
    label field) ?
    <?xml version="1.0"?>
    <rootNode>
            <childNode>
            < subchildNode >
                    <valueNode>1000</valueNode >
                    < valueNode >999-888-777</valueNode >
                    < valueNode >STORTZ</valueNode >
                    < valueNode >PAM STORTZ</valueNode >
                    < valueNode >88 ST. MORTON ROAD</valueNode>
            </subchildNode>
            </childNode >
    </rootNode >

    as is - no how
    wrap those xml chunk with a class having clear public properties like:
    public class dataRecord {
         protected var xml:XML;
         function dataRecord(xml:XML) {
              this.xml = xml;
         public function get id ():String {
              return XML(xml.descendants("valueNode")[0]).toString();
         // and so on
    simpliest way is to change xml structure to use attributes than wrapping that thing with AS code, it's time consuming and non efficient.

  • My iphone recently crashed and i had music i had purchased from itunes that i hadnt yet synced to my puter, how can i get it back without having to buy it again???

    My iphone has recently crashed & i had music from itunes i had not yet synced to my computer how do i get it back without having to buy it again, im in Australia so do not yet have icloud

    Unfortunately you can't.  You could try contacting Apple and asking nicely, but they're under no obligation to help you.  If you can wait until fall*, when iCloud is officially launched alongside iOS 5, you can probably download them all again then.
    The small print at the bottom of http://www.apple.com/au/icloud/ says "some music features of iCloud are available in beta now in the U.S. only"
    I can't find anything which guarantees it will work outside the US after the beta, but it probably will.  iTunes Match is definitely US only, for a couple of years at least until the legal stuff is dealt with.
    *Autumn

Maybe you are looking for