Tag: hotkeys

RegisterHotkey Fn修饰符?

我知道你可以为RegisterHotKey使用CTRL , ALT , SHIFT等修饰符,但是Fn键怎么样? 我以前在我的笔记本电脑上有一些膨胀软件,当按下Fn + Up / Down时会改变亮度。 我删除了所有的英国媒体报道,我想编写一个同样的程序。 任何帮助表示赞赏!

MVVM中的Silverlight热键命令?

我正在尝试基于Silverlight中的击键来触发命令。 据我了解,您无法在Silverlight中使用AccessKey或AcceleratorKey。 它看起来可能是有用的附加属性InputBindings也不起作用。 我开始在其他地方寻找。 看起来Prism是让Silverlight中的命令工作的方式,所以我检查了一下。 但是它们只有一个Click处理程序,它甚至不是设置关键命令的有用起点。 我只是错过了Prism的某些部分吗? 或者有一个很好的标准方法来处理MVVM Silverlight的热键?

如何在Visual Studio中更快地键入“{0}”?

在C#中,在使用string.Format()或Console.WriteLine()格式化字符串时,必须键入{0} , {1}等。 考虑到它的频率,它是一组尴尬的击键。 但是,尽管我进行了搜索,但我找不到任何类型的速记或热键来自动将其插入Visual Studio中。 有没有人想出一些方法来加快这个过程?

在.NET中注册热键 – 三/四键的组合

我被困。 现在,我使用以下代码来收听热键: [DllImport(“user32.dll”)] public static extern bool RegisterHotKey(IntPtr hWnd, int id, int fsModifiers, int vlc); [DllImport(“user32.dll”)] public static extern bool UnregisterHotKey(IntPtr hWnd, int id); protected override void WndProc(ref Message m) { if (m.Msg == 0x0312) { // whatever i need } base.WndProc(ref m); } 和这个注册热键的function: Form1.RegisterHotKey(this.Handle, this.GetType().GetHashCode(), 0, (int)chr); 它完美地运作。 我的问题是如何将多个热键注册为相同的组合,例如: A + B + […]

使用RegisterHotKey注册多个热键

我找到了这段代码来注册一个热键: [DllImport(“user32.dll”)] public static extern bool RegisterHotKey(IntPtr hWnd, int id, int fsModifiers, int vlc); protected override void WndProc(ref Message m) { if (m.Msg == 0x0312) MessageBox.Show(“Hotkey pressed”); base.WndProc(ref m); } public FormMain() { InitializeComponent(); //Alt + A RegisterHotKey(this.Handle, this.GetType().GetHashCode(), 1, (int)’A’); } 它工作得很好,但我的问题是我想使用两个不同的快捷方式。 我知道第二个参数是id,所以我想我可以创建一个不同的id并在WndProc函数中添加一个新的if语句,但我不知道我会怎么做。 简而言之,我将如何创建第二个快捷方式? 谢谢,

使用RegisterHotKey检测Ctrl + V但不截取它

我需要检测用户何时按下Ctrl + V (无论窗口焦点如何 – 我的应用程序可能会被最小化)但我不能停止实际的粘贴操作。 我尝试了一些事情:(我成功绑定了RegisterHotKey的键击) 我有: protected override void WndProc(ref Message m) { if (m.Msg == 0x312) hotKey(); base.WndProc(ref m); } 我尝试过以下方法: void hotKey() { SendKeys.SendWait(“^v”); //just puts ‘v’ instead of clipboard contents } 和 void hotKey() { SendKeys.SendWait(ClipBoard.GetText()); /* This works, but since Ctrl is still down, it triggers * all the […]