Hotstrings block by pressing AppsKey/RCtrl Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Shyrik
Posts: 18
Joined: 24 Jul 2019, 09:42

Hotstrings block by pressing AppsKey/RCtrl

Post by Shyrik » 31 Mar 2023, 10:18

Greetings to everyone!

First and foremost I`d like to thank AutoHotKey community for the greatest automation programme and all the forum dwellers for sharing their profound AHK knowledge with others!

Time flies, but I still use AHK mainly for remapping and hotstring purposes. The thing is that I sometimes need to prevent some of my hotstrings from unfolding into the specific phrase standing behind it. What I usually do when I want to stop a random hotstring of mine is pressing End key or Right key physically after typing the abbreviation. For instance, in a case

Code: Select all

::btw::by the way
I type "btw", then press End/Right and get just "btw". And that`s okay, but at the end of the day my right hand`s pinky and wrist naturally get tired.

I analyzed the keyboard I use and came to the conclusion AppsKey and RCtrl keys would be a better option for doing this. My AppsKey is already remapped the following way:

Code: Select all

AppsKey::^s
But I thought there would be no problem with that and two functions could be easily combined.

So I wrote two code strings just to test the idea:

Code: Select all

AppsKey::SendInput {Right}^s
RCtrl::SendInput {End}
Strangely, both remappings work, but none of them prevent hotstrings from operation. Let me formulate it in a more precise way: these strings work only in the middle of the text in a word processor, but not in the line which is not complete. That means, when I put cursor in the middle of the sentence and then type "btw" and press AppsKey, the code does what it should, but when the phrase is not finished and "btw" is being the last word in the last phrase on the page, the "btw" hotstring doesn`t get stopped, so it fires after pressing Space. But pressing Right or End keys physically works in both cases, in the middle of the text or at the end of the last phrase.

So again, I would be pleased if by typing the sequence "btwAppsKey" I got "btw" as is and the text file I work in saved, and also the context menu shouldn`t appear. The same with RCtrl. If it is possible to realize the desired manipulation ("fingerpulation" so to say) without adding Right or End function to AppsKey/RCtrl keys, that will also be cool, but I can`t even imagine how this may be accomplished.

I feel there should be a rather simple solution to this, but have been groping for it for several hours already and to no avail. If there is no such simple solution, that`s okay, I have no intention to bother anyone with this stuff. And I`m sorry for describing the case in such a detail, but being a complete lamer I don`t really know what information matters and what does not, and I also wanted the case to be set crystal clear for you.

Thanks in advance!

User avatar
mikeyww
Posts: 26848
Joined: 09 Sep 2014, 18:38

Re: Hotstrings block by pressing AppsKey/RCtrl  Topic is solved

Post by mikeyww » 31 Mar 2023, 12:39

Code: Select all

AppsKey::
SendLevel 1
Send {Right}^s
Return
Explained: SendLevel

Shyrik
Posts: 18
Joined: 24 Jul 2019, 09:42

Re: Hotstrings block by pressing AppsKey/RCtrl

Post by Shyrik » 31 Mar 2023, 13:24

That`s awesome, mikeyww! Knowledge is power indeed) Thank you very much! :thumbup:

Post Reply

Return to “Ask for Help (v1)”