1

I'm trying to write a small interactive application that copies a text file to the clipboard line by line on key press. I haven't even gotten to the clipboard part yet... The biggest issue I couldn't search up is having the window always on top and active. I used the line:

root.attributes('-topmost', True)

to position it on top, but it still only registers key presses when it's the active window.

similar questions:

Setting tkinter to always be the current active window. (no answers)

Make a Tkinter Toplevel active (OS specific)

Is what I'm looking for solely possible with Tkinter or should I be incorporating something else? I'm new, so descriptive advice would really be appreciated.

syaolie
  • 51
  • 1
  • the problem is that, i really dont think this is possible on a beginner basis as it would require OOP to begin with cuz while which ever window is being minimized, udw ur window to be minized, right?as far as the clipboard part,y do u have to care abt the window being on top? told all dis assuming u are a beginner, correct me, if im wrong – Delrius Euphoria Aug 05 '20 at 17:26
  • You are looking for system wide hotkeys and there are several ways to achive this.One can be found here http://timgolden.me.uk/python/win32_how_do_i/catch_system_wide_hotkeys.html – Thingamabobs Aug 05 '20 at 17:38
  • @CoolCloud: FYI "txt spk" is discouraged on this site - it makes your comments more difficult to read. https://meta.stackoverflow.com/a/345652/7432 – Bryan Oakley Aug 05 '20 at 18:28
  • @BryanOakley ooo thanks for letting me know – Delrius Euphoria Aug 05 '20 at 18:50
  • @CoolCloud the purpose of the clipboard program (for me) is to break a dialogue text script up so I can copy and paste each line into another program without having to refer back to the original script. the main reason i want it on top is so that i can view which line is being copied and which line is next up. and i want it active since i'll be selecting the image editor. i'm pretty beginner level........... – syaolie Aug 06 '20 at 08:07
  • thanks for bringing the system wide hotkeys to my attention. i will go read more on that – syaolie Aug 06 '20 at 08:14
  • okays cool, all the best – Delrius Euphoria Aug 06 '20 at 08:19

0 Answers0