def widget_grab_keyboard(self, widget):
        self.window.handle_KeyPress = widget.handle_KeyPress
        self.saved_focus = self.qtile.currentWindow
        self.window.window.set_input_focus()
A widget can call this method to grab the keyboard focus
dataset/ETHPy150Open qtile/qtile/libqtile/bar.py/Bar.widget_grab_keyboard