How do I detect Shift Lock when it's enabled?

For example, I want to make something that allows players to aim down sights when the user is in third person. I’ve already handled that part. However, I also want it so players have to have Shift Lock on so people don’t aim when they move their camera around.

How would I be able to do that?

Here’s the part of the script where it handles aiming on PC.

consider searching please.