Disable keyboard totally?

Hi all!

Have been searching for a solution to this to no avail. I am creating an application for administering an examination. Due to the nature of the examination, students are not allowed to exit the application prematurely. To do this, I have used a fullscreen window with no window controls and also disabled the menubar. However, I have no means to disallow students from alt-tabbing out of the application or killing off the application by using alt-ctrl-del. As the examination is totally mouse-controlled, I am thinking of entirely disabling the keyboard and only allowing exit out of the application through a Quit button protected by a password that only the examiner would have.

That said, is there any way I can entirely disable the keyboard while my application is running, or are there other solutions to what I am trying to do?

Thanks in advance! :smiley:

You might want to tag this as Windows instead of General…

From a quick Google search, it doesn’t look like you can disable the CTRL+ALT+DEL key command, as it is handled by the keyboard driver (or something like that)…

You might be able to use SetWindowsHookEx https://msdn.microsoft.com/en-us/library/ms644990(VS.85).aspx through declares, but someone who is smarter than me with Windows might be able to answer better…

Thanks for the suggestion, but guess I’m not just hoping for a Windows solution, I intend to run the app on both Windows and Mac. In fact, I’m working on it on a mac right now, which is why I posted it under General :slight_smile: I’ve seen applications like this that doesn’t let you get out of it easily, am wondering whether there are controls within Xojo that can handle that.

Check out the CancelClose event.

Set an ‘exit flag’ in your legitimate exit section and check this flag in CancelClose. If ok then close the app or if not ok don’t allow the closure.

[quote=356201:@Simon Berridge]Check out the CancelClose event.

Set an ‘exit flag’ in your legitimate exit section and check this flag in CancelClose. If ok then close the app or if not ok don’t allow the closure.[/quote]
That’ll prevent the app from m quitting but not switching away from it or a force quit.

It sounds like you want “kiosk” mode. Xojo does not have anything built-in for this.

Mac info:

Windows info: