• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# InputMode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中InputMode的典型用法代码示例。如果您正苦于以下问题:C# InputMode类的具体用法?C# InputMode怎么用?C# InputMode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



InputMode类属于命名空间,在下文中一共展示了InputMode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: RawStylusInputReport

        internal RawStylusInputReport(
            InputMode mode,
            int timestamp,
            PresentationSource inputSource,
            PenContext penContext,
            RawStylusActions actions,
            int tabletDeviceId,
            int stylusDeviceId,
            int[] data)
            : base(inputSource, InputType.Stylus, mode, timestamp)
        {
            // Validate parameters
            if (!RawStylusActionsHelper.IsValid(actions))
            {
                throw new InvalidEnumArgumentException(SR.Get(SRID.Enum_Invalid, "actions"));
            }
            if (data == null && actions != RawStylusActions.InRange)
            {
                throw new ArgumentNullException("data");
            }

            _penContext     = new SecurityCriticalDataClass<PenContext>(penContext);
            _actions        = actions;
            _tabletDeviceId = tabletDeviceId;
            _stylusDeviceId = stylusDeviceId;
            _data           = data;
            _isSynchronize  = false;
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:28,代码来源:RawStylusInputReport.cs


示例2: getMove

 void getMove()
 {
     move = false;
     if (Input.GetKeyDown(KeyCode.M)){
         input = "M";
         move = true;
         mode = InputMode.getRoom;
         }
     if (Input.GetKeyDown(KeyCode.S)){
         input = "S";
         move = true;
         mode = InputMode.getArrowPath;
         }
     if (Input.GetKeyDown(KeyCode.Q)){
         input = "Q";
         move = true;
         }
     //clear everything
     if (move){
         selectedRoom = null;
         arrowPath = null;
         tempPath.Clear();
         move = false;
         }
 }
开发者ID:imperialsoup,项目名称:HuntTheWumpus_3D,代码行数:25,代码来源:InputController.cs


示例3: CharacterMapKeysAttribute

 public CharacterMapKeysAttribute(InputMode mode, string charList, int width, params Key[] keys)
 {
     _mode = mode;
     _charList = charList;
     _width = width;
     _keys = keys;
 }
开发者ID:mcwatt77,项目名称:vimcontrols,代码行数:7,代码来源:CharacterMapKeysAttribute.cs


示例4: SetInputMode

		/// <summary>
		/// Specifies the input mode on a Smartphone.
		/// </summary>
		public static void SetInputMode(Control control, InputMode mode)
		{
			int msg;

			//only certain controls are supported
			if(control is TextBox)
			{
				msg = EM_SETINPUTMODE; 
			}
			else if(control is ComboBox)
			{
				msg = LB_SETINPUTMODE;
			}
			else
			{
				return;
			}

			//get the handle to the child (native) control
			control.Capture = true;
			IntPtr hwnd = Win32Window.GetWindow(Win32Window.GetCapture(), GW.CHILD);
			control.Capture = false;			

			//send message
			IntPtr result = Win32Window.SendMessage(hwnd, msg, IntPtr.Zero, (int)mode);
		}
开发者ID:JeffreyZksun,项目名称:gpstranslator,代码行数:29,代码来源:InputModeEditor.cs


示例5: ChangeMode

 public void ChangeMode(InputMode mode)
 {
     var member = GetType().GetField(string.Format("_{0}Dict", mode.ToString().ToLower()), BindingFlags.NonPublic | BindingFlags.Instance);
     if (member == null) throw new Exception(mode + " does not have a dictionary set up");
     _currentDict = (SequencedDictionary<Key, Message>)member.GetValue(this);
     InputMode = mode;
 }
开发者ID:mcwatt77,项目名称:vimcontrols,代码行数:7,代码来源:MessageDictionary.cs


示例6: InputHelper

        public InputHelper(InputMode inputDevice = InputMode.KeyMouse)
        {
            this.inputDevice = inputDevice;

            currentControlerState = GamePad.GetState(PlayerIndex.One);
            currentKeyboardState = Keyboard.GetState();
            currentMouseState = Mouse.GetState();
        }
开发者ID:Monkeysfists,项目名称:Pacman,代码行数:8,代码来源:InputHelper.cs


示例7: UIMapControlInputHandler

        protected UIMapControlInputHandler(InputMode setInputMode, UIMapControl setUIMapControl)
        {
            mapUnitOrder = MapUnitOrder.None;
             IsSpanningRectangle = false;
             selectionRectangle = RectangleF.Empty;

             MapControl = setUIMapControl;
             InputMode = setInputMode;
        }
开发者ID:CAMongrel,项目名称:WinWar,代码行数:9,代码来源:UIMapControlInputHandler.cs


示例8: ActivateAttackModifier

    public void ActivateAttackModifier()
    {
        Debug.Log("attc md activated");
        m_InputMode = InputMode.attack;
        attackModifier = true;
        Cursor.SetCursor(attackCursorTexture, Vector2.zero, CursorMode.Auto);

        Input.ResetInputAxes();
    }
开发者ID:JadeLens,项目名称:TrashPanda,代码行数:9,代码来源:Player.cs


示例9: Update

    void Update()
    {
        if (Input.GetButtonDown ("Fire1")) {
            RaycastManager.RaycastControl ();
        }

        if (GameManager.CellControlled == null)
        {
            mode = InputMode.Default;
            return;
        }

        if (GameManager.CellControlled.GetComponent<AgentLife> ().isInfected)
        {
            DeselectAll();
            return;
        }

        if (Input.GetButtonDown ("Fire2")) {
            playerTarget = RaycastManager.RaycastAttackEnemy ();
            GameManager.CellControlled.GetComponent<AgentMovement> ().enabled = false;
            GameManager.CellControlled.GetComponent<MoveToPoint> ().DefineNewDestination (Camera.main.ScreenToWorldPoint (Input.mousePosition));

            if (playerTarget != null) {
                mode = InputMode.Attacking;
            }
            else
            {
                mode = InputMode.Controlling;
            }

        }

        switch (mode) {

        case (InputMode.Attacking):

            if(playerTarget == null)
            {
                //GameManager.CellControlled.GetComponent<AgentMovement> ().enabled = true;
                mode = InputMode.Controlling;
                break;
            }

            GameManager.CellControlled.GetComponent<MoveToPoint> ().DefineNewDestination (playerTarget.transform.position);

            if (Vector2.Distance (GameManager.CellControlled.transform.position, playerTarget.transform.position) < 10) {
                GameManager.CellControlled.GetComponent<AgentMovement> ().enabled = true;
                GameManager.CellControlled.GetComponent<MoveToPoint> ().enabled = false;

            }

            break;

        //case (InputMode.Attacking)
        }
    }
开发者ID:BeNeNuTs,项目名称:Breaking-Blood-Cells,代码行数:57,代码来源:InputManager.cs


示例10: InputController

        public InputController(InputMode mode)
        {
            m_Mode = mode;
            m_oldState = new KeyboardState();
            m_newState = new KeyboardState();

            m_oldControllerState = new GamePadState[NUM_SUPPORTED_PLAYERS];
            m_newControllerState = new GamePadState[NUM_SUPPORTED_PLAYERS];
        }
开发者ID:cmsboyd,项目名称:LPProject,代码行数:9,代码来源:InputController.cs


示例11: HexagonyEnv

        public HexagonyEnv(string source, string input, HexagonySettings settings)
        {
            if (source.StartsWith("❢"))
                _linearCode = source.Substring(1);
            else
            {
                _grid = Grid.Parse(source);
                _ips = Ut.NewArray(
                    new PointAxial(0, -_grid.Size + 1),
                    new PointAxial(_grid.Size - 1, -_grid.Size + 1),
                    new PointAxial(_grid.Size - 1, 0),
                    new PointAxial(0, _grid.Size - 1),
                    new PointAxial(-_grid.Size + 1, _grid.Size - 1),
                    new PointAxial(-_grid.Size + 1, 0));
                _ipDirs = Ut.NewArray(
                    Direction.East,
                    Direction.SouthEast,
                    Direction.SouthWest,
                    Direction.West,
                    Direction.NorthWest,
                    Direction.NorthEast);
            }
            switch (_inputMode = settings.InputMode)
            {
                case InputMode.Utf8:
                    _input = input.ToUtf8();
                    break;

                case InputMode.Utf16:
                    _input = input.ToUtf16();
                    break;

                case InputMode.Numbers:
                    var m = Regex.Match(input, @"\A(\s*\d+\s*)*\Z", RegexOptions.Singleline);
                    if (!m.Success)
                        throw new InvalidOperationException("The input provided is not a whitespace-separated list of numbers.");
                    _input = m.Groups[1].Captures.Cast<Capture>().Select(c =>
                    {
                        byte b;
                        if (!byte.TryParse(c.Value.Trim(), out b))
                            throw new InvalidOperationException("The number {0} in the input string does not fit in a byte.".Fmt(c.Value.Trim()));
                        return b;
                    }).ToArray();
                    break;

                default:
                    throw new InvalidOperationException("Please choose an input mode from the “Input semantics” menu.");
            }

            _inputIndex = 0;
            _settings = settings;
            if (!settings.MemoryAnnotations.ContainsKey(settings.LastMemoryAnnotationSet))
                settings.MemoryAnnotations[settings.LastMemoryAnnotationSet] = new Dictionary<Direction, Dictionary<PointAxial, string>>();
            _memory = new Memory(settings.MemoryAnnotations[settings.LastMemoryAnnotationSet]);
        }
开发者ID:Timwi,项目名称:EsotericIDE,代码行数:55,代码来源:Environment.cs


示例12: DelayInputModeSwitch

 public static IEnumerator DelayInputModeSwitch(InputMode switchTo)
 {
     float elapsedTime = 0;
     while (elapsedTime <= GameConstants.DELAYED_INPUT_SWITCH_DURATION)
     {
         elapsedTime += Time.unscaledDeltaTime;
         yield return null;
     }
     mode = switchTo;
     DelayedSwitch = null;
 }
开发者ID:oatssss,项目名称:McGill-Once-McGill-Twice,代码行数:11,代码来源:CustomInputManager.cs


示例13: RawAppCommandInputReport

 /// <summary>
 ///     Constructs ad instance of the RawAppCommandInputReport class.
 /// </summary>
 /// <param name="inputSource">
 ///     The input source that provided this input.
 /// </param>
 /// <param name="mode">
 ///     The mode in which the input is being provided.
 /// </param>
 /// <param name="timestamp">
 ///     The time when the input occured.
 /// </param>
 /// <param name="appCommand">
 ///     The Application Command associated.
 /// </param>
 /// <param name="device">
 ///     The device that generated the app command.
 /// </param>
 /// <param name="inputType">the input device that generated the input event</param>
 internal RawAppCommandInputReport(
     PresentationSource  inputSource,
     InputMode           mode,
     int                 timestamp,
     int                 appCommand,
     InputType           device,
     InputType           inputType) : base(inputSource, inputType, mode, timestamp)
 {
     _appCommand = appCommand;
     _device = device;
 }
开发者ID:JianwenSun,项目名称:cc,代码行数:30,代码来源:RawAppCommandInputReport.cs


示例14: InputReport

        protected InputReport(PresentationSource inputSource, InputType type, InputMode mode, int timestamp)
        {
            if (inputSource == null)
                throw new ArgumentNullException("inputSource");

            Validate_InputType( type );
            Validate_InputMode( mode );
            _inputSource= new SecurityCriticalData<PresentationSource>(inputSource);
            _type = type;
            _mode = mode;
            _timestamp = timestamp;
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:12,代码来源:InputReport.cs


示例15: Update

    // Update is called once per frame
    void Update()
    {
        // None -> Hold
        // Hold -> Tap, or Drag
        // Tap, Drag -> None

        // Get data we will need
        // We only care about clicks if they are not over a UI element
        leftButtonDown = Input.GetMouseButton(0)
                       && !UnityEngine.EventSystems.EventSystem.current.IsPointerOverGameObject();
        Vector2 currentPosition = Input.mousePosition;

        switch (currentInputMode) {
        case InputMode.None:
            // If we are in the default mode, we can only enter Hold mode
            if (leftButtonDown) {
                currentInputMode = InputMode.Hold;
                lastPosition = currentPosition;
            }
            break;
        case InputMode.Hold:
            // If we are holding, we have to check position (transforming to Drag)
            // and releaseing the click (transforming to Tap)
            if (GetFastDistance(currentPosition, lastPosition) < 10 &&
                framesSinceLastClick < 5) {
                // Tap
                if (!leftButtonDown) {
                    currentInputMode = InputMode.Tap;
                    eventPosition = currentPosition;
                }
            }
            else {
                // Drag
                currentInputMode = InputMode.Drag;
                eventPosition = currentPosition;
            }
            break;
        case InputMode.Tap:
            currentInputMode = InputMode.None;
            break;
        case InputMode.Drag:
            if (leftButtonDown) {
                framesSinceLastClick++;
                lastPosition = eventPosition;
                eventPosition = currentPosition;
            }
            else {
                framesSinceLastClick = 0;
                currentInputMode = InputMode.None;
            }
            break;
        }
    }
开发者ID:gizmo-mk0,项目名称:kartofwar-client,代码行数:54,代码来源:InputController.cs


示例16: RawTextInputReport

        /// <summary> 
        ///     Constructs ad instance of the RawKeyboardInputReport class.
        /// </summary> 
        /// <param name="inputSource">
        ///     The input source that provided this input.
        /// </param>
        /// <param name="mode"> 
        ///     The mode in which the input is being provided.
        /// </param> 
        /// <param name="timestamp"> 
        ///     The time when the input occured.
        /// </param> 
        /// <param name="isDeadCharacter">
        ///     True if the char code is a dead char.
        /// </param>
        /// <param name="isSystemCharacter"> 
        ///     True if the char code is a system char.
        /// </param> 
        /// <param name="isControlCharacter"> 
        ///     True if the char code is a control char.
        /// </param> 
        /// <param name="characterCode">
        ///     The character code.
        /// </param>
        public RawTextInputReport( 
            PresentationSource inputSource,
            InputMode mode, 
            int timestamp, 
            bool isDeadCharacter,
            bool isSystemCharacter, 
            bool isControlCharacter,
            char characterCode) : base(inputSource, InputType.Text, mode, timestamp)
        {
            _isDeadCharacter = isDeadCharacter; 
            _isSystemCharacter = isSystemCharacter;
            _isControlCharacter = isControlCharacter; 
 
            _characterCode = characterCode;
        } 
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:39,代码来源:RawTextInputReport.cs


示例17: RawUIStateInputReport

        public RawUIStateInputReport(
            PresentationSource inputSource,
            InputMode mode,
            int timestamp,
            RawUIStateActions action,
            RawUIStateTargets targets) : base(inputSource, InputType.Keyboard, mode, timestamp)
        {
            if (!IsValidRawUIStateAction(action))
                throw new System.ComponentModel.InvalidEnumArgumentException("action", (int)action, typeof(RawUIStateActions));
            if (!IsValidRawUIStateTargets(targets))
                throw new System.ComponentModel.InvalidEnumArgumentException("targets", (int)targets, typeof(RawUIStateTargets));

            _action = action;
            _targets = targets;
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:15,代码来源:RawUIStateInputReport.cs


示例18: RawMouseInputReport

        public RawMouseInputReport(
            InputMode mode,
            int timestamp, 
            PresentationSource inputSource,
            RawMouseActions actions, 
            int x, 
            int y, 
            int wheel, 
            IntPtr extraInformation) : base(inputSource, InputType.Mouse, mode, timestamp)
        {
            if (!IsValidRawMouseActions(actions))
                throw new System.ComponentModel.InvalidEnumArgumentException("actions", (int)actions, typeof(RawMouseActions));

            /* we pass a null state from MouseDevice.PreProcessorInput, so null is valid value for state */
            _actions = actions;
            _x = x;
            _y = y;
            _wheel = wheel;
            _extraInformation = new SecurityCriticalData<IntPtr>(extraInformation);
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:20,代码来源:RawMouseInputReport.cs


示例19: RawKeyboardInputReport

        public RawKeyboardInputReport(
            PresentationSource inputSource,
            InputMode mode,
            int timestamp, 
            RawKeyboardActions actions, 
            int scanCode, 
            bool isExtendedKey,
            bool isSystemKey,
            int virtualKey, 
            IntPtr extraInformation) : base(inputSource, InputType.Keyboard, mode, timestamp)
        {
            if (!IsValidRawKeyboardActions(actions))
                throw new System.ComponentModel.InvalidEnumArgumentException("actions", (int)actions, typeof(RawKeyboardActions));

            _actions = actions;
            _scanCode = scanCode;
            _isExtendedKey = isExtendedKey;
            _isSystemKey = isSystemKey;
            _virtualKey = virtualKey;
            _extraInformation = new SecurityCriticalData<IntPtr>(extraInformation);
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:21,代码来源:RawKeyboardInputReport.cs


示例20: QuestionMutliOrSingelInputViewModel

 public QuestionMutliOrSingelInputViewModel(object question, InputMode inputMode)
     : base(question, inputMode)
 {
 }
开发者ID:JPVenson,项目名称:WPFCommon,代码行数:4,代码来源:QuestionMutliOrSingelInputViewModel.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# InputState类代码示例发布时间:2022-05-24
下一篇:
C# InputManager类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap