caret

Set focus and carret position in textarea according to mouse position, as if user had clicked

Once a page with a textarea is loaded, I want some textarea to have the focus immediatly if the mouse cursor is inside that textarea. This is the easy part because a onmousehover handler can set the focus. Now, how to I also set the position of the caret? I would like the caret to be where it would be if the user had clicked using the m...

Notepad++ Move Caret Outside Bracket

I've searched everywhere and can't find an answer to something incredibly simple and useful for Notepad++. When using autoclose, the cursor gets stuck inside, which is good until I've finished typing the parameters. How do I get the caret to jump outside of the currently nested autoclosed element? Regardless of it being (), {}, [], "", ...

jquery Setting cursor position in contenteditable div

The old version of the question is below, after researching more, I decided to rephrase the question. The problem as before is, I need to focus a contenteditable div without highlighting the text, doing straight up focus highlights the text in Chrome. I realize that people solved this problems in textareas by resetting the caret positio...

Set the caret/cursor position to the end of the string value WPF textbox

I am try to set the caret/cursor position to the end of the string value in my WPF textbox when I open my window for the first time. I use the FocusManager to set the focus on my textbox when my window opens. Nothing seems to work. Any ideas? Note, I am using the MVVM pattern, and I included only a portion of the XAML from my code. ...

VS 2010 SDK - Get function and class name when carret change, with c#.

Hi experts. How can i get the name of the function and its class when the caret change position i a code file, using VS SDK 2010? I am using Editor Text Adornment template as an start and c#. Thanks. ...

XY position of text cursor/caret in an editable iframe on key events

Is there a cross browser way to find the XY coordinates of the caret (as opposed to the mouse position, which is provided by mouse events) in an editable iframe on key events? ...

jQuery Textarea Caret Position to End on Focus

I have multiple textareas on a page and would like to set the position of the caret to the end of the text which changes per textarea (textareas do not contain similar length values). How would I initiate this on focus to move caret from the position they select to the end? Thanks in advance. -B ...

After JTable cell setDefaultRenderer to jTextArea how to highlight the selected row in jTextArea

This is my renderer class tblCalendarRenderer extends JTextArea implements TableCellRenderer { JTextArea textField; public tblCalendarRenderer() { textField = new JTextArea(); } public Component getTableCellRendererComponent(JTable table, Object value, boolean selected, boolean focused, int row, ...

characters XOR with caret manipulation

Working with exclusive-OR on bits is something which is clear to me. But here, XOR is working on individual characters. So does this mean the byte which makes up the character is being XORed? What does this look like? #include <iostream.h> int main() { char string[11]="A nice cat"; char key[11]="ABCDEFGHIJ"; for(int x=0; x<10; ...

JTextPane how to show caret when extends jPanel ?

I want to show the caret on the jTextPane when i extends it to jPanel instead or JFrame. My problem now is when I extends my class to jPane the caret wont show on the jTextPane. ...

move cursor from input box with jquery

Hi, I'm trying to do something but I'm not sure what it's called or what I should be looking for. I want to do it in jquery. Basically when you're in an input box, if the user enters a character I want the caret to automatically jump to the next input box. Banks usually have it. What class does this or what should I be looking for? ...

Show beginning of HTML input value on blur with JavaScript

I have a fixed width input of type text. If the user was to enter a long value into this field I would like the beginning of the value to be shown when the input no longer has focus. Default behaviour in FF and IE leaves the view of the field value in the same state. Chrome on the other hand seems to behave as I want, it shows the beg...

Javascript :: Div Editable and More... More...

Well, I need to replace a word, in a div contentEdible property on, by the same word but formatted... Like this: <div> My balls are big </div> To this (replace the word: balls): <div> My <font style="color:blue;">balls</font> are big </div> In a contentEditable this happens dinamically, while the user type the text the replacements hap...

Rewrite a IE Code to a FF Code

This is the code (now is full): HTML: <div id="content" contentEditable="true" onkeyup="highlight(this)">This is some area to type.</div> Javascript: function highlight(elem){ // store cursor position var cursorPos=document.selection.createRange().duplicate(); var clickx = cursorPos.getBoundingClientRect().left; ...

How do I keep my cursor/caret from moving inside of an input text element?

I'm trying to build a form that works in a manner similar to the Google Search page, as well as Gmail and several other pages (including the this page - see the "Tags" input on the Ask Question page). As text is input, a list of options will appear, and the user can use up and down arrows to select the option they want. The problem I a...

insertHTML execCommand BEFORE cursor caret in a contenteditable div

People seem to love to answer this question everywhere online while ignoring the CONTENTEDITABLE div requirement. Using code that seems to only work on input fields or textareas and not divs. Additionally, most questions people have wanted to put the cursor caret INSIDE the newly inserted HTML... which is weird, because it does it autom...

Javascript Set Caret in ContentEditable Div

I have a div tag that is contenteditable so that users can type in the div. There is a function that adds a link into the div when the user presses a button. I would like the caret to be positioned after the link so that users can continue to type. The link can be inserted many times. Example Code: <div id="mydiv" contenteditable="true...

Creating a windowless, zoomable text region that proxies to a real Winforms textbox in C#

Important: we really need the stated functionality, so please don't start suggesting alternatives. We're trying to display and input text on a custom WinForms control that includes text and non-text regions - in other words, a modern canvas. We need to be able to display the text and caret on the custom control at various zoom levels a...

Does anyone know how to change the character of a textfield caret with javascript?

Like the title reads, I want to change the character of a caret. Maybe make it a letter or something? Thanks. ...

How to avoid cmd.exe interpreting shell special characters like < > ^

I have a Windows CMD script that accepts a number of parameters and executes an EXE, passing first some hard-coded arguments and then all of the parameters from the user. The CMD script looks like this: launcher.exe paramX paramY %* The user would execute the CMD script from the Windows shell as follows: launcher.cmd param1 param2 pa...