示例#1
0
        private void DoBinding(KeyBind kb)
        {
            GUILayout.BeginHorizontal();
            GUILayout.Label(kb.description, GUILayout.Width(165));
            string label;

            if (IsCapturing() && kb == captureTarget)
            {
                label = "...";
            }
            else
            {
                label = kb.HumanBinding;
            }
            if (GUILayout.Button(label, GUILayout.Width(110)))
            {
                if (captureTarget == null)
                {
                    StartKeyCapture(kb);
                }
                else
                {
                    CancelKeyCapture();
                }
            }
            if (!kb.IsRequiredBound() && GUILayout.Button("clear", WindowStyles.DeleteButtonStyle))
            {
                CancelKeyCapture();
                kb.SetBinding(null);
            }
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
        }
示例#2
0
 private void DoBinding(KeyBind kb)
 {
     GUILayout.BeginHorizontal();
     GUILayout.Label(kb.description, GUILayout.Width(165));
     string label;
     if (IsCapturing() && kb == captureTarget) {
         label = "...";
     } else {
         label = kb.HumanBinding;
     }
     if (GUILayout.Button(label, GUILayout.Width(110))) {
         if (captureTarget == null) {
             StartKeyCapture(kb);
         } else {
             CancelKeyCapture();
         }
     }
     if (!kb.IsRequiredBound() && GUILayout.Button("clear", C.DeleteButtonStyle)) {
         CancelKeyCapture();
         kb.SetBinding(null);
     }
     GUILayout.FlexibleSpace();
     GUILayout.EndHorizontal();
 }
示例#3
0
 private void CompleteKeyCapture(Event ev)
 {
     captureTarget.SetBinding(ev);
     StateHandler.keyBindings.captureAnyKey -= HandleCapturedKey;
     captureTarget = null;
 }