'KeyPress handler for the minibuffer.
Currently only supports ASCII characters.'

def handle_KeyPress(self, e):

    mask = (xcbq.ModMasks['shift'] | xcbq.ModMasks['lock'])
    state = (1 if (e.state & mask) else 0)
    keysym = self.qtile.conn.code_to_syms[e.detail][state]
    handle_key = self._get_keyhandler(keysym)
    if handle_key:
        handle_key()
        del self.key
    self._update()
