hotkeys

How to create a global hotkey on Windows with 3 arguments?

£可爱£侵袭症+ 提交于 2019-11-28 10:33:15
Just like Ctl, Alt + delete I want to write a program, which uses global hotkeys with 3 or more arguments in python. The assigned function should only perform when I press all three keys on my keyboard. For example alt, windows and F3. win32con.VK_F3, win32con.MOD_WIN, win32con.VK_F5 This is the current program I want to run, however its output is: Traceback (most recent call last): File "C:\Python32\Syntax\hot keys\hotkeys2.py", line 41, in <module> for id, (vk, modifiers) in HOTKEYS.items (): ValueError: too many values to unpack (expected 2) The Program: import os import sys import ctypes

Global Keyboard Hooks (C#) [duplicate]

柔情痞子 提交于 2019-11-28 10:23:49
Possible Duplicate: Global keyboard capture in C# application Can anyone help me setup a global keyboard hook for my application? I want to set hotkeys (such as Ctrl + S ) that can be used when not focused on the actual form. Paul's post links to two answers, one telling you how to implement a hook, and another telling you to call RegisterHotKey. You shouldn't need to install a hook for something as simple as a Ctrl+S hotkey, so call RegisterHotKey instead. Or you can use C#'s MessageFilter. It should work while any control/form from your application's process has focus. Sample Code: class

Hotkey (not global) in Windows Forms .NET

大憨熊 提交于 2019-11-28 09:58:53
In my Windows Forms application I would like one special button to run a test everytime I press it. There are dozens of controls so implementing it in each one takes too much time. Is there a way I can set a hotkey so, no matter what I am doing in the application, I can press the key, and it will fire off my event? You can override ProcessCmdKey and handle your hotkeys there, either in a control or a form. From MSDN : The ProcessCmdKey method first determines whether the control has a ContextMenu, and if so, enables the ContextMenu to process the command key. If the command key is not a menu

Detecting Ctrl+V with RegisterHotKey but not intercepting it

牧云@^-^@ 提交于 2019-11-28 09:18:20
I need to detect when a user presses Ctrl + V (regardless of window focus - my app will likely be minimised) but I must not stop the actual paste operation. I have tried a few things: (I am successfully binding to keystrokes with RegisterHotKey) I have: protected override void WndProc(ref Message m) { if (m.Msg == 0x312) hotKey(); base.WndProc(ref m); } and I've tried the following: void hotKey() { SendKeys.SendWait("^v"); //just puts 'v' instead of clipboard contents } and void hotKey() { SendKeys.SendWait(ClipBoard.GetText()); /* This works, but since Ctrl is still down, it triggers * all

multi key gesture in wpf

元气小坏坏 提交于 2019-11-28 08:57:18
问题 I have a RoutedUICommand called Comment Selection . I need to add an input gesture for this command as it is in VIsual Studio, ie. ( Ctrl+K , Ctrl+C ). How can I do this? Plz help me. (Keep VS functionality in mind). Regards, Jawahar 回答1: This code is made for "Ctrl+W, Ctrl+E" and/or "Ctrl+W, E" combinations, however you can parametrize it for any key combinations: XAML: <MenuItem Header="Header" InputGestureText="Ctrl+W, E" Command="ShowCommand"/> C#: public static readonly RoutedUICommand

AngularJS ng-keydown directive only working for <input> context?

蓝咒 提交于 2019-11-28 08:01:46
I am pretty new to AngularJS but found it quite to my liking so far. For my current project I need hotkey functionality and was happy to see that it is supported since the 1.1.2 release. The ng-keydown directive ( http://code.angularjs.org/1.1.3/docs/api/ng.directive:ngKeydown ) works as expected for input types but fails me for any other context like div etc. which seems odd given that the documentation says otherwise. Here is an minimal example ( http://jsfiddle.net/TdXWW/12/ ) of the working respectively the not working: <input ng-keydown="keypress($event)"> <div ng-keydown="keypress($event

How to disable facebook hotkeys with Chrome extension?

試著忘記壹切 提交于 2019-11-28 06:38:52
I have created a Chrome extension that uses the hotkeys [Alt]+[0...9] only to discover facebook uses the same hotkeys. Is there any way possible my extension could disable facebook's hotkeys so that mine fire alone? I'm fairly certain I have identified the code facebook uses to implement their [Alt]+[0...9] hotkeys: document.documentElement.onkeydown=function(a){a=a||window.event;var b=a.target||a.srcElement;var c=a.keyCode==13&&!a.altKey&&!a.ctrlKey&&!a.metaKey&&!a.shiftKey&&CSS.hasClass... This is in a script called from the head of the root document. I have tried the following to disable

Copy and Modify selected text in different application

牧云@^-^@ 提交于 2019-11-28 06:35:18
I have a windows application running at the backend. I have functions in this applications mapped to hot keys. Like if I put a message box into this function and give hot key as Alt + Ctrl + D . then on pressing Alt , Ctrl and D together the message box comes up. My application is working fine till this point. Now I want to write a code inside this function so that when I am using another application like notepad, I select a particular line of text and press the hot key Alt + Ctrl + D it is supposed to copy the selected text append it with "_copied" and paste it back to notepad. Anyone who has

Visual Studio: hotkeys to move line up/down and move through recent changes

佐手、 提交于 2019-11-28 03:06:27
I'm moving from Eclipse to Visual Studio .NET and have found all my beloved hotkeys except two: in Eclipse you can press ALT - ← and ALT - → to visit recent changes you have made, something I use frequently to go back to where I was in some other file and then return. Apparently in VS.NET the CTRL - - and CTRL - SHIFT - - do this but they don't seem to always work (e.g. on laptop, may be a numkey issue with the minus) and don't seem to follow the same algorithm of "where I was" as I am used to in Eclipse. Has anyone gotten this to work and rely on it daily, etc.? in Eclipse, to move a line up

How to comment a block in Eclipse?

被刻印的时光 ゝ 提交于 2019-11-28 02:49:21
Does Eclipse have a hot key to comment a block? and to uncomment a block? Jon Skeet Ctrl - / to toggle "//" comments and Ctrl - Shift - / to toggle "/* */" comments. At least for Java, anyway - other tooling may have different shortcuts. Ctrl - \ will remove a block of either comment, but won't add comments. Note: As for Eclipse CDT 4.4.2, Ctrl - Shift - / will not uncomment a "/* */" block comment. Use Ctrl - Shift - \ in that case. EDIT: It's Ctrl on a PC, but on a Mac the shortcuts may all be Cmd instead. I don't have a Mac myself, so can't easily check. Ikke There are two possibilities: