hotkeys

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

独自空忆成欢 提交于 2019-11-28 02:33:37
问题 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"/> 回答1: 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>

Registering 3 hotkeys? Possible?

拟墨画扇 提交于 2019-11-27 23:22:33
Hello I am trying to use RegisterHeyKeys in VB.NET however I got it to work with 2 hotkeys I tried just adding in the third and it's giving a too many arguments. This is probably something really simple and I'm also a nub so go easy. lol. Any help would be greatly appreciated. Here is the code so far: Public Const MOD_CONTROL As Integer = &H11 Public Const MOD_SHIFT As Integer = &H10 Public Const WM_HOTKEY As Integer = &H312 <DllImport("User32.dll")> _ Public Shared Function RegisterHotKey(ByVal hwnd As IntPtr, _ ByVal id As Integer, ByVal fsModifiers As Integer, _ ByVal vk As Integer) As

Global hotkeys in WPF working from every window

╄→гoц情女王★ 提交于 2019-11-27 22:56:44
I have to use hotkeys which will be working from every window and pulpit. In winforms I used: RegisterHotKey(this.Handle, 9000, 0x0002, (int)Keys.F10); and UnregisterHotKey(this.Handle, 9000); and protected override void WndProc(ref Message m) { base.WndProc(ref m); switch (m.Msg) { case 0x312: switch (m.WParam.ToInt32()) { case 9000: //function to do break; } break; } } In my WPF aplication I tried do: AddHandler(Keyboard.KeyDownEvent, (KeyEventHandler)HandleKeyDownEvent); and private void HandleKeyDownEvent(object sender, KeyEventArgs e) { if (e.Key == Key.F11 && (Keyboard.Modifiers &

How to comment a block in Eclipse?

余生长醉 提交于 2019-11-27 19:14:36
问题 Does Eclipse have a hot key to comment a block? and to uncomment a block? 回答1: 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

Any way (or shortcut) to auto import the classes in IntelliJ IDEA like in Eclipse?

烈酒焚心 提交于 2019-11-27 17:33:36
In Eclipse, while coding in Java and press Ctrl + Shift + O auto import all the Classes automatically. In NetBeans, this is done with Ctrl + Shift + I . Is any way to do this in IntelliJ IDEA? I searched an equivalent shortcut in google, StackOverflow, IntelliJ IDEA configuration and in the official IntelliJ website Keyboard Shortcuts You Cannot Miss IntelliJ IDEA does not have an action to add imports. Rather it has the ability to do such as you type. If you enable the "Add unambiguous imports on the fly" in Settings > Editor > General > Auto Import , IntelliJ IDEA will add them as you type

C++/Qt Global Hotkeys

心已入冬 提交于 2019-11-27 16:23:19
I'm working on an application, which I need to run in the background and run a function when a certain combination of buttons is pressed. I kind of understand that this requires a platform-specific API call (WIN32, X11, etc.), but I don't really know how to start. Also, is there a multi-platform way to achieve this? I really need this to work on Windows, Linux, and OSX. To summarize: The Qt Event System may be an option (with some help on system/desktop manager level) Qxt Library (not longer maintained) Or this project UGlobalHotkey . 2. seems the best option so far. Though it is not longer

Cocoa NSStatusBar Global HotKey

谁都会走 提交于 2019-11-27 11:01:24
问题 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

Ctrl+Enter jQuery in TEXTAREA

馋奶兔 提交于 2019-11-27 09:22:48
问题 How do I trigger something when the cursor is within TEXTAREA and Ctrl + Enter is pressed? Using jQuery . Thanks 回答1: 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. 回答2: Actually this one does the trick and works in all browsers: if ((event.keyCode == 10 || event.keyCode == 13) && event.ctrlKey) link to js fiddle.

How to disable/override Windows 10 Hotkeys with C#

主宰稳场 提交于 2019-11-27 08:28:54
问题 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

Register more than one hotkey with RegisterHotKey

走远了吗. 提交于 2019-11-27 06:08:40
问题 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