Implemented sneak key detection (used in GUIs).

Color button now supports next/prev state method with times parameter.