如何避免多余的按键被按下时的热键触发?

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: 如何避免多余的按键被按下时的热键触发?

Re: 如何避免多余的按键被按下时的热键触发?

by garry » 16 Apr 2024, 13:39

或许

Code: Select all

~^+a::
msgbox, 262208, ,CTRL+SHIFT+a,3
return

~+a::
msgbox, 262208, ,SHIFT+a,3
return

如何避免多余的按键被按下时的热键触发?

by Giresharu » 16 Apr 2024, 08:48

这是我的最短代码,

Code: Select all

~Shift & A:: {
    MsgBox("Pressed.")
}
结果当我按下 Ctrl+Shift+A 的时候,也会触发该热键,请问如何防止这类事情发生?
除了一个一个按键去 CheckKeyState ,每次都遍历100多个键位的话那效率也太低下了。
请问有什么办法能够限定,有且仅有指定按键触发时才执行呢?

Top