本文整理汇总了C#中KeyModifiers类的典型用法代码示例。如果您正苦于以下问题:C# KeyModifiers类的具体用法?C# KeyModifiers怎么用?C# KeyModifiers使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
KeyModifiers类属于命名空间,在下文中一共展示了KeyModifiers类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PencilKeyInfo
public PencilKeyInfo(Pencil.Gaming.Key key, int scancode, KeyAction action, KeyModifiers modifiers)
{
Key = key;
Scancode = scancode;
Action = action;
Modifiers = modifiers;
}
示例2: HotKeyEventArgs
public HotKeyEventArgs(IntPtr hotKeyParam, IntPtr wParam)
{
uint param = (uint)hotKeyParam.ToInt64();
Key = (Keys)((param & 0xffff0000) >> 16);
Modifiers = (KeyModifiers)(param & 0x0000ffff);
this.ID = (int)wParam;
}
示例3: RegisterHotkey
public int RegisterHotkey(Keys key, KeyModifiers keyflags)
{
UInt32 hotkeyid = Win32.GlobalAddAtom(System.Guid.NewGuid().ToString());
Win32.RegisterHotKey((IntPtr)hWnd, hotkeyid, (UInt32)keyflags, (UInt32)key);
keyIDs.Add(hotkeyid, hotkeyid);
return (int)hotkeyid;
}
示例4: RegisterHotKey
public void RegisterHotKey(KeyModifiers keyModifiers, uint key)
{
if(hotKeySet)
UnregisterHotKey();
hotKeySet = User32_RegisterHotKey(Handle, 100, keyModifiers, key);
}
示例5: KeyboardInput
/// <summary>
/// Initializes a new instance of the <see cref="FreezingArcher.Input.KeyboardInput"/> class.
/// </summary>
/// <param name="key">Key.</param>
/// <param name="scancode">Scancode.</param>
/// <param name="action">Action.</param>
/// <param name="modifier">Modifier.</param>
public KeyboardInput (Key key, int scancode, KeyAction action, KeyModifiers modifier)
{
Key = key;
Scancode = scancode;
Action = action;
Modifier = modifier;
}
示例6: RegisterHotKey
public static int RegisterHotKey(Keys key, KeyModifiers modifiers)
{
_windowReadyEvent.WaitOne();
int id = System.Threading.Interlocked.Increment(ref _id);
_wnd.Invoke(new RegisterHotKeyDelegate(RegisterHotKeyInternal), _hwnd, id, (uint)modifiers, (uint)key);
return id;
}
示例7: GlobalHotKey
public GlobalHotKey(KeyModifiers modifiers, Keys key)
{
if (!RegisterHotKey(this.Handle, ID, modifiers, key))
{
Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error());
}
}
示例8: AssertMapping
private void AssertMapping(KeyState keyState, string text, KeyModifiers modifiers = KeyModifiers.None)
{
VimKeyData vimKeyData;
Assert.True(_keyStateToVimKeyDataMap.TryGetValue(keyState, out vimKeyData));
Assert.Equal(text, vimKeyData.TextOptional);
Assert.Equal(modifiers, vimKeyData.KeyInputOptional.KeyModifiers);
}
示例9: VerifyConvert
private void VerifyConvert(VSConstants.VSStd2KCmdID cmd, KeyModifiers modifiers, KeyInput ki, EditCommandKind kind)
{
EditCommand command;
Assert.True(OleCommandUtil.TryConvert(VSConstants.VSStd2K, (uint)cmd, IntPtr.Zero, modifiers, out command));
Assert.Equal(ki, command.KeyInput);
Assert.Equal(kind, command.EditCommandKind);
}
示例10: HotKey
public HotKey(int id, KeyModifiers modifiers, Keys key, EventHandler<HotKeyEventArgs> genericHandler)
{
this.Id = id;
this.Modifiers = modifiers;
this.Keys = key;
this.Handler = null;
this.GenericHandler = genericHandler;
}
示例11: HotKey
public HotKey(int _keyID, Keys _key, KeyModifiers _modifier, EventHandler hotKeyPressed)
{
keyID = _keyID;
HotKeyPressed = hotKeyPressed;
key = _key;
modifier = _modifier;
Start();
}
示例12: RegisterHotKey
public static extern bool RegisterHotKey(
IntPtr hWnd,
int id,
KeyModifiers fsModifiers,
Keys vk
);
示例13: RegisterHotKey
public static extern bool RegisterHotKey(
//要定义热键的窗口的句柄
IntPtr hWnd,
//定义热键ID(不能与其它ID重复)
int id,
//标识热键是否在按Alt、Ctrl、Shift、Windows等键时才会生效
KeyModifiers fsModifiers,
//定义热键的内容
Keys vk
);
示例14: CreateKeyInput
internal static KeyInput CreateKeyInput(
VimKey key = VimKey.NotWellKnown,
KeyModifiers mod = KeyModifiers.None,
char? c = null)
{
return new KeyInput(
key,
mod,
c.HasValue ? FSharpOption<char>.Some(c.Value) : FSharpOption<char>.None);
}
示例15: Hotkey
public Hotkey(IntPtr handle, int id, KeyModifiers modifiers, Keys key)
{
if (key == Keys.None || modifiers == KeyModifiers.None) throw new Exception();
Handle = handle;
ID = id;
Modifiers = modifiers;
Key = key;
RegisterHotKey();
Application.AddMessageFilter(this);
}