how do I remove LeftCTRL binding from alt gr key? - windows

I have a laptop with an "alt gr" key in the Right Alt position.
This has an extra binding to the left CTRL key so that, in effect, pressing Alt gr is equivalent to pressing Left CTRL + Alt
Using KeyboardStateView utility, i have found that the following are sent on keypress of Alt gr:
17: CTRL key - 0x11;
18: ALT key - 0x12;
162: Left CONTROL Key - 0xa2;
165: Right Menu Key - 0xa5
is there any way to remove the binding to '17 - 0x11' AND '162 - 0xa2' WITHOUT disabling normal function of the Left CTRL key?
I think this will need to be done by altering the registry, I've tried a few keyboard remapping utilities but they don't have the level of functionality I need.
It MAY be possible with autohotkey, but I don't know enough about scripting it, have asked on their forum.

Related

Remap ctrl+c to cmd+c

By default zsh suggest ctrl+c as interruption hotkey. I need to remap to cmd+c. I tried to do it via bindkey, but can't find interrupt-action id. What can I do with that? Thank you much.
This is not a problem of zsh itself - it's actually a setting of underlying terminal emulator. You can view your current terminal settings using stty -a command. Output of this command will most probably contain intr = ^C somewhere, which is the currently used control character for interrupt.
Yes, you read it right - it is in fact a single character.
That's where the main problem lies with your proposed new key combination - key combination Command + C (sometimes called Super + C) produce unmodified c character - there is no way for terminal to actually recognize if the Command key was pressed or not.
So I'm afraid you can't changed it, at least not on shell level.
This will make you keyboard works like Mac.
Remaps Left Ctrl with AltGr
sudo vi /usr/share/X11/xkb/symbols/ctrl
Change the section
// Map Ctrl to the left Alt key, Alt to the left Win key,
// and Super to the left Ctrl key.
when it says "replace key " with
replace key { [ ISO_Level3_Shift ] };
Open Tweaks
On Additional Layout Options -> Ctrl , mark "Map Ctrl to the left Alt key, Alt to the left Win key, and Super to the left Ctrl key."
On your shell configuration .zshrc in my case, remap to intr check if you have the cent symbol there before. Add this to the file :
stty intr 0xA2
On gnome-terminal remap the copy and paste shortcuts to "Ctrl C" "Ctrl V"
And move physically your keys to make sense

Shorten code automatically in Xcode

I was wondering if it was possible to shorten code automatically in the last version of xcode. You know, when you press on the side of a void method for example and the (...) appear, and you have a shorter page. Is there a command to do it?
Click on the Editor>Code Folding menu and you'll see all your options for this, along with the keyboard shortcuts.
The shortcut is cmnd + shift + option + left arrow key. This will collapse all functions.
You can press command + alt + left cursor key on your keyboard to fold your codes or press command + alt + right cursor key to unfold. Make sure your pointer is inside of the curly brackets.

How can I block select in Geany?

