How to disable Shift Ctrl? - windows-10

I would like to disable Shift Ctrl without disabling other shorcuts like Shift Ctrl A, or Ctrl A, or Shift A.
I have tried multiple combinaison of ^+:: return with and without :
- Up : ^+ Up:: return
- ~ : ~^+ Up:: return
- & : ~^ & ~+ Up:: return
Nothing work. Even when I start my script as admin it doesn work.
I want to rename Shift Ctrl because I have two keyboard languages and pressing Shift Ctrl change it. I already have the shorcut Windows Space so I don't need Shift Ctrl.
I have tried with ahk but I am open to any other way to solve this.

"^" is the modifier symbol for the Control key and "+" for the Shift key.
Modifier symbols are used only in key-combinations for modifying other keys.
Try also
+Ctrl Up:: return
or
Shift & Ctrl Up:: return
EDIT:
You can change or remove the combination that changes the keyboard language on Control panel --> Language, as shown in the comments below.

Related

Tkinter: How to bind a Shift

I'm making a menubar in Tkinter with an accelerator:
menubar = tk.Menu(window)
file_menu = tk.Menu(menubar)
menubar.add_cascade(label='File', menu=file_menu)
window.config(menu=menubar)
file_menu.add_command(label='Open resource pack', command=openPack, accelerator='Cmd+o' if IS_MAC else 'Ctrl+o')
window.bind_all('<M1-o>' if IS_MAC else '<Control-o>', openPack)
file_menu.add_command(label='Copy original pack', command=copyOriginalPack, accelerator='Shift+Cmd+c' if IS_MAC else 'Shift+Ctrl+c')
window.bind_all('<M1-C>' if IS_MAC else '<Control-C>', copyOriginalPack)
But for the Copy original pack option the key combination is Shift + Command + C. The accelerator only shows the key combination in the menubar but doesn't actually run the command, so I have to manually bind to the window.
If I remember correctly, to bind Shift + Command + C I just need to say Control+C and make the C uppercase because of Shift.
But I can't bind Shift. It works if I click the menu option, but the key combo doesn't. It works for the other option, which doesn't have Shift
I fixed it by writing <M1-Shift-c> (note the lowercase c)

AHK in MS Excel (Cell Selection Issue With Script)

I started a little script using CAPSLock key for navigation (This is only part of the code):
SetCapsLockState, AlwaysOff
CapsLock & i::
if getkeystate("alt") = 0
Send,{Up}
else
Send,+{Up}
return
CapsLock & l::
if getkeystate("alt") = 0
Send,{Right}
else
send, +{Right}
return
It works perfectly everywhere.. except in MS Excel!
When I select a range of cells the selection marquee is there but no cell reference is taken in the formula.
Ex: Summing C3:C10 turns into =sum() no cells are actually selected in the formula.
if I keep trying up and down many times.. it shows, but never consistent.
Any idea how to fix this?
Thank you in advance
The problem comes from your shift key being released between the key presses.
Like for example try pressing keys like this in Excel and you'll see you're not actually selecting cells, you're just highlighting them:
Shift Down, Up Arrow, Shift Up
Shift Down, Up Arrow, Shift Up
Shift Down, Up Arrow, Shift Up
...
So you're going to have to keep shift pressed for the whole duration of your selection making process.
Here's what I could come up with:
CapsLock::Shift
#If, GetKeyState("CapsLock", "P")
*i::
if (GetKeyState("Alt", "P"))
SendInput, {Blind}{Alt Up}{Up}
else
SendInput, {Up}
return
*l::
if (GetKeyState("Alt", "P"))
SendInput, {Blind}{Alt Up}{Right}
else
SendInput, {Down}
return
#If
Or just like this to write it a lot cleaner with a ternary:
CapsLock::Shift
#If, GetKeyState("CapsLock", "P")
*i::SendInput, % GetKeyState("Alt", "P") ? "{Blind}{Alt Up}{Up}" : "{Up}"
*l::SendInput, % GetKeyState("Alt", "P") ? "{Blind}{Alt Up}{Right}" : "{Right}"
#If
So what's happening?
First we use the simple remapping syntax(docs) to remap CapsLock to Shift.
Then we create context sensitive hotkeys for I and L with #If(docs).
The hotkeys are only triggered if the physical state of CapsLock is down.
We need the physical state, because the logical state (which is default) was remapped to shift.
The hotkeys are created with the * modifier(docs) so they fire even if Shift and/or Alt is held down.
I switched the Send commands SendInput due to it being the recommended faster and more reliable send mode(docs).
And then about {Blind}. Normally, when you just send something with a send command, it automatically releases any modifiers you may be holding. But if you use the blind send mode(docs), this doesn't happen. So Shift is still held down all the time.

