本文整理汇总了C#中KeyModifiers类的典型用法代码示例。如果您正苦于以下问题:C# KeyModifiers类的具体用法?C# KeyModifiers怎么用?C# KeyModifiers使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
KeyModifiers类属于命名空间,在下文中一共展示了KeyModifiers类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: PencilKeyInfo
public PencilKeyInfo(Pencil.Gaming.Key key, int scancode, KeyAction action, KeyModifiers modifiers)
{
Key = key;
Scancode = scancode;
Action = action;
Modifiers = modifiers;
}
开发者ID:prepare,项目名称:three.net,代码行数:7,代码来源:PencilGamingWindows.cs
示例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;
}
开发者ID:freshprogrammer,项目名称:FreshTools,代码行数:7,代码来源:HotKeyManager.cs
示例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;
}
开发者ID:Tricoro,项目名称:OSUplayer,代码行数:7,代码来源:Win32.cs
示例4: RegisterHotKey
public void RegisterHotKey(KeyModifiers keyModifiers, uint key)
{
if(hotKeySet)
UnregisterHotKey();
hotKeySet = User32_RegisterHotKey(Handle, 100, keyModifiers, key);
}
开发者ID:atroxaper,项目名称:pushtotalk,代码行数:7,代码来源:hotkeyform.cs
示例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;
}
开发者ID:AreonDev,项目名称:NoWayOut,代码行数:14,代码来源:KeyboardInput.cs
示例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;
}
开发者ID:mikhailshilkov,项目名称:FsPokerLogic,代码行数:7,代码来源:HotkeyManager.cs
示例7: GlobalHotKey
public GlobalHotKey(KeyModifiers modifiers, Keys key)
{
if (!RegisterHotKey(this.Handle, ID, modifiers, key))
{
Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error());
}
}
开发者ID:DeCarabas,项目名称:pwlet,代码行数:7,代码来源:GlobalHotkey.cs
示例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);
}
开发者ID:kcprogrammer,项目名称:VsVim,代码行数:7,代码来源:KeyboardMapBuilderTest.cs
示例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);
}
开发者ID:aesire,项目名称:VsVim,代码行数:7,代码来源:OleCommandUtilTest.cs
示例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;
}
开发者ID:freshprogrammer,项目名称:FreshTools,代码行数:8,代码来源:HotKeyManager.cs
示例11: HotKey
public HotKey(int _keyID, Keys _key, KeyModifiers _modifier, EventHandler hotKeyPressed)
{
keyID = _keyID;
HotKeyPressed = hotKeyPressed;
key = _key;
modifier = _modifier;
Start();
}
开发者ID:TargetProcess,项目名称:Tp.TrayUtility,代码行数:8,代码来源:HotKey.cs
示例12: RegisterHotKey
public static extern bool RegisterHotKey(
IntPtr hWnd,
int id,
KeyModifiers fsModifiers,
Keys vk
);
开发者ID:NitroXenon,项目名称:LoLSpectX,代码行数:9,代码来源:Function.cs
示例13: RegisterHotKey
public static extern bool RegisterHotKey(
//要定义热键的窗口的句柄
IntPtr hWnd,
//定义热键ID(不能与其它ID重复)
int id,
//标识热键是否在按Alt、Ctrl、Shift、Windows等键时才会生效
KeyModifiers fsModifiers,
//定义热键的内容
Keys vk
);
开发者ID:eyuan,项目名称:CommentGenerator,代码行数:10,代码来源:HotKey.cs
示例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);
}
开发者ID:otf,项目名称:VsVim,代码行数:10,代码来源:VimUtil.cs
示例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);
}
开发者ID:stoicshark,项目名称:silkyshark,代码行数:11,代码来源:Hotkey.cs
示例16: RegisterHotKey
/// <summary>
/// Registers a hot key in the system.
/// </summary>
/// <param name="modifier">The modifiers that are associated with the hot key.</param>
/// <param name="key">The key itself that is associated with the hot key.</param>
/// <returns>Hot key ID</returns>
public int RegisterHotKey(KeyModifiers modifier, Keys key)
{
// increment the counter.
currentId = currentId + 1;
// register the hot key.
if (!RegisterHotKey(window.Handle, currentId, (uint)modifier, (uint)key))
{
throw new InvalidOperationException("Couldn’t register the hot key.");
}
return currentId;
}
开发者ID:forrest79,项目名称:hotkey79,代码行数:19,代码来源:KeyboardHook.cs
示例17: TryConvert
internal static bool TryConvert(Guid commandGroup, uint commandId, IntPtr pVariableIn, KeyModifiers modifiers, out EditCommand command)
{
KeyInput keyInput;
EditCommandKind kind;
if (!TryConvert(commandGroup, commandId, pVariableIn, out keyInput, out kind))
{
command = null;
return false;
}
keyInput = KeyInputUtil.ApplyModifiers(keyInput, modifiers);
command = new EditCommand(keyInput, kind, commandGroup, commandId);
return true;
}
开发者ID:rschatz,项目名称:VsVim,代码行数:14,代码来源:OleCommandUtil.cs
示例18: HotKey
/// Initializes a new instance of the <see cref="HotKey"/> by specific name, modifiers, and key.
/// <param name="name">A <see cref="string"/> to identify the system hot key.</param>
/// <param name="modifiers">Modify keys (Shift, Ctrl, Alt, and/or Windows Logo key).</param>
/// <param name="key">Key code.</param>
public HotKey(string name, KeyModifiers modifiers, Keys key)
{
if (name == null)
{
throw new ArgumentNullException("name");
}
if (key == Keys.None)
{
throw new ArgumentException("key cannot be Keys.None. Must specify a key for the hot key.", "key");
}
_name = name;
_modifiers = modifiers;
_key = key;
}
开发者ID:OccupyApollo,项目名称:Apollo,代码行数:20,代码来源:SystemHotkeyLib.cs
示例19: OnKeyDown
// TODO: UnsubscribeListener()
//
private void OnKeyDown(object sender, KeyboardKeyEventArgs keyboardKeyEventArgs)
{
List<KeyListener> listeners;
//KeyModifiers mods = keyboardKeyEventArgs.Modifiers; // note that this always returns 0, probably a bug in openTK
KeyModifiers mods = new KeyModifiers();
mods = mods | (keyboard[Key.AltLeft] || keyboard[Key.AltRight] ? KeyModifiers.Alt : 0);
mods = mods | (keyboard[Key.ShiftLeft] || keyboard[Key.ShiftRight] ? KeyModifiers.Shift : 0);
mods = mods | (keyboard[Key.ControlLeft] || keyboard[Key.ControlRight] ? KeyModifiers.Control : 0);
Listeners.TryGetValue(keyboardKeyEventArgs.Key, out listeners);
if (listeners != null)
{
for (int i = 0; i < listeners.Count; i++)
{
listeners[i](mods);
}
}
}
开发者ID:Killnetic,项目名称:OpenTK_Base_GL,代码行数:19,代码来源:Keybinder.cs
示例20: HotKeyRegister
public HotKeyRegister(IntPtr handle, int id, KeyModifiers modifiers, Keys key)
{
if (key == Keys.None || modifiers == KeyModifiers.None)
{
throw new ArgumentException("键或者编辑器不能为空。");
}
this.Handle = handle;
this.ID = id;
this.Modifiers = modifiers;
this.Key = key;
RegisterHotKey();
// 添加一个消息过滤器来监督窗体信息,因为它们是由目标选择路径的。
Application.AddMessageFilter(this);
}
开发者ID:zealoussnow,项目名称:OneCode,代码行数:18,代码来源:HotKeyRegister.cs
注:本文中的KeyModifiers类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论