     }
 }
 
-}
+} 

        }
        
        else if (showingDropdown &&
                 (event.keyCode == Keyboard.HOME ||
                  event.keyCode == Keyboard.END ||
                  event.keyCode == Keyboard.PAGE_UP ||
                  event.keyCode == Keyboard.PAGE_DOWN ||
                  event.keyCode == Keyboard.LEFT ||
                  event.keyCode == Keyboard.RIGHT ||
                  event.keyCode == Keyboard.UP ||
                  event.keyCode == Keyboard.DOWN))
        {
            // Redispatch the event from the SwatchPanel
            // so that its keyDownHandler() can handle it.
            dropdownSwatch.dispatchEvent(event);
        }
        
        else if (event.keyCode == Keyboard.LEFT)
        {
            if (selectedIndex == -1)
            {
                selectedIndex = findColorByName(selectedColor);
            }
            if (selectedIndex - 1 >= 0)
            {
                selectedIndex--;

                cpEvent = new ColorPickerEvent(ColorPickerEvent.CHANGE);
                cpEvent.index = selectedIndex;
                cpEvent.color = selectedColor;
                dispatchEvent(cpEvent);
            }
        }
        
        else if (event.keyCode == Keyboard.RIGHT)
        {
            if (selectedIndex == -1)
            {
                selectedIndex = findColorByName(selectedColor);
            }
            if (selectedIndex + 1 < dataProvider.length)
            {
                selectedIndex++;

                cpEvent = new ColorPickerEvent(ColorPickerEvent.CHANGE);
                cpEvent.index = selectedIndex;
                cpEvent.color = selectedColor;
                dispatchEvent(cpEvent);
            }
        }
    }

    //--------------------------------------------------------------------------
    //

    {
        var cpEvent:ColorPickerEvent = null;
        
        // If rtl layout, need to swap LEFT for RIGHT so correct action
        // is done.
        var keyCode:int = mapKeycodeForLayoutDirection(event);

        if (event.ctrlKey && keyCode == Keyboard.DOWN)
        {
            displayDropdown(true, event);
        }
        
        else if ((event.ctrlKey && keyCode == Keyboard.UP) ||
                 keyCode == Keyboard.ESCAPE)
        {
            if (dropdownSwatch && dropdownSwatch.enabled)
                close(event);
        }
        
        else if (showingDropdown && keyCode == Keyboard.ENTER && dropdownSwatch.enabled)
        {
            if (!dropdownSwatch.isOverGrid && editable)
            {
