protected override void _drawGUI(int id)
        {
            close_button();
            GUILayout.BeginVertical();

            int new_editing_index = editing_index;

            for (int i = 0; i < hotkey_map.Count; i++)
            {
                GUILayout.BeginHorizontal();

                FieldInfo      field = hotkey_map[i].field;
                AutoHotkeyAttr attr  = hotkey_map[i].attr;
                GUILayout.Label(attr.hotkey_name, GUIStyles.labelStyleLeft);
                string text    = (editing_index == i) ? "??" : field.GetValue(null).ToString();
                bool   pressed = GUILayout.Button(text, GUIStyles.toggleButtonStyle, GUILayout.MinWidth(75.0f), GUILayout.Width(75.0f));
                if (pressed)
                {
                    new_editing_index = i;
                }

                GUILayout.EndHorizontal();
            }

            GUILayout.EndVertical();
            GUI.DragWindow();

            // now perform input binding
            editing_index = new_editing_index;
            if (editing_index > -1)
            {
                if (Input.anyKeyDown)
                {
                    if (Input.GetKeyDown(KeyCode.Escape))
                    {
                        FieldInfo field = hotkey_map[editing_index].field;
                        field.SetValue(null, KeyCode.None);
                        editing_index = -1;
                    }
                    else
                    {
                        foreach (KeyCode vKey in Enum.GetValues(typeof(KeyCode)))
                        {
                            if (Input.GetKey(vKey))
                            {
                                FieldInfo field = hotkey_map[editing_index].field;
                                field.SetValue(null, vKey);
                                editing_index = -1;
                                break;
                            }
                        }
                    }
                }
            }
        }
 public HotkeyField(FieldInfo field, AutoHotkeyAttr attr)
 {
     this.field = field;
     this.attr  = attr;
 }