SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Where's my keypress! Possible fix for SD2-747

Last post 10-19-2006 8:04 PM by DanielGrunwald. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 10-19-2006 7:44 PM

    Where's my keypress! Possible fix for SD2-747

    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.

    Filed under: ,
  • 10-19-2006 8:04 PM In reply to

    Re: Where's my keypress! Possible fix for SD2-747

    Fixed in  revision 1916.

    Why do you reapply fixes for each build?

    You can use our subversion repository - the subversion client will merge local changes with the repository changes when you run "svn up".

    Daniel Grunwald
Page 1 of 1 (2 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.