Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System hotkeys can't be used during fullscreen Pygame window

I am trying to make a fullscreen game in Python out of Pygame. My problem is, I can't use the command+tab Mac system key combination (which is tab out) while in full screen. I also can't hide it. This is my code:

display = (1440,900)
pygame.init()
screen = pygame.display.set_mode(display, pygame.DOUBLEBUF | pygame.FULLSCREEN)

I've tried using pygame.display.iconify() to hide and minimize the window in order to tab out of the program, but it doesn't work in fullscreen because instead it creates a fullscreen black window. I also don't want to toggle fullscreen while doing this.

like image 221
Noah Avatar asked Nov 07 '22 13:11

Noah


1 Answers

It may be an instance of a known issue with pygame. A similar problem is described there:

Also when I Cmd+Tab through windows - it's not there. That's why I have to swipe up to see to four-finger-swipe-up […]

Apparently there was a fix:

I committed a fix in #415.

If you Compile from source you can try it out.

pip install https://github.com/pygame/pygame/archive/master.zip

Otherwise, it should be in pygame 1.9.4.

You could try this and see if it applies to your problem.

like image 94
mkrieger1 Avatar answered Nov 15 '22 06:11

mkrieger1