Ctrl + Alt + V: Disable auto-generation of the keyword "final"

It was not like this in version 1.5, but now that I updated my Android Studio to 2.1.1 whenever I generate a local variable with the Ctrl + Alt + V shortcut, the variable is generated with the keyword "final".
For example, let's say I have the following statements:
Object o = new Object();
o.toString();
Let's highlight the second line and press Ctrl + Alt + V and voila:
final String s = o.toString();
// ^ I'm talking about this.
How do I disable the auto-generaion of the keyword "final"?
This auto-insertion of final is highly annoying as I use this shortcut like every other minute and I have to delete the keyword because most of the time I don't need the variable to be final and would not like to keep my code unnecessarily wordy.
I don't know why you want to turn it off since it is good practice.
Here is how you can do that:

How to add brackets using AutoHotKey

I want to create a hotkey Ctrl + ( that adds brackets to a phrase. I.e select x-1 to get (x-1). How to program this function?
I write a lot of phrases such as: x+1/(x-1)^2 so it would be helpful to have a hotkey to add brackets.
^(::
SendInput, ^c
Sleep 10
Clipboard = (%Clipboard%)
SendInput, ^v
return
This implies that you are actually pressing CTRL+SHIFT+9 (since you don't have a ( key).
I did a quick test and it will add round brackets to anything you highlight. I would recommend tweaking the trigger key since CTRL+SHIFT+9 isn't that easy to hit, but otherwise seems to work without issues.
If you want to save the clipboard, then you'll have to do this:
^(::
SavedClipboard := ClipboardAll
SendInput, ^c
Sleep 10
Clipboard = (%Clipboard%)
SendInput, ^v
Clipboard := SavedClipboard
SavedClipboard =
return

Autohotkey remapping alt+j to left but alt+shift+j doesn't select left nor do alt+ctr+j move a caret , if getKeyState does not work

Basically,
It's inspired by Vim I want to use a key(e.g Alt, F1) combination(+I J K L) to map to Arrow Keys
What is already done in Autohotkey
Ralt & j::send{Left}
Ralt & k::send{Right}
...
Now I take Alt+I as up etc,which is pretty fine for me But the problem comes when you press
Ralt+Shift+j (Suppose to select the last charater)
Ralt+Ctrl+j (Suppose to move a caramel text)
These kind of combination would not work and it just get overrided to basic move cursor to left
Even if I use if/while statement with GetKeyState, it doesn't gonna work
if GetKeyState("Shift","P")
Ralt+j::send +{Left}
This kind of stuff didn't work
Any Ideas on that ?It would make coding very efficient without having to move the right hand.
Thanks in advance.
You are missing 2 things:
Must use a # symbol when doing a context sensitive hotkey
The bottom section of code is using a + instead of the & you used previously.
See the below modification:
RAlt & j:: Send {Left}
RAlt & k:: Send {Right}
#If GetKeyState("Shift","P")
RAlt & j:: Send +{Left}
RAlt & k:: Send +{Right}
; Close with #If to remove the context or simply start another '#If GetKeystate ....'

Resources