Textbox caret position?

Not favoritedFavorited Favorited 0 favourites
  • 7 posts
From the Asset Store
Forget about default textbox restrictions, you can create sprites atop of the textbox
  • simple question difficult answer.

    Is there a way to know at which position the caret/cursor is?

  • I'm not quite sure I understand.

    Can you try to explain what you need it for?

  • Hoyer Bit hard to explain. I am using c2 for maths software.

    I am using a text box to allow user to enter text. However, a virtual keyboard is also on screen that is requires to enter text that the student cannot enter by keyboard alone, e.g., exponents

    i.e, I need to know where the caret is so that I can insert text.

    I can post a capx tomorrow if it helps

  • Here is a capx of the app as it currently - very early

    https://www.dropbox.com/s/k544igpnaifrqez/InsertText_Caret.capx

    Simply open it type in x+2

    use left arrow to sit between x and the + and then click the n^2 virtual key, i want the exponent to appear where the user had their cursor but I don't know where their cursor was.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • bump.

    The inability to expose the caret position is a real problem for me and this app. I would appreciate any help.

    I am prepared to offer a bounty if someone can show me how to retrieve the caret position of an edit field. Either through a custom component or based on the official textbox.

    I have been making a case for using C2 at work and I made a small demo proejct that everyone loved now working on a bigger project and it starting to look like C2 cannot handle the job :(

    Help!

  • We are looking at making a textbox variant and seeing if we can implement a BeforeText and AfterText expression, i.e., text before and after the caret. Out of my comfort zone

  • Hooray! A break through

    http://numberworks.com/nwonl/caretdemo/index.html

    Ashley, we have implemented a before and after text expression.

    This works in firefox/chrome not in IE, would it be possible to have this functionality added to the official TextBox?

    It would be very useful in long term for me and I hope others will also find a use for it.

    https://www.dropbox.com/s/6eujr7t39njz8vn/TextBoxNWW.zip

    I have included the Custom component code which is derived from textbox and I have included a capx that shows what I use it for.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)