def create_bindings(self): modifier = TkUtil.key_modifier() self.master.bind("<{}-f>".format(modifier), self.find) self.master.bind("<{}-n>".format(modifier), self.new) self.master.bind("<{}-o>".format(modifier), self.open) self.master.bind("<{}-q>".format(modifier), self.close) self.master.bind("<{}-s>".format(modifier), self.save) self.master.bind("<F1>", self.help) for key in "fnoqs": # Avoid conflicts self.unbind_class("Text", "<{}-{}>".format(modifier, key)) # Ctrl+C etc. from the edit menu are already supported by the # Text (Editor) widget. TkUtil.bind_context_menu(self.editor.text, self.context_menu)
def create_bindings(self): # Can't use Ctrl for key bindings modifier = TkUtil.key_modifier() self.master.bind("<{}-n>".format(modifier), self.board.new_game) self.master.bind("<{}-q>".format(modifier), self.close) self.master.bind("<F1>", self.help)