hotkeys

How to select item by typing a keyboard letter key in WPF combobox?

℡╲_俬逩灬. 提交于 2019-11-29 09:11:39
I have a WPF ComboBox and I want to go to items that start with (for example) "e" in the ComboBox when I type that letter. How? My XAML code: <ComboBox ItemsSource="{Binding Roles}" SelectedValuePath="Id" ItemTemplate="{StaticResource ComboBoxDisplayName}" SelectedItem="{Binding SelectedRole}" Width="150"/> MoominTroll EDIT: I'm guessing you have an ItemTemplate that looks a little like this: <StackPanel> <TextBlock Text="{Binding Path=Foo}" /> <TextBlock Text="{Binding Path=Bar}" /> </StackPanel> If you want to search on Foo, then try... <ComboBox IsEditable = "True" TextSearch.TextPath =

ProcessCmdKey - wait for KeyUp?

岁酱吖の 提交于 2019-11-29 07:25:37
I'm having the following issue in a WinForms app. I'm trying to implement Hotkeys and I need to process Key messages whenever the control is active, no matter if the focus is on a textbox within that control, etc. Overriding ProcessCmdKey works beautifully for this and does exactly what I want with one exception: If a user presses a key and keeps it pressed, ProcessCmdKey keeps triggering WM_KEYDOWN events. However, what I want to achieve is that the user has to release the button again before another hotkey action would trigger (so, if someone sits on the keyboard it would not cause

Automatic namespaces import

浪子不回头ぞ 提交于 2019-11-28 20:43:57
问题 Is there a way in Visual Studio (a hotkey) to automatically import a type (or choosing between known namespaces) like the Ctrl + O in Eclipse? 回答1: When the red caret appears at the end of your member, just hit Shift + Alt + F10 , then use arrows keys to choose the right option: 回答2: Yes, Visual Studio can add the using for you. When you type in a class name, hit Ctrl + . and then Enter (the first option is 99.99% the right one, so just hit Enter ). And you can have it add the using at the

Cocoa NSStatusBar Global HotKey

流过昼夜 提交于 2019-11-28 17:59:38
I have created an NSStatusBar cocoa application which sits in the system status bar. I want to assign a hotkey so that when pressed it toggles my applications and show the menu. Is this possible?, In my searching and experimenting I have found a few different ways of assigning global hot keys that can be pressed when your application is in the background but I can't find any way to problematically make the menu show. Is this possible?, If anyone thinks a way of assigning a global hotkey is best please post it. Thanks. One of the hotkey tutorials I found was on http://dbachrach.com/blog/2005/11

Ctrl+Enter jQuery in TEXTAREA

邮差的信 提交于 2019-11-28 15:51:30
How do I trigger something when the cursor is within TEXTAREA and Ctrl + Enter is pressed? Using jQuery . Thanks You can use the event.ctrlKey flag to see if the Ctrl key is pressed, something like this: $('#textareaId').keydown(function (e) { if (e.ctrlKey && e.keyCode == 13) { // Ctrl-Enter pressed } }); Check the above snippet here . Yaroslav Yakovlev Actually this one does the trick and works in all browsers: if ((event.keyCode == 10 || event.keyCode == 13) && event.ctrlKey) link to js fiddle Universal solution Supports OS X as well. if ((e.ctrlKey || e.metaKey) && (e.keyCode == 13 || e

How do I hotkey directly to File Search tab in Eclipse

回眸只為那壹抹淺笑 提交于 2019-11-28 15:34:56
问题 When I use CTRL + H I end up on the Java Search tab. I would very much like a shortcut to go directly to File Search instead. Is that possible? See image here for what I'm talking about: 回答1: You can just define a key binding that opens the file search: Go to Preferences > General > Keys Type "file search" in the search box. (If there are no results, and you have a really old Eclipse version, select the Include Unbound Commands check box.) Put the caret into the Binding text box and press the

Find out what process registered a global hotkey? (Windows API)

拥有回忆 提交于 2019-11-28 15:08:47
As far as I've been able to find out, Windows doesn't offer an API function to tell what application has registered a global hotkey (via RegisterHotkey). I can only find out that a hotkey is registered if RegisterHotkey returns false, but not who "owns" the hotkey. In the absence of a direct API, could there be a roundabout way? Windows maintains the handle associated with each registred hotkey - it's a little maddening that there should be no way of getting at this information. Example of something that likely wouldn't work: send (simulate) a registered hotkey, then intercept the hotkey

How to disable/override Windows 10 Hotkeys with C#

杀马特。学长 韩版系。学妹 提交于 2019-11-28 14:31:06
I'm trying to register certain hotkeys, but I can't because they are Windows defaults. CTRL+WIN+1 minimizes the current window. I'd like it to do something else. I'd like to completely disable WIN+LEFT/RIGHT. I'm also trying to handle the CTRL+WIN+Arrow in my own virtual desktop manager. zVirtualDesktop This has to be done using c# and Win32 API if necessary. It absolutely cannot use Autohotkey. Every page I find descibes how this can be done with AutoHotKey. I'd post code, but I really don't know where to start. I use Win32 to register hotkeys. I assume there is a way to override them, but I

How do you disable system hotkeys in user32.dll?

别来无恙 提交于 2019-11-28 12:44:44
问题 I am coding in C#, if it is relevant. I am trying to disable system hotkeys for a kiosk application. The code used here has come from: https://www.codeproject.com/kb/cs/kiosk_cs.aspx?display=print This individual: How to disable the pressing/holding down of the Alt key, Control Key, and Shift Key when the left mouse button is clicked has appeared to have successfully used this method to disable Alt + F4 on Windows. However she didn't explicitly specify which version of Windows she was using

Register more than one hotkey with RegisterHotKey

感情迁移 提交于 2019-11-28 11:22:29
I found this little piece of code to register an hotkey: [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'); } It works perfectly, but my problem is I want to use two different shortcuts. I know the second parameter is the id, so I figure I could make a different id and add a new if