简体   繁体   中英

Disable mouse click and change pointer icon

i want to make application that like xtrlock but i don't know how to disable the mouse click (mouse movement still allowed) and change cursor icon (with custom png)

my simple python code is :

while True:
  password = raw_input()
  if password == "password":
    exit()

You practically need to interface with some desktop environment and some display server . On Linux that could be Xorg or Wayland . So you should use some GUI toolkit (and they usually provide some event loop ). Read more about GTK & Qt . Both are interfaced to Python, with PyGTK or PyQt . Write first some simple GUI application (in PyGTK or PyQt) to understand the concepts.

BTW, xtrlock is free software , so you can study its source code for inspiration.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM