当前位置: 首页>>代码示例>>C#>>正文


C# IController.IsPressed方法代码示例

本文整理汇总了C#中IController.IsPressed方法的典型用法代码示例。如果您正苦于以下问题:C# IController.IsPressed方法的具体用法?C# IController.IsPressed怎么用?C# IController.IsPressed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IController的用法示例。


在下文中一共展示了IController.IsPressed方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Set

		public void Set(IController controller)
		{
			var newVal = controller.IsPressed(Name);
			var changed = newVal != Checked;

			Checked = newVal;
			if (changed)
			{
				Refresh();
			}
		}
开发者ID:henke37,项目名称:BizHawk,代码行数:11,代码来源:VirtualPadButton.cs

示例2: CreateDisplayValueForButton

		public string CreateDisplayValueForButton(IController adapter, string buttonName)
		{
			if (adapter.Type.BoolButtons.Contains(buttonName))
			{
				return adapter.IsPressed(buttonName) ?
					Mnemonics[buttonName].ToString() :
					string.Empty;
			}

			if (adapter.Type.FloatControls.Contains(buttonName))
			{
				return adapter.GetFloat(buttonName).ToString();
			}

			return "!";
		}
开发者ID:Hathor86,项目名称:BizHawk,代码行数:16,代码来源:TasMovie.cs

示例3: CopyFrom

			/// <summary>
			/// this controller's definition changes to that of source
			/// </summary>
			/// <param name="source"></param>
			public void CopyFrom(IController source)
			{
				this.def = source.Type;
				buttons.Clear();
				foreach (var k in def.BoolButtons)
					buttons.Add(k, source.IsPressed(k) ? 1.0f : 0);
				foreach (var k in def.FloatControls)
				{
					if (buttons.Keys.Contains(k))
						throw new Exception("name collision between bool and float lists!");
					buttons.Add(k, source.GetFloat(k));
				}
			}
开发者ID:ddugovic,项目名称:RASuite,代码行数:17,代码来源:LibsnesCore.cs

示例4: LatchFromSource

		/// <summary>
		/// latches all buttons from the provided source
		/// </summary>
		public void LatchFromSource(IController source)
		{
			foreach (var button in Type.BoolButtons)
			{
				MyBoolButtons[button] = source.IsPressed(button);
			}

			foreach (var name in Type.FloatControls)
			{
				MyFloatControls[name] = source.GetFloat(name);
			}
		}
开发者ID:henke37,项目名称:BizHawk,代码行数:15,代码来源:Bk2ControllerAdapter.cs

示例5: ORLatchFromSource

		private void ORLatchFromSource(Bk2ControllerAdapter latching, IController source)
		{
			foreach (string button in latching.Type.BoolButtons)
			{
				latching[button] |= source.IsPressed(button);
			}

			foreach (string name in latching.Type.FloatControls)
			{
				float sFloat = source.GetFloat(name);
				int indexRange = source.Type.FloatControls.IndexOf(name);
				if (sFloat == source.Type.FloatRanges[indexRange].Mid)
					latching.SetFloat(name, sFloat);
			}
		}
开发者ID:henke37,项目名称:BizHawk,代码行数:15,代码来源:MovieZone.cs

示例6: LatchFromSourceButtons

		public void LatchFromSourceButtons(Bk2ControllerAdapter latching, IController source)
		{
			foreach (string button in source.Type.BoolButtons)
			{
				latching[button] = source.IsPressed(button);
			}

			foreach (string name in source.Type.FloatControls)
			{
				latching.SetFloat(name, source.GetFloat(name));
			}
		}
开发者ID:henke37,项目名称:BizHawk,代码行数:12,代码来源:MovieZone.cs

示例7: OR_FromLogical

		/// <summary>
		/// merges pressed logical buttons from the supplied controller, effectively ORing it with the current state
		/// </summary>
		public void OR_FromLogical(IController controller)
		{
			// change: or from each button that the other input controller has
			// foreach (string button in type.BoolButtons)
			if (controller.Type != null)
			{
				foreach (var button in controller.Type.BoolButtons)
				{
					if (controller.IsPressed(button))
					{
						_buttons[button] = true;
					}
				}
			}
		}
开发者ID:ddugovic,项目名称:RASuite,代码行数:18,代码来源:ControllerBinding.cs


注:本文中的IController.IsPressed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。