3 Replies Latest reply on Dec 1, 2007 4:08 PM by _kwigbo

    extending button class

    adrianwebb
      Hello all,

      I am trying to extend the button class to include the ability to click the button when a user presses the enter key on the keyboard. I do not know how I would go about doing this. There are two private functions that control the press and release of the button; buttonPressed() and buttonReleased(), along with a private property ButtonPhase that seem to control this functionality. At first I thought I would override the keyDownHandler and the keyUpHandler, as they allow the user to click the button with the space bar, but it won't work with the private functions and property. Any ideas on how I could achieve this goal without having to copy and alter the original button class would be greatly appreciated. Does anybody know why the developers chose to have the button click when the space is hit instead of the enter key? It seems to me that the enter key is a much more intuitive keyboard shortcut than the space bar.

      Thanks for your help