public/javascripts/yui/colorpicker/colorpicker.js
function(e) {
            var c = Event.getCharCode(e);

            //alert(Event.getCharCode(e) + ", " + e.keyCode + ", " + e.charCode);

            // special keys
            if (c === 38) { // up arrow
                return 3;
            } else if (c === 13) { // return
                return 6;
            } else if (c === 40) { // down array
                return 4;
            } else if (c >= 48 && c<=57) { // 0-9
                return 1;
            } else if (c >= 97 && c<=102) { // a-f
                return 2;
            } else if (c >= 65 && c<=70) { // A-F
                return 2;
            //} else if ("8, 9, 13, 27, 37, 39".indexOf(c) > -1 || 
            //              (c >= 112 && c <=123)) { // including F-keys
            // tab, delete, return, escape, left, right or ctrl/meta sequences
            } else if ("8, 9, 13, 27, 37, 39".indexOf(c) > -1 ||
                       e.ctrlKey || e.metaKey) { // special chars
                return 5;
            } else { // something we probably don't want
                return 0;
            }
        }
function(e) {
            var c = Event.getCharCode(e);

            //alert(Event.getCharCode(e) + ", " + e.keyCode + ", " + e.charCode);

            // special keys
            if (c === 38) { // up arrow
                return 3;
            } else if (c === 13) { // return
                return 6;
            } else if (c === 40) { // down array
                return 4;
            } else if (c >= 48 && c<=57) { // 0-9
                return 1;
            } else if (c >= 97 && c<=102) { // a-f
                return 2;
            } else if (c >= 65 && c<=70) { // A-F
                return 2;
            //} else if ("8, 9, 13, 27, 37, 39".indexOf(c) > -1 || 
            //              (c >= 112 && c <=123)) { // including F-keys
            // tab, delete, return, escape, left, right or ctrl/meta sequences
            } else if ("8, 9, 13, 27, 37, 39".indexOf(c) > -1 ||
                       e.ctrlKey || e.metaKey) { // special chars
                return 5;
            } else { // something we probably don't want
                return 0;
            }
        }
function ( e ) { var c = Event . getCharCode ( e ) ; //alert(Event.getCharCode(e) + ", " + e.keyCode + ", " + e.charCode); // special keys if ( c === 38 ) { // up arrow return 3 ; } else if ( c === 13 ) { // return return 6 ; } else if ( c === 40 ) { // down array return 4 ; } else if ( c >= 48 && c <= 57 ) { // 0-9 return 1 ; } else if ( c >= 97 && c <= 102 ) { // a-f return 2 ; } else if ( c >= 65 && c <= 70 ) { // A-F return 2 ; //} else if ("8, 9, 13, 27, 37, 39".indexOf(c) > -1 ||  //              (c >= 112 && c <=123)) { // including F-keys // tab, delete, return, escape, left, right or ctrl/meta sequences } else if ( "8, 9, 13, 27, 37, 39" . indexOf ( c ) > - 1 || e . ctrlKey || e . metaKey ) { // special chars return 5 ; } else { // something we probably don't want return 0 ; } }
Key map to well-known commands for txt field input
@method _getCommand
@param e {Event} the keypress or keydown event
@return {int} a command code
<ul>
<li>0 = not a number, letter in range, or special key</li>
<li>1 = number</li>
<li>2 = a-fA-F</li>
<li>3 = increment (up arrow)</li>
<li>4 = decrement (down arrow)</li>
<li>5 = special key (tab, delete, return, escape, left, right)</li>
<li>6 = return</li>
</ul>
@protected
Key map to well - known commands for txt field input