键盘快捷键不允许写入条目 Python Gtk 3

keyboard shortcuts don't let write in an entry Python Gtk 3

在 window 中,我正在使用键盘快捷键,但快捷键阻止了我的 window 条目,并且不允许我在上面写字。我有这样的东西:

self.connect("key-press-event",self._key_press_event, b_finalizar, b_agregar, c_scales, b_buscar, storeCompra,entryCliente, l_total, entry, spinCantidad, spinPrecio, storeAutocomp, tree, l_unidad)

我的事件方法是这样的:

def _key_press_event(self,widget,event, b_finalizar, b_agregar, c_scales, b_buscar,storeCompra,entryCliente, l_total, entry, spinCantidad, spinPrecio, storeAutocomp, tree, l_unidad):
    keyval = event.keyval
    keyval_name = Gdk.keyval_name(keyval)
    state = event.state
    ctrl = (state & Gdk.ModifierType.CONTROL_MASK)
    if ctrl and keyval_name == 'a':
        self.agregar_clicked(b_agregar, storeCompra, entry, spinCantidad, spinPrecio, storeAutocomp, tree, l_unidad, l_total)
        print "AGREGAR ITEM"
    elif ctrl and keyval_name == 'b':
        print "básculas"
    elif ctrl and keyval_name == 'f':
        self.finalizar_clicked(b_finalizar, storeCompra, entryCliente, l_total)
        print "finalizar"
    elif ctrl and keyval_name == 'c':
        self.buscar_clicked(b_buscar, entry)
        print "catalogo"
        return False
    return True

我需要能够在条目中书写并使用快捷方式,任何想法都会有所帮助。谢谢

你最后的状态:

   elif ctrl and keyval_name == 'c':
    self.buscar_clicked(b_buscar, entry)
    print "catalogo"
   else:
    return False

return True