   $('body').keyup ( event) ->
     switch event.which
       when K_H then $('#help_dialog').fadeToggle 'fast'
-      when K_0 then select_color_source 0
-      when K_1 then select_color_source 1
-      when K_2 then select_color_source 2
-      when K_3 then select_color_source 3
+      when K_0 then editor.choose_brush 0
+      when K_1 then editor.choose_brush 1
+      when K_2 then editor.choose_brush 2 if mode.color_mode is 'multi-color'
+      when K_3 then editor.choose_brush 3 if mode.color_mode is 'multi-color'
       when K_C then copy_from_index = selected_character_code
       when K_V then selected_character().copy_from  copy_from_index
       when K_S then localStorage["data"] = JSON.stringify( data )

        $(tr).append  td
      table.append  tr
    table.find('td').mousedown(@when_button_pressed).mouseup @when_button_released
    @render()

  coordinates_from: ( event) ->
    td = $(event.currentTarget)


  constructor: ->
    @build()
    # When the page first loads, the color on the brush should be evident
    @choose_brush 1 # @brush remembers whether to paint with foreground or background pixels

  build: ->
    # The number of rows and columns change with the mode:
