示例#1
0
		public KeyListener( object sender )
		{
			MouseCover = true;
			var list = sender as ListBox;

			var keybordvalue = list.SelectedItem as GameControlsManager.SystemKeyboardMouseValue;
			if( keybordvalue != null )
			{
				_oldKeyboardMouseValue = keybordvalue;
				controlItem = keybordvalue.Parent;
			}
			var joystickvalue = list.SelectedItem as GameControlsManager.SystemJoystickValue;
			if( joystickvalue != null )
			{
				_oldJoystickValue = joystickvalue;
				controlItem = joystickvalue.Parent;
			}
		}
 //Incin
 protected bool checkCommandConflict(GameControlKeys command)
 {
     if (GameControlsManager.Instance != null)
     {
         int count = GameControlsManager.Instance.GetControlKetCount();
         //foreach(GameControlKeys in GameControlKeys)
         GameControlsManager.GameControlItem item = GameControlsManager.Instance.GetItemByControlKey(command);
         if (item != null && item.ControlKey == command)
         {
             _conflictCommand = item;
             return true;
         }
         else
         {
             _conflictCommand = null;
             return false;
         }
     }
     return false;
 }
        //private GameControlsManager.GameControlItem _selected_strength;

        public KeyListener(object sender)
        {
            //try{CommandBindingWindow.Listener(as Listener)
            //{ catch {CommandBindingWindow.Listener(as Listener)}};

            MouseCover = true;
            var list = sender as ListBox;

            var keybordvalue = list.SelectedItem as GameControlsManager.SystemKeyboardMouseValue;
            if (keybordvalue != null)
            {
                _oldKeyboardMouseValue = keybordvalue;
                controlItem = keybordvalue.Parent;
            }
            var joystickvalue = list.SelectedItem as GameControlsManager.SystemJoystickValue;
            if (joystickvalue != null)
            {
                _oldJoystickValue = joystickvalue;
                controlItem = joystickvalue.Parent;
            }
        }