简体   繁体   中英

How can I bring a pyGTK program to visibility, at any time, with a keypress?

This question isn't about how to grab the keypress, i'm using accelators for that(but fi thats the wrong way by all means correct me)

Once i start my program, i press ESC to hide it with window.hide_all().

the user may then do other things in other programs, etc, but I want to make it so whenever the user presses, for example, alt + backspace, my program comes back to visibility

Very much like in unix system, pressing alt + f2 fires up the GUI launcher.

bonus: plus what happens if the key combination i set (alt + backspace) is already a shortcut for something in the user's system?

You'll need to arrange that in the window manager. If the program doesn't have the input focus, it doesn't even receive keystrokes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM