Block windows key wxPython

2019-07-28 04:11发布

问题:

I am creating an application with wxpython for writing tests in schools, and it needs to be able to block the windows key, alt-tab and so on to prevent cheating. Is this possible and if it is, how do you do it?

I know that you can't block ctrl + alt + del, but is it possible to detect when it is pressed?

回答1:

I came across this in a similar discussion, http://timgolden.me.uk/python/win32_how_do_i/track-session-events.html

Which provides an outline of tracking user events such as those triggered by a ctrl + alt + del press.

It may provide a workaround to having to block the keypresses.



回答2:

The simple answer is No, unless this is a touchscreen application with no access to the computer hardware. That would probably work. Otherwise you'll have to look into how to lockdown your PC with Microsoft Policies etc. Or you might be able to do it with a locked down Linux install. Regardless, it's not really something you can manage with wxPython. It's something you have to manage at the OS level.