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

C# IKeyboard类代码示例

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

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



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

示例1: SetUp

 public void SetUp()
 {
     stubKeyboard = MockRepository.GenerateStub<IKeyboard>();
     stubMouse = MockRepository.GenerateStub<IMouse>();
     stubKeyMapping = MockRepository.GenerateStub<IKeyMapping>();
     gameInput = new GameInput(stubKeyMapping, stubKeyboard, stubMouse);
 }
开发者ID:zakvdm,项目名称:Frenetic,代码行数:7,代码来源:GameInputTests.cs


示例2: VMKeyboardEditable

        public VMKeyboardEditable( VMContextEditable ctx, IKeyboard kb )
            : base(ctx)
        {
            _zones = new ObservableCollection<VMZoneEditable>();
            _keys = new ObservableCollection<VMKeyEditable>();
            _keyboard = kb;
            _holder = ctx;
            Model = kb;
            _keyboardModes = new ObservableCollection<VMKeyboardMode>();

            foreach( IZone zone in _keyboard.Zones )
            {
                var vmz = Context.Obtain( zone );
                // TODO: find a better way....
                if( zone.Name == "Prediction" ) Zones.Insert( 0, vmz );
                else Zones.Add( vmz );

                foreach( IKey key in zone.Keys )
                {
                    _keys.Add( Context.Obtain( key ) );
                }
            }

            RegisterEvents();

            RefreshModes();
        }
开发者ID:rit3k,项目名称:ck-certified,代码行数:27,代码来源:VMKeyboardEditable.cs


示例3: VMKeyboardSimple

        internal VMKeyboardSimple( VMContextSimpleBase ctx, IKeyboard kb )
            : base(ctx)
        {
            Debug.Assert( Dispatcher.CurrentDispatcher == Context.NoFocusManager.ExternalDispatcher, "This method should only be called by the ExternalThread." );

            _zones = new ObservableCollection<VMZoneSimple>();
            _keys = new ObservableCollection<VMKeySimple>();

            _keyboard = kb;

            RegisterEvents();

            foreach( IZone zone in _keyboard.Zones.ToList() )
            {
                VMZoneSimple zoneVM = Context.Obtain( zone );
                Zones.Add( zoneVM );
                foreach( IKey key in zone.Keys )
                {
                    _keys.Add( Context.Obtain( key ) );
                }
            }

            UpdateW();
            UpdateH();
            SafeUpdateInsideBorderColor();
            UpdateHighlightBackground();
            UpdateHighlightFontColor();
            UpdateLoopCount();
            UpdateBackgroundPath();

            IsHighlightableTreeRoot = true;
        }
开发者ID:Invenietis,项目名称:ck-certified,代码行数:32,代码来源:VMKeyboardSimple.cs


示例4: Window

 public Window(IntPtr handle, IUIAutomation uiAutomation, IKeyboard keyboard, IWinUserWrap winUserWrap)
 {
     this.Handle = handle;
     this.uiAutomation = uiAutomation;
     this.keyboard = keyboard;
     this.winUserWrap = winUserWrap;
 }
开发者ID:shaunstanislaus,项目名称:winappdriver,代码行数:7,代码来源:Window.cs


示例5: Initialize

 public static void Initialize(         
  IConsole console,
  ISurface surface,
  IStyle style,
  IDrawings drawing,
  IShapes shapes,
  IImages images,
  IControls controls,
  ISounds sounds,         
  IKeyboard keyboard,
  IMouse mouse,
  ITimer timer,
  IFlickr flickr,
  ISpeech speech,
  CancellationToken token)
 {
     TextWindow.Init(console);
      Desktop.Init(surface);
      GraphicsWindow.Init(style, surface, drawing, keyboard, mouse);
      Shapes.Init(shapes);
      ImageList.Init(images);
      Turtle.Init(surface, drawing, shapes);
      Controls.Init(controls);
      Sound.Init(sounds);
      Timer.Init(timer);
      Stack.Init();
      Flickr.Init(flickr);
      Speech.Init(speech);
      Program.Init(token);
 }
