bustiiing / blazingstars

Automatically exported from code.google.com/p/blazingstars
0 stars 0 forks source link

pokerWindowIsActive - Not find is PokerStars is the FrontMostApp #59

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
i propose this solution :

#import "HKWindowManager.h"

-(BOOL)pokerWindowIsActive
{
    if ([lowLevel pokerStarsAppIsFrontMostApp]) {
        switch ([self windowIsTable:[lowLevel getMainWindow]]) {
            case HKTournamentTable:
            case HKHoldemCashTable:
            case HKPLOTable:
                return YES;
        }   
    }
    return NO;
}

#import "HKLowLevel.h"

-(BOOL)pokerStarsAppIsFrontMostApp {
    NSString *appTitle;
    AXUIElementCopyAttributeValue([self getFrontMostApp], kAXTitleAttribute,
(CFTypeRef *)&appTitle);

    return ([appTitle isEqual:@"PokerStars"]) ? YES : NO;
}

Now, i'm sure when pokerWindowIsActive, PokerStars app is active too.
If i have PokerStars app in back app, a PokerTable can as the active window
of the PokerStars but not really the window active ... you understand :p

Original issue reported on code.google.com by loiseau....@gmail.com on 22 Mar 2010 at 12:52

GoogleCodeExporter commented 8 years ago
Loiseau,

What problem is this trying to solve?  getMainWindow will return nil unless the
PokerStars table is in front and focused (which is important:  it can be 
front-most,
but not focused, in which case we should not fire the hotkeys).  I can't think 
of why
I would care if PokerStars was front-most but *not* focused...?

Original comment by steven.h...@gmail.com on 22 Mar 2010 at 2:21

GoogleCodeExporter commented 8 years ago
I make a video ;) my english is too povre ...

Original comment by loiseau....@gmail.com on 22 Mar 2010 at 3:37

GoogleCodeExporter commented 8 years ago
Ok, the error it's me ;)

I have found my i have do ! I when i have try "autoTimeBankKey", i have clic on 
the
debug console, and the debugRect as apear on the console ... 

I'm sorry ;)

Original comment by loiseau....@gmail.com on 22 Mar 2010 at 4:57

GoogleCodeExporter commented 8 years ago

Original comment by steven.h...@gmail.com on 22 Mar 2010 at 9:01