For a project I've been working on, I've more or less made a console emulator... y'don't want its code... I'm not very good at "simple" and terrible at comments, but I can leave you with the idea behind the relevant parts:
- When looking for input, check which keys the user has pressed.
- Pass ASCII value of pressed keys to input class, translating arrows/delete/enter into special characters (some may be done for you)
- Check received text for specific special characters. If it isn't one of these, drop it at the appropriate position in a string, and increment the location
- If it is a key to move through the string, change your location variable accordingly. If it is delete/enter, submit the string or delete at the location.
- Draw the string to the screen.
- Use the built in functions of sf::Text and the location to find where to put the cursor. This will give you a proper X/Y value, though scaling can get... complicated. Draw a box here.
-- Alternate Method: Insert a Vertical Bar (|) into the string at the cursor location before drawing. Simpler, but messes with Kearning.
Might be more... elegant methods, but that should be enough for you to get coding one on your own, which, in the long run, will help you far more than dumping a bunch of code on you.