How would it work though? If I hit F1 when I start mIRC, will $key be $true until I close mIRC? Or did you have something else in mind?