hotkeys

Disabling hotkeys in firefox addon

醉酒当歌 提交于 2019-12-11 04:28:06
问题 Is there a way to disable keyboard shortcuts (hotkeys) in a firefox add-on? 回答1: If your addon has an overlay for browser.xul, an alternative to handling the "keypress" event is to use script in the "load" handler to remove the relevant elements from the browser XUL document like this: var key = document.getElementById("key_openDownloads"); key.parentNode.removeChild(key); In case it's not obvious, this removes the hotkey for opening the download manager. You can see all the keys here: http:/

how to toggle keyboard mapping in AutoHotKey

北城余情 提交于 2019-12-11 03:12:35
问题 I would like to map part of my keyboard as a number pad:(my laptop keyboard has no number pad) j->1 k->2 l->3 u->4 i->5 o->6 I would like to toggle the mapping with a short cut, let's say Control + Alt + M , my code is below, however, I don't know how to reset the mapping: mode = 0 ^!m:: if (mode = 1) { mode = 0 j->1 k->2 l->3 u->4 i->5 o->6 } else { mode = 1 u::u ;got error here: duplicate hotkey } return I got duplicate hotkey error with u::u , seems AHK does not allow mapping more than one

Change mouse pointer speed in Windows using python

我与影子孤独终老i 提交于 2019-12-11 00:27:16
问题 I'm using a Windows10 system. I have a Tkinter canvas which has an image drawn on it. Is there any way to slow down mouse pointer speed when it is hovering over the canvas? I've checked out this link and this link but the answer seems unstable.. To be more specific, is it possible to slow down mouse pointer speed in plain Python/Tkinter? 回答1: On windows system you can use native SystemParametersInfo to change speed of the mouse pointer. It's possible to implement via ctype, which is part of

ProcessCmdKey analog in WPF

泄露秘密 提交于 2019-12-10 18:38:34
问题 I'm new to WPF and in WinForms to add hotkeys to the form I've usually used ProcessCmdKey that made easy to override(add) key related functionality (similar to the way described here). Is there an easy way to assign hotkeys in WPF? I'm using Commands with keys, but sometimes that doesn't work (I think some other controls on window respond to that gestures and do their jobs, so that my command can't respond to predefined key gesture). 回答1: InputBindings are scoped with the control they are

Proper way to select previous and next row using a hotkey via DataGridView

*爱你&永不变心* 提交于 2019-12-10 18:09:02
问题 Somewhat new to .NET 4.0 C# development and have a quick question. I am working on a basic windows form application where I am using a DataGridView to view data stored in an Access Database. I would like to use ALT+N to select the next row down and ALT+P to select the next row up (wrapping if possible or maybe just not move at all if already at top of row list or bottom). I have done a fair amount of looking into this via the internet and I am just not seeing how I can accomplish this, and I

Will this hotkey work for Mac users?

☆樱花仙子☆ 提交于 2019-12-10 12:35:34
问题 I'm using the following code to catch when people press Ctrl + Shift + P for my chrome extension: window.addEventListener("keydown", function(event) { var modifier = event.ctrlKey || event.metaKey; if (modifier && event.shiftKey && event.keyCode == 80) { //code goes here } }); I'm hoping the var modifier = event.ctrlKey || event.metaKey; line means it will catch when Mac users press Cmd-Shift-P but have no Mac computer to test this on. Is it so? Will my hotkey work for Mac users? Also, what

WPF Accelerator Keys like Visual Studio

拟墨画扇 提交于 2019-12-10 10:35:11
问题 I'm developing a large line of business app with C# and WPF. Our standard is to include accelerator keys for buttons on all forms (Save, Cancel, Search, etc.). I've recently noticed that when a form is loaded, the accelerator key is active even when the user does not press the "Alt" key. For example, our Search button uses "Alt-H" as the accelerator, but the user can initiate a search by simply pressing "H". I'm using the standard "_" in the button content to create the accelerator key.

How do you register a custom Win+V hotkey on Windows 8?

与世无争的帅哥 提交于 2019-12-10 10:29:02
问题 It was possible to register the Win+V hotkey on versions of Windows prior to Windows 8. An example application using this combination is PureText. With the Windows 8 Release Preview I've noticed that Windows 8 has taken control of a lot of hotkeys involving Windows key, but Win+V doesn't appear to be used. The following code will allow me to register a hotkey for Win+CTRL+V: #include <Windows.h> int _tmain(int argc, _TCHAR* argv[]) { if (RegisterHotKey( NULL, 1, MOD_WIN | MOD_NOREPEAT | MOD

Adding an F5 Hotkey in C#

冷暖自知 提交于 2019-12-08 17:13:15
问题 I'm making a windows app (WinForms) and would like my application to call a method when the user presses F5 - this should work no matter what the user is doing but they must be using the program - I don't want to use global hooks - any ideas? 回答1: Override the form's ProcessCmdKey on your main form and look for F5. protected override bool ProcessCmdKey (ref Message msg, Keys keyData) { bool bHandled = false; // switch case is the easy way, a hash or map would be better, // but more work to

Acessing C# code in Powershell

允我心安 提交于 2019-12-08 13:25:12
问题 I want to use a system wide hotkey in my powershell GUI application. I found this C# code for registering a hotkey and integrated it in my script. The trouble is, because I can't fully understand the C# code, I don't know how to properly add the parameters for the registerhotkey method. The goal is: on key press SHIFT + ALT + Z execute the code in $hotkeyExecCode . [void][System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") [System.Windows.Forms.Application]: