How do I check if the ctrl key is pressed from within a mouseReleased actio

How do I check if the ctrl key is pressed from within a mouseReleased action?
      addMouseListener( new MouseAdapter() {
         public void mouseReleased( final MouseEvent e ) {
           // If ctrl button is held down and mouse is clicked, do something
         }};

Found it, I think
    e.isControlDown()

Similar Messages

  • How do I know if the CTRL button is pressed or not?

    I want to let the user hold down CTRL or not, on the keyboard, when they click on a button, how do I detect this?
    I don't want to add a listener to it, I only need to check,if it is down or not, when the mouse is clicked on a specific button.
    Surely I should be able to check this, like I could a JButton, but just can't find how.

    Try this
    regards
    Stas
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.*;
    public class Test extends JFrame {
    public Test() {
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    this.setBounds(50,50,200,200);
    this.getContentPane().setLayout(new FlowLayout());
    JButton b=new JButton("test");
    this.getContentPane().add(b);
    b.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    if ((e.getModifiers()&e.CTRL_MASK)==0) {
    System.out.println("CTRL isn't pressed");
    }//if
    else {
    System.out.println("CTRL is pressed");
    this.show();
    public static void main(String[] args) {
    new Test();

  • Help: How Can I turn off a sound bound to the CTRL key?

    Hi, I made a small Unity3D game using the CTRL key as the fire button. There I added a sound to the CTRL key. Now all of a sudden that key always makes that sound "on mouse release". No help even after deleting the sound file, clearing the PR Ram, making restarts. OS X Yosemite on my iMac 5k will always make that sound initially only active during the game. Any help appreciated. Thanks Rolf

    Problem found - there was a hidden web page open with a similar game that accepted the CTRL key. :-)

  • Is there a hidden screw or latch under the ctrl key to release the keyboard on the HP ENVY dv6-7250?

    The keyboard is damaged and I want to replace it.
    I have a HP Envy dv6 Notebook PC Model # C2L44UA#ABL with S/N {Content Removed}
    i believe the part number is B6R23AV WIN 8 MULTI lANGUAGE 64.1.1 dv6 for the keyboard.
    I removed all the screws and separated the top surface that holds the keyboard but something under the ctrl key is holding everything together.
    Is there a release mechanism in that area. If so how does it work?

    Maybe this will help:
    How to disassemble HP Pavilion dv6 laptop
    Kind Regards,
    Dragon-Fur

  • My homepage shrunk when I accidentally pressed the ctrl key and the underscore key ( I mean't to press the shift key to underscore)

    I was entering a website a wanted to visit which required an underscore,
    but instead of pressing the shift key along with the ' underscore ' key (-_), I pressed the ctrl key and my firefox homepage shrunk to where the print was unreadable. How do I bring the homepage back to where it should be?

    Reset the page zoom on pages that cause problems: <b>View > Zoom > Reset</b> (Ctrl+0 (zero); Cmd+0 on Mac)
    See:
    * http://kb.mozillazine.org/Zoom_text_of_web_pages

  • 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 do I change the color of font in a fillable form in Adobe Reader? How can I check if the writer of the document has given permission to edit color and not just add text?

    How do I change the color of font in a fillable form in Adobe Reader? How can I check if the writer of the document has given permission to edit color and not just add text? Please help! I'm technologically challenged.

    Most forms (99% or more) are created for simple text input, where you cannot change anything.
    The creator of the form could allow Rich Text input (which allows you to change font, text size, color, etc.), but frankly I have never seen such a form, and I wouldn't know how they look.  But I'm sure they would show some kind of controls to alter the text appearance.

  • How can I check on the delivery of an photo but that I created and sent to a friend.  I have the order number but I can't find the tracking information.

    How can I check on the delivery of a photo book that I created and sent to a friend.  I have the order number but I can't find the tracking information.

  • I had bought a Mac PRE 13 in,  in 7th Sep,but it is 15th Sep today,how doesn't my computer come to me? So,how can I check where the computer is at this moment?

    I had bought a Mac PRE 13 in,  in 7th Sep in the online Apple Store,
    but it is 15th Sep today,how doesn't my computer come to me yet?
    So,how can I check where the computer is at this moment?

    Call the online Apple Store.  You should have received an email with a FedEx tracking # if you are in the US.
    There is nothing anyone can do for you on a message board!  We are all end users just like yourself.

  • HT1766 I have manually back up my iphone few days back, and my contact got missing the next day. i restored my back up from iTunes, however, my contact did not get restored. How do i check if the manual back up did actually back up my contact or not?

    I have manually back up my iphone few days back, and my contact got missing the next day. i restored my back up from iTunes, however, my contact did not get restored. How do i check if the manual back up did actually back up my contact or not? How do i get back my old contact in my phone?

    Your entire second paragraph is so confusing I am going to ignore it.
    But I may be able to answer your first and third paragraphs, which seem to address the same question.
    I wonder where your iPhone states it was backed up yesterday.  I am going to assume that you see this under Settings > iCloud > Storage & Backup.
    If that is true, then the backup from yesterday is in iCloud.  The one and only way to restore an iCloud backup is to do this on your iPhone:
    Settings > General > Reset > Erase All Content and Settings
    That will cause your iPhone to begin a setup process.  As part of that process, assuming you enter the same Apple ID you used when you created the iCloud backup, you will be offered the opportunity to restore from it.

  • Using PL/SQL Block how do you check if the character string value is aA-zZ

    I have a pl/sql block that I prompt the user for password and I load the string into an array and interrogate each index(entry) to see if it is "aA-zZ".
    How can I check if the value entered is Alpha.
    I need to do the same for number and Special character. Please advise. Thanks

    Thanks to All of you. The desired solution to verify complex password that enforces desired security policies. An example that I am using is the following:
    IF NOT (regexp_like(sz_complex_pw,'[[:digit:]]') AND regexp_like(sz_complex_pw,'[[:alpha:]]') AND regexp_like(sz_complex_pw,'[[:punct:]]') AND regexp_like(sz_complex_pw,'[[:upper:]]'))
    THEN
    --dbms_output.put_line('Password is not complex...');
    RAISE sz_err_pw_complex; -- Complex Password is not compliant
    END IF;
    DBMS_OUTPUT.PUT_LINE('Complex Password is in Compliance...');
    EXCEPTION
    This was helpful to me and I trust others will find helpful.
    Edited by: yakub21 on Oct 16, 2010 9:05 PM

  • How do I check if the associated PageItem is there/exists from a XMLElement ?

    Hi,
    I have the following structure:
    Extension Builder 1.5;
    InDesign 5.0;
    Image (Rectangule Frame);
    XML tag associated with the Image.
    The following scenario:
    I do have an application that checks if this strucuture is available and intact, that is, the user has not deleted the tag (XMLElement) and/or the Rectangule Frame(PageItem);
    I do not want loop through allPageItems (the page should have many of them - more than 1000) and get the XMLElement;
    So, I loop over the XMLElements and get the associated PageItem through xmlElement.xmlContent property;
    The document images properties (image, epss, etc) never are populated (document.epss.length = 0);
    I can validate if the tag was deleted or untaged easy.
    The problem:
    User deletes the Image/Rectangule Frame (PageItem) and keep the xml tag (untag the XMLElement);
    The isValid property (xmlElement.isValid = true) is true;
    The associated PageItem becomes a Text and is valid as well;
    The question:
    How do I check if the associated PageItem is there/exists from a XMLElement ?
    Regards
    Marcos

    Found it, I think
        e.isControlDown()

  • How do you check if the input is empty?

    Hello,
    I am asked to write a program which gets as input in the command line a number of strings, and is to print out the first of these string.
    but if the input is empty it must print our an error message.
    how do i check if the input is empty?
    i guessed
    public static void main (String[] args){
         if (args == null)
         ........but thats wrong.
    Thanks,
    iris

    If no arguments were passed, it means that there are zero arguments entered. So the args array will have a length of zero.

  • How to do CHECK IN the files for the document?

    Hi ,
    By using BAPI_DOCUMENT_CHECKIN2 Function module I am uploading the Files for the Document number.
    My problem is - After uploading the files to the document number the files are not in check in status.
    I want the files to be checked in after uploading the from the FM.
    Can anyone tell me what I am missing ? How to do check in the files.
    I am passing the following values to FM.
          ls_files-SOURCEDATACARRIER = ls_file-DATA_CARRIER.
          ls_files-WSAPPLICATION     = ls_file-application.
          ls_files-DESCRIPTION       = ls_file-file_desc.
          ls_files-STORAGECATEGORY   = ls_file-category.
          ls_files-DOCFILE           = ls_file-doc_path.
          ls_files-CHECKEDIN         = 'X'.
        CALL FUNCTION 'BAPI_DOCUMENT_CHECKIN2'
          EXPORTING
            DOCUMENTTYPE            = ls_file_data-dokar
            DOCUMENTNUMBER          = ls_file_data-doknr
            DOCUMENTPART            = ls_file_data-doktl
            DOCUMENTVERSION         = ls_file_data-dokvr
          IMPORTING
            RETURN                  =  ls_return
          TABLES
            DOCUMENTFILES           =  lt_files
        COMPONENTS              =
        DOCUMENTSTRUCTURE       =
    I appriciate you response on this.
    Thanks in advance.

    Hi,
    Check the values you are passing into ls_files .
    you dont need to pass checkedin = 'X'.
    and check the storagecategory field - this should not be blnak.
    files-SOURCEDATACARRIER = lsfile-DATA_CARRIER.
    ls_files-WSAPPLICATION = ls_file-application.
    ls_files-DESCRIPTION = ls_file-file_desc.
    ls_files-STORAGECATEGORY = ls_file-category.
    ls_files-DOCFILE = ls_file-doc_path.
    ls_files-CHECKEDIN = 'X'.
    This FM will work. No issues just check the values you are psssing into this LS_FILES structure.
    Rest of the fields are corect.
    Thanks,
    Murali.

  • How to do Check in the files for the document number?

    Hi ,
    By using BAPI_DOCUMENT_CHECKIN2 Function module I am uploading the Files for the Document number.
    My problem is - After uploading the files to the document number the files are not in check in status.
    I want the files to be checked in after uploading the from the FM.
    Can anyone tell me what I am missing ? How to do check in the files.
    I am passing the following values to FM.
          ls_files-SOURCEDATACARRIER = ls_file-DATA_CARRIER.
          ls_files-WSAPPLICATION     = ls_file-application.
          ls_files-DESCRIPTION       = ls_file-file_desc.
          ls_files-STORAGECATEGORY   = ls_file-category.
          ls_files-DOCFILE           = ls_file-doc_path.
          ls_files-CHECKEDIN         = 'X'.
        CALL FUNCTION 'BAPI_DOCUMENT_CHECKIN2'
          EXPORTING
            DOCUMENTTYPE            = ls_file_data-dokar
            DOCUMENTNUMBER          = ls_file_data-doknr
            DOCUMENTPART            = ls_file_data-doktl
            DOCUMENTVERSION         = ls_file_data-dokvr
          IMPORTING
            RETURN                  =  ls_return
          TABLES
            DOCUMENTFILES           =  lt_files
        COMPONENTS              =
        DOCUMENTSTRUCTURE       =
    I appriciate you response on this.
    Thanks in advance.

    Any answers for this?
    Thanks.

Maybe you are looking for

  • HELP!!! AE3000 Adapter Not Working With Windows 7

    Hello, I have a Gateway desktop with Windows 7 installed on it. I recently bought the Linksys AE3000 adapter to get internet for it, but whenever I plug it in, the light doesn't come on or anything. I tried the CD as well and it says that the adapter

  • How to configure the Oracle XSL Mapper for ‘schemaLocation’ attribute?

    In the Transformation_1.xsl I need to have the ‘schemaLocation’ attribute defined as such: <inc:CaseIncidentReport xsi:schemaLocation="http://caseincidentreport.com/1.0.4 CaseIncidentReport.xsd"> This is fine as long as long as I don’t switch to the

  • Movie rented on MacBook to apple tv?

    how to look at the apple tv movie rented on the MacBook? transfer of the film is not possible?

  • Distribution error

    I am using the following distribution file: <mail id="XQRSN" to="[email protected]" subject="report test"> <body srcType="file"> <include src="body.html"/> </body> <attach format="pdf" name="test.pdf" srcType="report"> <include src="report"/> </attac

  • Load progrm not found

    hi friends i am calling a smartform from a program bt facing run time error that "load_program_not_found" I have designed my smarform according to the steps givn in a questin in this forum: Smartforms for beginner plz help me how to solve Edited by: