Hi All,
using build 1913
I'm using the # TextEditor dll in a VS project. I have a button on the same form as the TextEditor with an accelerator key. When running the app the TextEditor does not register the character that is used as the accelerator key (applies to all characters). Menu accelerators don't break it though. This was raised previously:
http://community.sharpdevelop.net/forums/thread/6416.aspx
Which Matt logged as SD2-747
Thread http://community.sharpdevelop.net/forums/thread/4143.aspx did't apply so after some head scratching with the MS .NET SDK docs the solution seems too easy. Can any .NET guru confirm?
In TextArea.cs the TextArea class inherits from the Control class, the following solves the problem:
protected override bool IsInputChar(char charCode){
return true;
}
The MS docs state "Determines if a character is an input character that the control recognizes", now I'm assuming that since the TextEditor control should handle all characters then it should always return true (hence no need to call the base method, which always appears to return false - I'm assuming it would since its the generic base control and would not necessarily be a control that handles key events). Though reading the rest of the SDK text for this method I'm not sure if always returning true has any side effects. It just works.
(I did notice when running this fix that the method gets called twice for each keypress but only once when an acclerator key is present on the form.)
regards,
DAN
PS whilst putting this fix in could you drop http://community.sharpdevelop.net/forums/thread/12405.aspx in as well, would stop me having to reapply my fix on each build - cheers.