way to make the window forcefully open?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
slickytree
Prole
Posts: 4
Joined: Fri May 19, 2017 11:12 am

way to make the window forcefully open?

Post by slickytree »

im trying to make some kind of window that doesnt close no matter what you do unless you hold a certain button.
is there some kind of love function that makes the window forcefully open by itself or is it just not possible?

code i have so far:

Code: Select all

love.window.setFullscreen(true)
local t = 0

function love.update(dt)
  if not love.window.hasFocus() then
    -- ??
  end
  if love.keyboard.isDown('g') then
    t = t + dt
    if t > 1 then
      love.event.quit()
    end
  end
end

function love.keyreleased(key)
  if key == 'g' then
    t = 0
  end
end
grump
Party member
Posts: 947
Joined: Sat Jul 22, 2017 7:43 pm

Re: way to make the window forcefully open?

Post by grump »

It's not possible to make a window that doesn't close "no matter what you do". You could probably make it harder than usual with some ffi trickery. But it would be system dependent, and frankly. it sounds pretty much like asshole design. Nobody wants a program that behaves like that.
User avatar
slime
Solid Snayke
Posts: 3161
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: way to make the window forcefully open?

Post by slime »

You can use the love.quit callback to prevent the game from quitting when certain conditions are met, and love.event.quit to cause the game to quit.
slickytree
Prole
Posts: 4
Joined: Fri May 19, 2017 11:12 am

Re: way to make the window forcefully open?

Post by slickytree »

grump wrote: Tue Sep 12, 2017 8:45 am It's not possible to make a window that doesn't close "no matter what you do". You could probably make it harder than usual with some ffi trickery. But it would be system dependent, and frankly. it sounds pretty much like asshole design. Nobody wants a program that behaves like that.
yes, i agree that it's a bad design if it's a game of some sort. im using it for myself because some of my siblings peak my pc while im off doing something else. i just use love2d for some childish stuff nowadays tbh lol
slime wrote: Tue Sep 12, 2017 12:07 pm You can use the love.quit callback to prevent the game from quitting when certain conditions are met, and love.event.quit to cause the game to quit.
thanks that helps
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: way to make the window forcefully open?

Post by zorg »

Using both love.quit and having a borderless window may help; no buttons -> no os-specific exit button.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
grump
Party member
Posts: 947
Joined: Sat Jul 22, 2017 7:43 pm

Re: way to make the window forcefully open?

Post by grump »

slickytree wrote: Tue Sep 12, 2017 12:21 pmyes, i agree that it's a bad design if it's a game of some sort. im using it for myself because some of my siblings peak my pc while im off doing something else. i just use love2d for some childish stuff nowadays tbh lol
It might be enough to prank a bunch of kids. But you said "no matter what you do", and there's no easy way you can prevent someone from opening the task manager or a console and just kill your process. There's also simply Alt-Tab, I don't know if that can be intercepted from a love app.

They only fool-proof "no matter what you do" thing is the lock screen feature of your OS. Or maybe you could install your love app as a password protected screensaver.
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests