Flex components that support keyboard navigation override a protected method called keyDownHandler()
that is defined by UIComponent
. There is also a keyUpHandler()
method, but you typically only need to use one or the other.
In this case, the ColorPicker
component overrides keyDownHandler()
. It's quite long, you can see it in the Apache Flex github repo on line 1436.
You create a custom color picker class that overrides this method and does not call the super class method if the arrow keys are pressed:
override protected function keyDownHandler(event:KeyboardEvent):void
{
var keyCode:uint = event.keyCode;
// don't call the super class for these keys
if ( !(keyCode == Keyboard.LEFT || keyCode == Keyboard.RIGHT) )
{
super.keyDownHandler(event);
}
}
Note, this is untested, you might need more logic than this to make it work properly. I recommend inspecting the super class method ;)