开发者ID:mrange,项目名称:funbasic,代码行数:30,代码来源:_Library.cs


示例6: SetUp

        public void SetUp()
        {
            _keyboard = Substitute.For<IKeyboard>();

            _keyboard.State.Returns(new KeyboardState());

            _keyboardHandler = new KeyboardHandler(_keyboard);
        }
开发者ID:DaveEmmerson,项目名称:SpaceWar2,代码行数:8,代码来源:KeyboardHandlerTests.cs


示例7: TcpKeyboardReceiver

        public TcpKeyboardReceiver(IKeyboard targetKeyboard, string host, int port)
        {
            this.targetKeyboard = targetKeyboard;

            client = new TcpClient();
            client.Connect(host, port);
            new Thread(Loop).Start();
        }
开发者ID:hediet,项目名称:Neo2Net,代码行数:8,代码来源:TcpKeyboard.cs


示例8: KeyChord

		public KeyChord(IKeyboard keyboard, IAppSettings settings)
		{
			_pressedKeys = new List<VirtualKeyCode>();
			_keyboard = keyboard;
			
			if(settings.Chord
			
		}
开发者ID:archnaut,项目名称:sandbox,代码行数:8,代码来源:KeyChord.cs


示例9: CPU

        public CPU(Memory memory, IDisplay display, IKeyboard keyboard)
        {
            this.memory = memory;
            this.display = display;
            this.keyboard = keyboard;
            this.DelayTimer = new SimpleTimer();
            this.SoundTimer = new SimpleTimer();

            this.RandomFunc = this.RandomGenerator;

            InstructionSet[0x0] = SYS;
            InstructionSet[0x1] = JP;
            InstructionSet[0x2] = CALL;
            InstructionSet[0x3] = SE;
            InstructionSet[0x4] = SNE;
            InstructionSet[0x5] = SEV;
            InstructionSet[0x6] = LD;
            InstructionSet[0x7] = ADD;
            InstructionSet[0x8] = REG;
            InstructionSet[0x9] = SNEV;
            InstructionSet[0xA] = LDI;
            InstructionSet[0xB] = JPV;
            InstructionSet[0xC] = RND;
            InstructionSet[0xD] = DRW;
            InstructionSet[0xE] = SKP;
            InstructionSet[0xF] = LDS;

            // used with REG
            RegisterCommands[0x0] = (x, y) => Register[x] = Register[y];
            RegisterCommands[0x1] = (x, y) => Register[x] |= Register[y];
            RegisterCommands[0x2] = (x, y) => Register[x] &= Register[y];
            RegisterCommands[0x3] = (x, y) => Register[x] ^= Register[y];
            RegisterCommands[0x4] = (x, y) =>
                {
                    Register[0xf] = (byte)((Register[x] + Register[y]) > 0xff ? 1 : 0);
                    Register[x] += Register[y];
                };
            RegisterCommands[0x5] = (x, y) =>
                                        {
                                            Register[0xf] = (byte) (Register[x] > Register[y] ? 1 : 0);
                                            Register[x] -= Register[y];
                                        };
            RegisterCommands[0x6] = (x, y) =>
                                        {
                                            Register[0xf] = (byte) (Register[x] & 0x1);
                                            Register[x] = (byte) (Register[x] >> 1);
                                        };
            RegisterCommands[0x7] = (x, y) =>
            {
                Register[0xf] = (byte)(Register[x] < Register[y] ? 1 : 0);
                Register[x] = (byte) (Register[y] - Register[x]);
            };
            RegisterCommands[0xe] = (x, y) =>
            {
                Register[0xf] = (byte)(Register[x] >> 7);
                Register[x] = (byte)(Register[x] << 1);
            };
        }
开发者ID:perfp,项目名称:Chip8,代码行数:58,代码来源:CPU.cs


示例10: KeyboardService

 public KeyboardService(ServiceMode mode, string host = null, int? port = null)
 {
     var sik = mode == ServiceMode.Sender ?
         (IKeyboard)new TcpKeyboard(host, port.Value) : new SendInputKeyboard();
     targetKeyboard = new Keyboard(sik, new SemanticKeyboard(sik));
     this.mode = mode;
     this.host = host;
     this.port = port;
 }
开发者ID:hediet,项目名称:Neo2Net,代码行数:9,代码来源:KeyboardService.cs


示例11: KeyboardBackup

        /// <summary>
        /// Ctor
        /// </summary>
        /// <param name="backedUpKeyboard">The <see cref="IKeyboard"/> that has been backedup</param>
        /// <param name="backedUpFilePath">Th elinked back up file path</param>
        public KeyboardBackup( IKeyboard backedUpKeyboard, string backedUpFilePath )
        {
            if( backedUpKeyboard == null ) throw new ArgumentNullException( "backedUpKeyboard", "The backed up keyboard can't be null in the ctor of a KeyboardBackup object" );
            if( !String.IsNullOrWhiteSpace( backedUpFilePath ) && !File.Exists( backedUpFilePath ) ) throw new ArgumentException( "backedUpFilePath", "The keyboard's backup file path must be either null (in the case of a new keyboard) or be an existing file." );

            Name = backedUpKeyboard.Name;
            BackedUpKeyboard = backedUpKeyboard;
            BackUpFilePath = backedUpFilePath;
        }
开发者ID:Invenietis,项目名称:ck-certified,代码行数:14,代码来源:KeyboardBackup.cs


示例12: UACPromptHandler

 public UACPromptHandler(IUIAutomation uiAutomation, IKeyboard keyboard)
 {
     this.uiAutomation = uiAutomation;
     this.keyboard = keyboard;
     this.threadLazy = null;
     this.stopped = false;
     this.alive = false;
     this.allowed = false;
 }
开发者ID:shaunstanislaus,项目名称:winappdriver,代码行数:9,代码来源:UACPromptHandler.cs


示例13: KeyboardEditionViewModel

        public KeyboardEditionViewModel( IKeyboardEditorRoot root, WizardManager wizardManager, IKeyboard editedKeyboard )
            : base(root, wizardManager, false)
        {
            Root.EditedContext = new VMContextEditable( root, editedKeyboard, Root.Config, root.SkinConfiguration );
            Next = new SavingStepViewModel( Root, WizardManager, EditedContext.KeyboardVM.Model );

            Title = String.Format( R.KeyboardEditionStepTitle, editedKeyboard.Name );
            Description = R.KeyboardEditionStepDesc;
        }
开发者ID:rit3k,项目名称:ck-certified,代码行数:9,代码来源:KeyboardEditionViewModel.cs


示例14: KeyboardCommandFactory

        public KeyboardCommandFactory(IGeneralRegisters generalRegisters, IKeyboard keyboard)
        {
            if (generalRegisters == null)
                throw new ArgumentNullException("generalRegisters");
            if (keyboard == null)
                throw new ArgumentNullException("keyboard");

            _generalRegisters = generalRegisters;
            _keyboard = keyboard;
        }
开发者ID:valmaev,项目名称:wonky-chip-8,代码行数:10,代码来源:KeyboardCommandFactory.cs


示例15: AppManager

        public AppManager(ConsoleSession debug, IKeyboard keyboard)
        {
            this.keyboard = keyboard;

            this.debug = debug;

            shell = new Shell();

            currentApp = shell;
        }
开发者ID:Profi-Concept,项目名称:MOSA-Project,代码行数:10,代码来源:AppManager.cs


示例16: SingleKeyAction

        /// <summary>
        /// Initializes a new instance of the <see cref="SingleKeyAction"/> class.
        /// </summary>
        /// <param name="keyboard">The <see cref="IKeyboard"/> to use in performing the action.</param>
        /// <param name="mouse">The <see cref="IMouse"/> to use in setting focus to the element on which to perform the action.</param>
        /// <param name="actionTarget">An <see cref="ILocatable"/> object providing the element on which to perform the action.</param>
        /// <param name="key">The modifier key (<see cref="Keys.Shift"/>, <see cref="Keys.Control"/>, <see cref="Keys.Alt"/>) to use in the action.</param>
        protected SingleKeyAction(IKeyboard keyboard, IMouse mouse, ILocatable actionTarget, string key)
            : base(keyboard, mouse, actionTarget)
        {
            if (!ModifierKeys.Contains(key))
            {
                throw new ArgumentException("key must be a modifier key (Keys.Shift, Keys.Control, or Keys.Alt)", "key");
            }

            this.key = key;
        }
开发者ID:RanchoLi,项目名称:selenium,代码行数:17,代码来源:SingleKeyAction.cs


示例17: Chip8Cpu

        public Chip8Cpu(IDisplay display, IRandomizer randomizer, IKeyboard keyboard, IBcdConverter bcdConverter, IInstructionDecoder instructionDecoder, ITimerClock timerClock)
        {
            _display = display;
            _randomizer = randomizer;
            _keyboard = keyboard;
            _bcdConverter = bcdConverter;
            _instructionDecoder = instructionDecoder;
            _timerClock = timerClock;

            State = new CpuState();
        }
开发者ID:ChrisJansson,项目名称:chip8,代码行数:11,代码来源:Chip8Cpu.cs


示例18: KeyboardProfileViewModel

        /// <summary>
        /// Ctor
        /// </summary>
        /// <param name="wizardManager">The wizard manager</param>
        /// <param name="model">The keyboard to create or modify</param>
        public KeyboardProfileViewModel( IKeyboardEditorRoot root, WizardManager wizardManager, IKeyboard model )
            : base(root, wizardManager, false)
        {
            _model = model;
            _viemModel = new SimpleKeyboardViewModel( model );

            _backupFileName = Root.BackupKeyboard( model );

            Title = R.KeyboardProfileTitle;
            Description = R.KeyboardProfileDesc;
        }
开发者ID:Invenietis,项目名称:ck-certified,代码行数:16,代码来源:KeyboardProfileViewModel.cs


示例19: SemanticKeyboard

        public SemanticKeyboard(IKeyboard targetKeyboard)
        {
            this.targetKeyboard = targetKeyboard;

            var defs = TymlSerializerHelper.DeserializeFromFile<KeyDefinitions>("Data/KeyDefinitions.tyml");

            foreach (var def in defs.Definitions)
                keyDefinitions[def.Name] = def;

            new Thread(UpdateLoop) { IsBackground = true }.Start();
        }
开发者ID:hediet,项目名称:Neo2Net,代码行数:11,代码来源:SemanticKeyboard.cs


示例20: KeyboardDrivenSkipNextOperationCommand

        public KeyboardDrivenSkipNextOperationCommand(int address, int operationCode, IGeneralRegisters generalRegisters,
            IKeyboard keyboard)
            : base(address, operationCode, generalRegisters)
        {
            if (FirstOperationCodeHalfByte != 0xE ||
                (SecondOperationCodeByte != 0x9E && SecondOperationCodeByte != 0xA1))
                throw new ArgumentOutOfRangeException("operationCode");
            if (keyboard == null)
                throw new ArgumentNullException("keyboard");

            _keyboard = keyboard;
        }
开发者ID:valmaev,项目名称:wonky-chip-8,代码行数:12,代码来源:KeyboardDrivenSkipNextOperationCommand.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# ILArray类代码示例发布时间:2022-05-24
下一篇:
C# IKey类代码示例发布时间: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