get_key_bindings (Raggle::Interfaces::NcursesInterface)

    # File raggle, line 4102
          def NcursesInterface::get_key_bindings
            # Create our integer <=> name array, first Ncurses keys
            key_names = Ncurses::constants.grep(/^KEY/).inject([]) { |ret, name|
              ret[Ncurses::const_get(name)] = name
              ret
            }
            # then standard ASCII keys
            0.upto(255) { |i| key_names[i] = i.chr }

            # create keys hash, stores key names => method called
            keys = {}
            $config['keys'].each { |key, value| keys[key_names[key]] = value }
            # make the key names useful
            keys.each_key { |key|
              old_key = key
              key = key.gsub(/^KEY_/, '')
              case key
              when 'DC':        key = 'Delete'
              when ' ':         key = 'Space'
              when 'NPAGE':     key = 'Page Down'
              when 'PPAGE':     key = 'Page Up'
              when '':        key = 'Control-L'
              when '        ':  key = 'Tab'
              when /^\d$/:      key = '1-9'
              end
              unless key == old_key  # remove cruft if key info updated
                keys[key] = keys[old_key]
                keys.delete(old_key)
              end
            }
            # strip off extraneous method info and return hash
            keys.each { |key, value|
              keys[key] = value.to_s.sub(/^\|.*\|\s?/, '').sub(/^.*::/, '').sub(/\(.*\)$/, '').tr('_', ' ').capitalize
            }
            # Note: I can't get \n to display properly in the help window, so:
            keys.delete_if { |key, value| value == 'Select item' and key != 'Space' }
          end