Is it possible to change the behavior of Ctrl-K to Alt-Q or other key combination?(I am not asking about key bindigs but about key chords) - keyboard-shortcuts

Is it possible to change the behavior of Ctrl+K to Alt+Q or other key combination?
For example I want to use Alt+Q W or Ctrl+I Q instead of Ctrl+K Q

Related

How can I check if a key-value pair is not in a map of kframework?

I wrote something like
requires notBool(K |-> V in P)
But it does not seem to be the right syntax. What is the right way to check if a key-value pair does not exist in a map?
The syntax you want is notBool K in_keys(P) to check whether a key is in a map. If you want to also check whether the key is bound to a certain value, you can write notBool K in_keys(P) orBool P[K] =/=K V.

Intellij Idea Keyboard Shortcut To Select A Token

Is there any intellij idea shortcut to select a token in a statement?
For example, consider this:
cell.setCellValue((profileInfo.get("startTimeOfCrawl")!=null)?profileInfo.get("startTimeOfCrawl"):"");
Currently, if my cursor is on the first character of the above statement(i.e. at beginning of c of cell, if I have to select profileInfo, then I will have to use my mouse and double click on profileInfo to select that.
Another workaround I found was to use arrow keys to get cursor to profileInfo
Then use ctrl+shift+right-arrow keys to select till the end(i.e. till o) of profileInfo
This is good when my cursor is placed at beginning of profileInfo(or even end in which case we can use left-arrow key).
But if my cursor is placed somewhere in between of profileInfo then I will have to use ctrl+right (or ctrl+left) to get the cursor to either beginning or end of this token. Then I Will have to use ctrl+shift+right-arrow (or left-arrow as the case may be).
(Switching from keyboard to mouse breaks the continuity, hence looking for keyboard shortcuts.)
Is there a better shortcut to do above in 1 step?
PS: Solution to above will be very useful when making string replacements.
Use Edit | Extend Selection (Ctrl-W in the default keymaps, Alt-Up in the Mac OS 10.5+ keymap). You can press it multiple times to extend the selection to larger enclosing syntax constructs.
I can't think of a 1-step process of doing this but try using the alt to traverse via arrow keys, it will traverse it per "word" instead of per character.
You can also use alt+shift+ arrow keys to select per word.

how to return (F1) from 113 key value ?

when I press F2 then following code in my form keydown event return 113
MessageBox.Show(e.KeyValue.ToString());//If pressed key is F2 ->113
but when I want to get the Char from KeyValue from following code then it return "q"
MessageBox.Show(Char.ConvertFromUtf32(113));//return q
how can I reach to F2 from 113 keyvalue ?
As its a KeyCode cast to the Keys enum?
((Keys)e.KeyValue).ToString();
Typically, the function keys are not actually characters. Frequently, they are mapped as key combinations, like (0, 113). Why do you want the character code for F2?
The reason you are getting the letter q when you try and get the char value of 113 is because it maps to the ASCII value of q
And to answer the rest of your question
ascii codes for windows keyboard keys and the codes for function keys(F1 - F12) and other keys like shift,capslock,backspace,ctrl etc
I found this article here http://bytes.com/topic/c-sharp/answers/429451-keycode-keyvalue-keydata
There are KeyUp, KeyDown and KeyPress event. Only the KeyPress event
supplies the character code. I don't say ASCII because this code
depends on the current language settings; even one code can be
generated as a result of pressing a sequence of keys. Even in the
simplest cases with English language settings there is no 1:1 mapping
between keys and character codes e.g. key A produces ASCII for 'a' or
key A produces ASCII for 'A' if cpaslock is on or shift is pressed or
'a' of both capslock is on and shift is pressed, etc. Even more there
are keys that don't produce ASCII codes - ctrl, alt, shift, F1, F2.,
Fx, windows keys, etc

How to use keyDown() and keyUp() in sikuli?

This is my code snippet,
reg = selectRegion("Selected a region")
reg.keyDown(KEY_CTRL)
reg.keyUp()
My objective is to select some lines, as we do it by pressing CTRL and then scrolling down, but it throws
java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: Invalid key code
It's obvious that I have done something wrong, Could any one help me out with this??
The documentation on special keys says to use CTRL with keyDown(). KEY_CTRL is used with type() or other cases where you want to add the modifier key as a mask. (And that's actually deprecated and should be KeyModifier.CTRL now, instead.)
For example:
reg.keyDown(CTRL)
... some code that scrolls ...
reg.keyUp(CTRL)
Or to press the "down" key twice while holding control:
reg.type(Key.DOWN + Key.DOWN, KeyModifier.CTRL);
(As a side-note, it's generally shift that's used as the modifier key for creating a selection and not control.)

Converting CGKeyCodes for International Keyboards

In my application, I need to map a shortcut to the key to the left of the "1" key on the keyboard. On a standard US keyboard, this would be the backtick character (" ` "), which is key code number 50. Unfortunately, international keyboards (the French keyboard, for example) has a different key to the left of the 1 key (the forward slash key "/"), so hard coding that key code would result in unexpected results for users who are not using a US keyboard.
Is there any way to convert a US key code into a key code for international keyboards at runtime, or a way to programatically determine the key code based on the position of the key on the keyboard?
The character on the key to the left of "1" is different on different keyboard layouts, but the virtual key code should be the same. If you look at HIToolbox/Events.h, you can see the constant kVK_ANSI_Grave, which represents the key you're talking about; above the list of constants, there's a comment that suggests that at the virtual key code level, equality means that the physical key is the same, though the scan code might be different and the emitted letter might be different.
In other words: the keyboard driver maps from scan codes to virtual key codes, and the keyboard layout (which you can change in System Preferences) maps from virtual key codes to characters.
This is all potentially wrong; I don't have a non-US keyboard with which to verify these assertions.