hotkeys

Setting Mnemonics and Hot Keys for a JOptionPane Dialog

核能气质少年 提交于 2019-12-05 11:49:35
Is it possible to assign hotkeys and mnemonics to the buttons in a JOptionPane Dialog? I'd like to be able, in a JOptionPane generated message dialog with the options Yes, No and Cancel, press Y to hit the Yes button, N to hit the No button and escape to activate the escape button. Similarly in a dialog with Okay and Cancel buttons I'd like to be able to activate them with enter and escape. I've attempted passing JButtons into the JOptionPane's button Object array with the Mnemonics set already. The mnemonics work and the buttons show up correctly in the dialogs, however, they do not act

How to detect when a hotkey (shortcut key) is pressed

你。 提交于 2019-12-05 10:39:55
How do I detect when a shortcut key such as Ctrl + O is pressed in a WPF (independently of any particular control)? I tried capturing KeyDown but the KeyEventArgs doesn't tell me whether or not Control or Alt is down. private void Window_KeyDown(object sender, KeyEventArgs e) { if (e.KeyboardDevice.Modifiers == ModifierKeys.Control) { // CTRL is down. } } I finally figured out how to do this with Commands in XAML. Unfortunately if you want to use a custom command name (not one of the predefined commands like ApplicationCommands.Open) it is necessary to define it in the codebehind, something

Using a hotkey to submit an HTML form?

白昼怎懂夜的黑 提交于 2019-12-05 06:42:46
I have a very simple HTML form, only containing a submit button and a textarea. Is there an easy way to use a hotkey to submit this form, as an alternative to pressing the button? Thanks in advance :-) Submit buttons can have accesskeys , but there are drawbacks . Users would probably be better off just hitting the tab key to focus the submit button, and then pressing enter. you can use the "keyDown", "keyPress" events if you use a JS library (JQUERY or MOOTOOLS).. you can program your own Ctrl+S to submit. On JQuery see this http://api.jquery.com/keypress/ On Mootools see this http:/

Is there a way to capture HotKeys/Shortcuts in Excel VSTO using only C# and no VBA?

删除回忆录丶 提交于 2019-12-05 04:37:07
So I want to capture some key-commands in our Docuement-level Excel VSTO addin. I can't seem to find a way to do it, other than to use VBA and have our addin talk to the VBA. Any help/examples would be greatly appreciated. I am using Excel 2007. You can only do this through API calls to subclass Excel and watch for key commands. This is older, but it still applies. Anonymous Type One method involves using the 3rd party solution from Addin-Express . Their product includes the ability to add a keyboard shortcut as a property to the ribbon menu commands. The other way is to make use of low level

THotkey with win-key support?

匆匆过客 提交于 2019-12-05 03:41:22
问题 Is there anyway to get the THotkey component in delphi to support the windows key? Or does anyone know of a component that can do this? Thanks heaps! 回答1: THotKey doesn't support the Win-Key. I would add a check box next to it maybe for the Win-Key modifier. 回答2: IMHO it is a good thing THotKey does not support this. Don't use the windows key for keyboard shortcuts in your program, the "Windows Vista User Experience Guidelines" says the following under Guidelines - Interaction - Keyboard: Don

hook a hotkey from windows logon screen

瘦欲@ 提交于 2019-12-05 02:01:42
问题 i built a program that hooks the keyboard and when some hotkey pressed it openning the door (that connected to the COM1 serial port of the computer). this works fine, until i locking the computer (winkey+L). i want to be able to open the door with the same hotkey from the logon screen. i using Windows XP & C#. how do i do that? thanks. 回答1: You need to write a Windows service that does this. Services and drivers can run outside of user logins, and services are a lot easier to write than

Visual Studio find out what command is assigned to an hotkey

不想你离开。 提交于 2019-12-05 01:14:55
I've installed a VisualStudio plugin that redefines some hotkeys, I need to come back to the standard hotkeys of Visual Studio for some of them. I know that under Tools->Options->Environment->Keyboard I can redefine the hotkeys, and I did it. The problem is that now it seems that my hotkey Ctrl-E, C has two command associated, the plugin one and the standard one. When I press that combination visual studio runs the plugin command and not the standard one. The problem is that I don't know the plugin-command name so I can't deassociate it unless I go through all the command to see the associated

What is the hotkey to jump between split windows in Visual Studio 2008

余生长醉 提交于 2019-12-04 23:39:25
I've split the code window for a long css file into two sections, top half for viewing one area of code, bottom area for viewing another area of the code. I did this by dragging the splitter on the top right of the code editor to the middle of the editing area. What is the keystroke command that makes the cursor jump from the lower window to the upper window and vice versa? I believe the hotkey is the same as sql server. The F6 key moves between window splits in the default keymap. You can find and customize all keyboard shortcuts in Visual Studio in the Keyboard Command options. If you go

NSEvent addGlobalMonitorForEventsMatchingMask: Hotkey Intercepting

烈酒焚心 提交于 2019-12-04 18:02:42
I wanna intercept hotkeys that begin with Control + Shift and ends with a character (mandatory). I have the following code: [NSEvent addGlobalMonitorForEventsMatchingMask:NSFlagsChangedMask handler: ^(NSEvent *event) { NSUInteger flags = [event modifierFlags] & NSDeviceIndependentModifierFlagsMask; if(flags == NSControlKeyMask + NSShiftKeyMask){ NSLog(@"pressed!"); } }]; What do i need to add to my code to check if the user pressed Control Shift +character, and what character the user pressed? The code NSLog(@"pressed!"); will be executed only if what i said above is true. This is my pseudo

Add application launch shortcut in Eclipse?

对着背影说爱祢 提交于 2019-12-04 09:03:18
问题 I've been programming Android in Eclipse for about a year now and I have always launched my app by right clicking on my project name in the project explorer, followed by "run as", then "Android Application". There has to be a better way... Is there a way to change this (three mouse clicks): "Right click on project" -> "run as" -> "Android Application" To this (one hotkey press): <My favorite hotkey> So I can just press one button to launch my app? Thanks! 回答1: In preferences, go to General ->