How to press 2 keys with "keyPress" event" at the same time?

Hi~~
I 'm now developing a Java Application that need to press 2 key(keyEvent) at the same time, but it seem not to work after trying.
So, I wonder how to make it work?
Thank~~

You can use a "modifier" (Control, Alt, Shift) key in combination with a regular key, but you can't combine regular keys unless you add some custom logic.
Basically in the keyPressed event you need to store the previous key that was pressed and add some comparison logic to see if the two keys you are monitoring where pressed back to back.

Similar Messages

  • How do I delete loads of calendar events at the same time

    I Have no idea how, but my entire school timetable has somehow appeared on my calendar throughout the entire of December this year and late November. I can't delete them without having to individually delete all 9 events on every day, and there're about 35 days of it. How did my school timetable for the past year that I've just finished even get on my calendar anyway, and how do I delete them all at once without spending ages? (it's holidays)

    Unfortunately it isn't possible. You have to select one at a time. You might want to add your name to the many that have requested this feature in the past.
    https://www.apple.com/feedback/ipad.html

  • How many computers can sync with Apple TV at the same time?

    I'm thinking of buying one of these things for my parents as a last-minute Christmas gift. They both have their own iMac, with their own choice of music/movies/photos/etc. If I get them this device and set it up in their living room, could they stream content from both computers to this?

    Eric wrote:
    When you say "online" you mean bonjour, right?
    So all I'd have to do for set up, is turn on the "share library" in their iTunes? Alright, sounds easy enough.
    No, AppleTV's are set up in a specific manner.
    You can sync with 1 iTunes library, and stream from several.
    Synced material is seen under My Music, My Movies categories of the respective media types (Music/Movies/TV Shows/Podcasts), and if iTunes is running any compatible material that hasn't synced (copied to AppleTV in order to play if computer is off) can be streamed as needed.
    Streaming libraries that don't sync are selected under a My Shared Music/Movies etc category,and stream as needed, but only one is selected at a time.
    To set up a library to sync/stream, AppleTV announces itself across the network to itunes, and a 5 digit code appears on the connected TV which is then entered in iTunes on the machine which is being added to 'computers'. Quite simple really.

  • How can i share documents with different users on the same mac?

    How can i share documents with different users on the same mac?

    Shared how? The other users can read the documents or you all can read and write the documents?
    The first is easy just place the documents in /Users/Shared anyone can access the files there and the other users will be able to read them.
    The second is a bit trickier.

  • How do i share music with 2 iphones using the same apple id?

    how do i share music with 2 iphones using the same apple id?

    Sync them both to the same iTunes music library.  You can also automatically download purchased music to both by going to Settings>iTunes & App Stores and turning Music to On under Automatic Downloads.  If you music is in multiple computers, you can enable Home sharing to share your music library across multiple devices (see http://support.apple.com/kb/HT3819).

  • How to export 2 different report with a link at the same time

    Hi,
    Do anybody know how to export 2 different report with a link at the same time. I currently create a report which link to another report. But when I want to export the 1st report I also want the 2nd report also be exported.
    Thank you very much.
    Best Rgds,
    SL Voon

    Export all the three components individually.
    It will generate 3 script files. Now run them from SQL>
    null

  • Can anybody explain how to print multiple copies of different documents at the same time as at the moment I have to open each individually and press print

    Can anybody explain how to print multiple copies of different documents at the same time as at the moment I have to open each individually and press print

    is this a windows in bootcamp question ?

  • How do I get 2 layers to move at the same time?

    How do you get 2 layers to move at the same time?

    Thanks for the help folks, sorry I've been away.
    I'd love help with the problem of why I only one track seems to accept clips to play. When I drag them to other tracks or create a track by dragging the clips are grayed out and won't play, but if I drag them to the one track where they're blue they play.

  • How do you keep two users logged in at the same time?

    How do I keep two users logged in at the same time to be able to access home sharing?

    Fast User Switching in Users & Groups or Accounts preferences in Login Options.

  • How can I get rid of multiple pictures at the same time?

    how can I get rid of multiple pictures at the same time?

    Adobe Bridge, lightroom and your file browser (windows explorer or Mac Finder) can select multiple pictures at once and then delete. If you are looking for more than that for information, you will need to be more specific at what your doing, what OS you have, and version of software your using. If necessary post screen shots so we can see what your doing. The more information we have the more detailed of an explaination can can give back to you.

  • How do I view more than one image at the same time in CS6?

    How do I view more than one image at the same time in CS6?

    Hi there
    If you go to Window > Arrange you can choose from several view options. Below I have selected Two-Up Horizontal since I have two images, but you can select other options if you have more than one image.

  • How do i open 2 hotmail outlook accounts at the same time? Thanks.

    How do I open 2 hotmail outlook accounts at the same time? Thanks.

    Safari only lets me to sign in to one hotmail account at any one time. If I am signed in to one account and I open a new window (or tab) the existing hotmail account I am signed in to opens again (I want to sign into second account simultaneously). So I am trying to sign in to 2 hotmail accounts at the same time. Does that makes sense?

  • How do I delete all of my mail at the same time?

    How do I delete all of my mail at the same time? Or is this even possible? Thanks for your help.

    Unfortunately it isn't possible. You have to select one at a time. You might want to add your name to the many that have requested this feature in the past.
    https://www.apple.com/feedback/ipad.html

  • How do I delete a bunch of pictures at the same time?

    How do I delete a bunch of pictures at the same time?

    Select the ones you want to delete, then go to Photos > Move to Trash.
    To permanently delete them, =you have to go to the iPhoto menu, then select Empty Photo Trash.

  • I am doing two people's jobs and I need to use two separate log-ins on the same website. How can I keep both log-ins open at the same time. Everytime I switch tabs I have to log in again.

    I am doing two people's jobs and I need to use two separate log-ins on the same website. How can I keep both log-ins open at the same time. Everytime I switch tabs I have to log in again.

    Try one of these extensions for multiple cookie sessions.
    Multifox: <br />
    http://br.mozdev.org/multifox/ <br />
    Cookie Swap extension: <br />
    https://addons.mozilla.org/firefox/3255/ <br />
    Cookie Pie extension: <br />
    http://www.nektra.com/oss/firefox/extensions/cookiepie/

Maybe you are looking for