This is my input procedure:
if(Event.Type == sf::Event::TextEntered){
char *ch = new char[2];
sf::String s;
if(unicodeToASCII(Event.Text.Unicode, ch[0])){
ch[1] = '\0';
inputText += ch;
print(ch);
s.SetText(ch);
cursorScreenPos.x += s.GetRect().GetWidth();
}
}
as you can see, I use width of single input character to move my cursor. Then I'm using this value while drawing cursor:
sf::Shape cursorLine;
float cursorWidth = 3.0f;
cursorLine = sf::Shape::Line(0, 0, 0, output.GetSize(), cursorWidth, textColor);
cursorLine.SetPosition( cursorScreenPos.x + cursorWidth/2 - scrollH.getCurScroll() ,cursorScreenPos.y - ScrollV.getCurScroll() );
ConsoleWin.Draw(cursorLine);
Those scroll things aren't important, because while testing they are zero value. This is all code currently affecting cursor position.
For example 'a' returns width of 17, but when I move cursor there, it's almost double the distance it should be..