I often need to select a block of text, like a leading character that occurs on many lines. LibreOffice has block selection. How can I do this in Geany?
For example, I want to remove the pipe and the space at the beginning of each line:
| Create another 'Login Role' for the 'auth' user:
| Role name: auth
| Password: auth
| Role privileges: Create database objects
It's called "column mode editing". Look here:
http://www.geany.org/manual/current/index.html#column-mode-editing-rectangular-selections
Column mode editing (rectangular selections)
There is basic support for column mode editing. To use it, create a
rectangular selection by holding down the Control and Shift keys (or
Alt and Shift on Windows) while selecting some text. Once a
rectangular selection exists you can start editing the text within
this selection and the modifications will be done for every line in
the selection.
It is also possible to create a zero-column selection - this is useful
to insert text on multiple lines.
Peter Mortensen has documented how to configure this on Lubuntu (for LXQt):
https://pmortensen.eu/world2/2020/03/29/using-geany/#Column_mode_blues
On Lubuntu, the keyboard shortcuts for selecting a rectangular area of
text (“column mode” in UltraEdit) do not work, because they conflict
with four default keyboard shortcuts in the window manager (LXDE?
Openbox?), Shift + Alt + arrow up, Shift + Alt + arrow down,
Shift + Alt + arrow left, and Shift + Alt + arrow right.
Disable the window manager keyboard shortcuts by editing file
~/.config/openbox/lubuntu-rc.xml near “S-A-Up”, “S-A-Down”,
“S-A-Left”, and “S-A-Right”. For example, change “S-A-Up” to
“S-A-Up99”, “S-A-Down” to “S-A-Down99”, “S-A-Left” to “S-A-Left99”,
and “S-A-Right” to “S-A-Right99”, respectively. And add an XML comment
as to why and document the original values (so they can more easily be
reverted). Edit and update (without a restart required):
vi ~/.config/openbox/lubuntu-rc.xml
openbox --reconfigure
It was tested with Lubuntu 18.04 (32 bit).
In Debian the following works for me: press only the Ctrl key and select by the mouse (not both Ctrl and Shift keys, as described in the manual).
In Ubuntu MATE (Geany 1.25) I can use Shift + Alt and then mark the text using arrow keys.
I think, Ctrl + Shift + mouse(!). It's working correct on Ubuntu with Geany 1.23.1. Please use the mouse, not the arrow keys.
Ctrl + Shift + Mouse on CentOS 7.3.
For me the key shortcuts are different. After installing the Extra Selection Geany plugin, I can use:
Alt + Shift + C (and then use the up, down, etc. arrow keys to move the cursor; edit the text; and then repeat Alt + Shift + C to go back to 'normal' edit mode).
More information is here.
(I use VirtualBox with Xubuntu 16.04.4 LTS (Windows 10 host).)

Right Alt key also triggers Windows Message for Left Control key

In a win32 message handler I'd like to be able to handle Left and Right Alt and Control keys. Left and Right is distinguished with bit 24 of lParam, but when I press the Right Alt then I also get a message for Left Control key (Right Alt is therefore "alt gr"). Is there a way to switch off this behavior or somehow distinguish the message for the Left Control key that was triggered by the Right Alt key?
I just hit this issue and found that Keyboard Language had United States-International keyboard selected. Switching that fixed the issue.
I figured it out thanks to Dell - Right Alt click does not work
Read about reading the keyboard states using Msdn GetKeyState
Then call GetKeyState() and use the VK of VK_LSHIFT VK_RSHIFT VK_LCONTROL VK_RCONTROL VK_LMENU VK_RMENU to see if it is pressed or not.

"Right Click" keyboard short cut for Visual Studio?

I'm trying to force myself to use as little mouse as possible and I can't find the answer to this simple short-cut anywhere! Here the the steps:
Open up Visual Studio. Open any C# file (or any code file I believe)
Point your mouse anywhere on the
window/file.
Right Click
Is there a shortcut key for this so I don't have to move my hand to the mouse?
Taken from lytebyte, you've got two options:
Shift + F10
That nutty key on the bottom-right of a modern Windows keyboard, the Menu key
Depends on where/why you're right-clicking.
The context-menu key is on the right of the keyboard nowadays, usually between the Windows key and the Control key on the right of your spacebar. That will open the context menu wherever the current focus is (usually in the text editor).
If you're using the right mouse button just to open the refactoring tools, you can use Ctrl + . (control period) to pop open the "smart tag" on any identifier. That'll get you the "generate method stub" menu item and the like.
To open a new file without keyboard you can use
CTRL + SHIFT + N (Using Resharper)
To show up the right click menu for any part of your code. Point to the part that you want and use
SHIFT + F10
Normally, I like using
CTRL + SHIFT + G (Resharper again)
for getting the Navigation menu (Usage, Base, Implementation, etc)
Even better if you want to go to any Method/class/intenal/or a field, use CTRL + SHIFT + ALT + N (Again using Resharper), this will bring you a list of all that match your criteria to choose from.
Does your keyboard have the extra 'Windows' keys, ie. the Windows logo (Start key) and the one on the right-hand side of the spacebar that looks like a menu? Cause that button on the right-hand side is the 'Context menu key'.
See the key between the right-hand side 'Windows' key and the Ctrl key?
Windows Keyboard layout
If your keyboard is less than 10 years old you should have these keys, unless you have an IBM laptop or a Mac.!
Assuming you just want a key you can press to right click, most\many keyboards have a key between alt and ctrl that right clicks.

Resources