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


C# IKeyboard类代码示例

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


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


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