Page 1 of 1

Notepad: Right Ctrl+Shift

Posted: 27 Mar 2024, 01:28
by Dmitry_N
Hi there,

Newbie here. Knowledge level of Autohotkey is zero.

In Windows 11 (didn't have this problem before), in Notepad, the combination of Ctrl+right Shift turns on right to left reading order.

Can a simple script for AHK v2 be created to emulate the left Shift when I press the right Shift? For Notepad only.

I need this combination to be able to switch languages. I'm left-handed and I've been using this key combination since the nineties.

What I've tried so far is seeking advice with Google search; I also "spoke" with Gemini, ChatGPT, and Copilot. They are too smart for Windows, I guess, as none of their offered scripts work. They want me to help them find issues in their scripts instead :)

Thanks so much in advance.

Re: Notepad: Right Ctrl+Shift

Posted: 27 Mar 2024, 03:39
by Noitalommi_2
Hi.

Like so? Switching RShift to LShift and vice versa?

Code: Select all

#Requires AutoHotkey 2.0
#SingleInstance

#HotIf WinActive("ahk_exe Notepad.exe")
*RShift::LShift
*LShift::RShift
#HotIf

Re: Notepad: Right Ctrl+Shift

Posted: 27 Mar 2024, 04:02
by Dmitry_N
Noitalommi_2 wrote:
27 Mar 2024, 03:39
Hi.

Like so? Switching RShift to LShift and vice versa?

Code: Select all

#Requires AutoHotkey 2.0
#SingleInstance

#HotIf WinActive("ahk_exe Notepad.exe")
*RShift::LShift
*LShift::RShift
#HotIf
Hi,

Thanks so much! It just works. But I managed to get a working script from Copilot, for which Gemini was really grateful. It seems I started working to transfer knowledge bases from one to another :)
I might use yours anyway, but will remove this *LShift::RShift, as I don't need the left key to be remapped.

What Copilot created is:

Code: Select all

#Requires AutoHotkey v2.0

#HotIf WinActive("ahk_exe notepad.exe")
RShift::LShift
#HotIf
Can you explain what the difference is between this and yours? Not so important for me, but I'm just curious.

Thank you so much again!

PS: I cannot find a button to express my gratitude here :) I am kind of used to hit some "Like" buttons, which seem to transfer my gratitude in the right direction.

Re: Notepad: Right Ctrl+Shift  Topic is solved

Posted: 27 Mar 2024, 06:45
by Noitalommi_2
The difference is that in my script there is an asterisk before the hotkey, this allows to activate the hotkey even if extra modifiers like Ctrl are being held down.
More explanation here: Hotkey Modifier Symbols

Re: Notepad: Right Ctrl+Shift

Posted: 27 Mar 2024, 19:54
by gregster
It's just that RShift::LShift is not a hotkey, but a remapping... so it should already allow additional modifier keys to be held down, and * would be redundant in this case, afaics.

Re: Notepad: Right Ctrl+Shift

Posted: 28 Mar 2024, 03:58
by Noitalommi_2
gregster wrote:
27 Mar 2024, 19:54
It's just that RShift::LShift is not a hotkey, but a remapping... so it should already allow additional modifier keys to be held down, and * would be redundant in this case, afaics.
Yes, that's right. I wasn't aware of that.