Tinkr2/4.2/AphelionCore/AphelionCommonControls/Controls/Button.cs
/// <summary>
/// Override this message to handle key events internally.
/// </summary>
/// <param name="key">Integer value of the key affected</param>
/// <param name="pressed">True if the key is currently being pressed; false if released</param>
/// <param name="handled">true if the event is handled. Set to true if handled.</param>
/// <remarks>
/// If the return Key (key == 10) is pressed or released the button is switched to
/// <see cref="PressState.Pressed"/> and <see cref="PressState.Normal"/> state.
/// On release the <see cref="Control.Tap"/> event is fired.
/// </remarks>
Override this message to handle key events internally.
Override this message to handle key events internally .
protected override void KeyboardKeyMessage(char key, bool pressed, ref bool handled)
      {
         if (key == 10)
         {
            handled = true;
            if (pressed)
            {
               if (_state != PressState.Pressed)
               {
                  _state = PressState.Pressed;
                  Invalidate();
               }
            }
            else
            {
               if (_state == PressState.Pressed)
               {
                  _state = PressState.Normal;
                  Invalidate();
                  OnTap(this, new point(Left, Top));
               }
            }
         }
         base.KeyboardKeyMessage(key, pressed, ref handled);
      }
protected override void KeyboardKeyMessage ( char key , bool pressed , ref bool handled ) { if ( key == 10 ) { handled = true ; if ( pressed ) { if ( _state != PressState . Pressed ) { _state = PressState . Pressed ; Invalidate ( ) ; } } else { if ( _state == PressState . Pressed ) { _state = PressState . Normal ; Invalidate ( ) ; OnTap ( this , new point ( Left , Top ) ) ; } } } base . KeyboardKeyMessage ( key , pressed , ref handled ) ; }
Override this message to handle key events internally.
Override this message to handle key events internally .
key
char
Integer value of the key affected
Integer value of the key affected
pressed
bool
True if the key is currently being pressed; false if released
True if the key is currently being pressed ; false if released
bool
ref
handled
true if the event is handled. Set to true if handled.
true if the event is handled . Set to true if handled .
remarks
If the return Key (key == 10) is pressed or released the button is switched to
and  state.
On release the  event is fired.
If the return Key ( key == 10 ) is pressed or released the button is switched to and state . On release the event is fired .