0

The context. I'm making a NotePad app to replace the windows notepad. But I have some problems with the inputs:

■ A good number of functions are registered to allow shortcuts. But some of them do different tasks for example "control + i" inserts a tab instead do what I defined. How I can change or disable this default behaviour?

    self.__root.bind("<Control-b>", self.__function_a)
    self.__root.bind("<Control-i>", self.__function_b)   # This don't work
    self.__root.bind("<Control-d>", self.__function_c)   # This don't work
    self.__root.bind("<Control-r>", self.__function_d)

■ Secondly, I have a personal keyboard layer, which allows to me have an English keyboard with characters such ñ, ¿,¡ but I added others more special like ●░▒▓█•º■▪…→đç☑❎, etc... It's made me easier to write in different languages, take notes or whatever. I can use this with any other app less Tkinder, which only prints these characters instead: "¦", "?". Exist and how I could make my app compatible with the addition of these special characters ??

● I used Microsoft Keyboard Layout Creator 1.4 .

● The Note pad is basically a text area but I notice this doesn't work in others tkinter apps: class Notepad:

__root = Tk() 
__text_area = Text(__root)
__scrollbar = Scrollbar(__text_area)
__menu_bar = Menu(__root)

● Thanks for your help!

Bryan Oakley
  • 370,779
  • 53
  • 539
  • 685
rennoib
  • 11
  • 1
  • Please only ask one question at a time. – Bryan Oakley Sep 01 '22 at 19:54
  • As for overriding the default behavior, your bound functions need to return the string "break". See https://stackoverflow.com/a/11542200/7432 for a more thorough discussion. – Bryan Oakley Sep 01 '22 at 19:54
  • Thanks a lot for your help again Bryan. And allow me an excuse for double questions. I will try to formulate better the questions in only one sentence the next time. – rennoib Sep 04 '22 at 15:03

0 Answers0