def handle_key(ch) #:nodoc:
      #map_keys unless @keys_mapped
      @current_index ||= 0
      @toprow ||= 0
      #h = scrollatrow()
      #rc = row_count
      #$log.debug " basiclistbox got ch #{ch}"
      #$log.debug " when kps #{@KEY_PREV_SELECTION}  "
      case ch
      #when 32
        #return if is_popup and @selection_mode == 'single' # not allowing select this way since there will be a difference 
        #toggle_row_selection @current_index #, @current_index
        #@repaint_required = true
      #when 0 # c-space
        #add_to_selection
      #when @KEY_NEXT_SELECTION # ?'
        #$log.debug "insdie next selection"
        #@oldrow = @current_index
        #do_next_selection 
        #bounds_check
      #when @KEY_PREV_SELECTION # ?"
        #@oldrow = @current_index
        #$log.debug "insdie prev selection"
        #do_prev_selection 
        #bounds_check
      #when @KEY_CLEAR_SELECTION
        #clear_selection 
        #@repaint_required = true
      when 27, ?\C-c.getbyte(0)
        $multiplier = 0
      when @KEY_BLOCK_SELECTOR
        mark_block #selection
      #when ?\C-u.getbyte(0)
        # multiplier. Series is 4 16 64
        # TESTING @multiplier = (@multiplier == 0 ? 4 : @multiplier *= 4)
      #  return 0
      #when ?\C-c.getbyte(0)
        #@multiplier = 0
        #return 0
      else
        # this has to be fixed, if compo does not handle key it has to continue into next part FIXME
        ret = :UNHANDLED # changed on 2009-01-27 13:14 not going into unhandled, tab not released
        if ret == :UNHANDLED
          # beware one-key eats up numbers. we'll be wondering why
          if @one_key_selection
            case ch
            #when ?A.getbyte(0)..?Z.getbyte(0), ?a.getbyte(0)..?z.getbyte(0), ?0.getbyte(0)..?9.getbyte(0)
            when ?A.getbyte(0)..?Z.getbyte(0), ?a.getbyte(0)..?z.getbyte(0)
              # simple motion, key press defines motion
              ret = set_selection_for_char ch.chr
            else
              ret = process_key ch, self
              @multiplier = 0
              # if no block associated with :PRESS (KEY_ENTER) lets allow the form to use ENTER
              # This is for default buttons. Added NO_BLOCK 2011-12-2 
              # 2011-12-2 11:54 PM this was resulting in no repaint even
              # when symbols were being executed??
              # Its risky since symbol can call something which returns
              # UNHNDLED or NO_BLOCK even tho' it executed.
              return :UNHANDLED if ret == :UNHANDLED #|| ret == :NO_BLOCK
            end
          else
            # no motion on single key, we can freak out like in vim, pref f <char> for set_selection
            case ch
            when ?0.getbyte(0)..?9.getbyte(0)
              $multiplier *= 10 ; $multiplier += (ch-48)
              #$log.debug " setting mult to #{$multiplier} in list "
              return 0
            end
            ret = process_key ch, self
            # if no block associated with :PRESS (KEY_ENTER) lets allow the form to use ENTER
            # This is for default buttons. Added NO_BLOCK 2011-12-2 
            return :UNHANDLED if ret == :UNHANDLED #|| ret == :NO_BLOCK1
          end
        end
      end
      $multiplier = 0
    end
def handle_key(ch) #:nodoc:
      #map_keys unless @keys_mapped
      @current_index ||= 0
      @toprow ||= 0
      #h = scrollatrow()
      #rc = row_count
      #$log.debug " basiclistbox got ch #{ch}"
      #$log.debug " when kps #{@KEY_PREV_SELECTION}  "
      case ch
      #when 32
        #return if is_popup and @selection_mode == 'single' # not allowing select this way since there will be a difference 
        #toggle_row_selection @current_index #, @current_index
        #@repaint_required = true
      #when 0 # c-space
        #add_to_selection
      #when @KEY_NEXT_SELECTION # ?'
        #$log.debug "insdie next selection"
        #@oldrow = @current_index
        #do_next_selection 
        #bounds_check
      #when @KEY_PREV_SELECTION # ?"
        #@oldrow = @current_index
        #$log.debug "insdie prev selection"
        #do_prev_selection 
        #bounds_check
      #when @KEY_CLEAR_SELECTION
        #clear_selection 
        #@repaint_required = true
      when 27, ?\C-c.getbyte(0)
        $multiplier = 0
      when @KEY_BLOCK_SELECTOR
        mark_block #selection
      #when ?\C-u.getbyte(0)
        # multiplier. Series is 4 16 64
        # TESTING @multiplier = (@multiplier == 0 ? 4 : @multiplier *= 4)
      #  return 0
      #when ?\C-c.getbyte(0)
        #@multiplier = 0
        #return 0
      else
        # this has to be fixed, if compo does not handle key it has to continue into next part FIXME
        ret = :UNHANDLED # changed on 2009-01-27 13:14 not going into unhandled, tab not released
        if ret == :UNHANDLED
          # beware one-key eats up numbers. we'll be wondering why
          if @one_key_selection
            case ch
            #when ?A.getbyte(0)..?Z.getbyte(0), ?a.getbyte(0)..?z.getbyte(0), ?0.getbyte(0)..?9.getbyte(0)
            when ?A.getbyte(0)..?Z.getbyte(0), ?a.getbyte(0)..?z.getbyte(0)
              # simple motion, key press defines motion
              ret = set_selection_for_char ch.chr
            else
              ret = process_key ch, self
              @multiplier = 0
              # if no block associated with :PRESS (KEY_ENTER) lets allow the form to use ENTER
              # This is for default buttons. Added NO_BLOCK 2011-12-2 
              # 2011-12-2 11:54 PM this was resulting in no repaint even
              # when symbols were being executed??
              # Its risky since symbol can call something which returns
              # UNHNDLED or NO_BLOCK even tho' it executed.
              return :UNHANDLED if ret == :UNHANDLED #|| ret == :NO_BLOCK
            end
          else
            # no motion on single key, we can freak out like in vim, pref f <char> for set_selection
            case ch
            when ?0.getbyte(0)..?9.getbyte(0)
              $multiplier *= 10 ; $multiplier += (ch-48)
              #$log.debug " setting mult to #{$multiplier} in list "
              return 0
            end
            ret = process_key ch, self
            # if no block associated with :PRESS (KEY_ENTER) lets allow the form to use ENTER
            # This is for default buttons. Added NO_BLOCK 2011-12-2 
            return :UNHANDLED if ret == :UNHANDLED #|| ret == :NO_BLOCK1
          end
        end
      end
      $multiplier = 0
    end
Listbox