#1
|
|||
|
|||
Dearest AHK masters
I am creating a simple ahk script to remap the four keyboard functions that WPEX just intorducded on there software. I used ahk, for instance, to make XButton1 perform the same action as down arrow key, if #IfWinActive, ahk_class TDlgTableHoldem.
First off, I have tweak UI installed and running properly. So far, the script works well. There is one problem I see though. Indeed it only performs the specified action on the active table, however, when I move my mouse cursor from the active table to the desktop or toolbar, it continues to leave the last table I was at active. It only leaves the table active if my cursor is moved directly into a "non window". Therefor, when I left click the desktop for instance, it performs "fold" on the last table, even though my mouse cursor is NOT over the table. In short, I want the ahk to only perform the action ONLY if the mouse cursor is over the table. How do I do it? Thanks in advance!! Here is my script. #IfWinActive, ahk_class TDlgTableHoldem RButton::Left |
#2
|
|||
|
|||
Re: Dearest AHK masters
Maybe use MouseGetPos (CoordMode, Mouse, Screen) and WinGetPos, and check that the mouse X and Y are in the window area.
There could be an easier way though.... |
#3
|
|||
|
|||
Re: Dearest AHK masters
[ QUOTE ]
I am creating a simple ahk script to remap the four keyboard functions that WPEX just intorducded on there software. I used ahk, for instance, to make XButton1 perform the same action as down arrow key, if #IfWinActive, ahk_class TDlgTableHoldem. First off, I have tweak UI installed and running properly. So far, the script works well. There is one problem I see though. Indeed it only performs the specified action on the active table, however, when I move my mouse cursor from the active table to the desktop or toolbar, it continues to leave the last table I was at active. It only leaves the table active if my cursor is moved directly into a "non window". Therefor, when I left click the desktop for instance, it performs "fold" on the last table, even though my mouse cursor is NOT over the table. In short, I want the ahk to only perform the action ONLY if the mouse cursor is over the table. How do I do it? Thanks in advance!! Here is my script. #IfWinActive, ahk_class TDlgTableHoldem RButton::Left [/ QUOTE ] <font class="small">Code:</font><hr /><pre>~RButton:: Fold(getid()) return getid() { id := "" MouseGetPos, , , id return id } Fold(id) { IfWinExist, ahk_id%id% { WinActivate, ahk_id%id% WinWaitActive, ahk_id%id%, , 1 If (errorlevel<>1) { Send, {LEFT} } } }</pre><hr /> I'm no expert with AHK, but these snippets taken from dave's BetPot script should do what you want I think (ie: send a Left arrow to the window below the mouse cursor). Juk [img]/images/graemlins/smile.gif[/img] |
#4
|
|||
|
|||
Re: Dearest AHK masters
[ QUOTE ]
[ QUOTE ] I am creating a simple ahk script to remap the four keyboard functions that WPEX just intorducded on there software. I used ahk, for instance, to make XButton1 perform the same action as down arrow key, if #IfWinActive, ahk_class TDlgTableHoldem. First off, I have tweak UI installed and running properly. So far, the script works well. There is one problem I see though. Indeed it only performs the specified action on the active table, however, when I move my mouse cursor from the active table to the desktop or toolbar, it continues to leave the last table I was at active. It only leaves the table active if my cursor is moved directly into a "non window". Therefor, when I left click the desktop for instance, it performs "fold" on the last table, even though my mouse cursor is NOT over the table. In short, I want the ahk to only perform the action ONLY if the mouse cursor is over the table. How do I do it? Thanks in advance!! Here is my script. #IfWinActive, ahk_class TDlgTableHoldem RButton::Left [/ QUOTE ] <font class="small">Code:</font><hr /><pre>~RButton:: Fold(getid()) return getid() { id := "" MouseGetPos, , , id return id } Fold(id) { IfWinExist, ahk_id%id% { WinActivate, ahk_id%id% WinWaitActive, ahk_id%id%, , 1 If (errorlevel<>1) { Send, {LEFT} } } }</pre><hr /> I'm no expert with AHK, but these snippets taken from dave's BetPot script should do what you want I think (ie: send a Left arrow to the window below the mouse cursor). [/ QUOTE ] Did this work ok? Juk [img]/images/graemlins/smile.gif[/img] |
#5
|
|||
|
|||
Re: Dearest AHK masters
Juk- Sorry for the delay... I live in US and am trying to get the payment situation figured out. Ugh!
Your script (or dave's) worked perfectly, thank you! I am trying to figure out what all that stuff means, but I seem to be having trouble remapping the other keys to perform like this one. If you have a chance, can you duplicate that into another piece that makes the WheelUp work the same as the Right arrow key? Then I can see what I should be replacing. Thanks again Juk! [img]/images/graemlins/smile.gif[/img] |
#6
|
|||
|
|||
Re: Dearest AHK masters
[ QUOTE ]
Juk- Sorry for the delay... I live in US and am trying to get the payment situation figured out. Ugh! Your script (or dave's) worked perfectly, thank you! I am trying to figure out what all that stuff means, but I seem to be having trouble remapping the other keys to perform like this one. If you have a chance, can you duplicate that into another piece that makes the WheelUp work the same as the Right arrow key? Then I can see what I should be replacing. Thanks again Juk! [img]/images/graemlins/smile.gif[/img] [/ QUOTE ] I think all you need it this: ~WheelUp::Right ~WheelDown::Left Juk [img]/images/graemlins/smile.gif[/img] |
|
|