How to I just test a specific key?

I just want to test a certain key for instance:
in my code would read:
if(keytest(KEY_LEFT)){
     //move ship left
if(keytest(KEY_UP)){
     //move ship up
and both, neither or either one of these could occur at at any time.
I can't seem to figure out how to use the KeyPressed event, and the tutorial is confusing to me.
Thanks for any help, If you know VC++ I want something like GetAsyncKeyState

You use an event-handler:
class myKeyEventHandler extends KeyAdapter {
   public void keyPressed(KeyEvent e) {
      if (e.getKeyCode() == KeyEvent.VK_UP) {
         // move up
      else if
      // etc, etc
}Then you attach an instance of this event-handler to your code:
JFrame myFrame = new JFrame();
myFrame.addKeyListener(new myKeyEventHandler());Michael Bishop

Similar Messages

  • Card specific keys

    My card implements the mutual authentication. For that purpose the external application and the card must share the set of secret keys. The first key is relevant for encryption and the other for the MAC calculation. At this point I am putting these keys on the card during the personalization. These keys are the same for all cards. Now I am thinking is this secure enough. I read that it is recommended to use derived (card specific) keys such that only one card is affected if a key is compromised. How can I calculate the card specific keys? If I will have this, then if someone finds out the initial secret keys and the algorithm how the card specific keys are made, then the card is again compromised. Right?

    You said that the random key is more secure way. You mean that during the personalization I can generate random key on the card. The operating system takes care of the security of such object. But, this random key has to be shared with the external party which is communicating with the card. Both of them need it in order to establish the secure channel. At some point it has to be extracted and given to the terminal side. Right? Or the random key has to be generated on the perso dll during the personalization. Then the outside world has to have some kind of lookup table in which the relation token serial number, random key has to be stored and before executing the mutual authenticate method, the external party has to for the particular token serial number extract its random key. What if the secure channel has to be made from the middleware API that is installed on the user’s PC. If the lookup table is stored somewhere like HSM it is impossible use case because the user’s PC is located in his home. With random keys, each key would be generated at perso time and injected into the card manager with PUT KEY over a secure channel. You could use the unique card identifier as the label for the key in the HSM so there is no lookup table. You could use the same data you would use to diversify a key since it should also be unique. I am assuming you have some way of having a connection back to a HSM from the middleware? If not, this model sounds worrying to me. If you have your keys exposed to every client client then you are opening up a security risk. You can assume the client machine is secure.
    You said:
    It is easier to secure a single set of master keys (and rotate as required) that are used like this than a master key that is shared
    I did not understand how this will work. In case of mutual authenticate method. The external party is using one master secret key from the set of secret key set. When the command comes to the card, the card has to verify it. But how the card knows with which key the message is encrypted.If you have keys in a HSM you need some way of knowing what key to use. You could map cards to a master key. Some security organisations recommendations on key rotation and usage policies which are designed to limit the exposure of sensitive keys. It adds overhead but you gain additional security (if a key is compromised only a limited number of your cards are compromised).
    Cheers,
    Shane

  • How to create  a test plan with specific transactions (or program)

    Hello,
    I'm a new user in Sol Man !
    How to create  a test plan with specific transactions (or program).
    In my Business Blueprint (SOLAR01) I've created in 'transaction tab' the name of my specific transactions and linked it.
    In my test plan (STWB_2) those specific doesn't appear to be selected !
    Thanks in advance.
    Georges HUYNEN

    Hi 
    In solar01 you have defined but you have to assign the test case in solar02 for this test case in the test cases tab.
    When you do so expand the business sceanario node in test plan generation of STWB_2 transaction and now that will appear.
    Also visit my weblog
    /people/community.user/blog/2006/12/07/organize-and-perform-testing-using-solution-manager
    please reward points.

  • I figured out how to detach audio, but cannot figure out how to export JUST the audio to send as MP3. How specifically do I do it?

    I have figure out how to detach my audio from my video clip, but I tried to just range select the audio and export just that, but the video keeps going with it. How can I JUST export the audio? I am a musician and need to make an MP3 out of it to send out.
    Please be as specific as possible if you can in explaining and thank you so much for any help you might be able to offer.

    You don't need to detach the audio. Export a master file and in settings you get the option to export audio only.

  • How can I arrange for the Enter key to just drop d...

    How can I arrange for the Enter key to just drop down a line instead of posting the message?

    In Skype go to Tools -> Options -> IM settings -> Show advanced options. In the section “Pressing Enter will” select the option: Insert line break.
    Note that this option is only available with Skype version newer than 6.1. The currently latest Skype version is 6.3.0.107.

  • Application specific key-value pairs in jndi.properties

    Hello,
    Can I specify my application specific key-value pair in jndi.properties?
    I tried something like this
    java.naming.factory.initial=.jndi.WLInitialContextFactory
    java.naming.provider.url=t3://localhost:7001
    myVar=myVal
    When i tried looking up "myVar" from my client program, I got an error.
    The other parameters like weblogic.jndi.WLInitialContextFactory are picked up.
    Anyhelp will be appreciated
    Vasim

    We have a similar problem.
    We would like to configure our PROVIDER_URL for a specific web application - not
    for the entire server. Since the URL should be different in development, test
    and production environments, we would prefer to just set it in the deployment
    descriptor. And we have a lot of code that just uses
    ctx = new InitialContext();
    when looking up EJBs, queues etc.
    Actually, to take the problem one step further, it should be expected that later
    we will have EJB's deployed on different machines/clusters - so we will actually
    need specific urls for each EJB.
    Is there a good way to do this? Or will we have to custom-develop our own jndi
    configuration standard using application parameters to set which JNDI provider
    each EJB should be looked up with?
    Alternativaely, can we "import" the JNDI trees of the app server in the JNDI tree
    of the web servers?
    So, how should we go about this?
    Robert Patrick <[email protected]> wrote:
    Vasim wrote:
    Hi Robert,
    You are right. But The object "myVar" which I am trying to look upis not in
    the JNDI tree nor am I interesed in binding it . But my requirementis that
    I have one application specific variable which I am trying to lookup and I
    dont want to have a separare config file for this..and hence the question..So, put the properties you want in the jndi.properties file and load
    the properties
    file from your code by doing something like this:
    Properties props = new Properties();
    ClassLoader cl = Thread.currentThread().getContextClassLoader();
    if (cl == null)
    cl = System.getSystemClassLoader();
    InputStream is = cl.getResourceAsStream("jndi.properties");
    props.load(is);
    Personally, I would not use this file and would create an application-specific
    file
    or, as Daniel suggested, define your properties as a System property
    and use
    System.getProperty("myVar").
    btw, is jndi.properties only for those objects which are bound to jnditree?
    jndi.properties is only used for creating the JNDI InitialContext. The
    whole idea
    of this file is that in remote client code (without the jndi.properties
    file), you
    need to do something like this to tell the JNDI classes how to connect
    to the JNDI
    provider:
    Properties props = new Properties();
    props.put(Context.PROVIDER_URL, "t3://myservername:7001");
    props.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    InitialContext ctx = new InitialContext(props);
    but inside the server, you only need to do this because the server is
    the provider
    and already knows how to connect to itself:
    InitialContext ctx = new InitialContext();
    Therefore, the jndi.properties file allows you to externalize this property-setting
    code that sets up the properties to be passed to the InitialContext constructor
    so
    that the remote client code can now look exactly like the code inside
    the server.
    The InitialContext constructor will look for this jndi.properties file
    in your
    classpath and load it to get the necessary configuration information
    to determine
    how to connect to the JNDI provider.
    Hope this helps,
    Robert

  • Assigning instruments to specific keys on a USB keyboard

    Is there a way to assign certain instruments to specific keys on a USB keyboard?
    I use an M-Audio Keystation 49e USB keyboard. It works fine, but I have no experience with MIDI and don't know what the "advanced functions" button on the keyboard allows me to do, although I'm sure with some pointers I can figure it out.
    (Some weeks back xs4ls recommended the JamPack 3 with the Studio Toolkit. Thanks for that recommendation. The stuff really improves upon the stock drumkit software instruments. But in the Studio Toolkit, certain instruments I might like to use together are often located more octaves apart than I can play at one time. The regular kits are generally organized on the keyboard such that I can play them "live" just like I do my actual drumset. This is how I prefer to lay down my drum parts. I'm also interested in assigning drum sounds from a various software kits to save as my own custom kit, if possible.)

    GB3 has a "programmable keyboard" feature that isn't as slick as the stock instruments, but it's better than nothing! (one of the good features of GB3)
    I found a bunch of old Qbert (the video game) noises on line, and created my own instrument with those. Pretty sweet.
    X
    p.s.
    Happy you liked the suggestion. I wish I could take credit for making the Jam Pack......

  • IviSwtch Compliance Test IVI Specific Driver in CVI crashing

    I have problem with IviSwtch Specific driver. I have finished all code for this driver and try to test in CVI tool called "Test IVI Specific Driver". Structure and Function panel test runs without any error. Problem is with Compliance test which returns:
    the driver could not be initialized through the class driver.
    Compliance Test was halted.
    Error returned: bffa0011
    Error Message: Function or method not supported.
    I tried to add exports to dll in according to this solution http://digital.ni.com/public.nsf/allkb/1DCA138862E75119862576C5006EA144
    After doing this Compliance test just crashing and I have to close it down. 
    Does anybody met this kind of problem? I would be grateful for any help.
    Regards
    Tomasz
    Solved!
    Go to Solution.

    >>The DLL version format is valid.
    ERROR: The DLL version is inconsistent with the version in the header file.
    All attributes have correct names.
    All attributes have correct data types.
    This error means the revision of the generated <driver_prefix>.dll does not match the Major and Minor version defined in header. This should not be a conern if you will not release the driver to customers and you take care of revision.
    >>ERROR: The driver is not c>ompliant with the Inherent group because:
    -The following Inherent attributes are not implemented:
    INSTRUMENT_MANUFACTURER
    INSTRUMENT_MODEL
    It is hard to tell the root reason of this issue, but there might be something doesn't work in your code. How about post these attributions' definition? OR send your project to  [email protected] I think NI could help to take a look into it.
    Thanks,
    Charles

  • How to Install Just AppleFileServer

    OK, who can tell me how to install just AppleFileServer 3.1.4 (I've got the pkg extracted from 10.4.8) into System/Library/Core Services?
    It is said that using 3.1.4 is the workaround for the networking #@@$%& that 10.4.9's update created.
    I can't just drag and drop because I don't have the proper permissions when logged in as codonnell -- do I have to login as Admin or do something else?

    Ok lets just start from scratch...
    You said you back up the the original app so first of all lets restore that. Open up Teminal and at the prompt (which ill denote as $ in examples) issue the following commands:
    <pre style="padding: 5px; border: 1px dotted #f00; background-color: #000; color: #ccc; overflow: auto;">$ sudo rm /System/Library/CoreServices/AppleFileServer.app
    $ sudo cp /System/Library/CoreServices/AppleFileServer.app.O /System/Library/CoreServices/AppleFileServer.app</pre>
    Now go to System Preferences and stop/start Personal File Sharing. If all is well it should say Personal File Sharing is on above the stop/start button. If i doesnt let us know in your reply, but you may continue on with the rest of these instructions.
    <pre style="padding: 5px; border: 1px dotted #f00; background-color: #000; color: #ccc; overflow: auto;">$ mkdir AFSFix
    $ cd AFSFix</pre>
    Now well make a working directory and navigate into it so we can easily delete the left overs from this little escapade later:
    Ok now lets download the proper combo update so that we can extract the proper AppleFileServer.app I suspect your friend may have the opposite architecture as you so you need to make sure you for the right one and the version you want. So just to be sure we are going to extract it from the combo update. To download the update directly from terminal issue this command one of the following commands depending on your systems architecture:
    For PPC
    <pre style="padding: 5px; border: 1px dotted #f00; background-color: #000; color: #ccc; overflow: auto;">$ curl -O http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=11795&cat=60&platfor m=osx&method=sa/MacOSXUpdCombo10.4.8PPC.dmg</pre>
    For Intel
    <pre style="padding: 5px; border: 1px dotted #f00; background-color: #000; color: #ccc; overflow: auto;">$ curl -O http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=11797&cat=60&platfor m=osx&method=sa/MacOSXUpdCombo10.4.8Intel.dmg</pre>
    When that is finished downloading (and it will take awhile) we need to mount the disk image. We can do this by issuing this command:
    For PPC$ hdiutil attach MacOSXUpdCombo10.4.8PPC.dmg</pre>
    For Intel
    <pre style="padding: 5px; border: 1px dotted #f00; background-color: #000; color: #ccc; overflow: auto;">$ hdiutil attach MacOSXUpdCombo10.4.8Intel.dmg</pre>
    Now that we have mounted the disk image we can copy the file we need to a local volume:
    For PPC$ cp /Volumes/Mac\ OS\ X\ 10.4.8\ Combined\ Update/MacOSXUpdCombo10.4.8PPC.pkg/Archive.pax.gz Archive.pax.gz</pre>
    For Intel
    <pre style="padding: 5px; border: 1px dotted #f00; background-color: #000; color: #ccc; overflow: auto;">$ cp /Volumes/Mac\ OS\ X\ 10.4.8\ Combined\ Update\ \(Intel\)/MacOSXUpdCombo10.4.8Intel.pkg/Archive.pax.gz Archive.pax.gz</pre>
    Ok now lets decompress the archive and get the file we want. First well decompress by issuing the following command (this may take a few minutes):
    <pre style="padding: 5px; border: 1px dotted #f00; background-color: #000; color: #ccc; overflow: auto;">$ tar -xvzf Archive.pax.gz</pre>
    Then we copy the AppleFileServer.app:
    <pre style="padding: 5px; border: 1px dotted #f00; background-color: #000; color: #ccc; overflow: auto;">$ Archive/System/Library/CoreServices/AppleFileServer.app AppleFileServer-10.4.8.app</pre>
    And then we can go ahead and unmount the disk image:
    For PPC:
    <pre style="padding: 5px; border: 1px dotted #f00; background-color: #000; color: #ccc; overflow: auto;">$ hdiutil detach /Volumes/Mac\ OS\ X\ 10.4.8\ Combined\ Update</pre>
    For Intel
    <pre style="padding: 5px; border: 1px dotted #f00; background-color: #000; color: #ccc; overflow: auto;">$ hdiutil detach /Volumes/Mac\ OS\ X\ 10.4.8\ Combined\ Update\ \(Intel\)</pre>
    Ok now that we have the file we know we want we can replace the 10.4.9 version thats causing us headaches. First though we want to make sure the AppleFileServer isnt running. Open System Preferences and stop Personal File Sharing. After it shuts down lets close System Preferences. Now we will go ahead and replace the current AppleFileServer with the old version from 10.4.8 and set its ownership and permissions with the following 3 commands:
    <pre style="padding: 5px; border: 1px dotted #f00; background-color: #000; color: #ccc; overflow: auto;">$ sudo cp AppleFileServer-10.4.8.app /System/Library/CoreServices/AppleFileServer.app
    $ sudo chown root:wheel /System/Library/CoreServices/AppleFileServer.app
    $ sudo chmod 755 /System/Library/CoreServices/AppleFileServer.app</pre>
    Finally we want to remove the old plist jsut in case there are any differences between the key/value paris between these two versions:
    <pre style="padding: 5px; border: 1px dotted #f00; background-color: #000; color: #ccc; overflow: auto;">$ sudo rm /Library/Preferences/com.apple.AppleFileServer.plist</pre>
    Ok we should be good now. lets go ahead and reboot the computer. Then after we log back in we will go ahead and open System Preferences again and start Personal File Sharing. And then we can go ahead and test it out.
    If everthing is working you can go ahead and delete ~/AFSFix
    G4 Quick Silver 2001 800 Mhz Mac OS X (10.4.7)

  • How can I view the USMT recovery key in SQL report

    Hello all,
    Can anyone help me to provide sql query for below link… What I am looking is Just to create a report with all computers that has computer association any type with the recovery key information.
    http://www.windows-noob.com/forums/index.php?/topic/1763-how-can-i-view-the-usmt-recovery-key/
    I have tried below but not working so looking for help…..
    SELECT     TOP (100) PERCENT dbo.v_StateMigration.SourceName, dbo.v_StateMigration.SiteCode, dbo.v_StateMigration.SMPServerName, 
                          dbo.v_StateMigration.SourceMACAddresses, dbo.v_StateMigration.RestoreMACAddresses, dbo.StateMigration.StateEncryptDecryptKey, 
                          dbo.StateMigration.StorePath, dbo.StateMigration.StoreSize
    FROM         dbo.StateMigration INNER JOIN
                          dbo.v_StateMigration ON dbo.StateMigration.SMPServerName = dbo.v_StateMigration.SMPServerName CROSS JOIN
                          dbo.v_UserStateMigration
    WHERE     (dbo.StateMigration.StorePath IS NOT NULL) AND (dbo.StateMigration.StoreSize IS NOT NULL)
    ORDER BY dbo.v_StateMigration.SourceName

    Try this.
    SELECT Distinct
    SM.SourceName,
    SM.SiteCode,
    SM.SMPServerName,
    SM.SourceMACAddresses,
    SM.RestoreMACAddresses,
    SMT.StateEncryptDecryptKey,
    SM.StorePath,
    SM.StoreSize
    FROM
    dbo.v_StateMigration SM
    JOIN dbo.v_UserStateMigration UM on SM.RestoreClientResourceID= UM.RestoreClientResourceID
    join dbo.StateMigration SMT on SM.SMPServerName = SMT.SMPServerName
    WHERE
    (SM.StorePath IS NOT NULL)
    AND (SM.StoreSize IS NOT NULL)
    ORDER BY
    SM.SourceName
    http://www.enhansoft.com/

  • HT1918 hee guys how do u delete a creditcard from your apple id? in the summer a friend of mine connected his own creditcard details to my apple id now i want to disconnect that again but i have no idea how? i just want my own apple id without a creditcar

    hee guys how do u delete a creditcard from your apple id? in the summer a friend of mine connected his own creditcard details to my apple id now i want to disconnect that again but i have no idea how? i just want my own apple id without a creditcard connected to it

    I own the movies and I want them to stay in my iTunes library basically forever.
    But in both cases the file name no longer shows in the movie list, so I don't know how to re-download it from the Cloud.
    iTunes prefs > Store > Show iTunes in the Cloud purchases.
    This will show all your iTunes purchases in your library with a cloud icon down arrow. Click the icon to redownload or click on Play to stream without downloading.
    Also see this , -> Download past purchases
    and techncially, you don't "own" the movie, You simply have a license to use it.
    Yet the first thing iTunes does when you hit the delete key is tell you that it will remove the movie forever from all devices and the library.
    Actually, no it does not tell you that.
    FYI: You should keep copies of all yoru iTnue spurahses as the labels/movie studios/copyright owners can pull their product at anytime and it won't be available to redownload.
    Suggestions here -> http://www.apple.com/feedback/

  • How can I create a new recovery key if you automatically removed my trusted device after update do iOS 8?

    How can I create a new recovery key if you automatically removed my trusted device after update do iOS 8?

    Hey -
    I need to do the EXACT same thing, but have no idea how. Has anyone out there done this?
    My situation is a tad different..this is a new Mac (and I'm a brand new Mac user). Tons of querks occur under my original account (videos won't run, Safari won't support certain plug-ins). I spent 6 hours on the phone w/ 4 different Apple Reps and nobody could fix it. A rep finally looked at my MacBook Pro in person today. He created a new account just to see if that would work and under that new account, everything works perfectly fine (no querks, can view video). He tried switching a million settings in my original account to no avail.
    He said to create a new account (as he did) and move my files over to the new account and then go back to the original and delete it. How do you do this?! I can't figure it out! I've got a new account created, but of course it just has the default folders in it w/ the little red icons next to them! Thanks in advance!

  • How can I permanently disable the "fn" key?

    Hi.  My subject says it all.  How can I permanently disable the "fn" key?
    At first I thought I had a virus or something because when I typed only weird symbols came out.  Then I reset the computer.  Then I couldn't even log in.  I tried Time Machine etc.
    Then I realized that the "fn" key wasn't working right.  It seems to be working backwards.  It acts like it's being pushed when it's not, and when I do push it it acts like it's not being used.
    So it's kind of a simple problem but it's really annoying.
    Is there a way I can just disable it permanently?  Even physical force if necessary.  I tried to break it but it wouldn't break.  I don't really use the key anyway so it doesn't really matter.  I don't want to pay a bunch of money to replace a key I don't even use.
    Thanks.  I hope someone knows.

    That's the best answer.  Yeah usually if you press "fn" or "option" you can get it to work for awhile.
    Yeah I have considered some kind of external keyboard also.  It will make a laptop less laptopish.  But it could do the job for awhile.
    It's sad because I don't even care about the "fn" or "option" keys.
    But anyway it's not catastrophic at least.
    And yeah maybe we can get a new computer later or something.  I like mine though.  It's customized and is how I like it right now.
    Anyway thanks for the reply.

  • How to restore just Mavericks from a Time Machine backup

    Macbook Pro 15", (early 2011) 2.0 GHz, 8GB memory
    After having my WD 750GB HD crash, I decided that I would opt for a smaller (256GB) SSD drive and just put Mavericks and my apps on the new drive and keep my user files on an external drive. I've installed and formatted the new drive but I can't figure out how to install just OSX from Time Machine since the entire backup is too big for my new drive.  Before the drive failed, I had installed the latest update for Mavericks (10.9.3?) Thoughts?

    I think you should do the following:
    Install Mavericks, Lion/Mountain Lion Using Internet Recovery
    Be sure you backup your files to an external drive or second internal drive because the following procedure will remove everything from the hard drive.
    Boot to the Internet Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND-OPTION- R keys until a globe appears on the screen. Wait patiently - 15-20 minutes - until the Recovery main menu appears.
    Partition and Format the hard drive:
    Select Disk Utility from the main menu and click on the Continue button.
    After DU loads select your newly installed hard drive (this is the entry with the mfgr.'s ID and size) from the left side list. Click on the Partition tab in the DU main window.
    Under the Volume Scheme heading set the number of partitions from the drop down menu to one. Click on the Options button, set the partition scheme to GUID then click on the OK button. Set the format type to Mac OS Extended (Journaled.) Click on the Partition button and wait until the process has completed. Quit DU and return to the main menu.
    Reinstall Lion/Mountain Lion. Mavericks: Select Reinstall Lion/Mountain Lion, Mavericks and click on the Install button. Be sure to select the correct drive to use if you have more than one.
    Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is three times faster than wireless.
    You can find more about restoring from a Time Machine backup at Pondini's Time Machine FAQ for help with all things Time Machine.
    You

  • How to add an app to a key combination

    How to add an app to a key combination

    You can do it with Automator, although it's harder than in Windows.
    Example:
    How to Launch Any App with a Keyboard Shortcut
    I like to press the Spotlight keyboard shortcut and then use type-ahead and Enter to launch. When Spotlight is open, if I start typing "wo" Microsoft Word will be highlighted and then I just press Enter to launch it.

Maybe you are looking for

  • Unable to run ADFBC JUNIT Test Classes with JDEV11G 11.1.1.6

    Dear All, I upgraded my project to the latest release JDEV 11G 11.1.1.6 Previously we are on JDEV 11G 11.1.1.5 I have a JUNIT class that I am running which test my ADFBC components. public class MyTestClass {   @Test   public void testVOAccess()    

  • Every App I open Crashes

    iTunes, Safari, iMovie... everything I open says quit unexpectanly whil using CoreFP Plug-in

  • Itunes not Installed Properly, Repaired and no luck.

    Hi. I haven't been able to create a CD for about 2 years now. I searched through these forums and found other ways of Repairing the Itunes program and have had no luck. I've repaired through downloading Itunes again, when Menu pops up, I choose to Re

  • Application library/dimension library not opening in EPM 11.1.2.1

    Hi, Ive installed essbase and planning 11.1.2.1 64 bit on windows xp 64 bit machine. Installed all the components as specified in the instalation documentation. But EPMA server doesnt start. I was able to log in to workspace and create an application

  • Interproject Invoice Issue

    Hi , Will be thankful if anyone could help me out in the following issue: Created the Implementations Options - Cross charge enabled, Provider and Receiver information provide. Setup > Costing> Provider and receiver control enabled - Receiver informa