Sensor to change computer screen

Hey everyone, I'm new to Arduino and have a question regarding PIR sensors. My son's 8th grade computer class has asked him to figure out a way to change the state of his computer (close the program he has opened and then open a different one) after someone enters his room.

My guess is that we could use a Arduino and something like a PIR sensor shield to detect the presence of a person and send a signal to his comohter to run a program that minimizes his current application and opens a different one.

Is that even possible?
Can someone direct us where we can start?

Thank you!

I'd start with an Arduino Micro or any other variant which has "native USB". (My personal favourite is the Teensy 3.2)

This can be configured as a keyboard, so it can do Alt-TAB easily. Or any other key combination.

But, the keyboard doesn't know which program is open. Windows doesn't tell the keyboard that information. So a second Alt-TAB will bring back the window you tried to hide.

He shouldn't be watching those videos anyway!