keyboard-shortcuts

How to detect ctrl-f in my SWT application

佐手、 提交于 2020-01-19 07:27:45
问题 I have written an SWT UI which has a primary function of displaying text in a StyledText control. I want to add a handler for Ctrl + F so that when that shortcut is pressed the focus is set to a search box. I have tried using the following code to detect the keypress. sWindow = new Shell(); ... sWindow.getDisplay().addFilter(SWT.KeyDown, new Listener() { @Override public void handleEvent(Event e) { System.out.println("Filter-ctrl: " + SWT.CTRL); System.out.println("Filter-mask: " + e

How to detect ctrl-f in my SWT application

孤街醉人 提交于 2020-01-19 07:27:05
问题 I have written an SWT UI which has a primary function of displaying text in a StyledText control. I want to add a handler for Ctrl + F so that when that shortcut is pressed the focus is set to a search box. I have tried using the following code to detect the keypress. sWindow = new Shell(); ... sWindow.getDisplay().addFilter(SWT.KeyDown, new Listener() { @Override public void handleEvent(Event e) { System.out.println("Filter-ctrl: " + SWT.CTRL); System.out.println("Filter-mask: " + e

Check if ALT key is pressed

淺唱寂寞╮ 提交于 2020-01-17 06:43:10
问题 After testing a lot I can't record if Alt key is pressed using GetAsyncKeyState in a C program. When I try this: if (GetAsyncKeyState(VK_SHIFT)) // do something It works properly, but when I try this if (GetAsyncKeyState(VK_MENU)) // do something It doesn't work. So my question is "How I can record ALT?". Thanks in advance 回答1: I use the code below to find out the value of any key that perfectly fits in GetAsyncKeyState , I think it is 18 for ALT key . #include <iostream> #include <cstdio>

alt+ctrl+f4 not working on visual studio 2005? but it did work previously

为君一笑 提交于 2020-01-17 01:47:10
问题 In VisualStudio .net (say 2005) I have this shortcut Alt + Ctrl + F4 which closes all the opened windows. (Already mapped to window.closealldocuments) and another one Alt + Ctrl + Shift + F4 to close all but this window. Now both shortcuts used to work on my previous workstation. Both having winxp 32.And i work on sv 2005 on both. But on this new machine, Alt + Ctrl + F4 does not seem to propagate to Visual studio, like there's some other application or the explorer mapping this key to

Is it possible to use KeyBindings in JFrame & Canvas?

女生的网名这么多〃 提交于 2020-01-16 16:10:34
问题 I've been have difficulty with KeyListener (not detecting keys) and I'm trying to switch over to KeyBindings but JFrame doesn't extend JComponent which is needed for the getInputMap() function. Any ideas? 回答1: Use a surrogate JComponent instead. For example, set the frame's contentPane to be a JPanel and use it to register the key bindings. This is a very basic example, which uses a JPanel as the contentPane and adds a Canvas to it. The key bindings are then registered through the JPanel on

Java Swing TextArea: How to make JTextArea DocumentListener DocumentEvent Trigger Two Or More Combined Codes/Keys?

 ̄綄美尐妖づ 提交于 2020-01-16 11:30:45
问题 My text editor contains two textAreas (TA). TA1 is for input Devanagari Unicode texts and TA2 is for output in ASCII as transliterated texts which get printed simultaneously as the input text got typed key by key using DocumentListener. I do this using a one to one transliteration scheme. However there are cases I need to map multiple/two Devanagari UCodes input in a single ASCII character. Eg. क्=k (क्=क+्). The problem is here that a single two UCodes containing character is generated

Why Does VS 2010 'Comment' Keyboard Shortcut Change in C++?

只愿长相守 提交于 2020-01-15 07:54:07
问题 For me, Visual Studio's Ctrl + K , Ctrl + C keyboard shortcut is used to comment-out the selected lines. When editing C++, this sometimes uses block comments ( /* */ ) and sometimes uses line comments ( // ). Why does it change? How does it decide which to use when? 回答1: A couple other discussions on the topic: Visual studio feature - commenting code Ctrl K - Ctrl C visual studio C++ toggle comment ? comment while not whole line is selected? Based on my own tinkerings, and what was said in

How to change shortcut keys for a given command in ReSharper?

独自空忆成欢 提交于 2020-01-14 08:52:29
问题 I need to change shortcut for finding member ( ALT + \ ) in ReSharper because of my native keyboard which brings me problem to press wrong key each time. Where can I re-set a new key combination for shortcuts in ReSharper? 回答1: Use Visual Studio's Keyboard options pane to change keyboard shortcut bindings. This can be found in Visual Studio by going Tools > Options > Environment > Keyboard . 来源: https://stackoverflow.com/questions/1657579/how-to-change-shortcut-keys-for-a-given-command-in

Creating a shortcut keys for a specific buttons on the webpage | chrome

元气小坏坏 提交于 2020-01-13 13:13:13
问题 Assume that i have two pages: Client page Items page in both pages i have an Add buttons, is it possible to create a shortcut keys like ctrl + A will click on the Add button and ctrl + B will be for submitting and ctrl + E for new Entity ? many thanks in advanced 回答1: Yes, this is definitely possible! You can build the code yourself, but there is no point in reinventing the wheel, so try one of pre-build libraries. For example: https://craig.is/killing/mice You can create custom shortcuts and

Creating a shortcut keys for a specific buttons on the webpage | chrome

亡梦爱人 提交于 2020-01-13 13:13:08
问题 Assume that i have two pages: Client page Items page in both pages i have an Add buttons, is it possible to create a shortcut keys like ctrl + A will click on the Add button and ctrl + B will be for submitting and ctrl + E for new Entity ? many thanks in advanced 回答1: Yes, this is definitely possible! You can build the code yourself, but there is no point in reinventing the wheel, so try one of pre-build libraries. For example: https://craig.is/killing/mice You can create custom shortcuts and