This could be done with an AutoHotKey script. AutoHotKey is a powerful Windows application to automate and customize actions. It is free and portable.
The following script minimized all open windows, blocks input from keyboard and mouse, and shows you a message to take a break. The timers can are customizable as well as the message. In this example I have set them to 20 seconds break for every 20 minutes of work. This script requires running as administrator
#NoEnv
#Persistent
#SingleInstance
SendMode Input
;; Configuration
MyWorkTime = 1200000 ; in milliseconds
MyBreakTime = 20000 ; in milliseconds
MySplashMessage = "Take a break"
;; Execution
SetTimer,takeBreak,%MyWorkTime%
return
takeBreak:
WinMinimizeAll
BlockInput, on
SplashTextOn,,,%MySplashMessage%
Sleep, %MyBreakTime%
SplashTextOff
BlockInput, off
WinMinimizeAllUndo
return
In case you don't have administrator privileges, then the best I could do is block mouse movement and specific keypresses. For example, the following script blocks the mouse and the Alt+Tab key combination. You can add other key combinations by reproducing the line Hotkey !Tab, BLOCKED
and replacing !Tab
with the desired key using this keylist
#NoEnv
#Persistent
#SingleInstance
SendMode Input
;; Configuration
MyWorkTime = 1200000 ; in milliseconds
MyBreakTime = 20000 ; in milliseconds
MySplashMessage = "Take a break"
;; Execution
SetTimer,takeBreak,%MyWorkTime%
return
takeBreak:
WinMinimizeAll
BlockInput, MouseMove
Hotkey !Tab, BLOCKED
SplashTextOn,,,%MySplashMessage%
Sleep, %MyBreakTime%
SplashTextOff
BlockInput, MouseMoveOff
Hotkey !Tab, off
WinMinimizeAllUndo
return
BLOCKED:
return
To pause/play audio and video, you can add Send, Media_Play_Pause
before and after the Sleep
command. I didn't include it in the scripts because it is a toggle function which would also play any paused media before locking, which is the opposite of what's requested.