If the default is 5 minutes, or if there is no fraction key type specified at startup, the following screen will be displayed assuming that there is a possibility of skipping.
If you press the x button to turn off this screen, monitoring will start again.
Since it is not converted to exe or app, please execute it from the command line on a PC with Python 3.7 installed.
Turn it off when starting work without a key type, such as MTG or presentation.
Please download the source from the following.
https://github.com/anchor-cable/stupidapp
sudo python3 main/watch_keyboard.py 1
I needed administrator privileges to monitor the keyboard with the keyboard library ... (I haven't done anything wrong to my knowledge, but I can't take responsibility for anything **)
Argument 1 is the monitoring time (minutes). If omitted, the default 5-minute monitoring is used. The argument cannot have a decimal point.
Please work normally as it is an app for working normally. If there is no key type during the monitoring time, the opening screen is displayed.
I wrote the following in recursion.
def watch(self,timeout_count):
typed_pool = []
keyboard.start_recording()
time.sleep(60)
typed_pool = keyboard.stop_recording()
if len(typed_pool) == 0:
timeout_count += 1
else:
timeout_count = 0
if timeout_count <= self.watch_minutes:
self.watch(timeout_count)
I try to display a pop-up window when I break out of the loop.
root.protocol("WM_DELETE_WINDOW", self.main())
It is extremely troublesome to start it again on the command line after pressing the × button. Before returning to work after being pointed out to skip, I tried to run the process from the beginning.
If you just want to make a simple screen, tkinter is good. If you do your best, you can make it a desktop application.
"Ah, the deadline for fucking app ad-care is near" "The app I originally thought about was released last year, so I decided to put it in storage ..." "What should I make ..."
(40 minutes later)
"Huh!" "I've been watching ** Twitter ** all the time" "I'm going to drop it as it is ... but I don't understand the language that can be written in GUI, and I can't do advanced things like machine learning." "... Is it a CLI tool?" "I wonder if I could make a CLI tool that prohibits skipping."
In order to check the operation of this, I had to leave it for 1 minute without inputting it many times, and each time I felt like "Hey, don't skip ...!".
Recommended Posts