admin管理员组文章数量:1401417
I am on Windows 11 and have swapped the Alt and Ctrl keys to emulate keypresses on a MacBook.
Consider the following sequence of keypresses to cut everything and paste, which works:
Alt (Ctrl) + A => (release keys) => Alt (Ctrl) + X => (release keys) => Alt (Ctrl) + V
However, the following doesn't:
Alt (Ctrl) + A => Alt (Ctrl) + X => => Alt (Ctrl) + V
In other words, I need to take my fingers off of the keys for the cut-and-paste to work. How do modify the script to ensure that Alt (Ctrl) pressed at the beginning during Alt (Ctrl) + A persists/sticks with the following commands, such that I could just do the following to achieve the same effect:
Alt (Ctrl) + A => (with Alt (Ctrl) pressed from before) X => (with Alt (Ctrl) pressed from before) V.
Here's the script that I have so far:
#HotKeyInterval 20000
#MaxHotKeysPerInterval 2000
; Swap Left Ctrl and Left Alt
LCtrl::LAlt
LAlt::LCtrl
; Window switching using the new remapped keys (works on hold)
LCtrl & Tab::
SendInput, !{Tab} ; Sends Alt + Tab
return ; Allows repeated presses without releasing Win
; Move cursor by word using Windows Key
#Left::SendInput, ^{Left} ; Win + Left Arrow moves one word left
#Right::SendInput, ^{Right} ; Win + Right Arrow moves one word right
; Delete previous word using Windows + Backspace (works on hold)
#Backspace::
SendInput, ^{Backspace} ; Send Ctrl + Backspace
return ; Ensures key repeat works properly
; Select Previous/Next Word
#+Left::SendInput, ^+{Left} ; Win + Shift + Left selects previous word
#+Right::SendInput, ^+{Right} ; Win + Shift + Right selects next word
#Persistent
I tried a bunch of things, such as adding the below snippet:
LAlt & a::
SendInput, ^a ; Ctrl + A (Select All)
return
LAlt & x::
SendInput, ^x ; Ctrl + X (Cut)
return
LAlt & v::
SendInput, ^v ; Ctrl + V (Paste)
return
But none of those worked. How do I modify the script?
Thanks!
本文标签: autohotkeyHow to make key presses stick from one command to the nextStack Overflow
版权声明:本文标题:autohotkey - How to make key presses stick from one command to the next? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744268677a2598072.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论