使用空格键作为修饰键后,空格键无法触发热字符串了

遇到了问题?请先进行搜索(中文和英文),然后在此提问

Moderators: tmplinshi, arcticir

User avatar
Zach47
Posts: 13
Joined: 15 Nov 2021, 10:05

使用空格键作为修饰键后,空格键无法触发热字符串了

Post by Zach47 » 23 Apr 2022, 09:21

为了方便使用,我把空格键改造成了修饰键。可是这样一来空格键就无法触发热字符串了。虽然可以将热字符串设置为立即触发,但是我还是比较想使用空格键触发。
不知道坛友们有没有比较好的办法,使得空格键既可以成为修饰键,又可以触发热字符串?非常感谢!
代码如下:

Code: Select all

space::space ;保证空格键原始功能

space & r::Reload ;重新加载

space & 1::MsgBox, Hello, World

::]1::abcdefg ;热字符串

garry
Posts: 3740
Joined: 22 Dec 2013, 12:50

Re: 使用空格键作为修饰键后,空格键无法触发热字符串了

Post by garry » 24 Apr 2022, 14:31

Hotstring / Hotkey test example
EDIT : added more examples

Code: Select all

;- 使用空格键作为修饰键后,空格键无法触发热字符串了 
;- https://www.autohotkey.com/boards/viewtopic.php?f=27&t=103142
transform,s,chr,32                         ;- space
Gui,Color,black
Gui,font,s12 cBlack,Lucida Console
Hotstring(":*:xyz","ABCD TEST`n",on)       ;- a hotstring
Gui,add,edit,x10 y10 w480 h350 -vscroll
Gui,show,x100 y100 w500 h400,TEST
return
;---------
Guiclose:
exitapp
;---------------------------------------------------------------------
space::space ;保证空格键原始功能          ;- only space
;-- hotkeys : -----------------------------
space & r::Reload ;重新加载           ;- 
space & 1::MsgBox, Hello World     ;- 
space & 2::run,charmap             ;-
space & 3::Send,{text}$%s%%s%¥%s%  ;- $ space space ¥ space
space & 4::send,{space}            ;- only space
;-----------------------------
Numpad0 & Numpad1::Send {Volume_Down 1}  ;- Numpad0+1 volume-down
Numpad0 & Numpad2::Send {Volume_Up 1}    ;- Numpad0+2 volume-up
Numpad0::Send {Numpad0}            ;-       only numpad0
;-----------------------------
NumpadPgDn::Send {Volume_Down 1}   ;- volume down
NumpadPgUp::Send {Volume_Up 1}     ;- volume-up
;-----------------------------
Ctrl & 1::msgbox,Used CTRL+1       ;-  
^2::Run, notepad                   ;- used ctrl+2
!r::Run,rstrui                     ;- alt+r run recovery
;--- Hotstrings : --------------------------
:x*:ps::run,powershell             ;- 
:*:9::你好  李香                      ;-
:?*X:$::sendinput,{U+00A5}         ;- send  ¥
:?*X:abg::Send,{text}$%s%%s%¥%s%   ;- $ plus 2space and ¥ and space
:O:dollar::$                       ;- $ add enter
:*:rmb::¥                          ;- ¥ without enter
:*X:abf::Send,ABCD                 ;-
:?*X:abe::Send,{text}@             ;- 
:*B:abc::{text}@                   ;- without abc
:*B0:abd::{text}@                  ;- with    abd
:*T:nrs::-20/+40^aâ
;=========================================================
esc::exitapp

Last edited by garry on 01 May 2022, 13:17, edited 1 time in total.

User avatar
Zach47
Posts: 13
Joined: 15 Nov 2021, 10:05

Re: 使用空格键作为修饰键后,空格键无法触发热字符串了

Post by Zach47 » 01 May 2022, 11:14

@garry

Thank you very much for your help.

garry
Posts: 3740
Joined: 22 Dec 2013, 12:50

Re: 使用空格键作为修饰键后,空格键无法触发热字符串了

Post by garry » 01 May 2022, 13:19

small modified , added some examples

Post Reply

Return to “请求帮助”