Jump to content


Event Responding to CTRL-ALT-DEL?

  • Please log in to reply
4 replies to this topic

#1 Harmonex


    GMC Member

  • GMC Member
  • 56 posts
  • Version:GM:HTML5

Posted 06 February 2012 - 10:57 PM

I'm wondering if it is possible to make an event respond to the input "CTRL-ALT-DEL" even though the Task Manager comes up. I'm new to Game Maker, so I'm not yet sure what is and isn't possible. I started with a code

if keyboard_check(vk_control) && keyboard_check(vk_alt) && keyboard_check(vk_left)

which worked fine each time I pressed the correct combination. I later changed it to

if keyboard_check(vk_control) && keyboard_check(vk_alt) && keyboard_check(vk_delete)

to see if it would work the same, but I heard no sound before or after the Task Manager popped up. Just to be completely sure, I modified it once more to

if keyboard_check(vk_control) && keyboard_check(vk_alt) && keyboard_check(vk_delete)

and found that the game would stay each time, meaning that the code wasn't completing. If the OS interrupts (for safety reasons, I'm assuming), then there's nothing I can do from here, but I wanted to double check just in case.

Thanks in advance.
  • 0

#2 Troy Martin

Troy Martin

    Surreal Earth Studios

  • New Member
  • 91 posts
  • Version:Unknown

Posted 09 February 2012 - 12:42 AM

I'm fairly certain that the OS' keyboard handler itself hooks the mighty three-finger salute. Programs that get around that are generally regarded as potential malware, so it's best to just assume you can't do it.
  • 0
Project Mindcrime Development milliBlog

Now I know you won't refuse
Because we've got so much to do
And you've got nothing more to lose
So take this number
And welcome
To Operation: Mindcrime

#3 TheouAegis


    GMC Member

  • GMC Member
  • 13885 posts
  • Version:GM:Studio

Posted 10 February 2012 - 12:53 AM

You will need to use keyboard_check_direct(key), not a normal keyboard_check. As soon as you press CTRL+ALT+DEL, the program should lose focus, so using keyboard_check_direct() should help there. And you will also need to tell GM to NOT pause when the program loses focus.
  • 0

"The problem with object-oriented languages is that they've got all this implicit environment that they carry around with them. You wanted a banana but what you've got is a gorilla holding the banana and the entire jungle." -Joe Armstrong


"It goes against the grain of modern education to teach children to program. What fun is there in making plans, acquiring discipline in organizing thoughts, devoting attention to detail and learning to be self-critical?" -Alan Perlis


"Do not think about where you want to be and how to get there; think about what you want to do and how to do it." -Theou Aegis

#4 Nocturne


    Nocturne Games

  • Administrators
  • 25708 posts
  • Version:GM:Studio

Posted 10 February 2012 - 07:27 AM

Care to tell us why you need this? I'm curious, especially as I can think of absolutely no legitemate reason...Posted Image
  • 0



#5 Harmonex


    GMC Member

  • GMC Member
  • 56 posts
  • Version:GM:HTML5

Posted 10 February 2012 - 07:56 AM

I was reading through functions when I came across the "keyboard_check_direct" one in regards to bringing back an out of focus window and I thought "Hey, that sounds like I could use it to...oh yeah, I posted that. Let's check." And sure enough there were several responses.

The reasons are semi-legitimate, as I'm creating an "unofficial sequel" to a creepypasta platform game (whose anonymous creator seems to have dropped off the planet) that used a lot of "fourth wall" breaking effects (including hiding the game as a process while faking a game over, then coming back and dragging the player to Hell). If you're worried that you're helping me create some form of malware, I could just kill taskmgr.exe in a step command without waiting for them to hit the relevant keys...much easier than disabling the keys. However, that would be counter-productive.

I actually don't know what I'm going to have connected to this event, but I'm imagining that the player would want to ctrl-alt-del out of either a scary part, or a blank part thinking the game froze. I want to have "something" happen when the command is pressed to encourage them to not close it down, so it'll probably just be a sound file (I'm sensing "laughter").

I considered a screamer, but that's the cheapest form of horror.

[EDIT]: On an unrelated note, I think I put this in the wrong board. I assumed just because I was using GM8, but really the questions probably apply to all versions. I'll put my next question in a different board (which will hopefully be the right one).

Edited by Harmonex, 12 February 2012 - 02:27 AM.

  • 0