Heres the dilemma: I am showing a screen with 3 input fields and 2 buttons inside of a tab(there are 3 tabs total, and they are on the bottom of the screen). the 2 buttons
This might help http://developer.android.com/reference/android/inputmethodservice/InputMethodService.html
https://android.googlesource.com/platform/packages/inputmethods/LatinIME/+/master/java/src/com/android/inputmethod/latin
The keyboard code is here, I grepped through it a little but give up, I don't see any Broadcasts being sent that would be of any use, at least in here. Maybe you can go find lower level code in the repo and find a useful Intent being sent. The first linke might tell you when it becomes visible, but I'm not sure how to tell when it becomes invisible.