Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Отсутствует вставка из буфера обмена #35

Closed
diirectshot opened this issue Sep 5, 2023 · 2 comments
Closed

Comments

@diirectshot
Copy link

Когда копирую адрес с браузера для вставки в url, ничего не происходит. Это должно так быть? Как фиксить?

@Genone22
Copy link
Contributor

Genone22 commented Sep 6, 2023

Когда копирую адрес с браузера для вставки в url, ничего не происходит. Это должно так быть? Как фиксить?

Для этого необходимо добавить следующий выделенный код

...
class Window(customtkinter.CTk):
def init(self):
super().init()
...
self.bind_all("<Key>", self.on_key_release, "+")
...

def on_key_release(self, event):
     ctrl = (event.state & 0x4) != 0
     if event.keycode == 88 and ctrl and event.keysym.lower() != "x":
         event.widget.event_generate("<<Cut>>")

     if event.keycode == 86 and ctrl and event.keysym.lower() != "v":
         event.widget.event_generate("<<Paste>>")

     if event.keycode == 67 and ctrl and event.keysym.lower() != "c":
         event.widget.event_generate("<<Copy>>")

     if event.keycode == 65 and ctrl and event.keysym.lower() != "a":
         event.widget.select_range(0, 'end')

Если возникнут вопросы обращайтесь...

@Duff89
Copy link
Owner

Duff89 commented Sep 21, 2023

Вышла новая версия, обновитесь

@Duff89 Duff89 closed this as completed Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants