Keybind conflict with GtkCompletion

Hello.
Sorry to bother you with so many questions, but you helped me everytime.
I have a GtkEntry with GtkEntryCompletion. I have binded the arrows key to do different function i.e. navigate through the command history like in terminal.

The problem is the navigation on Completion Popup will then conflict with history navigation.

So my questions are:

  • Is there any way to check if Completion Popup is visible/active, so that we can turn of history navigation.
  • Or is is there way to get total match count of Completion Popup (if 0 no navigation needed)

What is the best way to do it?

Hello.
Anyone can give me a tip ;).

Have a good day.