PhraseExpander detects all the keystrokes pressed in any application (that's how it can work in any application).
PhraseExpander detects the beginning of a new abbreviation when:
1.The active window has changed
2.The ENTER, TAB or SPACE or any leading delimiter characters are pressed
3.Clicking with the mouse
4.The ESC key is pressed