send the actions key combos do directly?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
PaigeDown
Posts: 19
Joined: 24 Dec 2022, 15:26

send the actions key combos do directly?

Post by PaigeDown » 06 Feb 2023, 15:53

I am wondering if its possible to send the actions key combos do directly, without pressing those keys.

for example, to cut, you could do ^x, but alternatively you could do +{ins}, or mouseclick, right then select cut, or you could send +{f10}, or AppsKey, and select cut.

is there a way to just send cut directly?


this is my example but I am curious about this for a wider range of applications, such as a triple click's ability to select an entire row without doing it in steps as {home}+{end} would do.

my goal is to be able to have less room for mess ups if I spam these key actions.

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

Re: send the actions key combos do directly?

Post by mikeyww » 06 Feb 2023, 16:11

Although various programs have various ways to manage a cut, my understanding is that Ctrl+X is the standard that is used by default throughout Windows, so it would typically work just about everywhere, though programs could override it if they choose. The main issue with the Windows clipboard is its slow speed, so simply sending the cut sequence rapidly is likely to fail in many settings. With the right timing, however, one can quickly create a clipboard manager with history. There are bunches of them available on the Web, including some in AutoHotkey.

PaigeDown
Posts: 19
Joined: 24 Dec 2022, 15:26

Re: send the actions key combos do directly?

Post by PaigeDown » 07 Feb 2023, 11:34

mikeyww wrote:
06 Feb 2023, 16:11
Although various programs have various ways to manage a cut, my understanding is that Ctrl+X is the standard that is used by default throughout Windows, so it would typically work just about everywhere, though programs could override it if they choose. The main issue with the Windows clipboard is its slow speed, so simply sending the cut sequence rapidly is likely to fail in many settings. With the right timing, however, one can quickly create a clipboard manager with history. There are bunches of them available on the Web, including some in AutoHotkey.
Perhaps you have advice on a better implementation for this, I am attempting to emulate notepad++'s "move row up / down"
it does so by selecting the row and cutting and pasting it in place. it actually looks pretty natural, but if you send it too many times in a row, you'll start to get mess ups like duplicate or missing lines.
i intentionally used shift insert as in total its less keypresses, as well as a stray {ins} wont overwrite a highlighted selection the way x and v would. (Microsoft's documentation lists shift/alt {ins} as native keycombos).

do you have any thoughts on how to implement this smoother? my next approach is going to try and use A_CaretX / Y and attempt to use mouse drag to move it, if you say window's clipboard is the bottleneck.

Code: Select all

~Alt::					
KeyWait Tab, D				; if alt tab
blockalt := 1				; dont do the alt jump
KeyWait Alt, U				; when u release alt
blockalt := 0				; reset it
return
#if not blockalt			

$!up::send {home}{Shift down}{down}{del}{shift up}{up}{shift down}{insert}{shift up}{up}
$!down::send {down}{home}{Shift down}{down}{del}{shift up}{up}+{insert}

#if

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

Re: send the actions key combos do directly?

Post by mikeyww » 07 Feb 2023, 15:09

An alternative is simply cutting the line.

Code: Select all

#Requires AutoHotkey v1.1.33
F3::Send {Home}+{Down}^x ; Cut line
F4::Send ^v              ; Paste
I recommend reading the documentation for KeyWait, since "U" is not one of the options.

Post Reply

Return to “Ask for Help (v1)”