Kill/Exit/Minimize a fullscreen application

Mac OSX specific forum
Lebostein
Addict
Addict
Posts: 849
Joined: Fri Jun 11, 2004 7:07 am

Kill/Exit/Minimize a fullscreen application

Post by Lebostein »

Hi,

how I can exit or minimize a fullscreen application? For example this:
Warning! Only way to exit is restart!

Code: Select all

InitSprite()
InitKeyboard()

ExamineDesktops()

b = DesktopWidth(0)
h = DesktopHeight(0)
d = DesktopDepth(0)

OpenScreen(b, h, d, "")

Repeat

ExamineKeyboard()

ClearScreen($0000FF)
FlipBuffers()

ForEver
It seems that PB applications with Keyboard() library blocks all system shortcuts....
Last edited by Lebostein on Tue Aug 03, 2010 9:06 pm, edited 1 time in total.
User avatar
KJ67
Enthusiast
Enthusiast
Posts: 218
Joined: Fri Jun 26, 2009 3:51 pm
Location: Westernmost tip of Norway

Re: Exit a fullscreen application.

Post by KJ67 »

Have you looked at KeyboardInkey()?
The best preparation for tomorrow is doing your best today.
User avatar
michel51
Enthusiast
Enthusiast
Posts: 290
Joined: Mon Nov 21, 2005 10:21 pm
Location: Germany

Re: Exit a fullscreen application.

Post by michel51 »

Lebostein wrote:Hi,

how I can exit or minimize a fullscreen application? For example this:
Warning! Only way to exit is restart!

Code: Select all

InitSprite()
InitKeyboard()

ExamineDesktops()

b = DesktopWidth(0)
h = DesktopHeight(0)
d = DesktopDepth(0)

OpenScreen(b, h, d, "")

Repeat

ExamineKeyboard()

ClearScreen($0000FF)
FlipBuffers()

ForEver
It seems that PB applications with Keyboard() library blocks all system shortcuts....
Hello Lebostein,
this is an endless loop :!:
You have to put in a possibility to leave the loop.
Try instead of <ForEver> the following:

Code: Select all

Until KeyboardPushed(#PB_Key_Escape)
or similar code.
Also a If - Endif with break condition is possible before ForEver.

Hope you understand my "german" english :-)
michel51

Mac OS X Snow Leopard (10.6.8 ) Intel
PureBasic V 5.21(x64), V 5.22beta
Lebostein
Addict
Addict
Posts: 849
Joined: Fri Jun 11, 2004 7:07 am

Re: Exit a fullscreen application.

Post by Lebostein »

michel51 wrote: this is an endless loop :!:
Yes! That is the point. How I can exit/kill/minimize a program with an intentional/unintentional endless loop like that?
With Windows I can press ctrl+alt+entf (task manager) in every case. But with Mac OS? Why all system shortcuts like cmd+m (minimize) or cmd+alt+esc (task manager) are blocked in PB fullscreen application? Its a PB specific problem or generally?
User avatar
Vera
Addict
Addict
Posts: 858
Joined: Tue Aug 11, 2009 1:56 pm
Location: Essen (Germany)

Re: Kill/Exit/Minimize a fullscreen application

Post by Vera »

Hi,

to block cmd+alt+esc (task manager) I think is really a bad idea :|
but I had in mind that on WIN you can exit a fullscreen-app by using ALT+TAB to switch between open applications - is there no such feature on MAC ?

greetings ~ Vera
WilliamL
Addict
Addict
Posts: 1256
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

Re: Kill/Exit/Minimize a fullscreen application

Post by WilliamL »

Yes, 'cmd+alt+esc' (or the Apple menu 'Force quit') won't cause any problems, it will just 'force quit' the program you select. I've done this many times :oops: and in this situation you are only quitting the app and not the IDE.

Hey, vera, you have a Mac?
MacBook Pro-M1 (2021), Tahoe 26.2, PB 6.30b5
User avatar
michel51
Enthusiast
Enthusiast
Posts: 290
Joined: Mon Nov 21, 2005 10:21 pm
Location: Germany

Re: Kill/Exit/Minimize a fullscreen application

Post by michel51 »

WilliamL wrote:Yes, 'cmd+alt+esc' (or the Apple menu 'Force quit') won't cause any problems, it will just 'force quit' the program you select. I've done this many times :oops: and in this situation you are only quitting the app and not the IDE.

Hey, vera, you have a Mac?
Hi William,
You are right. But I think, Lebostein will not quit the IDE, but the endless running application.
In this case 'cmd+alt+esc' (or the Apple menu 'Force quit') is the only way to finish the application.
michel51

Mac OS X Snow Leopard (10.6.8 ) Intel
PureBasic V 5.21(x64), V 5.22beta
Lebostein
Addict
Addict
Posts: 849
Joined: Fri Jun 11, 2004 7:07 am

Re: Kill/Exit/Minimize a fullscreen application

Post by Lebostein »

The problem is: cmd+alt+esc don't work!

Simple question: How I can kill a fullscreen application?

OK, I have disarmed my code. Please try to minimize or kill this without pressing [E]:

Code: Select all

InitSprite()
InitKeyboard()

ExamineDesktops()

b = DesktopWidth(0)
h = DesktopHeight(0)
d = DesktopDepth(0)

OpenScreen(b, h, d, "")

Repeat

ExamineKeyboard()

ClearScreen($0000FF)
FlipBuffers()

Until KeyboardPushed(#PB_Key_E)
User avatar
michel51
Enthusiast
Enthusiast
Posts: 290
Joined: Mon Nov 21, 2005 10:21 pm
Location: Germany

Re: Kill/Exit/Minimize a fullscreen application

Post by michel51 »

Lebostein wrote:The problem is: cmd+alt+esc don't work!

Simple question: How I can kill a fullscreen application?

OK, I have disarmed my code. Please try to minimize or kill this without pressing [E]:

Code: Select all

InitSprite()
InitKeyboard()

ExamineDesktops()

b = DesktopWidth(0)
h = DesktopHeight(0)
d = DesktopDepth(0)

OpenScreen(b, h, d, "")

Repeat

ExamineKeyboard()

ClearScreen($0000FF)
FlipBuffers()

Until KeyboardPushed(#PB_Key_E)
cmd+alt+esc works fine on my Mac, with and without debugger.
The program will be killed directly (red screen), the IDE is active.

Which version of PB do you have? Which Mac OS? Intel-machine?
May be, there is the reason for your problem.
michel51

Mac OS X Snow Leopard (10.6.8 ) Intel
PureBasic V 5.21(x64), V 5.22beta
Post Reply