请教如何在屏幕不同区域内,热键占用由AHK交回给系统?

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: 请教如何在屏幕不同区域内,热键占用由AHK交回给系统?

Re: 请教如何在屏幕不同区域内,热键占用由AHK交回给系统?

Post by gongnl » 06 Dec 2017, 08:57

使用 ~MButton:: 试一试

请教如何在屏幕不同区域内,热键占用由AHK交回给系统?

Post by pppguest3962 » 06 Dec 2017, 07:36

代码的意思是:在软件界面上设立两个热区,A区和B区,如果在这两个区域点击鼠标中间键,那么分别实现F11和F12的热键,那么问题来了,
现在中键完全被AHK所占用,如果我鼠标既不在A区和B区,点击中键就没有作用了,在非热区,是否可以把鼠标中键还给这个软件?
毕竟这个软件鼠标中键在软件的很多界面上还有其它功能,如果全用AHK完成非热区外的替代,很难做到(量太多)
我也想过再以键盘热键+鼠标中键搭配,但我热区操作就是为了模拟键盘的(F11和F12只是一个简写,实际上还有一些宏和运算判断),
所以想请教各位,有什么办法在热区外,把中键还给软件? thanks.

Code: Select all

#IfWinActive,ahk_class xxxxClass
MButton::
MouseGetPos, xpos, ypos
;关闭
if xpos>8
 {
  if xpos<23
  {
     if ypos>24
      {
        if ypos<713
         {
          Send {F12}
          return
          }
       return        
       }
    return
    }
  return
  }
;恢复
if xpos>8
 {
  if xpos<1264
  {
     if ypos>8
      {
        if ypos<30
         {
          Send {F11}
          return         
          }   
       return     
       }
    return
    }
  return
  }
return 
#IfWinActive

Top