inputsimulator icon indicating copy to clipboard operation
inputsimulator copied to clipboard

TextEntry with \n or \r\n doesn't work on a RichTextBox

Open michaelgorman opened this issue 5 years ago • 1 comments

using the TextEntry method, the newlines work fine on notepad but don't work if the target is a System.Windows.Forms.RichTextBox

sim.Keyboard.TextEntry("foo\nbar") ; sim.Keyboard.TextEntry("foo\r\nbar") ;

michaelgorman avatar Jul 19 '19 19:07 michaelgorman

I don't understand something, it works through sim.Keyboard.KeyDown('\r') sim.Keyboard.KeyUp('\r'). So I decided to look at what the difference is between the KeyDown, & TextEntry methods and what I wasn't expecting was that the KEYBDINPUT struct has different fields assigned between the two like Unicode flags, scan code & keycode. Both are doing keydowns & keyups so why are the different struct values assigned and what is the fundamental difference between the two?

michaelgorman avatar Jul 23 '19 13:07 michaelgorman