本文整理汇总了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);
}
示例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();
}
示例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;
}
示例4: Window
public Window(IntPtr handle, IUIAutomation uiAutomation, IKeyboard keyboard, IWinUserWrap winUserWrap)
{
this.Handle = handle;
this.uiAutomation = uiAutomation;
this.keyboard = keyboard;
this.winUserWrap = winUserWrap;
}
示例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);
}
示例6: SetUp
public void SetUp()
{
_keyboard = Substitute.For<IKeyboard>();
_keyboard.State.Returns(new KeyboardState());
_keyboardHandler = new KeyboardHandler(_keyboard);
}
示例7: TcpKeyboardReceiver
public TcpKeyboardReceiver(IKeyboard targetKeyboard, string host, int port)
{
this.targetKeyboard = targetKeyboard;
client = new TcpClient();
client.Connect(host, port);
new Thread(Loop).Start();
}
示例8: KeyChord
public KeyChord(IKeyboard keyboard, IAppSettings settings)
{
_pressedKeys = new List<VirtualKeyCode>();
_keyboard = keyboard;
if(settings.Chord
}
示例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);
};
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例15: AppManager
public AppManager(ConsoleSession debug, IKeyboard keyboard)
{
this.keyboard = keyboard;
this.debug = debug;
shell = new Shell();
currentApp = shell;
}