Type anywhere in JTextArea where mouse clicks

Is it possible to start typing anywhere where the mouse clicks with a JtextArea ? I have an application that needs to allow users to start typing at the position where mouse clicks. Be default, JtextArea starts at (0,0).

Well, this might not be the cleanest way, but you could create a mouselistener on the TextArea (or subclass it), and
1) check to see if the clicked position refers to a valid offset in the textArea. If so, you don't really have to do anything, since the basic functionality of the thing should drop the caret in just where you want it. ModelToView() will help you figure out where in the document the mouse clicked.
2) if not, figure out how many lines down/ tabs over need to be appended to the document to get the cursor where you want it, then insert them
3) move the cursor to the end of the document.
this might not be all that clean, especially since fonts vary in width. there are a number of ways you can find out how wide a string is in a given font, though.
hope that helps

Similar Messages

  • Adobe Stamps Don't Place Where Mouse Clicks

    Hello,
    My firm is experiencing some issues regarding stamps.  We've created a library of stamps for the employees to use in their documentation.  However, some users are noticing that the stamps don't place where they click.  For instance, a user will select a checkmark stamp, hover the mouse over a box on the pdf file, and click on the box to place the stamp.  The user wants the checkmark to appear inside the box.  However, for some odd reason the stamp appears 20 or so pixels above or below where the user clicks.  It's quite random.  And this occurs on more than one PC type (three different kinds of Toshiba laptops).  It also occurs in both XP and in Windows 7.  Has anyone noticed this?  Does anyone know how to fix this?  I have updated both Adobe and the mouse drivers to see if it makes a difference - it didn't.  Any suggestions would be appreciated!
    Thanks,
    Teresa

    Acrobat is kind of quirky about pasting into the file. Pastes tend to be done at either the top left or the middle of the page, depending on the version of Acrobat. You then have to use the object touchup tool to move the paste to where you want it.

  • JList where mouse click acts like ctrl-mouse click

    I'd like to create a JList where I can select multiple items as if the control key were down, but without having the control key down. I thought that perhaps I could do this by extending JList and overriding its processMouseEvent method, setting the MouseEvent object to think that control is pressed and then calling the super method like so, but it doesn't work (I still need to press the control key to get my desired effect):
    import java.awt.Component;
    import java.awt.event.InputEvent;
    import java.awt.event.MouseEvent;
    import javax.swing.*;
    public class Ctrl_Down_JList {
      private static void createAndShowUI() {
        String[] items = {"Sun", "Mon", "Tues", "Wed", "Thurs", "Fri", "Sat"};
        JList myJList = new JList(items) {
          @Override
          protected void processMouseEvent(MouseEvent e) {
            // change the modifiers to believe that control key is down
            int modifiers = e.getModifiers() | InputEvent.CTRL_DOWN_MASK;
            // can I use this anywhere?  I don't see how to change the
            // modifiersEx of the MouseEvent
            int modifiersEx = e.getModifiersEx() | InputEvent.CTRL_DOWN_MASK;
            MouseEvent myME = new MouseEvent(
                (Component) e.getSource(),
                e.getID(),
                e.getWhen(),
                modifiers, // my changed modifier
                e.getX(),
                e.getY(),
                e.getXOnScreen(),
                e.getYOnScreen(),
                e.getClickCount(),
                e.isPopupTrigger(),
                e.getButton());
            super.processMouseEvent(myME);
        JFrame frame = new JFrame("Ctrl_Down_JList");
        frame.getContentPane().add(new JScrollPane(myJList));
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
      public static void main(String[] args) {
        java.awt.EventQueue.invokeLater(new Runnable() {
          public void run() {
            createAndShowUI();
    }Any ideas would be much appreciated!

    Any ideas would be much appreciated!Here is a hack, idea is same as yours, but using Robot:
    public static void createAndShowUI2() {
         String[] items = { "Sun", "Mon", "Tues", "Wed", "Thurs", "Fri", "Sat" };
         final JList myJList = new JList(items);
         myJList.addMouseListener(new MouseAdapter() {
              Robot robot;
                   try {
                        robot = new Robot();
                   } catch (AWTException ex) {
                        ex.printStackTrace();
              @Override
              public void mouseEntered(MouseEvent e) {
                   if (robot != null)
                        robot.keyPress(KeyEvent.VK_CONTROL);
              @Override
              public void mouseExited(MouseEvent e) {
                   if (robot != null)
                        robot.keyRelease(KeyEvent.VK_CONTROL);
         JFrame frame = new JFrame("Ctrl_Down_JList");
         frame.getContentPane().add(new JScrollPane(myJList));
         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         frame.pack();
         frame.setLocationRelativeTo(null);
         frame.setVisible(true);
    }It does work, but there has to be some cleaner way of doing this, perhaps using SelectionModel but I don't know about it.
    Thanks!
    Edit: I found that if Control key is pressed manually, then this hack obviously, to handle this, it has to made dirtier:
    myJList.addMouseListener(new MouseAdapter() {
         Robot robot;
              try {
                   robot = new Robot();
              } catch (AWTException ex) {
                   ex.printStackTrace();
         Timer timer = new Timer(20, new ActionListener() {
              @Override
              public void actionPerformed(ActionEvent e) {
                   if (robot != null)
                        robot.keyPress(KeyEvent.VK_CONTROL);
            @Override
         public void mouseEntered(MouseEvent e) {
              if (robot != null) {
                   robot.keyPress(KeyEvent.VK_CONTROL);
                   timer.start();
            @Override
         public void mouseExited(MouseEvent e) {
              if (robot != null) {
                   robot.keyRelease(KeyEvent.VK_CONTROL);
                   timer.stop();
    });Edited by: T.B.M on Mar 13, 2010 10:06 PM

  • Is there a way to simulate a mouse click anywhere on a screen in Dictate ?

    I'm using Dictate because of hand problems. Unfortunately, it does not seem to have the ability as supplied to simulate mouse clicks anywhere on the screen as Dragon Naturally Speaking does on the Windows side.( I do not mean by this the ability to select an item in the menu, which It does have the built in ability to do.) It can, however, so I read, be scripted to do a lot of things. Is there an Applescript out there that would allow for the simulation of mouse clicks anywhere on the screen (as opposed to just on a UI item)?

    Platform: 2.2 gHz iMac using Mac OS X 10.5.5; Dictate v. 1.2.1 Build
    Okay, so, here, after a great deal of research, is a procedure for implementing a single mouse click anywhere on the screen. Since it’s a procedure, I’m detailing each step.
    !. Download the scripting addition (sometimes known as an OSAX) xTool.sax from: http://lestang.org/osax/XTool/XTool-2.0.dmg.tgz. You will have to decompress the file (StuffIt) and double-click it to get it to unfold into a .dmg (disk image) file. In this file you will find the file Xtool.osax. Drag it into your MacHD (or whatever the name of your topmost volume is)/library/ScriptingAdditions (no spaces in the name) folder. The purpose of this is to place it into a folder where Applescript is expecting to find scripting additions. In other words, it’s hard-coded and you can’t just drop it anywhere because Applescript may not find it. Also, there may be more than one Library folder in other directories. Under 10.5.5. which I’m running, I can tell you it works where I placed it.
    The effect all of this has is that when you create your script in Dictate’s New Commands window (Script Editor), Dictate will know what the commands “click mouse’ and “position of the mouse” mean. These are not standard Applsecript commands but are additions, hence the name Scripting Additions.
    2. Start Dictate and in the File drop-down select New Command. This will take you to a window with a pane on the left with names such as Applications, Global, and several others. Click on Global (so that the command will be recognized no matter what application your are in). To the right of the pane you will see a number of commands listed by name and, underneath, a (very small) “+” (and a minus sign and a small icon). Ignore everything but the “+”. Click on the “+”.
    Below several boxes will appear: Command, Description, Context, Type.
    In Command Name type in the name you want Dictate to recognize to do the click. (I call mine Mouse click.) In Description you can type something like Single-clciks the mouse. In the Context drop-down make sure to select Global. In the Type drop-down, select Applescript.
    Paste the following into Text Edit (orTexEdit Plus,if you have that):
    click mouse {(position of the mouse), [1]}
    For reasons unknown to me, you can’t just select that text, copy, and paste it into Dictate’s Script Editor winodw. You will have to select it in Text Edit and drag it into the Source text box.
    Click on the Compile button at the left bottom. After it finishes compiling (a matter of seconds if everything is normal), click on the Run button with your mouse. If all has gone well, you will very likely see the Run button get pressed repeatedly. Take your mouse off the button so it stops blinking like mad. (The Mouse click Appplescript is repeatedly looking at the position it find itself and clicking again, and again.)
    While your mileage may vary, I have been able to simulate single mouse-click using this workaround.
    So far, I have not been able to simulate a double-click reliably. There is, I believe, an issue with the amount of time between the two clicks (a parameter of the click mouse command above which I did not go into here). For anyone out there who wants to work on that, I would be glad to hear your results. I’ve tried values up to 2000 in the DELAY parameter after the TIMES parm. Here is what the dictionary shows for this command.
    click mouse?v
    click mouse [point] : where to do the mouse click
    [times integer] : how many times you want to clik the mouse
    [delay integer] : delay between two mouse clicks
    [using primary button/secondary button/middle button] : which mouse button
    If I get this to work I will let my fellow sufferers know.
    Thanks to Hiroto and Andrew99 in particular for their help.

  • Need a shortcut to "Allow pages to choose their own colors, instead of my selections above option preference" I know where it is and how to use it but I have to go through 7 mouse clicks to change it, then a few minutes later change it back. I also k

    Need a shortcut to "Allow pages to choose their own colors, instead of my selections above option preference" I know where it is and how to use it but I have to go through 7 mouse clicks to change it, then a few minutes later change it back. I also know the sequnce is alt t, alt o, alt c, alt a, then ok, ok. Got to be a way to make a one key short cut for this. I use a black background to reduce eye strain, but about 10% of the webpage I go to can't be send with black so I have to go into tools and hit 6 or 7 things to chnage it then after through with webpage have to do it all over at Not allow webpages to have own color. Very very cumbersome.
    == This happened ==
    A few times a week
    == made that way

    https://addons.mozilla.org/en-US/firefox/addon/toggledocumentcolors-198916/
    The above addon will solve your problem.
    Shortcut to toggle user color/page color :- Ctr+Shift+C

  • Figuring out where a mouse click is under an image

    I want to create a JFrame (or JPanel) where the whole area is one big gif (or icon etc) and I want to make some areas of this panel react to mouse clicks and other areas display messages.
    There are two ways that I can think of doing this.
    The first is that I figure out the x and y coordinates of each area and check to see if each mouse click is within that area.
    The second way is to see if I can figure out how to put something like transparent JButtons over the areas that I want to accept mouse clicks (all the areas will be rectangular) and just do what JButtons do normally.
    The second way sounds easier but I don't know how to do that.
    Does anyone have opinions on which way I should do it?
    Thanks

    To me the first method sounds eaiser.
    A third possible idea? Add a bunch of JPanels to the frame and have split the image into several pieces that are painted by each JPanel. Then use a mouse listener to detect clicks. (Seems easier than trying to make JButton transparent and placing it at the correct point).

  • Mouse click event on JTextArea

    Hi All,
    I have a JTextArea with some text which is not editable. If i click on any word on the text area, i want to get that word. Based on the word clicked, i have to display a popup window with some options. And i have to get the string which contains the word clicked.
    For ex:
    "How are you Joe ?" string is in text area. If i clicked on word 'you', i have to get the 'you' word and the string 'are you joe'.
         I am getting the caret position where i clicked on the text area. But i am not getting the word where i clicked. How to get that?
    Can anyone give me the idea how to solve this?
    Thank you.
    sridhar

    int offset = textArea.viewToModel( event.getPoint() );
    int start = Utilities.getWordStart(textArea, offset);
    int end = Utilities.getWordEnd(textArea, offset);
    String word = textArea.getDocument().getText(start, end-start);

  • I am using FireFox 4. Where is the "Bookmark All Tabs-" feature. I would like to save my Tabs for a later session. The selection is not on the menu when I right-mouse click or go to the Bookmarks feature of the Menu.

    Missing "Bookmark All Tabs…" feature which was in previous versions of FireFox 3.x. If you right-mouse click on a neutral part of the Browser window, there would be choice of "Bookmark this page" or "Bookmark All Tabs…". I have been unable to find it either in the sub-menu or the BOOKMARK selection from the Menu Bar.

    What do you mean by Tabs sub-menu is it right-clicking on a tab ?
    I know that "ctrl-shift-D" still work.
    I know that a right-click on a tab gives the "Bookmark all Tabs" function.
    But I would like to see it back in the Bookmarks menu. (which is its logical place)
    Because today the choice only disappeared from the menu as it is still reachable through keyboard shortcut or through mouse right-click on a tab
    but tomorrow it will totally disappear and personally I don't want that as this is one of my favorite functionality.
    Tank you for your understanding !

  • How do I set my project to advance to next slide on mouse click vs just play?

    Captivate 6 on mac running OS 10.7.5 file format in question .htm (firefox)
    I'm brand new to Captivate 6 (never used it before) I have put together a mock presentation from scratch which has a few introductory slides then a quiz. When I publish it there is a "play" button which is NOT the behavior I want.
    I watched a training video from Lynda.com and the insstructor imported a PPT file, there was a dialog box which asked the how to advance slide, there was a drop down menu and one of two options was advance "on mouse click". This is the behavior I'm looking for.
    I've scoured the internet and forums etc to find a comparable option elsewhere in Captivate 6 when creating from scratch vs importing from PPT and cannot find one anywhere. I've also read that you can insert a click box object and that that would do what I'm looking for but that doesn't work either.
    Does any such option exist and if so where/ how do I get to it/ use it. Please see attachments below. First screen shot is the first slide I get which isn't the first slide either, what's up with that? Next one is simply to show how the project just "plays" instead of advancing slide by slide. Third is my publish dialog box. Bottom line I don't want a "play" button I want the user to mouse click next, next, next etc. How do I do this?
    Thank you for any help or suggestions!

    Maybe I understand something wrongly, but thought you also wanted to know how you can make slides advance on clicking the Next button instead of having it playing on automatically? And instead of using the playbar you want to have a Previous and Next button?
    The way imported PPT with advance on Mouse click works is because there is a click box added to each slide that pauses that slide at its end. The user has to click on the slide to advance.
    A click box is an 'interactive' object: this means that you can have it pausing the slide, that the user can interact with it and trigger an action like 'Go to Next Slide'.
    You added (from what I see on the last screenshot) another interactive object, but now I'm confused: the third screenshot has a Prev and Next arrow, I think those are shapes. You do not need to add a click box on top of them (what I see on the last screenshot), they can be converted themselves into buttons. I blogged a lot about those shape buttons. Anyway, both click box and shape button can pause the slide. This is the case by default for click boxes (at the end of their duration, their timeline), for shape buttons you have to tell them to pause in the Timing accordion. In your case I certainly would choose a shape button because they can be put on a master slide, or timed for the rest of the project whereas Click boxes need to be unique on each slide, you'l have a lot of copy/paste to do then. In the Action accordion, On Success you choose the action, I think in this case you want 'Go to Next Slide' for the Next 'thing'
    As for the first screenshot, Rod explained that you cannot get rid of the play button for pdf output, but you can have a poster image instead of the blank screen. There is a folder icon in Preferences, Project, Start and End when you deselect AuotPlay.
    Here is a link to an article where I explain shape buttons:
    http://lilybiri.posterous.com/why-i-like-shape-buttons-captivate-6
    There is an on-demand webinar as well on the Adobe site which I presented, only about shape buttons.
    Lilybiri

  • Automator - How do I: Mouse Click, Move Windows, and more

    Hello,
    I am attempting to create my own Automator programs and for a while I had some that worked nicely. I have recently been tweaking my iMac so that it can "think" on its own (by automator of course) and do things for me. However, I've run across a block with Mavericks (I believe it's due to Mavericks).
    1. How can I get Automator to register a mouse click? "Watch me do" does not seem to want to work for me at all. I also would prefer if it would just be a registered mouse click, but not actually use the mouse (I know this is possible) so that if I'm doing something and it runs, it won't disturb my mouse and I can keep working.
    2. How can I register a keyboard stroke? Same as above
    3. How can I have automator move windows? I have two monitors and there are times when I may want it to move a window from one mintor to another
    The following is a list of all the things I'm attempting to accomplish at the moment (with other things when I think of them) with automator (either through applications, folder actions, or ical actions):
    1. Register a mouse click at a given area or on a given element in a safari page
    2. Register a keyboard stroke in a given program (be able to focus on a program and then do the keystroke)
    3. Move windows from one location to another
    4. Full-screen and Un-full-screen iTunes at certain times of day
    5. Download all purchased items on iTunes that aren't on the computer (sometimes iTunes doesn't download stuff if it was downloaded on my MacBook Pro first)
    6. Automatically voice read reminders (that I've set in Reminders) each day at a given time (I can use loop to repeat it to make sure I hear it all)
    I'll think of more of course, but the mouse click, keyboard stroke, and moving windows is the big thing I'm trying to figure out how to do. Can anyone help?
    Also, I am not a computer tech. I am tinkering with this because it's fun and helpful, but an answer of "just use applescript" or "just use java" will likely just give me a headache. I know that it's going to be one of those codes, but I'm hoping someone has a "base" code that can be copied and pasted that's just a standard click that I can adjust for where I need to click and what process I need to click on.
    If there is an Action Pack that includes a "Register Mouse Click" and/or "Register Keyboard Stroke", then that would work great, but the only action packs for automator I've seen that work with Mavericks is for photoshop.

    You're asking for a lot in one post.  It would be better to break your requests down a bit. 
    For example, to deal with mouse clicks, you can use the Automator Action Run Shell Script with this python script:
    import sys
    import time
    from Quartz.CoreGraphics import *
    def mouseEvent(type, posx, posy):
            theEvent = CGEventCreateMouseEvent(None, type, (posx,posy), kCGMouseButtonLeft)
            CGEventPost(kCGHIDEventTap, theEvent)
    def mousemove(posx,posy):
            mouseEvent(kCGEventMouseMoved, posx,posy);
    def mouseclick(posx,posy):
            mouseEvent(kCGEventLeftMouseDown, posx,posy);
            mouseEvent(kCGEventLeftMouseUp, posx,posy);
    ourEvent = CGEventCreate(None);
    # Save current mouse position
    currentpos=CGEventGetLocation(ourEvent);
    # Click the "Apple"
    mouseclick(25, 5);  
    # 1 second delay       
    time.sleep(1);        
    # Restore mouse position
    mousemove(int(currentpos.x),int(currentpos.y))
    It will look like this in Automator:
    To drag something (i.e. a window, a file icon) from position 40,60 to 60,300:
    import time
    from Quartz.CoreGraphics import *
    def mouseEvent(type, posx, posy):
               theEvent = CGEventCreateMouseEvent(None, type, (posx,posy), kCGMouseButtonLeft)
               CGEventPost(kCGHIDEventTap, theEvent)
    def mousemove(posx,posy):
               mouseEvent(kCGEventMouseMoved, posx,posy);
    def mouseclickdn(posx,posy):
               mouseEvent(kCGEventLeftMouseDown, posx,posy);
    def mouseclickup(posx,posy):
               mouseEvent(kCGEventLeftMouseUp, posx,posy);
    def mousedrag(posx,posy):
               mouseEvent(kCGEventLeftMouseDragged, posx,posy);
    ourEvent = CGEventCreate(None);
    # Save current mouse position
    currentpos=CGEventGetLocation(ourEvent);
    # move mouse to upper left of screen
    mouseclickdn(40, 60);
    # drag icon to new location
    mousedrag(60, 300);
    # release mouse
    mouseclickup(60, 300);
    # necessary delay
    time.sleep(1);
    # return mouse to start positon
    mouseclickdn(int(currentpos.x),int(currentpos.y));
    For keystokes in AppleScript (which can be added to Automator with the Run Applescript Action) see: http://dougscripts.com/itunes/itinfo/keycodes.php

  • COMMIT_FOARM IS NOT WORKING INSIDE THE  WHEN-MOUSE-CLICK

    Dear friends
    I have following script in when-mouse-click trigger
    BEGIN
    IF NOT Form_Success THEN
    Bell;
    RAISE Form_Trigger_Failure;
    END IF;
    IF :System.Form_Status = 'CHANGED' THEN
    IF :LOCK_FLAG = 1 THEN
    UPDATE PROJ.IM_REQUEST_HEADER
         SET LOCK_FLAG = 1
         WHERE DOC_CODE = :DOC_CODE ;
         SHOW_MESSAGE('DOCUMENT CODE -1'|| ' '||:DOC_CODE);
         SHOW_MESSAGE('LOCK FLAG -1'|| ' '||:LOCK_FLAG);
         Commit_Form;
         MESSAGE('The Record have been changed -1 ');
    ELSE
         UPDATE PROJ.IM_REQUEST_HEADER
         SET LOCK_FLAG = 0
         WHERE DOC_CODE = :DOC_CODE ;
         Commit_Form;
         MESSAGE('The Record have been changed - 2');
    END IF;
    ELSIF :System.Form_Status <> 'QUERY' THEN
    Message('An error prevented your changes from being
    committed.');
    Bell;
    RAISE Form_Trigger_Failure;
    END IF;
    END;
    Note :
    The above trigger is attached to this field LOCK_FLAG and the item type of LOCK_FLAG is check box in the form and the property of the LOCK_FLAG
    is site as the following :
    database item = NO , and the property of the blcok IM_REQUEST_HEADER is site as the following :
    database data block = NO
    and my problem is when i change the value of LOCK_FLAG is not executting the update statement .
    waiting for your valuable answer in details thank in advance for your cooperation.
    best regards
    jamil alshaibani

    Dear Wilfred
    Thank you very much for your cooperation, yes when I change the “Database data block “ property to no, it works, as I wanted to be.
    Notes about my application:
    In my program I provide the store keeper query screen, he can check the orders and lock the specific order by clicking on the LOCK_FLAG field, so after he locked the field the requester user can not change his order content if it is locked by the store keeper
    And the way I was trying to do it ,by query the data from      IM_REQUEST_HEADER Table which is the Order table which is the header table ,the form is displaying doc_code ,doc_date ,lock_flag,and the order store name ,and I provide him a report on the same form that he can see the details of the order items ,and all the field properties set to no, that is update allowed to no ,insert allowed set to no, but the field lock_flag property set as update allowed to yes and insert allowed set to yes
    and I would like to now how it was displaying this message
    ORA-01400 cannot insert NULL INTO “PROJ”.IM_REQUEST_HEADER”.DOC_CODE
    And I was not inserting, I was just updating the lock_flag by the above update statement.
    Best regards
    Jamil Alshaibani

  • Macbook Pro crashes on mouse click

    Hello everyone,
    I've been having this problem for two weeks now and it's happening more and more frequently!
    Info:
    Macbook Pro 15'' mid 2011
    Mac OS X Mavericks / Mac OS X Yosemite
    Hard Drive: Samsung 840 Evo 250GB SSD
    8 GB Ram
    THE ISSUE:
    Every so often at a random time, at the exact moment I perform a mouse click, my macbook pro crashes.
    That instant, the screen goes dark ( like I just ripped out it's battery ) and reboots automatically, saying "your mac restarted because of a problem".
    Like I said, it's gotten more and more frequent! ( 5 times a day or more now... )
    WHAT I'VE TRIED:
    So the problem occurred in Mavericks, so I figured I'll install Yosemite ( on a new partition ) and see if it's any better.. Well it isn't...
    Same problem, same type of crash.
    Then I figured maybe it's related to my magic mouse.. So i turned it off and used a third party mouse. No luck! It also happened while using the Macbook's trackpad.
    I also haven't found anyone with a similar problem online so far, so if any of you have experienced something like this or know what might be causing it, i'd be grateful for any information!
    Best regards,
    Robert

    These instructions must be carried out as an administrator. If you have only one user account, you are the administrator.
    This procedure is a diagnostic test. It makes no changes to your data.
    Please triple-click anywhere in the line below on this page to select it:
    syslog -k Sender kernel -k Message CSeq 'n Cause: -' | tail | awk '/:/{$4=""; print}' | pbcopy
    Copy the selected text to the Clipboard by pressing the key combination command-C.
    Launch the built-in Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window by pressing the key combination command-V. I've tested these instructions only with the Safari web browser. If you use another browser, you may have to press the return key after pasting.
    Wait for a new line ending in a dollar sign ($) to appear below what you entered.
    The output of the command will be automatically copied to the Clipboard. If the command produced no output, the Clipboard will be empty. Paste into a reply to this message.
    The Terminal window doesn't show the output. Please don't copy anything from there.

  • Integrating code for mouse click!

    Hello!
    I'm trying to get this code working where I want to integrate a shortcut for clicking an button made in Egde Animate.
    The code snippets you see is just some copied areas of the whole working code,
    Serial.print(c);
            if (c == '\n') {
              if (readString.indexOf("?") <0)
                //do nothing
              else
                 if(readString.indexOf("UP=UP") >0)
                     movetiltupstep();
    // now output HTML data starting with standard header
              client.println("HTTP/1.1 200 OK");
              client.println("Content-Type: text/html");
              client.println();
              //set background to green
              client.print("<body style=background-color:green>");
              client.println("<hr />");
              client.println("<center>");
              client.println("<h1>Servo control</h1>");
              client.println("<form method=get name=SERVO>");
              client.println("<input type=submit value=UP name=UP style=\"width:100px\"><br>");
              client.println("<input type=submit value=LT name=LT style=\"width:100px\"><input type=submit value=CN name=CN style=\"width:100px\"><input type=submit value=RT name=RT style=\"width:100px\"><br>");
              client.println("<input type=submit value=DN name=DN style=\"width:100px\">");
              client.println("</form>");
              client.println("</center>");
              client.println("</body></html>");
              //clearing string for next read
              readString="";
              //stopping client
              client.stop();
    void movetiltupstep(){
      tiltpos = tilt.read();
      Serial.println(tiltpos);
      if (tiltpos >= 66)
      tilt.write(tiltpos - 2);
    This is just an overview of my setup for a webpage, where I can move a servo with a button and this is called movetiltupstep();
    The button is made here, ("<input type=submit value=UP name=UP style=\"width:100px\"><br>"); and I want to use this with the button in Edge Animate.
    For a button this is the setup, function(sym, e) and I tried to integrate something like this:
    // insert code for mouse click here
    sym.$("<input type=submit value=UP name=UP>")  but not working.
    How would i proceed with this problem, ideas anyone?
    Regards, Tor

    import javax.swing.*;
    import java.awt.event.MouseMotionListener;
    import java.awt.event.MouseListener;
    import java.awt.event.MouseEvent;
    import java.awt.*;
    public class MouseTracker extends JFrame implements MouseListener, MouseMotionListener
        private JLabel statusBar;
        public MouseTracker()
            super("Demonstrating Mouse Events");
            statusBar = new JLabel();
            getContentPane().add(statusBar, BorderLayout.SOUTH);
            addMouseListener(this);
            addMouseMotionListener(this);
            setSize(275, 100);
            setVisible(true);
        public static void main(String[] args)
            MouseTracker application = new MouseTracker();
            application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        public void mouseClicked(MouseEvent e)
            statusBar.setText("Clicked at [" + e.getX() + ", " + e.getY() + "]");
        public void mouseReleased(MouseEvent e)
            statusBar.setText("Released at [" + e.getX() + ", " + e.getY() + "]");
        public void mouseEntered(MouseEvent e)
            statusBar.setText("Clicked at [" + e.getX() + ", " + e.getY() + "]");
            getContentPane().setBackground(Color.GREEN);
        public void mousePressed(MouseEvent e)
            statusBar.setText("Pressed at [" + e.getX() + ", " + e.getY() + "]");
        public void mouseExited(MouseEvent e)
            statusBar.setText("Mouse outside window");
            getContentPane().setBackground(Color.WHITE);
        public void mouseDragged(MouseEvent e)
            statusBar.setText("Dragged at [" + e.getX() + ", " + e.getY() + "]");
        public void mouseMoved(MouseEvent e)
            statusBar.setText("Moved at [" + e.getX() + ", " + e.getY() + "]");
    }

  • Different mouse clicks & speed up mouse movements?

    Hello,
    Does Adobe Captivate recognise different mouse clicks better
    to say if it can record on RMB LMB and MMB clicks different
    effects? For example I wish to record Software Simulation project
    were on different mouse clicks (RMB, LMB, MMB) would have custom
    effects like "OrangeRing" for RMB " "GreenRing" for LMB etc?
    One more question plz: I found Published movie mouse
    movements are very slow can I make it move more fast without
    editing every slide separatelly?
    Thanks
    Ton

    Hello Tony,
    Whilst Captivate does recognize different mouse clicks (in so
    much as the application will capture a right-click menu) you cannot
    specify what type of mouse effect the application will use when you
    capture.
    What you can do is change the mouse click effect post
    capture. To do this and with a just captured project open carry out
    these steps:
    1. Select the slide that has a mouse pointer where you would
    like need to show a right-click action.
    2. Choose Slide > Mouse > Properties...
    3. In the Mouse Properties dialog make sure that the option
    "show mouse click" is selected and then show either the color or
    the custom effect you would like to use to represent the
    right-click operation.
    Naturally, at the very start of your movie/project you would
    need to inform the learner that each time they see the one of the
    effect you want them to right-click. You could also include some
    audio as well which would be important if you need to adhere to
    accessibility standards.
    In regard to your second question, in most cases you will
    find that you get the best result if you adjust the mouse timing
    using the Timeline.
    That said if you own a copy of Adobe Captivate 2 you can
    change the mouse Display and Appear After settings globally via the
    Mouse Properties dialog. Personally, for mouse movement I would not
    recommend this. Anyway here are the steps to carry that out.
    1. Select any slide that has a mouse pointer present.
    2. Choose Slide > Mouse > Properties...
    3. Click the Timing tab
    4. Change the Display time and Appear After values
    5. Click the Settings button
    6. Choose the appropriate options from both Which properties
    and which slide categories
    7. Click OK.
    Note : You can also show the Mouse properties dialog by left
    clicking on mouse icon on any of the slides in the Filmstrip
    Regards,
    Mark

  • VBA to find mouse click

    Hi I need a Help for office Publisher. I Need to put the rectangle when i click on the publisher page. I want to insert the shape(rectangle) in the position where user click.
    1. Making a loop till pressing Escape. - Completed
    2. Find the x and y of the Mouse click - Completed
    3. Converting it to the left and top of the publisher. - Struggling
    4. Inserting the shape(Rectangle) - Completed
    Need help for step 3
    Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
    Private Declare Function ClientToScreen Lib "user32" (ByVal hwnd As Long, lpPoint As POINTAPI) As Long
    Private Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
    Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
    Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal hdc As Long, ByVal nIndex As Long) As Long
    Private Declare Function ScreenToClient Lib "user32" (ByVal hwnd As Long, lpPoint As POINTAPI) As Long
    Private Const VK_ESCAPE = &H1B
    Private Type POINTAPI
        x As Long
        y As Long
    End Type
    Sub MouseClicked()
    Dim l As Long
    Dim pt As POINTAPI
    MsgBox Application.ActiveWindow.hwnd
    AA:
    If (GetAsyncKeyState(vbKeyLButton)) Then
    l = GetCursorPos(pt)
    MsgBox pt.x & ", " & pt.y
    ElseIf (GetAsyncKeyState(VK_ESCAPE)) Then
    GoTo BB
    End If
    Call GetCursorPos(pt)
    Call ScreenToClient(ActiveWindow.hwnd, pt)
    pt.x = pt.x * Screen.TwipsPerPixelX
    pt.y = pt.y * Screen.TwipsPerPixelY
    MsgBox "My Position:" & vbLf & pt.x & "," & pt.y
    GoTo AA
    BB:
    End Sub

    It  is possible with Win32 commands.  Do something like this
    Call AppActivate("Publisher")
    hndl = GetForegroundWindow()
    If hndl > 0 Then
    retval = GetWindowPlacement(hndl, wp)
    This gets you the placement of Publisher on the screen.  You get the mouse click location then do a little math and you have the mouse location relative to publisher.  I am not sure of the name for publisher.  I often set the placement of the
    program so it is easy to find the point.

Maybe you are looking for

  • Mac Mini 320GB HD 4GB Ram

    Hi Just bought new Mac Mini, Snow Leopard. Partitioned HD with Boot Camp. Gave Windows 250Gb. Formatted Partition by Windows CD to NTFS. Installed Windows. After the install is complete Windows reboots, and I get this error: <windows root>\system32\n

  • Satellite L350: What is better choice: Recovery disc or F8 repair?

    Hi, I have a fairly new Satellite L350 (5 months). I recently discovered a trojan attached to program files for AVG software. I got rid of the trojan, did a restore to date before loading AVG in hopes that my system would go back to normal. It still

  • Write java prog

    Hello everone, I am new to java. Can anyone tell me what program should i download if i want to write & compile small java programs. please provide me link if you can. Thanks

  • Control-c

    I have a program which is performing work, and the command line is not being watched. Is there a Java equivalent of a UNIX Signal to pick up control-c, process it, and then return to the point at which the application was interrupted?

  • Using Photoshop CS with iPhoto 5

    I recently added Photoshop CS to my PowerBook. Can I use this application to edit photos that are in iPhoto? I know it sounds like a basic question, but I don't know where to start. I tried to import a photo from iPhoto to Photoshop to no avail. Can