Jump to content

Disabling windows key in tkinter login program

Enderg312

How do I disable the use of the windows key and any other inputs that could get around the login system?

 

Link to comment
Share on other sites

Link to post
Share on other sites

28 minutes ago, Enderg312 said:

How do I disable the use of the windows key and any other inputs that could get around the login system?

 

what do you mean by that? could you explain it better, maybe with pictures?

 

and i use this toll for creating guis with python: https://sourceforge.net/projects/page/

its a small simple useful program that makes us do it faster and it really helps.. ( for the options not in it, you will have to do them manually ) and this uses the place method to place the widgets

hey! i know to use a computer

Link to comment
Share on other sites

Link to post
Share on other sites

You can't.

4 minutes ago, Blue_Incog said:

from tkinter import *
root=Tk()

txtDisplay = Entry(root, width=28, justify=RIGHT)    
txtDisplay.grid(row=0, column=0, columnspan=5, pady=1)
txtDisplay.bind("<Key>", lambda e: "break")          # Disable characters from keyboard

root.mainloop()

 

This doesn't do what OP is asking. They want to make it so that when the "windows" button is pressed, nothing happens (including raising the start menu). That functionality is handled by the operating system and I don't think it can be overridden by python.

 

@Enderg312I don't know why you want to make a "login screen" with tkinter but you should understand that you can't substitute Windows' internal user access control system with a python script. Whatever you end up making will be easily exploitable by anyone who cares to try.

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

The keyboard is handled by the driver and the hooks are handled by the OS core. In order to do that you need to write your own driver and disregard the correct key signal for the windows key. Then simply replace the generic driver you are using for windows with yours. If you use a known brand keyboard and their apps it will stop working if on your custom driver. Being able to disable input device at OS would be a security violation. You might be lucky and have one of those keyboard with an on off switch for the windows key and might be able to disable it through it's library if it has one. For example Logitech old software had this feature to call the API and disable the windows key. If you can do that then it's a matter to attach yourself to the keypress of that lock/unlock button and if unlock is clicked simply relock it right away.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×