Locating the cursor position

Is it possible to locate the cursor position in a text item? in other words can I find the number of characters to the left of the cursor in a text item?
I really appreciate any kind of input on this.
null

I have to insert user selected variables that show up in a LOV into the text item at the cursor position.
A sloppy workaround for this problem is asking the user to put in a pre defined symbol where ever he/she wants to insert the variables and then replace the variable with the value selected from the LOV using the REPLACE function. There is always a chance of error here!
Instead if there is a way to know the cursor position, like the no. of characters to the left of the cursor or the cursor co-ordinates.............

Similar Messages

  • How to get the cursor position on a picture?

    I'd like to show the cursor position on a picture
    which is 400 by 400 pixel size and located at
    (0, 0, 400, 400) on a panel. So suppose that the
    cursor is at (50, 50), how can the java code know?
    Thank you.

    I am thinking about this, and use something like
    JPanel.setFocusable(true). Thank you.

  • Photoshop CS5 - Control and navigate the cursor position automatically

    Hello
    I wonder if it’s possible with Photoshop CS5 (OS: Win7)  to control and navigate the cursor position automatically?
    Given: I have individual image coordinates for a set of locations.
    Wanted: A possibility to position the cursor sequentially at those image location by the means of an external script or procedure.
    Any ideas if that is possible with CS5?
    Thanks for any help.
    Lars

    As far as I can tell with regard to a Photoshop Scripting approach: No.
    Creating a Selection of certain dimensions and a certain position would be possible, though.
    What exactly are you trying to achieve?

  • Is there an easy way to locate the cursor on a page?

    sometimes I have trouble locating the cursor. It gets lost in the page content.

    You can change the system-wide color of your cursor to something more easily findable (like a large black cursor). [http://www.ehow.com/how_6122649_change-cursor-color-windows-xp.html http://www.ehow.com/how_6122649_change-cursor-color-windows-xp.html]. Or you can read [http://www.askdavetaylor.com/how_to_make_cursor_more_visible_windows_xp_winxp.html http://www.askdavetaylor.com/how_to_make_cursor_more_visible_windows_xp_winxp.html], and tell the computer than when you it the Control key, it will automatically show you where the cursor is.
    Also, you should update to Firefox 11 to receive all the most recent security updates.

  • How to get the cursor position in the text edit box?

    Hi, all.
    I want to get the cursor position in the text edit box
    to insert some data.
    But I don't know how to get.
    Can someone give me some advice?
    BestRegard.
    Miya.

    Hi Miya,
    Write your own textSelectionSuite for this.
    and use ITextTarget->GetRange() function.
    Thanks and Regards,
    Yopangjo.

  • How to control the cursor position in the Table control in Module pool

    Hi,
    Can any body tell me how to change the cursor positon from last field of the first record to the
    first field of the second record , when user presses enter in the last field in the module pool
    programming.
    Thanks

    Hi,
    Please avoid posting duplicate posts.
    Re: how to get the cursor position from screen in module pool program
    Nag

  • How to control the cursor position on a text item..

    Hello,
    How can we control the cursor position programmatically on a text item.
    i.e. how do we move the cursor to home or end of the text item.
    TIA,
    Hiten

    If you have an access to metalink.oracle.com, take a look at notes:
    Note 61656.1 (V45) HIGHLIGHTING A REGION OF TEXT
    Note 131028.1 Default Highlighting in Forms (Client Server)
    and threads from metalink forum:
    531481.996 "Select_All not working in 6.0.8.25.2", 153092.995 "Text item cursor position"

  • Changing the cursor position

    Is it possible to change the cursor position automatically when changing the language?
    For example: when changing from English to Hebrew the cursor will move from the right end to the left?
    Thanks,
    Amnon

    I don't think this is possible in general, although some individual apps might do it.  Normally you use a direction control from an app menu or at the system level.
    http://support.apple.com/kb/PH14203

  • Can I control the cursor position

    I'd like to confine the cursors position to a grid when it's within a particular panel. I tried public void mouseMoved(MouseEvent e)
    int x = (int) (GRIDSIZE*java.lang.Math.round(e.getX()/(1.0*GRIDSIZE)));
    int y = (int) (GRIDSIZE*java.lang.Math.round(e.getY()/(1.0*GRIDSIZE)));
    e.translatePoint(x,y);
    } But that didn't work. Can it be done?

    I'm not exactly sure what you want to be done, but, if you want to control the mouse position, you can create a Robot object (check the class in the java docs) and use robot.mouseMove(mouseX,mouseY) where mouseX and mouseY are integers. THIS ONLY WORKS IN APPLICATIONS THOUGH. its too powerful to be able to control a persons mouse, (and keyboard is controllable too with Robot), you can imageine what a person could do lol.. Anyway, you could repeatedly check if the mouse position is on the grid, and if it isn't, use robot.mouseMove, to place it onto the grid.

  • Controling the cursor position

    Hi all,
    I have two x, and y signal outputs from a dll module and I plan to use them to control the cursor position. One problem I'm facing is that my signals are variable enough to cause the cursor to vibrate in stationary setting. So, I use hysterysis (putting threshold) to eliminate these fluctuations but the drawback is that keeping the treshold high enough to eliminate the fluctuations keeps me from getting a nice, smooth movement when the speed of movement (rate of x and y changing) is low. Any ideas or suggestions will be appreciated.
    p.s. I am using "SetCursorPos".dll as you might have already guessed.
    Thank you,
    Elnaz

    The formula for an exponential filter of degree D is the following:
    New Average = (New Value + (D-1)*Old Average)/D
    I usually add a special case for startup so that D is never greater than the number of points. 
    As I said, it is a low-pass filter, much like using a running average.  I usually like it because the state is simply a single value (Old Average) instead of the array of values you have to keep around to do a running average.
    As to the new question of separating high-frequency noise from your high-frequency signal, that is a bit more complicated (obviously).  You should take a power spectrum of the noise to see if there is a characteristic feature you can use (cutoff frequency, strong peaks).

  • Can any body answer this-Want to set the cursor position in textfield.

    i want my cusor position in textfield at the initial position which will come by default.
    but when i'm using the textfields in an inner class i'm getting the cursor position at the end of the text in text filed.pls can any body answer this.
    thanks in advance.
    if want run this example.
    import java.awt.*;
    import java.awt.event.*;
    class Testing extends JFrame implements ActionListener
         Container cnt;
         JButton jd;
         JTextField jt1;
         JTextField jt2;
         Testing()
              cnt = getContentPane();
              cnt.setLayout(new FlowLayout());
              jd = new JButton("OK");
              //jd.setBounds(50,50,100,30);
              cnt.add(jd);
              jd.addActionListener(this);
         public void actionPerformed(ActionEvent ae)
              Object but = ae.getSource();
              System.out.println("in action 00000");
              if(but.equals(jd))
                   System.out.println("in action ");
                   call();
                   return;
         void call()
              System.out.println("in action 1111111111");
              Inner inn = new Inner();
              inn.jdlg.show();
         public static void main(String s[])
              JFrame jf = new Testing();
              jf.setSize(200,200);
              jf.show();
         class Inner
              JDialog jdlg;
              //JTextField jt1;
              //JTextField jt2;
              Container cnt;
              Inner()
                   jdlg = new JDialog();
                   JLabel jla = new JLabel("Label");
                   jt1 = new JTextField();
                   jt2 = new JTextField(5);
                   cnt = jdlg.getContentPane();
                   cnt.setLayout(new FlowLayout());
                   cnt.add(jt1);
                   cnt.add(jt2);
                   jt1.setText("aaaaaaaa");
                   jt2.setText("bbbbbbbb");
                   System.out.println("the text "+jt1.getText());
                   jdlg.setSize(200,200);

    JTextFiled.setCaretPosition(0);

  • Is there a way to get the cursor position index of html text field

    I'm trying to work on a text pad like MC with "insert text at
    position X" and "find and replace" can anyone tell me how to find
    the cursor index of an html text field. Selection.getBeginIndex() ,
    Selection.getEndIndex(), Selection.getCaretIndex() as far as I know
    these methods only work with text and not htmltext.
    What I'm trying to do is assign different parts of the string
    to variables so that I can combine them to reconstitute my html
    string.

    enfantterrible:
    If I understand correctly, you want the corresponding
    position in the
    htmlText propery of the caret index (which as you point out
    is only the
    position in the plain text version of the textfield content).
    Below is how I would do it. Maybe there's an easier or more
    efficient
    way (using XML objects etc), but I don't know it. You could
    conduct all
    your string searches in the plain text and then convert the
    result to
    the html positions. I didn't build this to accept negative
    parameters
    for the pos parameter (e.g. from end of string backwards) but
    the
    function could be adapted to do this too if necessary. The
    test data is
    not proper html from a text field, but it doesn't really
    matter what it
    is so long as its formatted correctly. It just separates the
    tags from
    the content to enable apples with apples comparison.
    //some test data
    var testStringXML = "<format>Hel<b>lo i can't
    t<i>ell you h</i>ow hap</b>py I
    am.</format>";
    var undecoratedString = "Hello i can't tell you how happy I
    am.";
    //the conversion function
    function findDecoratedPosition(pos:Number, xmlString:String,
    test:Boolean):Number {
    //anything between '<' and '>' should be excluded from
    plain text search.
    //create an array of array elements (n=2) consisting of tag
    then plain text
    //requires correctly formatted xml/html
    var tempArr:Array = xmlString.split("<");
    for (var aa = 0; aa<tempArr.length; aa++) {
    tempArr[aa] = tempArr[aa].split(">");
    //remove the first and last elements of the new array (these
    are empty)
    tempArr.pop();
    tempArr.shift();
    //find the corresponding plaintext location and calculate
    the "decorated" position
    var retPos:Number = 0;
    var posCount:Number = 0;
    for (var aa = 0; aa<tempArr.length; aa++) {
    retPos += tempArr[aa][0].length+2+tempArr[aa][1].length;
    //+2 allows for missing < and >
    posCount += tempArr[aa][1].length;
    if (posCount>pos) {
    return (retPos+(pos-posCount));
    //out of range
    return -1;
    //test code:
    for (var aa = 0; aa<undecoratedString.length; aa++) {
    var altPos = findDecoratedPosition(aa, testStringXML);
    trace(undecoratedString.charAt(aa)+" in position "+aa+"
    plainText equates to position "+altPos+" in the decorated version
    ["+testStringXML.charAt(altPos)+"]");
    }

  • How to get the cursor position from screen in module pool program

    Hi,
    I am doing the module pool program, I have one table control in one screen.
    I have to give functionality to the user that when the user enters first record in the table control and after filling the last field
    when he presses enter the cursor will have to come in the starting field of the second record.
    I know the logic , but i m bit confused.
    Can any body help me to solve this....
    thanks

    Hi,
    Check this code,
    Write it in the PBO
    MODULE SET_CURSOR_WERTKONTRAKT.
    MODULE SET_CURSOR_WERTKONTRAKT OUTPUT.
      PERFORM SET_CURSOR USING 'VBAP-ZWERT'.
    ENDMODULE.                 " SET_CURSOR_WERTKONTRAKT  OUTPUT
    FORM SET_CURSOR USING US_FELDNAME.
      DATA: DA_TFILL LIKE SY-TFILL.
      DESCRIBE TABLE IVBAP LINES DA_TFILL.
    FCODE 'Create Position':
    ==> Cursor to the first free line set to make the new position
    Can be created directly
        IF DA_TFILL EQ 0.
          SET CURSOR FIELD US_FELDNAME LINE 1.   -> set cursor position
        ELSE.
          SET CURSOR FIELD US_FELDNAME LINE 2.
        ENDIF.
    Product proposal actively
    Set ==> cursor in the first row
      IF DPP_ACTIVE   EQ CHARX AND
         XVBAP_UMFANG_OPV IS INITIAL.
    in the 'target volume' if available
        IF KOPGR_MIT_ZMENG CS TVAK-KOPGR.
            SET CURSOR FIELD 'VBAP-ZMENG' LINE 1.
            EXIT.
        ELSE.
    Else in the field 'Order quantity'
          SET CURSOR FIELD 'RV45A-KWMENG' LINE 1.
          EXIT.
        ENDIF.
      ENDIF.
    Hope it helps you,
    Regards,
    Abhijit G. Borkar

  • Setting the cursor position in a field in XD01 transaction

    Hi,
    I am trying to validate the field Customer type (Path : XD01 > Sales area data > Extras > Additional data) in the transaction XD01 ie: It is a mandatory entry for Customer creation.
    I tried displaying an error message which worked fine. But i want the cursor to be positioned in the Customer type field.
    Is there any possibility for this?

    Santhosh,
    I tried giving "GET CURSOR FIELD v_field LINE v_line" in the exit EXIT_SAPMF02D_001. But no values are getting captured in those variables.
    Moreover they have specified in the documentation as - "However, the variables specified during PAI processing are always initialized". Now this exit is getting called during PAI. Hence i believe that the values will be initialized! Moreover i think that getting the field & line information of the current cursor position is not going to help us!

  • Changing the cursor position in an input text field and Removing leading numeric zeros

    Flash8 - AS2
    It's good to be back after all these years and thanks for the faithfull folks like kglad, Ned Murphy, Rothrock and all the others who give so much of themselves to make this forum a success!
    My Problem:
    I have an input text field that is named in the properties box as 'numberOfKids'.
    When the program is executed, and a delete or backspace is pressed the input textfield goes blank
    and any calculations that use 'numberOfKids' shows NaN.
    I have trapped the NaN and undefined so that a numeric 0 shows up instead of a blank.
    There are two problems:
    First problem:
      The cursor is to the left of the zero, so the first number inputted by the user is 10x larger than what they want.  0 becomes 10.
    Question:  How do I get the cursor to move to the right of the 0?
    Second Problem: 
      When I manually move the cursor to the right of the 0 and input a number, say 4, it shows up as 04.
    Question 2:  How do I delete the leading numeric zero in the input textfield?
    Thanks for the help.
    Here's the code I am using:
    calculateChildWeight = function () {
    if (isNaN(numberOfKids)) {
      numberOfKids = 0;
    if ((numberOfKids) == undefined) {
      numberOfKids = 0;
    if (numberOfKids>=0 && numberOfKids<=137) {
      numberOfKids = numberOfKids;
    } else {
      numberOfKids = 0;
    if (isNaN(adjustedChildWeight)) {
      adjustedChildWeight = 0;
    if ((adjustedChildWeight)=undefined) {
      adjustedChildWeight = 0;
    adjustedChildWeight = Number(numberOfKids*(-100));
    //numberOfKids.setSelection(numberOfKids.length, numberOfKids.length);
    //if (numberOfKids.length=2 && numberOfKids<10) {
      // remove the first character or leading zero
    //  numberOfKids = numberOfKids;

    Thanks Rothrock for being so  patient.
    I'm lost!
    I go back to a brand new flash file to try and implement the textfields as a stand alone test document.  I have lost the concept I think.
    I created on the stage of a blank .fla file  4 text fields, 2 input and 2 dynamic.  I gave them an instance name in the properties box.  I use this instance name.text to find the value of the field.  I use the parseInt to put that value into a numeric variable for calculation.  The results are put to the appropriate textfield.
    All seems to work except one of my input text fields.   I use the value of this field  to calculate:
    revisedValue = parseInt(numberOfKids.text);
    revisedValue = revisedValue*(-100);
    The problem now is that if the numberic '2' is inputted into numberOfKids, numberOfKids.text shows up as 200 and a trace shows up as '2NaN'.
    Flash is logical and consistant, I must conform to it but I'm in the dark.
    (( Concerning the forum:  If I click on helpful, which your posts have been in directing me, does that blank out the possibility of selecting the correct answer in the future???))

Maybe you are looking for